diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 0000000000..b417983545 --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,11 @@ +# To get started with Dependabot version updates, you'll need to specify which +# package ecosystems to update and where the package manifests are located. +# Please see the documentation for all configuration options: +# https://docs.github.com/code-security/dependabot/dependabot-version-updates/configuration-options-for-the-dependabot.yml-file + +version: 2 +updates: + - package-ecosystem: "npm" # See documentation for possible values + directory: "/" # Location of package manifests + schedule: + interval: "daily" diff --git a/e2e/server/requirements.txt b/e2e/server/requirements.txt index 8c8dd3c0f5..952073e4a5 100644 --- a/e2e/server/requirements.txt +++ b/e2e/server/requirements.txt @@ -120,7 +120,7 @@ honcho==1.1.0 # via -r requirements.in httplib2==0.22.0 # via oauth2client -idna==3.6 +idna==3.7 # via requests itsdangerous==1.1.0 # via diff --git a/package-lock.json b/package-lock.json index 7699f57b5b..08e15819b4 100644 --- a/package-lock.json +++ b/package-lock.json @@ -14811,9 +14811,9 @@ } }, "superdesk-ui-framework": { - "version": "3.0.79", - "resolved": "https://registry.npmjs.org/superdesk-ui-framework/-/superdesk-ui-framework-3.0.79.tgz", - "integrity": "sha512-3bz0/mTH9kTx4jXysGsKnLtiCK/6bt2R5+wfbZV+aE07VBbDCSEzKj9XC90F9ZXnakvic+G/PTfgCfp4AXCqyg==", + "version": "3.0.82", + "resolved": "https://registry.npmjs.org/superdesk-ui-framework/-/superdesk-ui-framework-3.0.82.tgz", + "integrity": "sha512-Ft24DCjzeuvfAiB6KK+DJ0GFON9udlME35HSvpXqK0ZQHvmbSAzLDUTNca6efsoNvukGIR+RhAEyWAKCgMOT2A==", "requires": { "@popperjs/core": "^2.4.0", "@superdesk/primereact": "^5.0.2-12", diff --git a/package.json b/package.json index 35fee1ee08..b124d4dfc4 100644 --- a/package.json +++ b/package.json @@ -122,7 +122,7 @@ "sass-loader": "6.0.6", "shortid": "2.2.8", "style-loader": "0.20.2", - "superdesk-ui-framework": "^3.0.79", + "superdesk-ui-framework": "^3.0.82", "ts-loader": "3.5.0", "typescript": "4.9.5", "uuid": "8.3.1", diff --git a/scripts/apps/workspace/content/components/ContentProfileFieldsConfig.tsx b/scripts/apps/workspace/content/components/ContentProfileFieldsConfig.tsx index 69ae1fd1ae..dbc86e2c79 100644 --- a/scripts/apps/workspace/content/components/ContentProfileFieldsConfig.tsx +++ b/scripts/apps/workspace/content/components/ContentProfileFieldsConfig.tsx @@ -23,6 +23,7 @@ import {WidgetsConfig} from './WidgetsConfig'; import {NewFieldSelect} from './new-field-select'; import {GenericArrayListPageComponent} from 'core/helpers/generic-array-list-page-component'; import {arrayMove} from '@superdesk/common'; +import {getTypeForFieldId} from 'apps/workspace/helpers/getTypeForFieldId'; // should be stored in schema rather than editor section of the content profile // but the fields should be editable via GUI @@ -509,14 +510,19 @@ export class ContentProfileFieldsConfig extends React.Component return this.state.editor[id]?.field_name ?? getLabelForFieldId(id, this.state.vocabularies); }; - const availableIds: Array<{id: string; label: string}> = this.state.allFieldIds + const availableIds: Array<{id: string; label: string; fieldType: string;}> = this.state.allFieldIds .filter((id) => { return ( this.isAllowedForSection(this.state.selectedSection, id) && !this.existsInFields(id) ); }) - .map((id) => ({id, label: getLabel(id)})); + .map((id) => ({ + id, + label: getLabel(id), + fieldType: getTypeForFieldId(id, this.state.vocabularies), + })) + .sort((x, y) => x.label.localeCompare(y.label)); const setIndexForNewItem = (index) => { this.setState({insertNewItemAtIndex: index}); diff --git a/scripts/apps/workspace/content/components/new-field-select.tsx b/scripts/apps/workspace/content/components/new-field-select.tsx index 92bf2db32d..85da9b8bcd 100644 --- a/scripts/apps/workspace/content/components/new-field-select.tsx +++ b/scripts/apps/workspace/content/components/new-field-select.tsx @@ -3,7 +3,7 @@ import {Button, Menu} from 'superdesk-ui-framework/react'; import {gettext} from 'core/utils'; interface IProps { - availableFields: Array<{id: string; label: string}>; + availableFields: Array<{id: string; label: string; fieldType?: string;}>; onSelect(value: string): void; } @@ -14,12 +14,18 @@ export class NewFieldSelect extends React.PureComponent { return (
({ - label: label, - onClick: () => { - this.props.onSelect(id); - }, - }))} + items={availableFields.map(({id, label, fieldType}) => { + const maybeLabelAndFieldType = (fieldType != null && fieldType !== '') + ? <>{label} ({fieldType}) + : label; + + return { + label: maybeLabelAndFieldType, + onClick: () => { + this.props.onSelect(id); + }, + }; + })} > {(toggle) => (