-
Notifications
You must be signed in to change notification settings - Fork 364
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
Config traits #5918
base: main
Are you sure you want to change the base?
Config traits #5918
Conversation
//@ts-ignore | ||
helpItems |
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.
was getting type error
This is ready for review, added a basic conversion so no breaking changes are introduced in patch or minor version. |
did another pass over this, also tried loading prod map-configs from https://github.com/TerriaJS/saas-catalogs-public, and no issue is raised to the user so I am pretty much confident that this can go without having to update the configs right away |
type: HelpItemTraits, | ||
name: "Help content items", | ||
description: "The content to be displayed in the help panel.", | ||
idProperty: "index" |
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.
Just dropping a comment here for a future full review: I think this should be:
idProperty: "index" | |
idProperty: "itemName", |
though I haven't thought through the consequences of either idProperty
choices.
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.
I think itemName
is good - then makes it easy to remove specific default help items
steps?: StepItemTraits[]; | ||
} | ||
|
||
export class HelpItemTraits extends ModelTraits { |
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.
Relating to https://github.com/TerriaJS/terriajs/pull/5918/files#r894124712. If using itemName
as an id you could add:
static isRemoval(helpItem: HelpItemTraits) {
// This condition looks sensible
return helpItem.markdownText === null && helpItem.trainerItems === null;
}
And then you could have default helpItems in terriajs that get overriden/removed in TerriaMap config using the strata system, I think. I have to play around with this branch sometime. And default help items in terriajs means translation support!
What this PR does
Fixes #
TerriaMap PR: TerriaJS/TerriaMap#557
Update TerriaJS config parameters to use traits system. Some of the parameters are renamed
showWelcomeMessage
andwelcomeMessageVideo
are now parameters on objectwelcomeMessage
asshow
andvideo
helpContent
is nowhelpItems
helpContentTerms
are nowhelpTerms
(they are not strictly related tohelpContent
)feedbackPreamble
andfeedbackMinLength
are now parameters on objectfeedback
aspreamble
andminLength
brandBarElements
,brandBarSmallElements
,displayOneBrand
are now parameters on objectbrandBar
aselements
,smallElements
,displayOneBrand
googleUrlShortenerKey
is deprecated long time ago but still left as a config parameterdisclaimer
is not used anywhere so I added it to deprecated listglobalDisclaimer
is also not used anywhere - not sure if IT should be marked as deprecated as it is set from TerriaMap?TODO
configParameter
in case when it is notprimitiveTrait
,objectTrait
will always be defined and that condition should be updatedp.s. this was much easier than initially expected
Checklist
[ ] There are unit tests to verify my changes are correct or unit tests aren't applicable (if so, write quick reason why unit tests don't exist)- All existing test passdoc/
.