Skip to content

Commit

Permalink
clarify functionality on unimplemented fields
Browse files Browse the repository at this point in the history
  • Loading branch information
tomaskikutis committed Dec 17, 2024
1 parent eb6b394 commit e83c6c7
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions client/components/planning-editor-standalone/profile-fields.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,20 +14,22 @@ interface ICustomVocabularyField extends IBaseField<'custom_vocabulary'> {
type IFieldConverted = IBaseField<'normal'> | ICustomVocabularyField;

/**
* Fields that don't have a planning profile schema
* Fields that might exist in the planning profile (database)
* but aren't mapped to work in a standalone editor.
*/
const FIELDS_TO_FILTER = [
const unimplementedFields = new Set<string>([
'associated_event',
];
]);

/**
* A function that handles planning profile field types so they can be used in authoring react.
*/
export const getPlanningProfileFields = (): Array<IFieldConverted> => {
const planningProfile = planningApi.contentProfiles.get('planning');
const planningGroups = getEditorFormGroupsFromProfile(planningProfile);
const planningFieldIds = Object.values(planningGroups).flatMap((x) => x.fields)
.filter((x) => !FIELDS_TO_FILTER.includes(x));
const planningFieldIds = Object.values(planningGroups)
.flatMap((x) => x.fields)
.filter((x) => !unimplementedFields.has(x));
const convertedFieldIds: Array<IFieldConverted> = [];

for (const fieldId of planningFieldIds) {
Expand Down

0 comments on commit e83c6c7

Please sign in to comment.