Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/release-2024-fall' into bugfix/F…
Browse files Browse the repository at this point in the history
…OUR-19611
  • Loading branch information
Rodrigo Quelca committed Oct 21, 2024
2 parents 518137e + a4339aa commit a26d2ff
Showing 1 changed file with 35 additions and 20 deletions.
55 changes: 35 additions & 20 deletions src/components/ScreenTemplates.vue
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,9 @@
data-cy="my-templates-list"
>
<b-card-group>
<b-card-body v-if="loading" class="d-flex justify-content-center">
<b-spinner variant="primary" label="Spinning"></b-spinner>
</b-card-body>
<b-card-body
v-if="noMyTemplatesFound"
class="p-2 h-100 overflow-auto"
Expand All @@ -60,6 +63,9 @@
data-cy="shared-templates-list"
>
<b-card-group>
<b-card-body v-if="loading" class="d-flex justify-content-center">
<b-spinner variant="primary" label="Spinning"></b-spinner>
</b-card-body>
<b-card-body
v-if="noSharedTemplatesFound"
class="p-2 h-100 overflow-auto"
Expand Down Expand Up @@ -109,6 +115,7 @@
sharedTemplatesSelected: false,
noMyTemplatesFound: false,
noSharedTemplatesFound: false,
loading: false,
};
},
methods: {
Expand All @@ -118,34 +125,42 @@
this.fetchMyTemplates();
},
fetchMyTemplates() {
this.loading = true;
ProcessMaker.apiClient
.get(
`templates/screen?is_public=0&screen_type=${this.screenType}`,
)
.then((response) => {
this.myTemplatesData = response.data.data;
if (this.myTemplatesData.length === 0 || this.myTemplatesData === undefined) {
this.noMyTemplatesFound = true;
.get(
`templates/screen?is_public=0&screen_type=${this.screenType}`,
)
.then((response) => {
this.myTemplatesData = response.data.data;
if (this.myTemplatesData.length === 0 || this.myTemplatesData === undefined) {
this.noMyTemplatesFound = true;
}
})
.catch((error) => {
console.error(error);
})
.finally(() => {
this.loading = false;
});
},
fetchSharedTemplates() {
ProcessMaker.apiClient
.get(
`templates/screen?is_public=1&screen_type=${this.screenType}`,
)
.then((response) => {
this.sharedTemplatesData = response.data.data;
if (this.sharedTemplatesData.length === 0 || this.sharedTemplatesData === undefined) {
this.noSharedTemplatesFound = true;
}
})
.catch((error) => {
console.error(error);
});
this.loading = true;
ProcessMaker.apiClient
.get(
`templates/screen?is_public=1&screen_type=${this.screenType}`,
)
.then((response) => {
this.sharedTemplatesData = response.data.data;
if (this.sharedTemplatesData.length === 0 || this.sharedTemplatesData === undefined) {
this.noSharedTemplatesFound = true;
}
})
.catch((error) => {
console.error(error);
})
.finally(() => {
this.loading = false;
});
},
showSharedTemplates() {
this.myTemplatesSelected = false;
Expand Down

0 comments on commit a26d2ff

Please sign in to comment.