-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Visuelt løft på dialog for endring av fase (#1289)
- Loading branch information
Showing
25 changed files
with
248 additions
and
198 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
9 changes: 7 additions & 2 deletions
9
...jectWebParts/src/components/ProjectPhases/ChangePhaseDialog/ChangePhaseDialog.module.scss
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,10 @@ | ||
.root { | ||
.changePhaseDialog { | ||
width: 550px; | ||
max-width: 550px; | ||
font-weight: 300; | ||
|
||
.dialogContent { | ||
display: flex; | ||
flex-direction: column; | ||
gap: 12px; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3 changes: 0 additions & 3 deletions
3
...ProjectPhases/ChangePhaseDialog/DynamicHomepageContent/DynamicHomepageContent.module.scss
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
12 changes: 8 additions & 4 deletions
12
...WebParts/src/components/ProjectPhases/ChangePhaseDialog/Views/ChangingPhaseView/index.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,18 @@ | ||
import { format, ProgressIndicator } from '@fluentui/react' | ||
import { format } from '@fluentui/react' | ||
import { ProjectPhasesContext } from '../../../../ProjectPhases/context' | ||
import * as strings from 'ProjectWebPartsStrings' | ||
import React, { FC, useContext } from 'react' | ||
import { Field, ProgressBar } from '@fluentui/react-components' | ||
|
||
export const ChangingPhaseView: FC = () => { | ||
const context = useContext(ProjectPhasesContext) | ||
return ( | ||
<ProgressIndicator | ||
<Field | ||
label={strings.PleaseWaitText} | ||
description={format(strings.ChangingPhaseDescription, context.state.confirmPhase.name)} | ||
/> | ||
hint={format(strings.ChangingPhaseDescription, context.state.confirmPhase.name)} | ||
validationState='none' | ||
> | ||
<ProgressBar /> | ||
</Field> | ||
) | ||
} |
18 changes: 10 additions & 8 deletions
18
.../src/components/ProjectPhases/ChangePhaseDialog/Views/InitialView/InitialView.module.scss
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,16 @@ | ||
@import '~@fluentui/react/dist/sass/References.scss'; | ||
@import "~@fluentui/react/dist/sass/References.scss"; | ||
|
||
.root { | ||
.header { | ||
@include ms-fontSize-14; | ||
} | ||
.commentField { | ||
margin: 10px 0 0 0; | ||
display: flex; | ||
flex-direction: column; | ||
gap: 12px; | ||
|
||
.tabList { | ||
display: flex; | ||
justify-content: space-between; | ||
|
||
textarea { | ||
height: 100px; | ||
.tabItem { | ||
cursor: default; | ||
} | ||
} | ||
} |
7 changes: 7 additions & 0 deletions
7
...ProjectPhases/ChangePhaseDialog/Views/InitialView/StatusActions/StatusActions.module.scss
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
.root { | ||
margin: 12px 0; | ||
|
||
.button { | ||
font-weight: var(--fontWeightRegular); | ||
} | ||
} |
22 changes: 22 additions & 0 deletions
22
.../src/components/ProjectPhases/ChangePhaseDialog/Views/InitialView/StatusActions/index.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
import React, { FC } from 'react' | ||
import { IStatusActionsProps } from './types' | ||
import styles from './StatusActions.module.scss' | ||
import { Button } from '@fluentui/react-components' | ||
|
||
export const StatusActions: FC<IStatusActionsProps> = ({ actions }) => { | ||
return ( | ||
<div className={styles.root}> | ||
{actions.map((action, index) => ( | ||
<Button | ||
className={styles.button} | ||
appearance='subtle' | ||
title={action.text} | ||
key={index} | ||
{...action} | ||
> | ||
{action.text} | ||
</Button> | ||
))} | ||
</div> | ||
) | ||
} |
3 changes: 3 additions & 0 deletions
3
...s/src/components/ProjectPhases/ChangePhaseDialog/Views/InitialView/StatusActions/types.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
export interface IStatusActionsProps { | ||
actions: any[] | ||
} |
9 changes: 0 additions & 9 deletions
9
...ProjectPhases/ChangePhaseDialog/Views/InitialView/StatusOptions/StatusOptions.module.scss
This file was deleted.
Oops, something went wrong.
16 changes: 0 additions & 16 deletions
16
.../src/components/ProjectPhases/ChangePhaseDialog/Views/InitialView/StatusOptions/index.tsx
This file was deleted.
Oops, something went wrong.
5 changes: 0 additions & 5 deletions
5
...s/src/components/ProjectPhases/ChangePhaseDialog/Views/InitialView/StatusOptions/types.ts
This file was deleted.
Oops, something went wrong.
42 changes: 26 additions & 16 deletions
42
...rojectWebParts/src/components/ProjectPhases/ChangePhaseDialog/Views/InitialView/index.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,29 +1,39 @@ | ||
import { TextField } from '@fluentui/react/lib/TextField' | ||
import * as strings from 'ProjectWebPartsStrings' | ||
import React, { FC } from 'react' | ||
import styles from './InitialView.module.scss' | ||
import { StatusOptions } from './StatusOptions' | ||
import { useInitialView } from './useInitialView' | ||
import { Field, Label, Tab, TabList, Textarea } from '@fluentui/react-components' | ||
import { StatusActions } from './StatusActions' | ||
import { format } from '@fluentui/react' | ||
|
||
export const InitialView: FC = () => { | ||
const { checklistItem, setComment, comment, actions } = useInitialView() | ||
const { checklistItem, checklistItems, setComment, comment, actions } = useInitialView() | ||
if (!checklistItem) return null | ||
|
||
return ( | ||
<div className={styles.root}> | ||
<div className={styles.header}> | ||
{checklistItem.id}. {checklistItem.title} | ||
</div> | ||
<TextField | ||
className={styles.commentField} | ||
onChange={(_, newValue: string) => setComment(newValue)} | ||
placeholder={strings.ChecklistCommentPlaceholder} | ||
description={strings.ChecklistCommentDescription} | ||
multiline | ||
value={comment} | ||
resizable={false} | ||
/> | ||
<StatusOptions actions={actions} /> | ||
<TabList className={styles.tabList} selectedValue={checklistItem.id}> | ||
{checklistItems.map((item) => ( | ||
<Tab | ||
className={styles.tabItem} | ||
key={item.id} | ||
title={format(strings.PhaseCheckListItem, item.id)} | ||
value={item.id} | ||
> | ||
{item.id} | ||
</Tab> | ||
))} | ||
</TabList> | ||
<Label weight='semibold'>{checklistItem.title}</Label> | ||
<Field hint={strings.ChecklistCommentDescription}> | ||
<Textarea | ||
rows={4} | ||
value={comment} | ||
placeholder={strings.ChecklistCommentPlaceholder} | ||
onChange={(_, data) => setComment(data.value)} | ||
/> | ||
</Field> | ||
<StatusActions actions={actions} /> | ||
</div> | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.