Skip to content

Commit

Permalink
Small improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
thecalcc committed Dec 12, 2024
1 parent ca97a80 commit 6f7325d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ import {IFieldDefinitions, IFieldDefinition} from './interfaces';
import {getTextFieldConfig} from './text-field-config';
import {getPlaceField} from './place-field';

export type IFieldGetter = () => IFieldDefinition;

export function getFieldDefinitions(): IFieldDefinitions {
const {gettext} = superdeskApi.localization;
const result: Array<IFieldDefinition> = [
Expand Down Expand Up @@ -63,7 +65,7 @@ export function getFieldDefinitions(): IFieldDefinitions {
return field;
},
},
getPlaceField(gettext),
getPlaceField(),
{
fieldId: 'coverages',
getField: ({id, required}) => {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import {IDropdownConfigVocabulary, IAuthoringFieldV2, IVocabularyItem} from 'superdesk-api';
import {superdeskApi} from '../../../superdeskApi';
import {IFieldGetter} from '.';

export const getPlaceField = (gettext: (val: string) => string) => ({
export const getPlaceField: IFieldGetter = () => ({
fieldId: 'place',
getField: ({id, required}) => {
const fieldConfig: IDropdownConfigVocabulary = {
Expand All @@ -13,7 +14,7 @@ export const getPlaceField = (gettext: (val: string) => string) => ({

const field: IAuthoringFieldV2 = {
id: id,
name: gettext('Place'),
name: superdeskApi.localization.gettext('Place'),
fieldType: 'dropdown',
fieldConfig: fieldConfig,
};
Expand Down

0 comments on commit 6f7325d

Please sign in to comment.