Skip to content

Commit

Permalink
Fix for issue where a published statusreport wasn't indicated as publ…
Browse files Browse the repository at this point in the history
…ished top right [skip-ci]
  • Loading branch information
Remi749 committed Jan 19, 2024
1 parent 4c88d20 commit b98487e
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 22 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,20 +8,21 @@ import { Shimmer } from '@fluentui/react'

export const PublishedStatus: FC = () => {
const { state } = useProjectStatusContext()

return (
<Shimmer isDataLoaded={state.isDataLoaded}>
<div className={styles.publishedStatus}>
<div className={styles.publishedStatusIcon} hidden={!state.selectedReport?.published}>
<CheckmarkSquare24Filled />
{state.selectedReport?.published ? (
<div className={styles.publishedStatus}>
<div className={styles.publishedStatusIcon}>
<CheckmarkSquare24Filled />
</div>
<WebPartTitle title={strings.PublishedStatusReport} />
</div>
) : (
<div className={styles.publishedStatus}>
<WebPartTitle title={strings.NotPublishedStatusReport} />
</div>
<WebPartTitle
title={
state.selectedReport?.published
? strings.PublishedStatusReport
: strings.NotPublishedStatusReport
}
/>
</div>
)}
</Shimmer>
)
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,23 +7,26 @@ import styles from './Sections.module.scss'
import { SectionContext } from './context'
import { useCreateContextValue } from './useCreateContextValue'
import { useSections } from './useSections'
import { Shimmer } from '@fluentui/react'

export const Sections: FC = () => {
const context = useProjectStatusContext()
const createContextValue = useCreateContextValue({ iconSize: 50 })
const sections = useSections()

return (
<div className={styles.root} id='pp-statussection'>
{!context.state.selectedReport ? (
<UserMessage title={strings.NoReportsFoundTitle} text={strings.NoStatusReportsMessage} />
) : (
sections.map((sec, idx) => (
<SectionContext.Provider key={idx} value={createContextValue(sec)}>
{SectionMap[sec.type] ?? null}
</SectionContext.Provider>
))
)}
</div>
<Shimmer isDataLoaded={context.state.isDataLoaded}>
<div className={styles.root} id='pp-statussection'>
{!context.state.selectedReport ? (
<UserMessage title={strings.NoReportsFoundTitle} text={strings.NoStatusReportsMessage} />
) : (
sections.map((sec, idx) => (
<SectionContext.Provider key={idx} value={createContextValue(sec)}>
{SectionMap[sec.type] ?? null}
</SectionContext.Provider>
))
)}
</div>
</Shimmer>
)
}

0 comments on commit b98487e

Please sign in to comment.