Skip to content

Commit

Permalink
order of messages
Browse files Browse the repository at this point in the history
  • Loading branch information
olemp committed Jan 14, 2025
1 parent 2854ff4 commit 831f0db
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 30 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@ export const TemplateConfigMessage: FC<ITemplateConfigMessageProps> = (props) =>
<div className={styles.root}>
{messages.map((message, index) => (
<div key={index} hidden={message.hidden}>
<UserMessage
key={index}
text={message.text}
intent={message.intent} />
<UserMessage
key={index}
text={message.text}
intent={message.intent} />
</div>
))}
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,32 +16,31 @@ export function useTemplateConfigMessage({ section }: ITemplateConfigMessageProp
const templateHasExtensions = !isEmpty(context.state.selectedTemplate?.extensions)
const templateHasContentConfig = !isEmpty(context.state.selectedTemplate?.contentConfig)

const messages: IUserMessageProps[] = []

messages.push({
text: format(
strings.TemplateConfigMessage,
context.state.selectedTemplate?.text,
[
templateHasExtensions && strings.ExtensionsSectionHeaderText,
templateHasContentConfig && strings.ContentConfigSectionHeaderText
]
.filter(Boolean)
.join(' og ')
.toLowerCase()
),
hidden: !(
(section === 'ExtensionsSection' && templateHasExtensions) ||
(section === 'ContentConfigSection' && templateHasContentConfig) ||
(section === 'TemplateSelector' && (templateHasExtensions || templateHasContentConfig))
)
})

messages.push({
text: strings.PlannerMemberWarningMessage,
intent: 'warning',
hidden: context.props.validation !== ProjectSetupValidation.UserNotGroupMember
})
const messages: IUserMessageProps[] = [
{
text: strings.PlannerMemberWarningMessage,
intent: 'warning',
hidden: context.props.validation !== ProjectSetupValidation.UserNotGroupMember
},
{
text: format(
strings.TemplateConfigMessage,
context.state.selectedTemplate?.text,
[
templateHasExtensions && strings.ExtensionsSectionHeaderText,
templateHasContentConfig && strings.ContentConfigSectionHeaderText
]
.filter(Boolean)
.join(' og ')
.toLowerCase()
),
hidden: !(
(section === 'ExtensionsSection' && templateHasExtensions) ||
(section === 'ContentConfigSection' && templateHasContentConfig) ||
(section === 'TemplateSelector' && (templateHasExtensions || templateHasContentConfig))
)
}
]

return messages
}

0 comments on commit 831f0db

Please sign in to comment.