Skip to content

Commit

Permalink
Fiks for #1478 (#1494)
Browse files Browse the repository at this point in the history
  • Loading branch information
olemp authored Apr 5, 2024
1 parent df6690f commit d597b3e
Show file tree
Hide file tree
Showing 4 changed files with 1,348 additions and 32 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -25,3 +25,4 @@ common/temp
**/package-lock.json
.vscode/launch.json*
SharePointFramework/**/.vscode/chrome-debug-user-data
SharePointFramework/ProjectExtensions/.gitmoji.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ import { FieldContainer } from 'pp365-shared-library'
import React, { FC, useEffect, useState } from 'react'
import { useRiskActionFieldCustomizerContext } from '../../../../../riskAction/context'
import { IResponsibleFieldProps } from './types'
import { format } from '@fluentui/react'
import { stringIsNullOrEmpty } from '@pnp/core'

export const ResponsibleField: FC<IResponsibleFieldProps> = (props) => {
const context = useRiskActionFieldCustomizerContext()
Expand All @@ -19,6 +21,8 @@ export const ResponsibleField: FC<IResponsibleFieldProps> = (props) => {
return (
<FieldContainer label={strings.ResponsibleFieldLabel} iconName='Person'>
<Combobox
freeform
value={value}
onOptionSelect={(_e, data) => {
props.onChange(data.optionValue)
}}
Expand All @@ -38,11 +42,11 @@ export const ResponsibleField: FC<IResponsibleFieldProps> = (props) => {
/>
</Option>
))}
{matchingUsers.length === 0 ? (
<Option key='no-results' text=''>
{strings.ResponsibleFieldNoResults}
{(!stringIsNullOrEmpty(value) && matchingUsers.length === 0) && (
<Option key='ResponsibleFieldNoResults' text=''>
{format(strings.ResponsibleFieldNoResults, value)}
</Option>
) : null}
)}
</Combobox>
</FieldContainer>
)
Expand Down
2 changes: 1 addition & 1 deletion SharePointFramework/ProjectExtensions/src/loc/nb-no.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ define([], function () {
DueDateLabel: 'Forfallsdato',
NewRiskActionPanelTitle: 'Legg til nytt tiltak for {0}',
NewRiskActionPanelAddNewRiskAction: 'Legg til nytt tiltak',
ResponsibleFieldNoResults: 'Fant ingen brukere',
ResponsibleFieldNoResults: 'Fant ingen brukere som matcher søket \'{0}\'.',
ResponsibleFieldLabel: 'Ansvarlig',
ApplyExtensionHooks: 'Kjører hooks definert i prosjekttillegg',
ApplyExtensionText: 'Legger på prosjekttilegg {0}',
Expand Down
Loading

0 comments on commit d597b3e

Please sign in to comment.