Repository: bcgov/SIMS
Pull request #4604: #4452 - Read-only application view: Remove FAED warning banner
Author: login: sh16011993
Labels: name: Form.io
description: Form IO definitions changed.
Created: 2025-04-14T22:24:12Z | Merged: 2025-04-15T20:55:49Z

## As a part of this PR, the following was completed:

- Removed the below shown FAED warning banner in read-only view for student, institution and ministry for both part-time and full-time applications.

**Removed the following mentioned banner for read-only view:**

![image](https://github.com/user-attachments/assets/91833d86-be79-4710-b06d-b4b281808791)

### **Screenshots:**

**Non-readonly Mode:**

<img width="1918" alt="image" src="https://github.com/user-attachments/assets/1f1d85eb-e489-4fbf-8bfa-4e909578e96f" />

--------------------------------------------------------------------------------------------------------------------------------------------

**Institution View (readonly):**

<img width="1918" alt="image" src="https://github.com/user-attachments/assets/1f0a8533-f32f-40bc-94fc-c91e6e746ce6" />

--------------------------------------------------------------------------------------------------------------------------------------------

**Ministry View (readonly):**

<img width="1921" alt="image" src="https://github.com/user-attachments/assets/1d8aceb7-5852-477c-8599-02d29b4b3191" />

--------------------------------------------------------------------------------------------------------------------------------------------

**Student View (readonly):**

<img width="1919" alt="image" src="https://github.com/user-attachments/assets/60e5b593-5f70-4b9e-86c5-fb7b16033a60" />



Diff:
diff --git a/sources/packages/forms/src/form-definitions/sfaa2022-23.json b/sources/packages/forms/src/form-definitions/sfaa2022-23.json
index 53905b881a..4f25ae5d4d 100644
--- a/sources/packages/forms/src/form-definitions/sfaa2022-23.json
+++ b/sources/packages/forms/src/form-definitions/sfaa2022-23.json
@@ -1508,8 +1508,7 @@
               "customClass": "font-weight-bold",
               "disabled": true,
               "calculateValue": "",
-              "lockKey": true,
-              "isNew": false
+              "lockKey": true
             },
             {
               "title": "Program",
@@ -2627,13 +2626,13 @@
                       "hideLabel": true,
                       "tags": [],
                       "conditional": {
-                        "show": "true",
-                        "when": "studyEndDateBeforeSixWeeksFromToday",
-                        "eq": "true"
+                        "show": "",
+                        "when": "",
+                        "eq": ""
                       },
                       "properties": {},
                       "customClass": "banner-warning",
-                      "customConditional": ""
+                      "customConditional": "show = !!!data.isReadOnly && !!data.studyEndDateBeforeSixWeeksFromToday;"
                     }
                   ],
                   "allowPrevious": false,
@@ -3710,13 +3709,13 @@
                   "type": "htmlelement",
                   "tags": [],
                   "conditional": {
-                    "show": "true",
-                    "when": "selectedStudyEndDateBeforeSixWeeksFromToday",
-                    "eq": "true"
+                    "show": "",
+                    "when": "",
+                    "eq": ""
                   },
                   "properties": {},
                   "customClass": "banner-warning",
-                  "customConditional": "",
+                  "customConditional": "show = !!!data.isReadOnly && !!data.selectedStudyEndDateBeforeSixWeeksFromToday;",
                   "hideLabel": true
                 },
                 {
diff --git a/sources/packages/forms/src/form-definitions/sfaa2023-24.json b/sources/packages/forms/src/form-definitions/sfaa2023-24.json
index df43cd927e..2323dd0582 100644
--- a/sources/packages/forms/src/form-definitions/sfaa2023-24.json
+++ b/sources/packages/forms/src/form-definitions/sfaa2023-24.json
@@ -1508,8 +1508,7 @@
               "customClass": "font-weight-bold",
               "disabled": true,
               "calculateValue": "",
-              "lockKey": true,
-              "isNew": false
+              "lockKey": true
             },
             {
               "title": "Program",
@@ -2627,13 +2626,13 @@
                       "hideLabel": true,
                       "tags": [],
                       "conditional": {
-                        "show": "true",
-                        "when": "studyEndDateBeforeSixWeeksFromToday",
-                        "eq": "true"
+                        "show": "",
+                        "when": "",
+                        "eq": ""
                       },
                       "properties": {},
                       "customClass": "banner-warning",
-                      "customConditional": ""
+                      "customConditional": "show = !!!data.isReadOnly && !!data.studyEndDateBeforeSixWeeksFromToday;"
                     }
                   ],
                   "allowPrevious": false,
