Skip to content

Commit

Permalink
Merge branch 'release-2024-fall' into FOUR-19630
Browse files Browse the repository at this point in the history
  • Loading branch information
caleeli authored Oct 21, 2024
2 parents 2250e61 + a4339aa commit 4d3015a
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 4d3015a

Please sign in to comment.