Skip to content

Commit

Permalink
Fix issues with missing data i 'Økonomi' statussection #1419 #1380
Browse files Browse the repository at this point in the history
  • Loading branch information
Remi749 committed Jan 19, 2024
1 parent b98487e commit 3f052de
Show file tree
Hide file tree
Showing 7 changed files with 20 additions and 45 deletions.
Original file line number Diff line number Diff line change
@@ -1,17 +1,9 @@
@import '~@fluentui/react/dist/sass/References.scss';

.root {

.projectPropertiesSection {
.fields {
margin: 25px 0 0 0;
display: -webkit-box;
display: -ms-flexbox;
display: flex;
-ms-flex-wrap: wrap;
flex-direction: row;
flex-wrap: wrap;
-ms-flex-pack: distribute;
justify-content: flex-start;
align-content: flex-start;
align-items: flex-start;
gap: 24px;
margin-top: 12px;
}
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { stringIsNullOrEmpty } from '@pnp/core'
import React, { FC, useContext } from 'react'
import { useProjectStatusContext } from '../../../ProjectStatus/context'
import { StatusElement } from '../../StatusElement'
import { BaseSection } from '../BaseSection/BaseSection'
import { SectionContext } from '../context'
Expand All @@ -9,7 +8,6 @@ import { StatusSectionField } from './StatusSectionField/StatusSectionField'
import { useProjectPropertiesSection } from './useProjectPropertiesSection'

export const ProjectPropertiesSection: FC = () => {
const context = useProjectStatusContext()
const { section } = useContext(SectionContext)
const { fieldValues, fields } = useProjectPropertiesSection()

Expand All @@ -28,7 +26,6 @@ export const ProjectPropertiesSection: FC = () => {
key={fieldName}
label={field.Title}
value={fieldValues[fieldName]}
width={context.props.fieldWidth}
/>
)
}
Expand All @@ -40,7 +37,7 @@ export const ProjectPropertiesSection: FC = () => {

return (
<BaseSection>
<div className={styles.root}>
<div className={styles.projectPropertiesSection}>
<StatusElement />
<div className={styles.fields}>{renderFields()}</div>
</div>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,11 @@
.root {
padding: 0 18px 18px 0;
box-sizing: border-box;
.container {
.fieldLabel {
font-size: 14px;
font-weight: 600;
}
.fieldValue {
margin: 10px 0 0 0;
font-size: 17px;
font-weight: 300;
}
.statusSectionField {
.label {
font-size: var(--fontWeightRegular);
font-weight: 600;
}
.value {
margin-top: 8px;
font-size: var(--fontWeightRegular);
font-weight: 300;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,11 @@ import styles from './StatusSectionField.module.scss'

export const StatusSectionField: FC<IStatusSectionFieldProps> = (props) => {
return (
<div className={styles.root} style={{ width: props.width || 250 }}>
<div className={styles.container}>
<div className={styles.fieldLabel}>{props.label}</div>
<div className={styles.fieldValue}>{props.value}</div>
</div>
<div className={styles.statusSectionField}>
<div className={styles.label}>{props.label}</div>
<div className={styles.value}>{props.value}</div>
</div>
)
}

StatusSectionField.displayName = 'StatusSectionField'
StatusSectionField.defaultProps = {
width: 250
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,4 @@ export interface IStatusSectionFieldProps {
* Value for the field
*/
value: string

/**
* Width for the component
*/
width: number
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ export function useProjectPropertiesSection() {
const context = useProjectStatusContext()
return {
fieldValues: {
...context.state.data.properties.fieldValues,
...context.state.selectedReport.fieldValues
...context.state.data.properties.fieldValues['_fieldValuesAsText'],
...context.state.selectedReport?.fieldValues['_fieldValuesAsText']
},
fields: [...context.state.data.properties.fields, ...context.state.data.reportFields]
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
.value {
font-size: 18px;
font-weight: 600;
margin-bottom: 5px;
margin-bottom: 4px;
}
}
}
Expand Down

0 comments on commit 3f052de

Please sign in to comment.