Skip to content

Commit

Permalink
Add provisionUrl property + some styling fixes [packages-only]
Browse files Browse the repository at this point in the history
  • Loading branch information
Remi749 committed Nov 14, 2024
1 parent 5cfa41c commit 698731d
Show file tree
Hide file tree
Showing 6 changed files with 27 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -182,12 +182,14 @@ export function useIdeaField(props: IIdeaFieldProps) {
}
}

const statusKey = ['approve', 'consideration', 'reject'].find(
(key) =>
approveValue.includes(textValue) ||
considerationValue.includes(textValue) ||
rejectValue.includes(textValue)
)
let statusKey = null
if (approveValue.includes(textValue)) {
statusKey = 'approve'
} else if (considerationValue.includes(textValue)) {
statusKey = 'consideration'
} else if (rejectValue.includes(textValue)) {
statusKey = 'reject'
}

const { backgroundColor, icon } = statusStyles[statusKey] || {
backgroundColor: 'var(--colorNeutralBackground2)',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,17 @@
}
}

.accordion {
width: fit-content;
padding: 0 8px;
margin-bottom: 16px;

&:hover {
background-color: var(--colorNeutralBackground1Hover);
border-radius: var(--borderRadiusLarge);
}
}

.idea {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(450px, 1fr));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,7 @@ export const IdeaModule: FC<IIdeaModuleProps> = (props) => {
{state.selectedIdea.item.processing && (
<Accordion openItems={openItems} onToggle={handleToggle} multiple collapsible>
<AccordionItem value='registration'>
<AccordionHeader size='large' icon={getFluentIcon('Lightbulb')}>
<AccordionHeader className={styles.accordion} size='large' icon={getFluentIcon('Lightbulb')}>
Registrert idé
</AccordionHeader>
<AccordionPanel>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ export const IdeaPhaseBar: FC = () => {
<>
<TabList className={styles.ideaPhases} selectedValue={context.state.phase}>
{phases.map((phase) => {
if (phase.phase === IdeaPhase.Provisioned) {
if (phase.phase === IdeaPhase.Provisioned && context.props.provisionUrl) {
return (
<ProjectProvision
{...context.props}
Expand All @@ -46,7 +46,7 @@ export const IdeaPhaseBar: FC = () => {
}
size='medium'
disabled={context.state.phase !== IdeaPhase.ApprovedForConcept}
provisionUrl='https://puzzlepart.sharepoint.com/sites/bestillingsportalen'
provisionUrl={context.props.provisionUrl}
/>
)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ export interface IIdeaModuleProps extends IBaseComponentProps {
listSize?: 'extra-small' | 'small' | 'medium'
hiddenRegFields?: string[]
hiddenProcFields?: string[]
provisionUrl?: string
}

export interface IIdeaModuleState {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,10 @@ export default class IdeaModuleWebPart extends BasePortfolioWebPart<IIdeaModuleP
multiline: true,
resizable: true,
rows: 6
}),
PropertyPaneTextField('provisionUrl', {
label: 'Provisjoneringsområde',
description: 'URL til området som håndterer bestillinger'
})
]
}
Expand Down

0 comments on commit 698731d

Please sign in to comment.