Skip to content

Commit

Permalink
Small fix
Browse files Browse the repository at this point in the history
  • Loading branch information
thecalcc committed Dec 12, 2024
1 parent 086d67f commit 37f7717
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ export const getCustomVocabularyFields = () => {
storageAdapter: {
storeValue: (item, operationalValue: IVocabularyItem['qcode']) => {
const vocabulary = allVocabularies.get(id);
const vocabItems = vocabulary.items.filter((x) => operationalValue.includes(x.qcode)) ?? [];
const vocabItems = vocabulary.items.filter((x) => operationalValue.includes(x.qcode));

// Subfield values
const itemsToSubject: Array<ISubject> = vocabItems.map((x) => ({
Expand Down
5 changes: 2 additions & 3 deletions client/components/planning-editor-standalone/profile.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ import {
} from '../../planning-extension/src/authoring-react-fields/planning-attachments/interfaces';
import {getCustomVocabularyFields} from './field-adapters/custom-vocabularies';
import {getPlanningProfileFields} from './profile-fields';
import {IEventOrPlanningItem} from 'interfaces';

function getTextFieldConfig(options: {id: string; label: string, required: boolean}): IAuthoringFieldV2 {
const editor3ConfigWithoutFormatting: IEditor3Config = {
Expand Down Expand Up @@ -64,9 +63,9 @@ export interface IFieldDefinition {
fieldId: string;
getField: (options: {required: boolean, id: string}) => IAuthoringFieldV2;
storageAdapter?: {
storeValue: <T extends IEventOrPlanningItem>(item: T, operationalValue: unknown) => T; // returns stored value
storeValue: <T extends IPlanningItem>(item: T, operationalValue: unknown) => T; // returns stored value
retrieveStoredValue:
<T extends IEventOrPlanningItem>(item: T, fieldId: string) => unknown; // returns operational value
<T extends IPlanningItem>(item: T, fieldId: string) => unknown; // returns operational value
};
}

Expand Down

0 comments on commit 37f7717

Please sign in to comment.