@@ -3710,13 +3709,13 @@
                   "type": "htmlelement",
                   "tags": [],
                   "conditional": {
-                    "show": "true",
-                    "when": "selectedStudyEndDateBeforeSixWeeksFromToday",
-                    "eq": "true"
+                    "show": "",
+                    "when": "",
+                    "eq": ""
                   },
                   "properties": {},
                   "customClass": "banner-warning",
-                  "customConditional": "",
+                  "customConditional": "show = !!!data.isReadOnly && !!data.selectedStudyEndDateBeforeSixWeeksFromToday;",
                   "hideLabel": true
                 },
                 {
diff --git a/sources/packages/forms/src/form-definitions/sfaa2024-25.json b/sources/packages/forms/src/form-definitions/sfaa2024-25.json
index 976a53ecb0..715b39a0d6 100644
--- a/sources/packages/forms/src/form-definitions/sfaa2024-25.json
+++ b/sources/packages/forms/src/form-definitions/sfaa2024-25.json
@@ -1508,8 +1508,7 @@
               "customClass": "font-weight-bold",
               "disabled": true,
               "calculateValue": "",
-              "lockKey": true,
-              "isNew": false
+              "lockKey": true
             },
             {
               "title": "Program",
@@ -2627,13 +2626,13 @@
                       "hideLabel": true,
                       "tags": [],
                       "conditional": {
-                        "show": "true",
-                        "when": "studyEndDateBeforeSixWeeksFromToday",
-                        "eq": "true"
+                        "show": "",
+                        "when": "",
+                        "eq": ""
                       },
                       "properties": {},
                       "customClass": "banner-warning",
-                      "customConditional": ""
+                      "customConditional": "show = !!!data.isReadOnly && !!data.studyEndDateBeforeSixWeeksFromToday;"
                     }
                   ],
                   "allowPrevious": false,
@@ -3710,13 +3709,13 @@
                   "type": "htmlelement",
                   "tags": [],
                   "conditional": {
-                    "show": "true",
-                    "when": "selectedStudyEndDateBeforeSixWeeksFromToday",
-                    "eq": "true"
+                    "show": "",
+                    "when": "",
+                    "eq": ""
                   },
                   "properties": {},
                   "customClass": "banner-warning",
-                  "customConditional": "",
+                  "customConditional": "show = !!!data.isReadOnly && !!data.selectedStudyEndDateBeforeSixWeeksFromToday;",
                   "hideLabel": true
                 },
                 {
diff --git a/sources/packages/forms/src/form-definitions/sfaa2025-26.json b/sources/packages/forms/src/form-definitions/sfaa2025-26.json
index f9bd35945a..39275705b9 100644
--- a/sources/packages/forms/src/form-definitions/sfaa2025-26.json
+++ b/sources/packages/forms/src/form-definitions/sfaa2025-26.json
@@ -2628,13 +2628,13 @@
                       "hideLabel": true,
                       "tags": [],
                       "conditional": {
-                        "show": "true",
-                        "when": "studyEndDateBeforeSixWeeksFromToday",
-                        "eq": "true"
+                        "show": "",
+                        "when": "",
+                        "eq": ""
                       },
                       "properties": {},
                       "customClass": "banner-warning",
-                      "customConditional": ""
+                      "customConditional": "show = !!!data.isReadOnly && !!data.studyEndDateBeforeSixWeeksFromToday;"
                     }
                   ],
                   "allowPrevious": false,
@@ -3711,13 +3711,13 @@
                   "type": "htmlelement",
                   "tags": [],
                   "conditional": {
-                    "show": "true",
-                    "when": "selectedStudyEndDateBeforeSixWeeksFromToday",
-                    "eq": "true"
+                    "show": "",
+                    "when": "",
+                    "eq": ""
                   },
                   "properties": {},
                   "customClass": "banner-warning",
