Skip to content
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

Define AppConfigDescriptor with JSON instead of string #649

Open
wants to merge 2 commits into
base: develop
Choose a base branch
from

Conversation

nickgros
Copy link
Contributor

No description provided.

Comment on lines +6 to +20
"appConfigDefaultConfiguration": {
"GOOGLE_MAP": false,
"VIEW_ASSOCIATED_PROJECTS": false,
"PROVENANCE_DOCKER_IMAGES": false,
"JSONSCHEMA_VALIDATION_STATUS": false,
"DESCRIPTION_FIELD": false,
"ADD_WIKI_WIDGETS": false,
"WIKI_DIFF_TOOL": false,
"CUSTOM_STORAGE_LOCATION_SETTINGS": false,
"CHALLENGE_SUBMISSION_SETTINGS": false,
"PROVENANCE_V2_VISUALIZATION": true,
"VIRTUALTABLE_SUPPORT": false,
"SRC_BASED_AR_MODAL_WIZARD": false,
"REACT_ENTITY_ACL_EDITOR": true
}
Copy link
Contributor Author

@nickgros nickgros Aug 15, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Now this must be JSON

@@ -35,7 +35,7 @@
"Ref": "dev101portalAppConfigConfigProfile"
},
"Description": "Freeform config for toggling experimental mode features",
"Content": "{\"GOOGLE_MAP\": false, \"VIEW_ASSOCIATED_PROJECTS\": false, \"PROVENANCE_DOCKER_IMAGES\": false, \"JSONSCHEMA_VALIDATION_STATUS\": false, \"DESCRIPTION_FIELD\": false, \"ADD_WIKI_WIDGETS\": false, \"WIKI_DIFF_TOOL\": false, \"CUSTOM_STORAGE_LOCATION_SETTINGS\": false, \"CHALLENGE_SUBMISSION_SETTINGS\": false, \"PROVENANCE_V2_VISUALIZATION\": true, \"VIRTUALTABLE_SUPPORT\": false, \"SRC_BASED_AR_MODAL_WIZARD\": false, \"REACT_ENTITY_ACL_EDITOR\": true}",
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Had to remove spaces because those are lost on serialization

Comment on lines 27 to 32
ObjectMapper mapper = new ObjectMapper();
try {
this.appConfigDefaultConfiguration = mapper.writeValueAsString(mapper.writeValueAsString(appConfigDefaultConfiguration));
} catch (JsonProcessingException e) {
throw new IllegalArgumentException("Failed to serialize appConfigDefaultConfiguration", e);
}
Copy link
Contributor Author

@nickgros nickgros Aug 15, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We still need to pass a string to CloudFormation, so use Jackson to serialize the object to a string twice, which will give us properly-escaped stringified JSON.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant