Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,9 @@
v-if="allowInterstitial"
v-model="screen"
:label="$t('Screen Interstitial')"
:required="true"
:helper="$t('What Screen Should Be Used For Rendering This Interstitial')"
:params="parameters"
default-key="interstitial"
:excluded-keys="['interstitial']"
/>
</div>
</template>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@
:show-labels="false"
label="title"
track-by="id"
:name="name"
@open="load()"
@search-change="load"
:name="name"
>
<template slot="noResult">
{{ $t("No elements found. Consider changing the search query.") }}
Expand Down Expand Up @@ -46,7 +46,7 @@
@asset="processAssetCreation"
/>
<a
v-if="content && content.id"
v-if="canOpenScreen"
:href="`/designer/screen-builder/${content.id}/edit`"
target="_blank"
>
Expand Down Expand Up @@ -74,6 +74,7 @@ export default {
"placeholder",
"defaultKey",
"name",
"excludedKeys",
],
data() {
return {
Expand All @@ -85,6 +86,11 @@ export default {
uniqId: uniqueId("screen-select-"),
};
},
computed: {
canOpenScreen() {
return Boolean(this.content && this.content.id && this.canUseScreen(this.content));
},
},
watch: {
content: {
handler() {
Expand Down Expand Up @@ -118,6 +124,9 @@ export default {
this.setDefault();
},
methods: {
canUseScreen(screen) {
return !(Array.isArray(this.excludedKeys) && this.excludedKeys.includes(screen?.key));
},
type() {
if (this.params && this.params.type) {
return this.params.type;
Expand Down Expand Up @@ -173,7 +182,7 @@ export default {
{ params },
);
this.loading = false;
this.screens = data.data;
this.screens = data.data.filter((screen) => this.canUseScreen(screen));
} catch (err) {
console.error("There was a problem getting the screens", err);
this.loading = false;
Expand All @@ -186,15 +195,18 @@ export default {
}

ProcessMaker.apiClient
.get("screens", { params: {
key: this.defaultKey,
include_system: 1,
order_by: "id",
order_direction: "ASC",
per_page: 1,
}})
.get("screens", {
params: {
key: this.defaultKey,
include_system: 1,
order_by: "id",
order_direction: "ASC",
per_page: 1,
},
})
.then(({ data }) => {
this.content = data.data[0];
const [screen] = data.data;
this.content = screen;
});
},
/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,9 @@
v-model="screen"
name="interstitialScreen"
:label="$t('Screen Interstitial')"
:required="true"
:helper="$t('What Screen Should Be Used For Rendering This Interstitial')"
:params="parameters"
default-key="interstitial"
:excluded-keys="['interstitial']"
/>
</div>
</template>
Expand Down
Loading