Skip to content

Commit

Permalink
fix: should be possible to not select accessRight
Browse files Browse the repository at this point in the history
  • Loading branch information
hegeaal committed Jan 22, 2025
1 parent b91d56c commit 0b00714
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,10 @@ import { AccessRightsUriTable } from './access-rights-uri-table';
import styles from '../../dataset-form.module.css';

const accessRightsOptions = [
{ value: AccessRights.PUBLIC, label: localization.datasetForm.accessRight.public },
{ value: AccessRights.RESTRICTED, label: localization.datasetForm.accessRight.restricted },
{ value: AccessRights.NON_PUBLIC, label: localization.datasetForm.accessRight.nonPublic },
{ value: '', label: localization.accessRight.none },
{ value: AccessRights.PUBLIC, label: localization.accessRight.public },
{ value: AccessRights.RESTRICTED, label: localization.accessRight.restricted },
{ value: AccessRights.NON_PUBLIC, label: localization.accessRight.nonPublic },
];

export const AccessRightFields = () => {
Expand All @@ -34,7 +35,7 @@ export const AccessRightFields = () => {
<Combobox
id='accessRights.uri-combobox'
size='sm'
value={[values.accessRights?.uri || AccessRights.PUBLIC]}
value={[values?.accessRights?.uri || '']}
onValueChange={(values) => setFieldValue('accessRights.uri', values.toString())}
virtual
>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,6 @@ export const datasetToBeCreatedTemplate = (): DatasetToBeCreated => {
losTheme: [],
type: undefined,
keywordList: { nb: [] },
keyword: [{ nb: '' }],
conceptList: [],
provenance: undefined,
accrualPeriodicity: undefined,
Expand Down
5 changes: 0 additions & 5 deletions libs/utils/src/lib/language/dataset.form.nb.ts
Original file line number Diff line number Diff line change
Expand Up @@ -80,11 +80,6 @@ export const datasetFormNb = {
informationModel: 'Informasjonsmodell',
contactPoint: 'Kontaktpunkt',
},
accessRight: {
public: 'Allmenn tilgang',
restricted: 'Betinget tilgang',
nonPublic: 'Ikke-allmenn tilgang',
},
fieldLabel: {
losTheme: 'LOS-tema(er)',
euDataTheme: 'Hovedtema(er)',
Expand Down
7 changes: 7 additions & 0 deletions libs/utils/src/lib/language/nb.ts
Original file line number Diff line number Diff line change
Expand Up @@ -496,4 +496,11 @@ export const nb = {
icon: {
trash: 'Søppelikon',
},

accessRight: {
public: 'Allmenn tilgang',
restricted: 'Betinget tilgang',
nonPublic: 'Ikke-allmenn tilgang',
none: 'Ingen tilgangsrettighet valgt',
},
};

0 comments on commit 0b00714

Please sign in to comment.