-                  "customConditional": "",
+                  "customConditional": "show = !!!data.isReadOnly && !!data.selectedStudyEndDateBeforeSixWeeksFromToday;",
                   "hideLabel": true
                 },
                 {


Reviews:
user: login: andrewsignori-aot
body: Nice work, looks good 👍 
state: APPROVED
author_association: COLLABORATOR
submitted_at: 2025-04-15T15:38:36Z
user: login: bidyashish
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-04-15T20:00:24Z
user: login: sh16011993
state: COMMENTED
author_association: COLLABORATOR
submitted_at: 2025-04-15T20:06:06Z
user: login: sh16011993
state: COMMENTED
author_association: COLLABORATOR
submitted_at: 2025-04-15T20:06:18Z
user: login: bidyashish
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-04-15T20:10:24Z
user: login: bidyashish
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-04-15T20:12:00Z
user: login: bidyashish
body: LGTM

state: APPROVED
author_association: CONTRIBUTOR
submitted_at: 2025-04-15T20:51:31Z

Review comments:
diff_hunk: @@ -2627,13 +2626,13 @@
                       "hideLabel": true,
                       "tags": [],
                       "conditional": {
-                        "show": "true",
-                        "when": "studyEndDateBeforeSixWeeksFromToday",
-                        "eq": "true"
+                        "show": "",
+                        "when": "",
+                        "eq": ""
                       },
                       "properties": {},
                       "customClass": "banner-warning",
-                      "customConditional": ""
+                      "customConditional": "show = !!!data.isReadOnly && !!data.studyEndDateBeforeSixWeeksFromToday;"
path: sources/packages/forms/src/form-definitions/sfaa2022-23.json
user: login: bidyashish
body: `!!!data`. seems like typo!
created_at: 2025-04-15T19:59:25Z
author_association: CONTRIBUTOR
diff_hunk: @@ -3710,13 +3709,13 @@
                   "type": "htmlelement",
                   "tags": [],
                   "conditional": {
-                    "show": "true",
-                    "when": "selectedStudyEndDateBeforeSixWeeksFromToday",
-                    "eq": "true"
+                    "show": "",
+                    "when": "",
+                    "eq": ""
                   },
                   "properties": {},
                   "customClass": "banner-warning",
-                  "customConditional": "",
+                  "customConditional": "show = !!!data.isReadOnly && !!data.selectedStudyEndDateBeforeSixWeeksFromToday;",
path: sources/packages/forms/src/form-definitions/sfaa2022-23.json
user: login: bidyashish
body: Same here 
created_at: 2025-04-15T19:59:36Z
author_association: CONTRIBUTOR
diff_hunk: @@ -2627,13 +2626,13 @@
                       "hideLabel": true,
                       "tags": [],
                       "conditional": {
-                        "show": "true",
-                        "when": "studyEndDateBeforeSixWeeksFromToday",
-                        "eq": "true"
+                        "show": "",
+                        "when": "",
+                        "eq": ""
                       },
                       "properties": {},
                       "customClass": "banner-warning",
-                      "customConditional": ""
+                      "customConditional": "show = !!!data.isReadOnly && !!data.studyEndDateBeforeSixWeeksFromToday;"
path: sources/packages/forms/src/form-definitions/sfaa2022-23.json
user: login: sh16011993
body: `!!!data.isReadOnly` is equivalent to `!(!!data.isReadOnly)` which first ensures strict boolean conversion `(!!data.isReadOnly)` and then negates it. Using either approach will work similarly, but the triple negation `(!!!)` can provide slightly more predictable behavior across all possible input values by enforcing strict boolean conversion.
created_at: 2025-04-15T20:06:06Z
author_association: COLLABORATOR
diff_hunk: @@ -3710,13 +3709,13 @@
                   "type": "htmlelement",
                   "tags": [],
                   "conditional": {
-                    "show": "true",
-                    "when": "selectedStudyEndDateBeforeSixWeeksFromToday",
-                    "eq": "true"
+                    "show": "",
+                    "when": "",
+                    "eq": ""
                   },
                   "properties": {},
                   "customClass": "banner-warning",
-                  "customConditional": "",
+                  "customConditional": "show = !!!data.isReadOnly && !!data.selectedStudyEndDateBeforeSixWeeksFromToday;",
path: sources/packages/forms/src/form-definitions/sfaa2022-23.json
user: login: sh16011993
body: https://github.com/bcgov/SIMS/pull/4604#discussion_r2045391986
created_at: 2025-04-15T20:06:18Z
author_association: COLLABORATOR
diff_hunk: @@ -2627,13 +2626,13 @@
                       "hideLabel": true,
                       "tags": [],
                       "conditional": {
-                        "show": "true",
-                        "when": "studyEndDateBeforeSixWeeksFromToday",
-                        "eq": "true"
+                        "show": "",
+                        "when": "",
+                        "eq": ""
                       },
                       "properties": {},
                       "customClass": "banner-warning",
-                      "customConditional": ""
+                      "customConditional": "show = !!!data.isReadOnly && !!data.studyEndDateBeforeSixWeeksFromToday;"
path: sources/packages/forms/src/form-definitions/sfaa2022-23.json
user: login: bidyashish
body: It is redundant, and can be removed as it is not required. 

created_at: 2025-04-15T20:10:24Z
author_association: CONTRIBUTOR
diff_hunk: @@ -3710,13 +3709,13 @@
                   "type": "htmlelement",
                   "tags": [],
                   "conditional": {
-                    "show": "true",
-                    "when": "selectedStudyEndDateBeforeSixWeeksFromToday",
-                    "eq": "true"
+                    "show": "",
+                    "when": "",
+                    "eq": ""
                   },
                   "properties": {},
                   "customClass": "banner-warning",
-                  "customConditional": "",
+                  "customConditional": "show = !!!data.isReadOnly && !!data.selectedStudyEndDateBeforeSixWeeksFromToday;",
path: sources/packages/forms/src/form-definitions/sfaa2022-23.json
user: login: bidyashish
body: !!!data.isReadOnly negates it three times. This is equivalent to ! (!!data.isReadOnly). Since !!data.isReadOnly is the boolean equivalent of data.isReadOnly, applying one more ! just gives you the standard negation.
created_at: 2025-04-15T20:12:00Z
author_association: CONTRIBUTOR

PR comments:
user: login: sonarqubecloud[bot]
created_at: 2025-04-14T23:19:24Z
body: ## [![Quality Gate Passed](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/QualityGateBadge/qg-passed-20px.png 'Quality Gate Passed')](https://sonarcloud.io/dashboard?id=bcgov_SIMS&pullRequest=4604) **Quality Gate passed**  
Issues  
![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/passed-16px.png '') [0 New issues](https://sonarcloud.io/project/issues?id=bcgov_SIMS&pullRequest=4604&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)  
![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/accepted-16px.png '') [0 Accepted issues](https://sonarcloud.io/project/issues?id=bcgov_SIMS&pullRequest=4604&issueStatuses=ACCEPTED)

Measures  
![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/passed-16px.png '') [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=bcgov_SIMS&pullRequest=4604&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)  
![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/passed-16px.png '') [0.0% Coverage on New Code](https://sonarcloud.io/component_measures?id=bcgov_SIMS&pullRequest=4604&metric=new_coverage&view=list)  
![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/passed-16px.png '') [0.0% Duplication on New Code](https://sonarcloud.io/component_measures?id=bcgov_SIMS&pullRequest=4604&metric=new_duplicated_lines_density&view=list)  
  
[See analysis details on SonarQube Cloud](https://sonarcloud.io/dashboard?id=bcgov_SIMS&pullRequest=4604)


author_association: NONE
user: login: github-actions[bot]
created_at: 2025-04-14T23:20:03Z
body: <!-- coverage-monitor-action: E2E Workflow Workers Coverage Report -->
## E2E Workflow Workers Coverage Report

|  Totals | ![Coverage](https://img.shields.io/static/v1?label=coverage&message=69%&color=green) |
| :-- | :-- |
| Statements: | 65.81% ( 614 / 933 ) |
| Methods: | 60.36% ( 67 / 111 ) |
| Lines: | 68.87% ( 489 / 710 ) |
| Branches: | 51.79% ( 58 / 112 ) |

author_association: NONE
user: login: github-actions[bot]
created_at: 2025-04-14T23:20:10Z
body: <!-- coverage-monitor-action: Backend Unit Tests Coverage Report -->
## Backend Unit Tests Coverage Report

|  Totals | ![Coverage](https://img.shields.io/static/v1?label=coverage&message=25%&color=yellow) |
| :-- | :-- |
| Statements: | 21.81% ( 3979 / 18243 ) |
| Methods: | 9.79% ( 228 / 2330 ) |
| Lines: | 25.17% ( 3441 / 13673 ) |
| Branches: | 13.84% ( 310 / 2240 ) |

author_association: NONE
user: login: github-actions[bot]
created_at: 2025-04-14T23:22:32Z
body: <!-- coverage-monitor-action: E2E Queue Consumers Coverage Report -->
## E2E Queue Consumers Coverage Report

|  Totals | ![Coverage](https://img.shields.io/static/v1?label=coverage&message=88%&color=green) |
| :-- | :-- |
| Statements: | 85.75% ( 1511 / 1762 ) |
| Methods: | 83.41% ( 171 / 205 ) |
| Lines: | 88.12% ( 1246 / 1414 ) |
| Branches: | 65.73% ( 94 / 143 ) |

author_association: NONE
user: login: github-actions[bot]
created_at: 2025-04-14T23:34:04Z
body: <!-- coverage-monitor-action: E2E SIMS API Coverage Report -->
## E2E SIMS API Coverage Report

|  Totals | ![Coverage](https://img.shields.io/static/v1?label=coverage&message=74%&color=green) |
| :-- | :-- |
| Statements: | 70.4% ( 6568 / 9329 ) |
| Methods: | 68.74% ( 818 / 1190 ) |
| Lines: | 73.77% ( 5097 / 6909 ) |
| Branches: | 53.09% ( 653 / 1230 ) |

author_association: NONE