-
Notifications
You must be signed in to change notification settings - Fork 160
Fixes #13628: System configuration to visually distinguish different systems #13788
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: development
Are you sure you want to change the base?
Changes from all commits
f14ce4a
3c52600
49bc667
2981281
78f021f
e891043
e93a8a1
a6c0729
cf9cb29
9a09694
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -46,3 +46,5 @@ bin | |
| /sormas-e2e-tests/logs | ||
|
|
||
| .DS_Store | ||
|
|
||
| /.run-configs | ||
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -15062,4 +15062,58 @@ ALTER TABLE testreport_history ADD COLUMN serotype character varying(255); | |||||||||||||||||||||
| ALTER TABLE testreport_history ADD COLUMN straincallstatus character varying(255); | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| INSERT INTO schema_version (version_number, comment) VALUES (602, 'External message additional fields'); | ||||||||||||||||||||||
| -- *** Insert new sql commands BEFORE this line. Remember to always consider _history tables. *** | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| ALTER TABLE systemconfigurationvalue ADD CONSTRAINT uk_systemconfigurationvalue_config_key UNIQUE (config_key); | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| DO | ||||||||||||||||||||||
| $$ | ||||||||||||||||||||||
| DECLARE | ||||||||||||||||||||||
| general_configuration_id bigint; | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| BEGIN | ||||||||||||||||||||||
| -- Check if the category 'GENERAL_CATEGORY' already exists | ||||||||||||||||||||||
| SELECT id | ||||||||||||||||||||||
| INTO general_configuration_id | ||||||||||||||||||||||
| FROM systemconfigurationcategory | ||||||||||||||||||||||
| WHERE name = 'GENERAL_CATEGORY'; | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| -- Insert the general category if it doesn't exist | ||||||||||||||||||||||
| IF | ||||||||||||||||||||||
| general_configuration_id IS NULL THEN | ||||||||||||||||||||||
| INSERT INTO systemconfigurationcategory(id, uuid, changedate, creationdate, name, caption, description) | ||||||||||||||||||||||
| VALUES (nextval('entity_seq'), generate_base32_uuid(), now(), now(), 'GENERAL_CATEGORY', 'i18n/General/categoryGeneral', | ||||||||||||||||||||||
| 'i18n/General/categoryGeneral') | ||||||||||||||||||||||
| RETURNING id INTO general_configuration_id; | ||||||||||||||||||||||
| END IF; | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| -- Insert new configurations if missing | ||||||||||||||||||||||
| -- Background color | ||||||||||||||||||||||
| INSERT INTO systemconfigurationvalue(config_key, config_value, category_id, value_optional, value_pattern, | ||||||||||||||||||||||
| value_encrypt, data_provider, validation_message, changedate, creationdate, | ||||||||||||||||||||||
| id, | ||||||||||||||||||||||
| uuid) | ||||||||||||||||||||||
| VALUES ('MENU_BACKGROUND_COLOR', 'default', general_configuration_id, true, | ||||||||||||||||||||||
| '^(default|red|green|indigo|gray)|(#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3}))$', false, | ||||||||||||||||||||||
| null, | ||||||||||||||||||||||
| 'i18n/systemConfigurationValueValidationInvalidBackgroundColor', now(), now(), nextval('entity_seq'), | ||||||||||||||||||||||
| generate_base32_uuid()) | ||||||||||||||||||||||
| ON CONFLICT (config_key) DO NOTHING; | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| -- Menu Subtitle | ||||||||||||||||||||||
| INSERT INTO systemconfigurationvalue(config_key, config_value, category_id, value_optional, value_pattern, | ||||||||||||||||||||||
| value_encrypt, data_provider, validation_message, changedate, creationdate, | ||||||||||||||||||||||
| id, | ||||||||||||||||||||||
| uuid) | ||||||||||||||||||||||
| VALUES ('MENU_SUBTITLE', '', general_configuration_id, true, | ||||||||||||||||||||||
| '^\w{0,16}$', false, | ||||||||||||||||||||||
| null, | ||||||||||||||||||||||
| 'i18n/systemConfigurationValueValidationMenuSubtitle', now(), now(), nextval('entity_seq'), | ||||||||||||||||||||||
| generate_base32_uuid()) | ||||||||||||||||||||||
|
Comment on lines
+15107
to
+15111
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
The pattern If this is intentional (e.g., for a short identifier), please disregard. Otherwise, consider a more permissive pattern: Suggested pattern allowing spaces and common punctuation- VALUES ('MENU_SUBTITLE', '', general_configuration_id, true,
- '^\w{0,16}$', false,
+ VALUES ('MENU_SUBTITLE', '', general_configuration_id, true,
+ '^[\w\s\-\.]{0,16}$', false,This allows word characters, spaces, hyphens, and periods up to 16 characters. 📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||||||||||||||||||
| ON CONFLICT (config_key) DO NOTHING; | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| END | ||||||||||||||||||||||
| $$ | ||||||||||||||||||||||
| LANGUAGE plpgsql; | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| INSERT INTO schema_version (version_number, comment) VALUES (603, 'System configuration: to visually distinguish different system types'); | ||||||||||||||||||||||
| -- *** Insert new sql commands BEFORE this line. Remember to always consider _history tables. *** | ||||||||||||||||||||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -530,4 +530,8 @@ | |
| background-color: #FFFFFF !important; | ||
| border-radius: 24px; | ||
| } | ||
|
|
||
| .underline { | ||
| text-decoration: underline; | ||
| } | ||
| } | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🧩 Analysis chain
🏁 Script executed:
Repository: SORMAS-Foundation/SORMAS-Project
Length of output: 2625
🏁 Script executed:
Repository: SORMAS-Foundation/SORMAS-Project
Length of output: 8165
🏁 Script executed:
Repository: SORMAS-Foundation/SORMAS-Project
Length of output: 126
🏁 Script executed:
Repository: SORMAS-Foundation/SORMAS-Project
Length of output: 503
Add cleanup before the unique constraint to prevent migration failures.
The
ALTER TABLE ADD CONSTRAINTon line 15066 will fail if duplicateconfig_keyvalues exist in production. Prior schema migrations (version 569) demonstrate the correct pattern: DELETE duplicate rows before adding the constraint. AddDELETE FROM systemconfigurationvalue WHERE config_key IN ('MENU_BACKGROUND_COLOR', 'MENU_SUBTITLE');before the constraint addition, consistent with the established migration pattern for configuration updates.🤖 Prompt for AI Agents