From 1ea7f1f43bceee820341c4dfd5ac621c926ef829 Mon Sep 17 00:00:00 2001 From: Eleazar Resendez Date: Wed, 1 Apr 2026 14:08:28 -0600 Subject: [PATCH 1/3] Resolve FOUR-28033 --- .../components/inspector/Interstitial.vue | 3 +- .../components/inspector/ScreenSelect.vue | 34 +++++++++++++------ .../components/inspector/TaskInterstitial.vue | 3 +- 3 files changed, 25 insertions(+), 15 deletions(-) diff --git a/resources/js/processes/modeler/components/inspector/Interstitial.vue b/resources/js/processes/modeler/components/inspector/Interstitial.vue index bfdf7f17ab..71fadb0b8d 100644 --- a/resources/js/processes/modeler/components/inspector/Interstitial.vue +++ b/resources/js/processes/modeler/components/inspector/Interstitial.vue @@ -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']" /> diff --git a/resources/js/processes/modeler/components/inspector/ScreenSelect.vue b/resources/js/processes/modeler/components/inspector/ScreenSelect.vue index d2d3cf85ff..76ca0806bc 100644 --- a/resources/js/processes/modeler/components/inspector/ScreenSelect.vue +++ b/resources/js/processes/modeler/components/inspector/ScreenSelect.vue @@ -16,9 +16,9 @@ :show-labels="false" label="title" track-by="id" + :name="name" @open="load()" @search-change="load" - :name="name" > From e6a84b847b7bfeb253e4f4b581cb6d10bc647172 Mon Sep 17 00:00:00 2001 From: Eleazar Resendez Date: Wed, 8 Apr 2026 10:29:09 -0600 Subject: [PATCH 2/3] Fix FOUR-28033 interstitial screen selection --- .../Http/Controllers/Api/ScreenController.php | 7 ++++- .../components/inspector/Interstitial.vue | 1 - .../components/inspector/ScreenSelect.vue | 29 +++++++++++++++---- .../components/inspector/TaskInterstitial.vue | 1 - tests/Feature/Api/ScreenTest.php | 28 ++++++++++++++++++ 5 files changed, 57 insertions(+), 9 deletions(-) diff --git a/ProcessMaker/Http/Controllers/Api/ScreenController.php b/ProcessMaker/Http/Controllers/Api/ScreenController.php index 3428ede8ad..d0545d6042 100644 --- a/ProcessMaker/Http/Controllers/Api/ScreenController.php +++ b/ProcessMaker/Http/Controllers/Api/ScreenController.php @@ -206,8 +206,13 @@ public function index(Request $request) * ), * ) */ - public function show(Screen $screen) + public function show(Request $request, Screen $screen) { + $include = $request->input('include', ''); + if ($include) { + $screen->load(explode(',', $include)); + } + return new ScreenResource($screen); } diff --git a/resources/js/processes/modeler/components/inspector/Interstitial.vue b/resources/js/processes/modeler/components/inspector/Interstitial.vue index 71fadb0b8d..f6ba6e206c 100644 --- a/resources/js/processes/modeler/components/inspector/Interstitial.vue +++ b/resources/js/processes/modeler/components/inspector/Interstitial.vue @@ -22,7 +22,6 @@ :label="$t('Screen Interstitial')" :helper="$t('What Screen Should Be Used For Rendering This Interstitial')" :params="parameters" - :excluded-keys="['interstitial']" /> diff --git a/resources/js/processes/modeler/components/inspector/ScreenSelect.vue b/resources/js/processes/modeler/components/inspector/ScreenSelect.vue index 76ca0806bc..457e537459 100644 --- a/resources/js/processes/modeler/components/inspector/ScreenSelect.vue +++ b/resources/js/processes/modeler/components/inspector/ScreenSelect.vue @@ -74,7 +74,6 @@ export default { "placeholder", "defaultKey", "name", - "excludedKeys", ], data() { return { @@ -88,7 +87,7 @@ export default { }, computed: { canOpenScreen() { - return Boolean(this.content && this.content.id && this.canUseScreen(this.content)); + return Boolean(this.content && this.content.id && this.isEditableScreen(this.content)); }, }, watch: { @@ -124,8 +123,20 @@ export default { this.setDefault(); }, methods: { - canUseScreen(screen) { - return !(Array.isArray(this.excludedKeys) && this.excludedKeys.includes(screen?.key)); + includesWithCategory(include) { + const includes = new Set( + String(include || "") + .split(",") + .map((value) => value.trim()) + .filter(Boolean), + ); + + includes.add("category"); + + return Array.from(includes).join(","); + }, + isEditableScreen(screen) { + return !(screen?.is_system || screen?.category?.is_system); }, type() { if (this.params && this.params.type) { @@ -146,7 +157,11 @@ export default { loadScreen(value) { this.loading = true; ProcessMaker.apiClient - .get(`screens/${value}`) + .get(`screens/${value}`, { + params: { + include: "category", + }, + }) .then(({ data }) => { this.loading = false; this.content = data; @@ -169,6 +184,7 @@ export default { type: this.type(), interactive: this.interactive(), include_system: 1, + include: this.includesWithCategory(this.params?.include), order_direction: "asc", status: "active", selectList: true, @@ -182,7 +198,7 @@ export default { { params }, ); this.loading = false; - this.screens = data.data.filter((screen) => this.canUseScreen(screen)); + this.screens = data.data; } catch (err) { console.error("There was a problem getting the screens", err); this.loading = false; @@ -199,6 +215,7 @@ export default { params: { key: this.defaultKey, include_system: 1, + include: "category", order_by: "id", order_direction: "ASC", per_page: 1, diff --git a/resources/js/processes/modeler/components/inspector/TaskInterstitial.vue b/resources/js/processes/modeler/components/inspector/TaskInterstitial.vue index 4045088479..986b4f0302 100644 --- a/resources/js/processes/modeler/components/inspector/TaskInterstitial.vue +++ b/resources/js/processes/modeler/components/inspector/TaskInterstitial.vue @@ -10,7 +10,6 @@ :label="$t('Screen Interstitial')" :helper="$t('What Screen Should Be Used For Rendering This Interstitial')" :params="parameters" - :excluded-keys="['interstitial']" /> diff --git a/tests/Feature/Api/ScreenTest.php b/tests/Feature/Api/ScreenTest.php index 2bc2b2912c..d6b15608b3 100644 --- a/tests/Feature/Api/ScreenTest.php +++ b/tests/Feature/Api/ScreenTest.php @@ -202,6 +202,34 @@ public function testGetScreen() $response->assertJsonStructure(self::STRUCTURE); } + public function testListScreenCanIncludeCategoryForSystemScreens() + { + $screen = Screen::getScreenByKey('interstitial'); + + $response = $this->apiCall( + 'GET', + self::API_TEST_SCREEN . '?include_system=1&include=category&key=interstitial&per_page=1' + ); + + $response->assertStatus(200); + $response->assertJsonPath('data.0.id', $screen->id); + $response->assertJsonPath('data.0.category.is_system', 1); + } + + public function testGetScreenCanIncludeCategoryForSystemScreens() + { + $screen = Screen::getScreenByKey('interstitial'); + + $response = $this->apiCall( + 'GET', + self::API_TEST_SCREEN . '/' . $screen->id . '?include=category' + ); + + $response->assertStatus(200); + $response->assertJsonPath('id', $screen->id); + $response->assertJsonPath('category.is_system', 1); + } + /** * Update Screen parameter are required */ From 56be19f9346f57754e49521be5b93b88d7e0f2ba Mon Sep 17 00:00:00 2001 From: Eleazar Resendez Date: Wed, 8 Apr 2026 10:48:34 -0600 Subject: [PATCH 3/3] Restore default interstitial selection --- .../js/processes/modeler/components/inspector/Interstitial.vue | 2 ++ .../processes/modeler/components/inspector/TaskInterstitial.vue | 2 ++ 2 files changed, 4 insertions(+) diff --git a/resources/js/processes/modeler/components/inspector/Interstitial.vue b/resources/js/processes/modeler/components/inspector/Interstitial.vue index f6ba6e206c..bfdf7f17ab 100644 --- a/resources/js/processes/modeler/components/inspector/Interstitial.vue +++ b/resources/js/processes/modeler/components/inspector/Interstitial.vue @@ -20,8 +20,10 @@ 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" /> diff --git a/resources/js/processes/modeler/components/inspector/TaskInterstitial.vue b/resources/js/processes/modeler/components/inspector/TaskInterstitial.vue index 986b4f0302..fc2897d796 100644 --- a/resources/js/processes/modeler/components/inspector/TaskInterstitial.vue +++ b/resources/js/processes/modeler/components/inspector/TaskInterstitial.vue @@ -8,8 +8,10 @@ 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" />