diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index a891f69..d5b4d43 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -13,7 +13,7 @@ jobs: strategy: matrix: - node-version: [18.x] + node-version: [18] steps: - name: Checkout diff --git a/docker/builder/start.sh b/docker/builder/start.sh index 5be5fb2..12482a8 100755 --- a/docker/builder/start.sh +++ b/docker/builder/start.sh @@ -40,10 +40,10 @@ docker compose -f docker/builder/docker-compose.yml up -d # # installing utility tool to auth -npm install -g npm-cli-adduser +npm install -g npm-cli-login # authenticating -npm-cli-adduser \ +npm-cli-login \ -u $VERDACCIO_USERNAME \ -p $VERDACCIO_PASSWORD \ -e $VERDACCIO_EMAIL \ diff --git a/src/lib/components/form/base/fields/RecordTypeField.js b/src/lib/components/form/base/fields/RecordTypeField.js new file mode 100644 index 0000000..73cdd93 --- /dev/null +++ b/src/lib/components/form/base/fields/RecordTypeField.js @@ -0,0 +1,68 @@ +/* + * This file is part of GEO-Components-React. + * Copyright (C) 2022 GEO Secretariat. + * + * GEO-Components-React is free software; you can redistribute it and/or modify it + * under the terms of the MIT License; see LICENSE file for more details. + */ + +import React from 'react'; + +import PropTypes from 'prop-types'; +import { SelectField } from 'react-invenio-forms'; + +import { i18next } from '@translations/i18next'; +import { Icon } from 'semantic-ui-react'; + +/** + * Record Type field for the GEO Knowledge Hub. + * @constructor + * + * @param {String} fieldPath Path where the field data will be stored in the + * Formik context. + * @param {Object} fieldProps (Spread) Extra parameters for the `SelectField`. + */ +export const RecordTypeField = ({ fieldPath, ...fieldProps }) => { + return ( + + ); +}; + +RecordTypeField.propTypes = { + fieldPath: PropTypes.string.isRequired, +}; + +RecordTypeField.defaultProps = { + fieldPath: 'metadata.record_type', + label: ( + <> + {i18next.t('Record type')} + + ), + placeholder: i18next.t('Select a Record Type'), + noQueryMessage: i18next.t('Start typing to search for a Record Type'), + multiple: true, +}; diff --git a/src/lib/components/form/base/fields/index.js b/src/lib/components/form/base/fields/index.js index 23035ae..d2ef42a 100644 --- a/src/lib/components/form/base/fields/index.js +++ b/src/lib/components/form/base/fields/index.js @@ -14,5 +14,7 @@ export { TargetAudienceField } from './TargetAudienceField'; export { EngagementPriorityField } from './EngagementPriorityField'; export { WorkProgrammeActivityField } from './WorkProgrammeActivityField'; +export { RecordTypeField } from './RecordTypeField'; export { ResourceTypeField } from './ResourceTypeField'; + export { AuthorsField } from './AuthorsField'; diff --git a/src/lib/components/form/moldure/search/FilterBuilder/panes/BasicFilterFormPane/BasicFilterForm.js b/src/lib/components/form/moldure/search/FilterBuilder/panes/BasicFilterFormPane/BasicFilterForm.js index 0f6375a..b79936b 100644 --- a/src/lib/components/form/moldure/search/FilterBuilder/panes/BasicFilterFormPane/BasicFilterForm.js +++ b/src/lib/components/form/moldure/search/FilterBuilder/panes/BasicFilterFormPane/BasicFilterForm.js @@ -17,6 +17,7 @@ import { TargetAudienceField, WorkProgrammeActivityField, ResourceTypeField, + RecordTypeField, AuthorsField, } from '../../../../../base'; @@ -42,6 +43,17 @@ export const BasicFilterForm = ({ fieldPathPrefix, ...fieldConfig }) => { return ( <> + + + + + obj.value) + .map((obj) => obj.value || obj) .join(` ${this.operator} `); }