-
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.
Redesign av Programadministrasjon (#1294)
- Loading branch information
Showing
62 changed files
with
385 additions
and
489 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
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
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
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
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
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
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
18 changes: 7 additions & 11 deletions
18
...bParts/src/components/ProgramAdministration/AddProjectDialog/AddProjectDialog.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,24 +1,20 @@ | ||
@import '~@fluentui/react/dist/sass/References.scss'; | ||
|
||
.root { | ||
.addProjectDialog { | ||
width: 950px; | ||
max-width: 950px; | ||
box-sizing: border-box; | ||
position: relative; | ||
|
||
.dialogContent { | ||
height: 650px; | ||
.content { | ||
height: 550px; | ||
margin: 20px 0 0 0; | ||
box-sizing: border-box; | ||
|
||
.searchBox { | ||
width: 625px; | ||
margin: 10px 0 0 0; | ||
box-sizing: border-box; | ||
} | ||
overflow-y: auto; | ||
overflow-x: hidden; | ||
} | ||
|
||
div[class*="ms-List-cell"] { | ||
min-height: 0px; | ||
.actions { | ||
padding: 20px 0 0 0; | ||
} | ||
} |
100 changes: 44 additions & 56 deletions
100
...rogramWebParts/src/components/ProgramAdministration/AddProjectDialog/AddProjectDialog.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,76 +1,64 @@ | ||
import { | ||
DefaultButton, | ||
Button, | ||
Dialog, | ||
DialogFooter, | ||
DialogType, | ||
PrimaryButton, | ||
SelectionMode, | ||
ShimmeredDetailsList, | ||
ScrollablePane | ||
} from '@fluentui/react' | ||
import _ from 'lodash' | ||
DialogActions, | ||
DialogContent, | ||
DialogSurface, | ||
DialogTitle | ||
} from '@fluentui/react-components' | ||
import * as strings from 'ProgramWebPartsStrings' | ||
import _ from 'lodash' | ||
import React, { FC, useContext } from 'react' | ||
import { columns } from '../columns' | ||
import { ProjectList } from '../ProjectList' | ||
import { ProgramAdministrationContext } from '../context' | ||
import { ListHeaderSearch } from '../ListHeaderSearch/ListHeaderSearch' | ||
import { ADD_CHILD_PROJECTS, TOGGLE_ADD_PROJECT_DIALOG } from '../reducer' | ||
import { SET_SELECTED_TO_ADD, TOGGLE_ADD_PROJECT_DIALOG } from '../reducer' | ||
import styles from './AddProjectDialog.module.scss' | ||
import { useAddProjectDialog } from './useAddProjectDialog' | ||
|
||
export const AddProjectDialog: FC = () => { | ||
const context = useContext(ProgramAdministrationContext) | ||
const { selection, availableProjects, onSearch, onRenderRow } = useAddProjectDialog() | ||
const { availableProjects, onAddChildProjects } = useAddProjectDialog() | ||
|
||
return ( | ||
<Dialog | ||
hidden={false} | ||
modalProps={{ containerClassName: styles.root }} | ||
onDismiss={() => context.dispatch(TOGGLE_ADD_PROJECT_DIALOG())} | ||
dialogContentProps={{ | ||
type: DialogType.largeHeader, | ||
title: strings.ProgramAdministrationAddChildsButtonText | ||
open={context.state.addProjectDialog?.open} | ||
onOpenChange={(_, data) => { | ||
if (!data.open) { | ||
context.dispatch(TOGGLE_ADD_PROJECT_DIALOG()) | ||
} | ||
}} | ||
> | ||
<div className={styles.dialogContent}> | ||
<ScrollablePane> | ||
<ShimmeredDetailsList | ||
setKey='AddProjectDialog' | ||
<DialogSurface className={styles.addProjectDialog}> | ||
<DialogTitle> | ||
<h2>{strings.ProgramAdministrationAddChildsButtonText}</h2> | ||
</DialogTitle> | ||
<DialogContent className={styles.content}> | ||
<ProjectList | ||
items={availableProjects} | ||
columns={columns({ renderAsLink: false })} | ||
selectionMode={SelectionMode.multiple} | ||
selection={selection} | ||
enableShimmer={context.state.loading.AddProjectDialog} | ||
selectionPreservedOnEmptyClick={true} | ||
onRenderRow={onRenderRow} | ||
onRenderDetailsHeader={(detailsHeaderProps, defaultRender) => ( | ||
<ListHeaderSearch | ||
selectedItems={context.state.selectedProjectsToAdd} | ||
detailsHeaderProps={detailsHeaderProps} | ||
defaultRender={defaultRender} | ||
search={{ | ||
placeholder: strings.AddProjectDialogSearchBoxPlaceholder, | ||
onSearch | ||
}} | ||
/> | ||
)} | ||
onSelectionChange={(_, data) => { | ||
context.dispatch(SET_SELECTED_TO_ADD(Array.from(data.selectedItems))) | ||
}} | ||
search={{ | ||
placeholder: strings.AddProjectDialogSearchBoxPlaceholder | ||
}} | ||
/> | ||
</ScrollablePane> | ||
</div> | ||
<DialogFooter> | ||
<PrimaryButton | ||
text={strings.Add} | ||
disabled={_.isEmpty(context.state.selectedProjectsToAdd)} | ||
onClick={async () => { | ||
await context.props.dataAdapter.addChildProjects(context.state.selectedProjectsToAdd) | ||
context.dispatch(ADD_CHILD_PROJECTS()) | ||
}} | ||
/> | ||
<DefaultButton | ||
text={strings.Cancel} | ||
onClick={() => context.dispatch(TOGGLE_ADD_PROJECT_DIALOG())} | ||
/> | ||
</DialogFooter> | ||
</DialogContent> | ||
<DialogActions className={styles.actions}> | ||
<Button | ||
appearance='primary' | ||
disabled={_.isEmpty(context.state.addProjectDialog?.selectedProjects)} | ||
onClick={onAddChildProjects} | ||
> | ||
{strings.Add} | ||
</Button> | ||
<Button | ||
appearance='secondary' | ||
onClick={() => context.dispatch(TOGGLE_ADD_PROJECT_DIALOG())} | ||
> | ||
{strings.Cancel} | ||
</Button> | ||
</DialogActions> | ||
</DialogSurface> | ||
</Dialog> | ||
) | ||
} |
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: 3 additions & 0 deletions
3
...mework/ProgramWebParts/src/components/ProgramAdministration/Commands/Commands.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,3 @@ | ||
.commands { | ||
margin: 20px; | ||
} |
Oops, something went wrong.