From 1ab29e47aa2b5944bf110b725b832b1d7d1601e1 Mon Sep 17 00:00:00 2001 From: dleadbetter <> Date: Fri, 10 May 2024 13:35:28 -0400 Subject: [PATCH 01/22] CDC #157 - Updating DataList and DataTableColumnSelector components to append to session storage --- .../semantic-ui/src/components/DataList.js | 60 +++++-------------- .../src/components/DataTableColumnSelector.js | 52 ++++++++++++++-- .../semantic-ui/src/components/ListTable.js | 12 ++-- packages/semantic-ui/src/utils/ListSession.js | 41 +++++++++++++ 4 files changed, 112 insertions(+), 53 deletions(-) create mode 100644 packages/semantic-ui/src/utils/ListSession.js diff --git a/packages/semantic-ui/src/components/DataList.js b/packages/semantic-ui/src/components/DataList.js index 96cc84d3..4df28def 100644 --- a/packages/semantic-ui/src/components/DataList.js +++ b/packages/semantic-ui/src/components/DataList.js @@ -6,6 +6,7 @@ import uuid from 'react-uuid'; import _ from 'underscore'; import { Icon, Input, Message } from 'semantic-ui-react'; import i18n from '../i18n/i18n'; +import ListSessionUtils from '../utils/ListSession'; import Toaster from './Toaster'; type Props = { @@ -131,9 +132,6 @@ type State = { sortDirection: ?string }; -const SESSION_KEY = 'DataList'; -const SESSION_DEFAULT = '{}'; - const SORT_ASCENDING = 'ascending'; const SORT_DESCENDING = 'descending'; @@ -285,19 +283,6 @@ const useDataList = (WrappedComponent: ComponentType) => ( return { filters }; } - /** - * Returns the session storage key for the current list. - * - * @returns {string|null} - */ - getSessionKey() { - if (!this.props.session) { - return null; - } - - return `${SESSION_KEY}.${this.props.session.key}`; - } - /** * Initializes the state based on the passed props. * @@ -307,7 +292,8 @@ const useDataList = (WrappedComponent: ComponentType) => ( * saved: boolean, count: number, filters: (*|{}), page: number, error: null, loading: boolean, items: *[]}} */ initializeState(props: Props) { - const session = this.restoreSession(); + const { key, storage } = props.session || {}; + const session = ListSessionUtils.restoreSession(key, storage) || {}; const filters = session.filters || this.getDefaultFilters(props); const page = session.page || 1; @@ -445,6 +431,14 @@ const useDataList = (WrappedComponent: ComponentType) => ( }); } + /** + * When no columns are sortable, load data as is + * + */ + onInit(page?: number = 1) { + this.setState({ sortColumn: '', sortDirection: '', page }, this.fetchData.bind(this)); + } + /** * Sets the new active page and reloads the data. * @@ -516,14 +510,6 @@ const useDataList = (WrappedComponent: ComponentType) => ( this.setState({ sortColumn, sortDirection, page }, this.fetchData.bind(this)); } - /** - * When no columns are sortable, load data as is - * - */ - onInit(page?: number = 1) { - this.setState({ sortColumn: '', sortDirection: '', page }, this.fetchData.bind(this)); - } - /** * Renders the DataList component. * @@ -565,7 +551,7 @@ const useDataList = (WrappedComponent: ComponentType) => ( sortColumn={this.state.sortColumn} sortDirection={this.state.sortDirection} /> - {this.state.saved && ( + { this.state.saved && ( this.setState({ saved: false })} type={Toaster.MessageTypes.positive} @@ -578,7 +564,7 @@ const useDataList = (WrappedComponent: ComponentType) => ( /> )} - {this.state.error && ( + { this.state.error && ( this.setState({ error: false })} timeout={0} @@ -633,25 +619,11 @@ const useDataList = (WrappedComponent: ComponentType) => ( ); } - /** - * Restores the DataList session object. - */ - restoreSession() { - const key = this.getSessionKey(); - - if (!key) { - return {}; - } - - const session = sessionStorage.getItem(key) || SESSION_DEFAULT; - return JSON.parse(session); - } - /** * Sets the DataList session object. */ setSession() { - const key = this.getSessionKey(); + const { key, storage } = this.props.session || {}; if (!key) { return; @@ -666,14 +638,14 @@ const useDataList = (WrappedComponent: ComponentType) => ( sortDirection } = this.state; - sessionStorage.setItem(key, JSON.stringify({ + ListSessionUtils.setSession(key, storage, { filters, page, perPage, search, sortColumn, sortDirection - })); + }); } } ); diff --git a/packages/semantic-ui/src/components/DataTableColumnSelector.js b/packages/semantic-ui/src/components/DataTableColumnSelector.js index 38c3a0a1..d1637ace 100644 --- a/packages/semantic-ui/src/components/DataTableColumnSelector.js +++ b/packages/semantic-ui/src/components/DataTableColumnSelector.js @@ -5,6 +5,7 @@ import React, { Component, type ComponentType, type Element } from 'react'; import { Checkbox, Dropdown, Icon } from 'semantic-ui-react'; import _ from 'underscore'; import Draggable from './Draggable'; +import ListSessionUtils from '../utils/ListSession'; import type { Props as ListProps } from './List'; import './DataTableColumnSelector.css'; @@ -75,9 +76,7 @@ const useColumnSelector = (WrappedComponent: ComponentType) => ( constructor(props: Props) { super(props); - this.state = { - columns: props.columns - }; + this.state = this.initializeState(props); } /** @@ -85,10 +84,41 @@ const useColumnSelector = (WrappedComponent: ComponentType) => ( * * @param prevProps */ - componentDidUpdate(prevProps: Props): * { + componentDidUpdate(prevProps: Props, prevState: State): * { if (!ObjectUtils.isEqual(prevProps.columns, this.props.columns)) { this.setState({ columns: this.props.columns }); } + + if (!ObjectUtils.isEqual(prevState.columns, this.state.columns)) { + this.setSession(); + } + } + + /** + * Sets the initial state from the session, if provided. + * + * @param props + * + * @returns {{columns}|{columns: *}} + */ + initializeState(props) { + const { key, storage } = props.session || {}; + const session = ListSessionUtils.restoreSession(key, storage) || {}; + + if (_.isEmpty(session.columns)) { + return { + columns: props.columns + }; + } + + const columns = _.map(session.columns, (column) => ({ + ...(_.findWhere(props.columns, { name: column.name }) || {}), + ...column + })); + + return { + columns + }; } /** @@ -203,6 +233,20 @@ const useColumnSelector = (WrappedComponent: ComponentType) => ( ); } + + /** + * Sets the list columns on the session. + */ + setSession() { + const { key, storage } = this.props.session; + + if (!key) { + return; + } + + const columns = _.map(this.state.columns, (column) => _.pick(column, 'name', 'hidden')); + ListSessionUtils.setSession(key, storage, { columns }); + } } ); diff --git a/packages/semantic-ui/src/components/ListTable.js b/packages/semantic-ui/src/components/ListTable.js index 72334a68..dcd68deb 100644 --- a/packages/semantic-ui/src/components/ListTable.js +++ b/packages/semantic-ui/src/components/ListTable.js @@ -4,6 +4,7 @@ import { Hooks, ObjectJs as ObjectUtils } from '@performant-software/shared-comp import React, { useEffect } from 'react'; import _ from 'underscore'; import DataTable from './DataTable'; +import ListSessionUtils from '../utils/ListSession'; import type { Props as DataTableProps } from './DataTable'; import useDataList, { SORT_ASCENDING, SORT_DESCENDING, type Props as DataListProps } from './DataList'; import './ListTable.css'; @@ -88,11 +89,12 @@ const ListTable = useDataList((props: Props) => { */ useEffect(() => { if (!ObjectUtils.isEqual(props.columns, prevColumns)) { - const { - page, - defaultSort, - defaultSortDirection = SORT_ASCENDING - } = props; + const { key, storage } = props.session || {}; + const session = ListSessionUtils.restoreSession(key, storage); + + const defaultSort = session.sortColumn || props.defaultSort; + const defaultSortDirection = session.sortDirection || props.defaultSortDirection || SORT_ASCENDING; + const { page } = props; if (defaultSort) { props.onSort(defaultSort, defaultSortDirection, page); diff --git a/packages/semantic-ui/src/utils/ListSession.js b/packages/semantic-ui/src/utils/ListSession.js new file mode 100644 index 00000000..c5b88ada --- /dev/null +++ b/packages/semantic-ui/src/utils/ListSession.js @@ -0,0 +1,41 @@ +// @flow + +const SESSION_DEFAULT = '{}'; + +/** + * Restores the list session from the passed storage object. + * + * @param key + * @param storage + * + * @returns {{}|any} + */ +const restoreSession = (key, storage) => { + if (!(key && storage)) { + return {}; + } + + const session = storage.getItem(key) || SESSION_DEFAULT; + return JSON.parse(session); +}; + +/** + * Sets the passed list session on the passed storage object. + * + * @param key + * @param storage + * @param session + */ +const setSession = (key, storage, session) => { + if (!(key && storage)) { + return; + } + + const currentSession = restoreSession(key, storage); + storage.setItem(key, JSON.stringify({ ...currentSession, ...session })); +}; + +export default { + restoreSession, + setSession +}; From 7d3565b65b1be82708a1ef7c6bd389fb13cc2bd1 Mon Sep 17 00:00:00 2001 From: dleadbetter <> Date: Mon, 13 May 2024 07:14:58 -0400 Subject: [PATCH 02/22] CDC #157 - Publishing v2.2.2-beta.0 --- packages/controlled-vocabulary/package.json | 6 +++--- packages/core-data/package.json | 6 +++--- packages/geospatial/package.json | 2 +- packages/semantic-ui/package.json | 4 ++-- packages/shared/package.json | 2 +- packages/user-defined-fields/package.json | 6 +++--- packages/visualize/package.json | 2 +- react-components.json | 2 +- 8 files changed, 15 insertions(+), 15 deletions(-) diff --git a/packages/controlled-vocabulary/package.json b/packages/controlled-vocabulary/package.json index acdece81..00098f9b 100644 --- a/packages/controlled-vocabulary/package.json +++ b/packages/controlled-vocabulary/package.json @@ -1,6 +1,6 @@ { "name": "@performant-software/controlled-vocabulary", - "version": "2.2.1", + "version": "2.2.2-beta.0", "description": "A package of components to allow user to configure dropdown elements. Use with the \"controlled_vocabulary\" gem.", "license": "MIT", "main": "./dist/index.cjs.js", @@ -23,8 +23,8 @@ "underscore": "^1.13.2" }, "peerDependencies": { - "@performant-software/semantic-components": "^2.2.1", - "@performant-software/shared-components": "^2.2.1", + "@performant-software/semantic-components": "^2.2.2-beta.0", + "@performant-software/shared-components": "^2.2.2-beta.0", "react": ">= 16.13.1 < 19.0.0", "react-dom": ">= 16.13.1 < 19.0.0" }, diff --git a/packages/core-data/package.json b/packages/core-data/package.json index 9346d330..c209d5f9 100644 --- a/packages/core-data/package.json +++ b/packages/core-data/package.json @@ -1,6 +1,6 @@ { "name": "@performant-software/core-data", - "version": "2.2.1", + "version": "2.2.2-beta.0", "description": "A package of components used with the Core Data platform.", "license": "MIT", "main": "./dist/index.cjs.js", @@ -37,8 +37,8 @@ "underscore": "^1.13.2" }, "peerDependencies": { - "@performant-software/shared-components": "^2.2.1", - "@performant-software/geospatial": "^2.2.1", + "@performant-software/shared-components": "^2.2.2-beta.0", + "@performant-software/geospatial": "^2.2.2-beta.0", "@peripleo/maplibre": "^0.5.2", "@peripleo/peripleo": "^0.5.2", "react": ">= 16.13.1 < 19.0.0", diff --git a/packages/geospatial/package.json b/packages/geospatial/package.json index c083f3b6..13f15194 100644 --- a/packages/geospatial/package.json +++ b/packages/geospatial/package.json @@ -1,6 +1,6 @@ { "name": "@performant-software/geospatial", - "version": "2.2.1", + "version": "2.2.2-beta.0", "description": "A package of components for all things map-related.", "license": "MIT", "main": "./dist/index.cjs.js", diff --git a/packages/semantic-ui/package.json b/packages/semantic-ui/package.json index a3bf4794..04034f8e 100644 --- a/packages/semantic-ui/package.json +++ b/packages/semantic-ui/package.json @@ -1,6 +1,6 @@ { "name": "@performant-software/semantic-components", - "version": "2.2.1", + "version": "2.2.2-beta.0", "description": "A package of shared components based on the Semantic UI Framework.", "license": "MIT", "main": "./dist/index.cjs.js", @@ -35,7 +35,7 @@ "zotero-translation-client": "^5.0.1" }, "peerDependencies": { - "@performant-software/shared-components": "^2.2.1", + "@performant-software/shared-components": "^2.2.2-beta.0", "@samvera/clover-iiif": "^2.3.2", "react": ">= 16.13.1 < 19.0.0", "react-dnd": "^11.1.3", diff --git a/packages/shared/package.json b/packages/shared/package.json index ecda1756..4ed40e62 100644 --- a/packages/shared/package.json +++ b/packages/shared/package.json @@ -1,6 +1,6 @@ { "name": "@performant-software/shared-components", - "version": "2.2.1", + "version": "2.2.2-beta.0", "description": "A package of shared, framework agnostic, components.", "license": "MIT", "main": "./dist/index.cjs.js", diff --git a/packages/user-defined-fields/package.json b/packages/user-defined-fields/package.json index ecd894fe..b77704b8 100644 --- a/packages/user-defined-fields/package.json +++ b/packages/user-defined-fields/package.json @@ -1,6 +1,6 @@ { "name": "@performant-software/user-defined-fields", - "version": "2.2.1", + "version": "2.2.2-beta.0", "description": "A package of components used for allowing end users to define fields on models. Use with the \"user_defined_fields\" gem.", "license": "MIT", "main": "./dist/index.cjs.js", @@ -23,8 +23,8 @@ "underscore": "^1.13.2" }, "peerDependencies": { - "@performant-software/semantic-components": "^2.2.1", - "@performant-software/shared-components": "^2.2.1", + "@performant-software/semantic-components": "^2.2.2-beta.0", + "@performant-software/shared-components": "^2.2.2-beta.0", "react": ">= 16.13.1 < 19.0.0", "react-dom": ">= 16.13.1 < 19.0.0" }, diff --git a/packages/visualize/package.json b/packages/visualize/package.json index df84b654..9122bf3c 100644 --- a/packages/visualize/package.json +++ b/packages/visualize/package.json @@ -1,6 +1,6 @@ { "name": "@performant-software/visualize", - "version": "2.2.1", + "version": "2.2.2-beta.0", "description": "A package of components used for data visualization", "license": "MIT", "main": "./dist/index.cjs.js", diff --git a/react-components.json b/react-components.json index 8e7d4eca..387b0ab4 100644 --- a/react-components.json +++ b/react-components.json @@ -8,5 +8,5 @@ "packages/user-defined-fields", "packages/visualize" ], - "version": "2.2.1" + "version": "2.2.2-beta.0" } From c02fd821ac903593947dd654d53c57f61c6888d8 Mon Sep 17 00:00:00 2001 From: dleadbetter <> Date: Mon, 13 May 2024 07:15:19 -0400 Subject: [PATCH 03/22] CDC #157 - Fixing an undefined bug in DataTableColumnSelector --- packages/semantic-ui/src/components/DataTableColumnSelector.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/semantic-ui/src/components/DataTableColumnSelector.js b/packages/semantic-ui/src/components/DataTableColumnSelector.js index d1637ace..0da92206 100644 --- a/packages/semantic-ui/src/components/DataTableColumnSelector.js +++ b/packages/semantic-ui/src/components/DataTableColumnSelector.js @@ -238,7 +238,7 @@ const useColumnSelector = (WrappedComponent: ComponentType) => ( * Sets the list columns on the session. */ setSession() { - const { key, storage } = this.props.session; + const { key, storage } = this.props.session || {}; if (!key) { return; From 6ed630a4ffaffa1cc9af6a1033dc1dd4a5328f7a Mon Sep 17 00:00:00 2001 From: dleadbetter <> Date: Mon, 13 May 2024 07:15:50 -0400 Subject: [PATCH 04/22] CDC #157 - Adding useUserDefinedColumns hook --- .../src/components/UserDefinedFieldsForm.js | 11 +-- .../src/constants/DataTypes.js | 15 ++++ .../src/hooks/UserDefinedFields.js | 85 +++++++++++++++++++ packages/user-defined-fields/src/index.js | 3 + 4 files changed, 104 insertions(+), 10 deletions(-) create mode 100644 packages/user-defined-fields/src/constants/DataTypes.js create mode 100644 packages/user-defined-fields/src/hooks/UserDefinedFields.js diff --git a/packages/user-defined-fields/src/components/UserDefinedFieldsForm.js b/packages/user-defined-fields/src/components/UserDefinedFieldsForm.js index 8c9e57e4..d5ec445f 100644 --- a/packages/user-defined-fields/src/components/UserDefinedFieldsForm.js +++ b/packages/user-defined-fields/src/components/UserDefinedFieldsForm.js @@ -10,6 +10,7 @@ import React, { } from 'react'; import { Form } from 'semantic-ui-react'; import _ from 'underscore'; +import { DataTypes } from '../constants/DataTypes'; import UserDefinedFieldsService from '../services/UserDefinedFields'; type Props = { @@ -22,16 +23,6 @@ type Props = { tableName?: string }; -const DataTypes = { - boolean: 'Boolean', - date: 'Date', - number: 'Number', - richText: 'RichText', - select: 'Select', - string: 'String', - text: 'Text' -}; - const UserDefinedFieldsForm: ComponentType = (props: Props) => { const [fields, setFields] = useState([]); diff --git a/packages/user-defined-fields/src/constants/DataTypes.js b/packages/user-defined-fields/src/constants/DataTypes.js new file mode 100644 index 00000000..22266994 --- /dev/null +++ b/packages/user-defined-fields/src/constants/DataTypes.js @@ -0,0 +1,15 @@ +// @flow + +const DataTypes = { + boolean: 'Boolean', + date: 'Date', + number: 'Number', + richText: 'RichText', + select: 'Select', + string: 'String', + text: 'Text' +}; + +export { + DataTypes +}; diff --git a/packages/user-defined-fields/src/hooks/UserDefinedFields.js b/packages/user-defined-fields/src/hooks/UserDefinedFields.js new file mode 100644 index 00000000..66d6350e --- /dev/null +++ b/packages/user-defined-fields/src/hooks/UserDefinedFields.js @@ -0,0 +1,85 @@ +// @flow + +import { BooleanIcon } from '@performant-software/semantic-components'; +import { Date as DateUtils } from '@performant-software/shared-components'; +import React, { useEffect, useMemo, useState } from 'react'; +import _ from 'underscore'; +import { DataTypes } from '../constants/DataTypes'; +import UserDefinedFieldsService from '../services/UserDefinedFields'; + +/** + * Returns the loading state and list of user defined columns for the passed defineable ID and defineable type. + * + * @param defineableId + * @param defineableType + * + * @returns {{userDefinedColumns: [], loading: boolean}} + */ +const useUserDefinedColumns = (defineableId, defineableType) => { + const [fields, setFields] = useState([]); + const [loading, setLoading] = useState(false); + + /** + * Memo-izes the columns. + * + * @type {[]} + */ + const userDefinedColumns = useMemo(() => { + const columns = []; + + _.each(fields, (field) => { + const column = { + name: field.column_name, + label: field.column_name, + hidden: true, + sortable: true + }; + + if (field.data_type === DataTypes.boolean) { + columns.push({ + ...column, + render: (item) => ( + + ) + }); + } + + if (field.data_type === DataTypes.date) { + columns.push({ + ...column, + resolve: (item) => DateUtils.formatDate(item.user_defined[field.uuid]) + }); + } + + if (field.data_type !== DataTypes.richText) { + columns.push({ + ...column, + resolve: (item) => item.user_defined[field.uuid] + }); + } + }); + + return columns; + }, [fields]); + + /** + * Fetches the user defined fields for the passed defineable ID and defineable type. + */ + useEffect(() => { + setLoading(true); + + UserDefinedFieldsService + .fetchAll({ defineable_id: defineableId, defineable_type: defineableType }) + .then(({ data }) => setFields(data.user_defined_fields)) + .finally(() => setLoading(false)); + }, [defineableId, defineableId]); + + return { + loading, + userDefinedColumns + }; +}; + +export default useUserDefinedColumns; diff --git a/packages/user-defined-fields/src/index.js b/packages/user-defined-fields/src/index.js index 8b26adda..1b595d84 100644 --- a/packages/user-defined-fields/src/index.js +++ b/packages/user-defined-fields/src/index.js @@ -7,6 +7,9 @@ export { default as UserDefinedFieldsEmbeddedList } from './components/UserDefin export { default as UserDefinedFieldsForm } from './components/UserDefinedFieldsForm'; export { default as UserDefinedFieldsList } from './components/UserDefinedFieldsList'; +// Hooks +export { default as useUserDefinedColumns } from './hooks/UserDefinedFields'; + // Services export { default as UserDefinedFieldsService } from './services/UserDefinedFields'; From 37fefa2746a22e702f287adaebdfd1a64d607f4d Mon Sep 17 00:00:00 2001 From: dleadbetter <> Date: Mon, 13 May 2024 07:23:29 -0400 Subject: [PATCH 05/22] CDC #157 - Publishing v2.2.2-beta.1 --- packages/controlled-vocabulary/package.json | 6 +++--- packages/core-data/package.json | 6 +++--- packages/geospatial/package.json | 2 +- packages/semantic-ui/package.json | 4 ++-- packages/shared/package.json | 2 +- packages/user-defined-fields/package.json | 6 +++--- packages/visualize/package.json | 2 +- react-components.json | 2 +- 8 files changed, 15 insertions(+), 15 deletions(-) diff --git a/packages/controlled-vocabulary/package.json b/packages/controlled-vocabulary/package.json index 00098f9b..5d3365b2 100644 --- a/packages/controlled-vocabulary/package.json +++ b/packages/controlled-vocabulary/package.json @@ -1,6 +1,6 @@ { "name": "@performant-software/controlled-vocabulary", - "version": "2.2.2-beta.0", + "version": "2.2.2-beta.1", "description": "A package of components to allow user to configure dropdown elements. Use with the \"controlled_vocabulary\" gem.", "license": "MIT", "main": "./dist/index.cjs.js", @@ -23,8 +23,8 @@ "underscore": "^1.13.2" }, "peerDependencies": { - "@performant-software/semantic-components": "^2.2.2-beta.0", - "@performant-software/shared-components": "^2.2.2-beta.0", + "@performant-software/semantic-components": "^2.2.2-beta.1", + "@performant-software/shared-components": "^2.2.2-beta.1", "react": ">= 16.13.1 < 19.0.0", "react-dom": ">= 16.13.1 < 19.0.0" }, diff --git a/packages/core-data/package.json b/packages/core-data/package.json index c209d5f9..64064399 100644 --- a/packages/core-data/package.json +++ b/packages/core-data/package.json @@ -1,6 +1,6 @@ { "name": "@performant-software/core-data", - "version": "2.2.2-beta.0", + "version": "2.2.2-beta.1", "description": "A package of components used with the Core Data platform.", "license": "MIT", "main": "./dist/index.cjs.js", @@ -37,8 +37,8 @@ "underscore": "^1.13.2" }, "peerDependencies": { - "@performant-software/shared-components": "^2.2.2-beta.0", - "@performant-software/geospatial": "^2.2.2-beta.0", + "@performant-software/shared-components": "^2.2.2-beta.1", + "@performant-software/geospatial": "^2.2.2-beta.1", "@peripleo/maplibre": "^0.5.2", "@peripleo/peripleo": "^0.5.2", "react": ">= 16.13.1 < 19.0.0", diff --git a/packages/geospatial/package.json b/packages/geospatial/package.json index 13f15194..9c6e8512 100644 --- a/packages/geospatial/package.json +++ b/packages/geospatial/package.json @@ -1,6 +1,6 @@ { "name": "@performant-software/geospatial", - "version": "2.2.2-beta.0", + "version": "2.2.2-beta.1", "description": "A package of components for all things map-related.", "license": "MIT", "main": "./dist/index.cjs.js", diff --git a/packages/semantic-ui/package.json b/packages/semantic-ui/package.json index 04034f8e..bf6330f4 100644 --- a/packages/semantic-ui/package.json +++ b/packages/semantic-ui/package.json @@ -1,6 +1,6 @@ { "name": "@performant-software/semantic-components", - "version": "2.2.2-beta.0", + "version": "2.2.2-beta.1", "description": "A package of shared components based on the Semantic UI Framework.", "license": "MIT", "main": "./dist/index.cjs.js", @@ -35,7 +35,7 @@ "zotero-translation-client": "^5.0.1" }, "peerDependencies": { - "@performant-software/shared-components": "^2.2.2-beta.0", + "@performant-software/shared-components": "^2.2.2-beta.1", "@samvera/clover-iiif": "^2.3.2", "react": ">= 16.13.1 < 19.0.0", "react-dnd": "^11.1.3", diff --git a/packages/shared/package.json b/packages/shared/package.json index 4ed40e62..f5b906b9 100644 --- a/packages/shared/package.json +++ b/packages/shared/package.json @@ -1,6 +1,6 @@ { "name": "@performant-software/shared-components", - "version": "2.2.2-beta.0", + "version": "2.2.2-beta.1", "description": "A package of shared, framework agnostic, components.", "license": "MIT", "main": "./dist/index.cjs.js", diff --git a/packages/user-defined-fields/package.json b/packages/user-defined-fields/package.json index b77704b8..f5cb8e56 100644 --- a/packages/user-defined-fields/package.json +++ b/packages/user-defined-fields/package.json @@ -1,6 +1,6 @@ { "name": "@performant-software/user-defined-fields", - "version": "2.2.2-beta.0", + "version": "2.2.2-beta.1", "description": "A package of components used for allowing end users to define fields on models. Use with the \"user_defined_fields\" gem.", "license": "MIT", "main": "./dist/index.cjs.js", @@ -23,8 +23,8 @@ "underscore": "^1.13.2" }, "peerDependencies": { - "@performant-software/semantic-components": "^2.2.2-beta.0", - "@performant-software/shared-components": "^2.2.2-beta.0", + "@performant-software/semantic-components": "^2.2.2-beta.1", + "@performant-software/shared-components": "^2.2.2-beta.1", "react": ">= 16.13.1 < 19.0.0", "react-dom": ">= 16.13.1 < 19.0.0" }, diff --git a/packages/visualize/package.json b/packages/visualize/package.json index 9122bf3c..07b843fb 100644 --- a/packages/visualize/package.json +++ b/packages/visualize/package.json @@ -1,6 +1,6 @@ { "name": "@performant-software/visualize", - "version": "2.2.2-beta.0", + "version": "2.2.2-beta.1", "description": "A package of components used for data visualization", "license": "MIT", "main": "./dist/index.cjs.js", diff --git a/react-components.json b/react-components.json index 387b0ab4..7f12c1e9 100644 --- a/react-components.json +++ b/react-components.json @@ -8,5 +8,5 @@ "packages/user-defined-fields", "packages/visualize" ], - "version": "2.2.2-beta.0" + "version": "2.2.2-beta.1" } From 57827a3cf3b0b3c03f43760da8ec1cb84bdeeff4 Mon Sep 17 00:00:00 2001 From: dleadbetter <> Date: Mon, 13 May 2024 07:26:31 -0400 Subject: [PATCH 06/22] CDC #157 - Adding null checks to useUserDefinedFields hook --- .../src/hooks/UserDefinedFields.js | 28 +++++++++++++++---- 1 file changed, 23 insertions(+), 5 deletions(-) diff --git a/packages/user-defined-fields/src/hooks/UserDefinedFields.js b/packages/user-defined-fields/src/hooks/UserDefinedFields.js index 66d6350e..c4520e2e 100644 --- a/packages/user-defined-fields/src/hooks/UserDefinedFields.js +++ b/packages/user-defined-fields/src/hooks/UserDefinedFields.js @@ -2,7 +2,12 @@ import { BooleanIcon } from '@performant-software/semantic-components'; import { Date as DateUtils } from '@performant-software/shared-components'; -import React, { useEffect, useMemo, useState } from 'react'; +import React, { + useCallback, + useEffect, + useMemo, + useState +} from 'react'; import _ from 'underscore'; import { DataTypes } from '../constants/DataTypes'; import UserDefinedFieldsService from '../services/UserDefinedFields'; @@ -19,6 +24,19 @@ const useUserDefinedColumns = (defineableId, defineableType) => { const [fields, setFields] = useState([]); const [loading, setLoading] = useState(false); + /** + * Resolves the user defined field value for the passed item. + * + * @type {(function(*, *): (null|*))|*} + */ + const resolveValue = useCallback((item, field) => { + if (!item.user_defined) { + return null; + } + + return item.user_defined[field.uuid]; + }, []); + /** * Memo-izes the columns. * @@ -40,7 +58,7 @@ const useUserDefinedColumns = (defineableId, defineableType) => { ...column, render: (item) => ( ) }); @@ -49,20 +67,20 @@ const useUserDefinedColumns = (defineableId, defineableType) => { if (field.data_type === DataTypes.date) { columns.push({ ...column, - resolve: (item) => DateUtils.formatDate(item.user_defined[field.uuid]) + resolve: (item) => DateUtils.formatDate(resolveValue(item, field)) }); } if (field.data_type !== DataTypes.richText) { columns.push({ ...column, - resolve: (item) => item.user_defined[field.uuid] + resolve: (item) => resolveValue(item, field) }); } }); return columns; - }, [fields]); + }, [fields, resolveValue]); /** * Fetches the user defined fields for the passed defineable ID and defineable type. From 665ec3a7d3417378ffb89502ad01b668a7e89326 Mon Sep 17 00:00:00 2001 From: dleadbetter <> Date: Mon, 13 May 2024 09:47:17 -0400 Subject: [PATCH 07/22] CDC #157 - Publishing v2.2.2-beta.2 --- packages/controlled-vocabulary/package.json | 6 +++--- packages/core-data/package.json | 6 +++--- packages/geospatial/package.json | 2 +- packages/semantic-ui/package.json | 4 ++-- packages/shared/package.json | 2 +- packages/user-defined-fields/package.json | 6 +++--- packages/visualize/package.json | 2 +- react-components.json | 2 +- 8 files changed, 15 insertions(+), 15 deletions(-) diff --git a/packages/controlled-vocabulary/package.json b/packages/controlled-vocabulary/package.json index 5d3365b2..c5a673a9 100644 --- a/packages/controlled-vocabulary/package.json +++ b/packages/controlled-vocabulary/package.json @@ -1,6 +1,6 @@ { "name": "@performant-software/controlled-vocabulary", - "version": "2.2.2-beta.1", + "version": "2.2.2-beta.2", "description": "A package of components to allow user to configure dropdown elements. Use with the \"controlled_vocabulary\" gem.", "license": "MIT", "main": "./dist/index.cjs.js", @@ -23,8 +23,8 @@ "underscore": "^1.13.2" }, "peerDependencies": { - "@performant-software/semantic-components": "^2.2.2-beta.1", - "@performant-software/shared-components": "^2.2.2-beta.1", + "@performant-software/semantic-components": "^2.2.2-beta.2", + "@performant-software/shared-components": "^2.2.2-beta.2", "react": ">= 16.13.1 < 19.0.0", "react-dom": ">= 16.13.1 < 19.0.0" }, diff --git a/packages/core-data/package.json b/packages/core-data/package.json index 64064399..0843715b 100644 --- a/packages/core-data/package.json +++ b/packages/core-data/package.json @@ -1,6 +1,6 @@ { "name": "@performant-software/core-data", - "version": "2.2.2-beta.1", + "version": "2.2.2-beta.2", "description": "A package of components used with the Core Data platform.", "license": "MIT", "main": "./dist/index.cjs.js", @@ -37,8 +37,8 @@ "underscore": "^1.13.2" }, "peerDependencies": { - "@performant-software/shared-components": "^2.2.2-beta.1", - "@performant-software/geospatial": "^2.2.2-beta.1", + "@performant-software/shared-components": "^2.2.2-beta.2", + "@performant-software/geospatial": "^2.2.2-beta.2", "@peripleo/maplibre": "^0.5.2", "@peripleo/peripleo": "^0.5.2", "react": ">= 16.13.1 < 19.0.0", diff --git a/packages/geospatial/package.json b/packages/geospatial/package.json index 9c6e8512..1e0ce7df 100644 --- a/packages/geospatial/package.json +++ b/packages/geospatial/package.json @@ -1,6 +1,6 @@ { "name": "@performant-software/geospatial", - "version": "2.2.2-beta.1", + "version": "2.2.2-beta.2", "description": "A package of components for all things map-related.", "license": "MIT", "main": "./dist/index.cjs.js", diff --git a/packages/semantic-ui/package.json b/packages/semantic-ui/package.json index bf6330f4..4408d8a2 100644 --- a/packages/semantic-ui/package.json +++ b/packages/semantic-ui/package.json @@ -1,6 +1,6 @@ { "name": "@performant-software/semantic-components", - "version": "2.2.2-beta.1", + "version": "2.2.2-beta.2", "description": "A package of shared components based on the Semantic UI Framework.", "license": "MIT", "main": "./dist/index.cjs.js", @@ -35,7 +35,7 @@ "zotero-translation-client": "^5.0.1" }, "peerDependencies": { - "@performant-software/shared-components": "^2.2.2-beta.1", + "@performant-software/shared-components": "^2.2.2-beta.2", "@samvera/clover-iiif": "^2.3.2", "react": ">= 16.13.1 < 19.0.0", "react-dnd": "^11.1.3", diff --git a/packages/shared/package.json b/packages/shared/package.json index f5b906b9..9ee530fb 100644 --- a/packages/shared/package.json +++ b/packages/shared/package.json @@ -1,6 +1,6 @@ { "name": "@performant-software/shared-components", - "version": "2.2.2-beta.1", + "version": "2.2.2-beta.2", "description": "A package of shared, framework agnostic, components.", "license": "MIT", "main": "./dist/index.cjs.js", diff --git a/packages/user-defined-fields/package.json b/packages/user-defined-fields/package.json index f5cb8e56..5df0c7af 100644 --- a/packages/user-defined-fields/package.json +++ b/packages/user-defined-fields/package.json @@ -1,6 +1,6 @@ { "name": "@performant-software/user-defined-fields", - "version": "2.2.2-beta.1", + "version": "2.2.2-beta.2", "description": "A package of components used for allowing end users to define fields on models. Use with the \"user_defined_fields\" gem.", "license": "MIT", "main": "./dist/index.cjs.js", @@ -23,8 +23,8 @@ "underscore": "^1.13.2" }, "peerDependencies": { - "@performant-software/semantic-components": "^2.2.2-beta.1", - "@performant-software/shared-components": "^2.2.2-beta.1", + "@performant-software/semantic-components": "^2.2.2-beta.2", + "@performant-software/shared-components": "^2.2.2-beta.2", "react": ">= 16.13.1 < 19.0.0", "react-dom": ">= 16.13.1 < 19.0.0" }, diff --git a/packages/visualize/package.json b/packages/visualize/package.json index 07b843fb..7b703c01 100644 --- a/packages/visualize/package.json +++ b/packages/visualize/package.json @@ -1,6 +1,6 @@ { "name": "@performant-software/visualize", - "version": "2.2.2-beta.1", + "version": "2.2.2-beta.2", "description": "A package of components used for data visualization", "license": "MIT", "main": "./dist/index.cjs.js", diff --git a/react-components.json b/react-components.json index 7f12c1e9..c863c970 100644 --- a/react-components.json +++ b/react-components.json @@ -8,5 +8,5 @@ "packages/user-defined-fields", "packages/visualize" ], - "version": "2.2.2-beta.1" + "version": "2.2.2-beta.2" } From a926306559b800a63fb3ae2f1adda56bb095f3d8 Mon Sep 17 00:00:00 2001 From: dleadbetter <> Date: Mon, 13 May 2024 09:47:38 -0400 Subject: [PATCH 08/22] CDC #157 - Updating DataTableColumnSelector to account for new columns when restoring session --- .../src/components/DataTableColumnSelector.js | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/packages/semantic-ui/src/components/DataTableColumnSelector.js b/packages/semantic-ui/src/components/DataTableColumnSelector.js index 0da92206..6e82ffbd 100644 --- a/packages/semantic-ui/src/components/DataTableColumnSelector.js +++ b/packages/semantic-ui/src/components/DataTableColumnSelector.js @@ -105,17 +105,28 @@ const useColumnSelector = (WrappedComponent: ComponentType) => ( const { key, storage } = props.session || {}; const session = ListSessionUtils.restoreSession(key, storage) || {}; + // If the session does not have any stored columns, use the provided props if (_.isEmpty(session.columns)) { return { columns: props.columns }; } + // Iterate over the session columns to preserve the ordering const columns = _.map(session.columns, (column) => ({ ...(_.findWhere(props.columns, { name: column.name }) || {}), ...column })); + // Append any new columns not stored in the session + const columnNames = _.pluck(columns, 'name'); + + _.each(props.columns, (column) => { + if (!_.contains(columnNames, column.name)) { + columns.push(column); + } + }); + return { columns }; From 9eef215133ecb83ae8f03af92c9fe463bf7cee38 Mon Sep 17 00:00:00 2001 From: dleadbetter <> Date: Mon, 13 May 2024 09:59:37 -0400 Subject: [PATCH 09/22] CDC #157 - Publishing v2.2.2-beta.3 --- packages/controlled-vocabulary/package.json | 6 +++--- packages/core-data/package.json | 6 +++--- packages/geospatial/package.json | 2 +- packages/semantic-ui/package.json | 4 ++-- packages/shared/package.json | 2 +- packages/user-defined-fields/package.json | 6 +++--- packages/visualize/package.json | 2 +- react-components.json | 2 +- 8 files changed, 15 insertions(+), 15 deletions(-) diff --git a/packages/controlled-vocabulary/package.json b/packages/controlled-vocabulary/package.json index c5a673a9..e756fc25 100644 --- a/packages/controlled-vocabulary/package.json +++ b/packages/controlled-vocabulary/package.json @@ -1,6 +1,6 @@ { "name": "@performant-software/controlled-vocabulary", - "version": "2.2.2-beta.2", + "version": "2.2.2-beta.3", "description": "A package of components to allow user to configure dropdown elements. Use with the \"controlled_vocabulary\" gem.", "license": "MIT", "main": "./dist/index.cjs.js", @@ -23,8 +23,8 @@ "underscore": "^1.13.2" }, "peerDependencies": { - "@performant-software/semantic-components": "^2.2.2-beta.2", - "@performant-software/shared-components": "^2.2.2-beta.2", + "@performant-software/semantic-components": "^2.2.2-beta.3", + "@performant-software/shared-components": "^2.2.2-beta.3", "react": ">= 16.13.1 < 19.0.0", "react-dom": ">= 16.13.1 < 19.0.0" }, diff --git a/packages/core-data/package.json b/packages/core-data/package.json index 0843715b..399cdd79 100644 --- a/packages/core-data/package.json +++ b/packages/core-data/package.json @@ -1,6 +1,6 @@ { "name": "@performant-software/core-data", - "version": "2.2.2-beta.2", + "version": "2.2.2-beta.3", "description": "A package of components used with the Core Data platform.", "license": "MIT", "main": "./dist/index.cjs.js", @@ -37,8 +37,8 @@ "underscore": "^1.13.2" }, "peerDependencies": { - "@performant-software/shared-components": "^2.2.2-beta.2", - "@performant-software/geospatial": "^2.2.2-beta.2", + "@performant-software/shared-components": "^2.2.2-beta.3", + "@performant-software/geospatial": "^2.2.2-beta.3", "@peripleo/maplibre": "^0.5.2", "@peripleo/peripleo": "^0.5.2", "react": ">= 16.13.1 < 19.0.0", diff --git a/packages/geospatial/package.json b/packages/geospatial/package.json index 1e0ce7df..e81c5e8c 100644 --- a/packages/geospatial/package.json +++ b/packages/geospatial/package.json @@ -1,6 +1,6 @@ { "name": "@performant-software/geospatial", - "version": "2.2.2-beta.2", + "version": "2.2.2-beta.3", "description": "A package of components for all things map-related.", "license": "MIT", "main": "./dist/index.cjs.js", diff --git a/packages/semantic-ui/package.json b/packages/semantic-ui/package.json index 4408d8a2..e231f6fc 100644 --- a/packages/semantic-ui/package.json +++ b/packages/semantic-ui/package.json @@ -1,6 +1,6 @@ { "name": "@performant-software/semantic-components", - "version": "2.2.2-beta.2", + "version": "2.2.2-beta.3", "description": "A package of shared components based on the Semantic UI Framework.", "license": "MIT", "main": "./dist/index.cjs.js", @@ -35,7 +35,7 @@ "zotero-translation-client": "^5.0.1" }, "peerDependencies": { - "@performant-software/shared-components": "^2.2.2-beta.2", + "@performant-software/shared-components": "^2.2.2-beta.3", "@samvera/clover-iiif": "^2.3.2", "react": ">= 16.13.1 < 19.0.0", "react-dnd": "^11.1.3", diff --git a/packages/shared/package.json b/packages/shared/package.json index 9ee530fb..1a2cea29 100644 --- a/packages/shared/package.json +++ b/packages/shared/package.json @@ -1,6 +1,6 @@ { "name": "@performant-software/shared-components", - "version": "2.2.2-beta.2", + "version": "2.2.2-beta.3", "description": "A package of shared, framework agnostic, components.", "license": "MIT", "main": "./dist/index.cjs.js", diff --git a/packages/user-defined-fields/package.json b/packages/user-defined-fields/package.json index 5df0c7af..9a52c69d 100644 --- a/packages/user-defined-fields/package.json +++ b/packages/user-defined-fields/package.json @@ -1,6 +1,6 @@ { "name": "@performant-software/user-defined-fields", - "version": "2.2.2-beta.2", + "version": "2.2.2-beta.3", "description": "A package of components used for allowing end users to define fields on models. Use with the \"user_defined_fields\" gem.", "license": "MIT", "main": "./dist/index.cjs.js", @@ -23,8 +23,8 @@ "underscore": "^1.13.2" }, "peerDependencies": { - "@performant-software/semantic-components": "^2.2.2-beta.2", - "@performant-software/shared-components": "^2.2.2-beta.2", + "@performant-software/semantic-components": "^2.2.2-beta.3", + "@performant-software/shared-components": "^2.2.2-beta.3", "react": ">= 16.13.1 < 19.0.0", "react-dom": ">= 16.13.1 < 19.0.0" }, diff --git a/packages/visualize/package.json b/packages/visualize/package.json index 7b703c01..9496b633 100644 --- a/packages/visualize/package.json +++ b/packages/visualize/package.json @@ -1,6 +1,6 @@ { "name": "@performant-software/visualize", - "version": "2.2.2-beta.2", + "version": "2.2.2-beta.3", "description": "A package of components used for data visualization", "license": "MIT", "main": "./dist/index.cjs.js", diff --git a/react-components.json b/react-components.json index c863c970..2fcc6a7a 100644 --- a/react-components.json +++ b/react-components.json @@ -8,5 +8,5 @@ "packages/user-defined-fields", "packages/visualize" ], - "version": "2.2.2-beta.2" + "version": "2.2.2-beta.3" } From 95ffe6d3c8b7400267d29f970ac482c4eef7fa56 Mon Sep 17 00:00:00 2001 From: dleadbetter <> Date: Mon, 13 May 2024 10:00:08 -0400 Subject: [PATCH 10/22] CDC #157 - Adding options argument to useUserDefinedColumns hook --- .../src/hooks/UserDefinedFields.js | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/packages/user-defined-fields/src/hooks/UserDefinedFields.js b/packages/user-defined-fields/src/hooks/UserDefinedFields.js index c4520e2e..30d855aa 100644 --- a/packages/user-defined-fields/src/hooks/UserDefinedFields.js +++ b/packages/user-defined-fields/src/hooks/UserDefinedFields.js @@ -17,10 +17,11 @@ import UserDefinedFieldsService from '../services/UserDefinedFields'; * * @param defineableId * @param defineableType + * @param options * * @returns {{userDefinedColumns: [], loading: boolean}} */ -const useUserDefinedColumns = (defineableId, defineableType) => { +const useUserDefinedColumns = (defineableId, defineableType, options = {}) => { const [fields, setFields] = useState([]); const [loading, setLoading] = useState(false); @@ -30,12 +31,18 @@ const useUserDefinedColumns = (defineableId, defineableType) => { * @type {(function(*, *): (null|*))|*} */ const resolveValue = useCallback((item, field) => { - if (!item.user_defined) { + let record = item; + + if (options.resolveRecord) { + record = options.resolveRecord(item); + } + + if (!record.user_defined) { return null; } - return item.user_defined[field.uuid]; - }, []); + return record.user_defined[field.uuid]; + }, [options.resolveRecord]); /** * Memo-izes the columns. From 510f7bf84e63382c4ce951a1f6b6fdb3144b3f3f Mon Sep 17 00:00:00 2001 From: dleadbetter <> Date: Mon, 13 May 2024 10:39:45 -0400 Subject: [PATCH 11/22] CDC #157 - Publishing v2.2.2-beta.4 --- packages/controlled-vocabulary/package.json | 6 +++--- packages/core-data/package.json | 6 +++--- packages/geospatial/package.json | 2 +- packages/semantic-ui/package.json | 4 ++-- packages/shared/package.json | 2 +- packages/user-defined-fields/package.json | 6 +++--- packages/visualize/package.json | 2 +- react-components.json | 2 +- 8 files changed, 15 insertions(+), 15 deletions(-) diff --git a/packages/controlled-vocabulary/package.json b/packages/controlled-vocabulary/package.json index e756fc25..0092b862 100644 --- a/packages/controlled-vocabulary/package.json +++ b/packages/controlled-vocabulary/package.json @@ -1,6 +1,6 @@ { "name": "@performant-software/controlled-vocabulary", - "version": "2.2.2-beta.3", + "version": "2.2.2-beta.4", "description": "A package of components to allow user to configure dropdown elements. Use with the \"controlled_vocabulary\" gem.", "license": "MIT", "main": "./dist/index.cjs.js", @@ -23,8 +23,8 @@ "underscore": "^1.13.2" }, "peerDependencies": { - "@performant-software/semantic-components": "^2.2.2-beta.3", - "@performant-software/shared-components": "^2.2.2-beta.3", + "@performant-software/semantic-components": "^2.2.2-beta.4", + "@performant-software/shared-components": "^2.2.2-beta.4", "react": ">= 16.13.1 < 19.0.0", "react-dom": ">= 16.13.1 < 19.0.0" }, diff --git a/packages/core-data/package.json b/packages/core-data/package.json index 399cdd79..43512423 100644 --- a/packages/core-data/package.json +++ b/packages/core-data/package.json @@ -1,6 +1,6 @@ { "name": "@performant-software/core-data", - "version": "2.2.2-beta.3", + "version": "2.2.2-beta.4", "description": "A package of components used with the Core Data platform.", "license": "MIT", "main": "./dist/index.cjs.js", @@ -37,8 +37,8 @@ "underscore": "^1.13.2" }, "peerDependencies": { - "@performant-software/shared-components": "^2.2.2-beta.3", - "@performant-software/geospatial": "^2.2.2-beta.3", + "@performant-software/shared-components": "^2.2.2-beta.4", + "@performant-software/geospatial": "^2.2.2-beta.4", "@peripleo/maplibre": "^0.5.2", "@peripleo/peripleo": "^0.5.2", "react": ">= 16.13.1 < 19.0.0", diff --git a/packages/geospatial/package.json b/packages/geospatial/package.json index e81c5e8c..a101e1c8 100644 --- a/packages/geospatial/package.json +++ b/packages/geospatial/package.json @@ -1,6 +1,6 @@ { "name": "@performant-software/geospatial", - "version": "2.2.2-beta.3", + "version": "2.2.2-beta.4", "description": "A package of components for all things map-related.", "license": "MIT", "main": "./dist/index.cjs.js", diff --git a/packages/semantic-ui/package.json b/packages/semantic-ui/package.json index e231f6fc..0da3a963 100644 --- a/packages/semantic-ui/package.json +++ b/packages/semantic-ui/package.json @@ -1,6 +1,6 @@ { "name": "@performant-software/semantic-components", - "version": "2.2.2-beta.3", + "version": "2.2.2-beta.4", "description": "A package of shared components based on the Semantic UI Framework.", "license": "MIT", "main": "./dist/index.cjs.js", @@ -35,7 +35,7 @@ "zotero-translation-client": "^5.0.1" }, "peerDependencies": { - "@performant-software/shared-components": "^2.2.2-beta.3", + "@performant-software/shared-components": "^2.2.2-beta.4", "@samvera/clover-iiif": "^2.3.2", "react": ">= 16.13.1 < 19.0.0", "react-dnd": "^11.1.3", diff --git a/packages/shared/package.json b/packages/shared/package.json index 1a2cea29..162c1cc1 100644 --- a/packages/shared/package.json +++ b/packages/shared/package.json @@ -1,6 +1,6 @@ { "name": "@performant-software/shared-components", - "version": "2.2.2-beta.3", + "version": "2.2.2-beta.4", "description": "A package of shared, framework agnostic, components.", "license": "MIT", "main": "./dist/index.cjs.js", diff --git a/packages/user-defined-fields/package.json b/packages/user-defined-fields/package.json index 9a52c69d..ad537474 100644 --- a/packages/user-defined-fields/package.json +++ b/packages/user-defined-fields/package.json @@ -1,6 +1,6 @@ { "name": "@performant-software/user-defined-fields", - "version": "2.2.2-beta.3", + "version": "2.2.2-beta.4", "description": "A package of components used for allowing end users to define fields on models. Use with the \"user_defined_fields\" gem.", "license": "MIT", "main": "./dist/index.cjs.js", @@ -23,8 +23,8 @@ "underscore": "^1.13.2" }, "peerDependencies": { - "@performant-software/semantic-components": "^2.2.2-beta.3", - "@performant-software/shared-components": "^2.2.2-beta.3", + "@performant-software/semantic-components": "^2.2.2-beta.4", + "@performant-software/shared-components": "^2.2.2-beta.4", "react": ">= 16.13.1 < 19.0.0", "react-dom": ">= 16.13.1 < 19.0.0" }, diff --git a/packages/visualize/package.json b/packages/visualize/package.json index 9496b633..a8f551f8 100644 --- a/packages/visualize/package.json +++ b/packages/visualize/package.json @@ -1,6 +1,6 @@ { "name": "@performant-software/visualize", - "version": "2.2.2-beta.3", + "version": "2.2.2-beta.4", "description": "A package of components used for data visualization", "license": "MIT", "main": "./dist/index.cjs.js", diff --git a/react-components.json b/react-components.json index 2fcc6a7a..8701c08d 100644 --- a/react-components.json +++ b/react-components.json @@ -8,5 +8,5 @@ "packages/user-defined-fields", "packages/visualize" ], - "version": "2.2.2-beta.3" + "version": "2.2.2-beta.4" } From dd110d4a5798246afe8576289c31e8ce64ed529f Mon Sep 17 00:00:00 2001 From: dleadbetter <> Date: Mon, 13 May 2024 10:40:31 -0400 Subject: [PATCH 12/22] CDC #157 - Updating useUserDefinedColumns to only allow sorting on base record columns --- .../user-defined-fields/src/hooks/UserDefinedFields.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/packages/user-defined-fields/src/hooks/UserDefinedFields.js b/packages/user-defined-fields/src/hooks/UserDefinedFields.js index 30d855aa..c5643c36 100644 --- a/packages/user-defined-fields/src/hooks/UserDefinedFields.js +++ b/packages/user-defined-fields/src/hooks/UserDefinedFields.js @@ -25,6 +25,13 @@ const useUserDefinedColumns = (defineableId, defineableType, options = {}) => { const [fields, setFields] = useState([]); const [loading, setLoading] = useState(false); + /** + * If we're resolving a related record, the column cannot be sortable. + * + * @type {boolean} + */ + const sortable = useMemo(() => !options.resolveRecord, [options.resolveRecord]); + /** * Resolves the user defined field value for the passed item. * @@ -57,7 +64,7 @@ const useUserDefinedColumns = (defineableId, defineableType, options = {}) => { name: field.column_name, label: field.column_name, hidden: true, - sortable: true + sortable }; if (field.data_type === DataTypes.boolean) { From ed3a7d1475010e85eb10e20cbe816de81ef3c7df Mon Sep 17 00:00:00 2001 From: dleadbetter <> Date: Mon, 13 May 2024 10:47:20 -0400 Subject: [PATCH 13/22] CDC #157 - Publishing v2.2.2-beta.5 --- packages/controlled-vocabulary/package.json | 6 +++--- packages/core-data/package.json | 6 +++--- packages/geospatial/package.json | 2 +- packages/semantic-ui/package.json | 4 ++-- packages/shared/package.json | 2 +- packages/user-defined-fields/package.json | 6 +++--- packages/visualize/package.json | 2 +- react-components.json | 2 +- 8 files changed, 15 insertions(+), 15 deletions(-) diff --git a/packages/controlled-vocabulary/package.json b/packages/controlled-vocabulary/package.json index 0092b862..8f3e0f80 100644 --- a/packages/controlled-vocabulary/package.json +++ b/packages/controlled-vocabulary/package.json @@ -1,6 +1,6 @@ { "name": "@performant-software/controlled-vocabulary", - "version": "2.2.2-beta.4", + "version": "2.2.2-beta.5", "description": "A package of components to allow user to configure dropdown elements. Use with the \"controlled_vocabulary\" gem.", "license": "MIT", "main": "./dist/index.cjs.js", @@ -23,8 +23,8 @@ "underscore": "^1.13.2" }, "peerDependencies": { - "@performant-software/semantic-components": "^2.2.2-beta.4", - "@performant-software/shared-components": "^2.2.2-beta.4", + "@performant-software/semantic-components": "^2.2.2-beta.5", + "@performant-software/shared-components": "^2.2.2-beta.5", "react": ">= 16.13.1 < 19.0.0", "react-dom": ">= 16.13.1 < 19.0.0" }, diff --git a/packages/core-data/package.json b/packages/core-data/package.json index 43512423..7952abab 100644 --- a/packages/core-data/package.json +++ b/packages/core-data/package.json @@ -1,6 +1,6 @@ { "name": "@performant-software/core-data", - "version": "2.2.2-beta.4", + "version": "2.2.2-beta.5", "description": "A package of components used with the Core Data platform.", "license": "MIT", "main": "./dist/index.cjs.js", @@ -37,8 +37,8 @@ "underscore": "^1.13.2" }, "peerDependencies": { - "@performant-software/shared-components": "^2.2.2-beta.4", - "@performant-software/geospatial": "^2.2.2-beta.4", + "@performant-software/shared-components": "^2.2.2-beta.5", + "@performant-software/geospatial": "^2.2.2-beta.5", "@peripleo/maplibre": "^0.5.2", "@peripleo/peripleo": "^0.5.2", "react": ">= 16.13.1 < 19.0.0", diff --git a/packages/geospatial/package.json b/packages/geospatial/package.json index a101e1c8..f9e09a76 100644 --- a/packages/geospatial/package.json +++ b/packages/geospatial/package.json @@ -1,6 +1,6 @@ { "name": "@performant-software/geospatial", - "version": "2.2.2-beta.4", + "version": "2.2.2-beta.5", "description": "A package of components for all things map-related.", "license": "MIT", "main": "./dist/index.cjs.js", diff --git a/packages/semantic-ui/package.json b/packages/semantic-ui/package.json index 0da3a963..5941977f 100644 --- a/packages/semantic-ui/package.json +++ b/packages/semantic-ui/package.json @@ -1,6 +1,6 @@ { "name": "@performant-software/semantic-components", - "version": "2.2.2-beta.4", + "version": "2.2.2-beta.5", "description": "A package of shared components based on the Semantic UI Framework.", "license": "MIT", "main": "./dist/index.cjs.js", @@ -35,7 +35,7 @@ "zotero-translation-client": "^5.0.1" }, "peerDependencies": { - "@performant-software/shared-components": "^2.2.2-beta.4", + "@performant-software/shared-components": "^2.2.2-beta.5", "@samvera/clover-iiif": "^2.3.2", "react": ">= 16.13.1 < 19.0.0", "react-dnd": "^11.1.3", diff --git a/packages/shared/package.json b/packages/shared/package.json index 162c1cc1..7640fd8c 100644 --- a/packages/shared/package.json +++ b/packages/shared/package.json @@ -1,6 +1,6 @@ { "name": "@performant-software/shared-components", - "version": "2.2.2-beta.4", + "version": "2.2.2-beta.5", "description": "A package of shared, framework agnostic, components.", "license": "MIT", "main": "./dist/index.cjs.js", diff --git a/packages/user-defined-fields/package.json b/packages/user-defined-fields/package.json index ad537474..5e516a01 100644 --- a/packages/user-defined-fields/package.json +++ b/packages/user-defined-fields/package.json @@ -1,6 +1,6 @@ { "name": "@performant-software/user-defined-fields", - "version": "2.2.2-beta.4", + "version": "2.2.2-beta.5", "description": "A package of components used for allowing end users to define fields on models. Use with the \"user_defined_fields\" gem.", "license": "MIT", "main": "./dist/index.cjs.js", @@ -23,8 +23,8 @@ "underscore": "^1.13.2" }, "peerDependencies": { - "@performant-software/semantic-components": "^2.2.2-beta.4", - "@performant-software/shared-components": "^2.2.2-beta.4", + "@performant-software/semantic-components": "^2.2.2-beta.5", + "@performant-software/shared-components": "^2.2.2-beta.5", "react": ">= 16.13.1 < 19.0.0", "react-dom": ">= 16.13.1 < 19.0.0" }, diff --git a/packages/visualize/package.json b/packages/visualize/package.json index a8f551f8..3707a758 100644 --- a/packages/visualize/package.json +++ b/packages/visualize/package.json @@ -1,6 +1,6 @@ { "name": "@performant-software/visualize", - "version": "2.2.2-beta.4", + "version": "2.2.2-beta.5", "description": "A package of components used for data visualization", "license": "MIT", "main": "./dist/index.cjs.js", diff --git a/react-components.json b/react-components.json index 8701c08d..bd51ddc3 100644 --- a/react-components.json +++ b/react-components.json @@ -8,5 +8,5 @@ "packages/user-defined-fields", "packages/visualize" ], - "version": "2.2.2-beta.4" + "version": "2.2.2-beta.5" } From 46477d33e709881c89dcae8de22655ac1c3a8d6e Mon Sep 17 00:00:00 2001 From: dleadbetter <> Date: Mon, 13 May 2024 10:57:55 -0400 Subject: [PATCH 14/22] CDC #157 - Refactoring sortable logic in useUserDefinedFields hook --- .../user-defined-fields/src/hooks/UserDefinedFields.js | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/packages/user-defined-fields/src/hooks/UserDefinedFields.js b/packages/user-defined-fields/src/hooks/UserDefinedFields.js index c5643c36..46560fd5 100644 --- a/packages/user-defined-fields/src/hooks/UserDefinedFields.js +++ b/packages/user-defined-fields/src/hooks/UserDefinedFields.js @@ -25,12 +25,7 @@ const useUserDefinedColumns = (defineableId, defineableType, options = {}) => { const [fields, setFields] = useState([]); const [loading, setLoading] = useState(false); - /** - * If we're resolving a related record, the column cannot be sortable. - * - * @type {boolean} - */ - const sortable = useMemo(() => !options.resolveRecord, [options.resolveRecord]); + const { sortable = true } = options; /** * Resolves the user defined field value for the passed item. From e9c0a61449e89f335a9a7a326ab7448269cec420 Mon Sep 17 00:00:00 2001 From: dleadbetter <> Date: Mon, 13 May 2024 11:03:08 -0400 Subject: [PATCH 15/22] CDC #157 - Publishing v2.2.2-beta.6 --- packages/controlled-vocabulary/package.json | 6 +++--- packages/core-data/package.json | 6 +++--- packages/geospatial/package.json | 2 +- packages/semantic-ui/package.json | 4 ++-- packages/shared/package.json | 2 +- packages/user-defined-fields/package.json | 6 +++--- packages/visualize/package.json | 2 +- react-components.json | 2 +- 8 files changed, 15 insertions(+), 15 deletions(-) diff --git a/packages/controlled-vocabulary/package.json b/packages/controlled-vocabulary/package.json index 8f3e0f80..9dffe476 100644 --- a/packages/controlled-vocabulary/package.json +++ b/packages/controlled-vocabulary/package.json @@ -1,6 +1,6 @@ { "name": "@performant-software/controlled-vocabulary", - "version": "2.2.2-beta.5", + "version": "2.2.2-beta.6", "description": "A package of components to allow user to configure dropdown elements. Use with the \"controlled_vocabulary\" gem.", "license": "MIT", "main": "./dist/index.cjs.js", @@ -23,8 +23,8 @@ "underscore": "^1.13.2" }, "peerDependencies": { - "@performant-software/semantic-components": "^2.2.2-beta.5", - "@performant-software/shared-components": "^2.2.2-beta.5", + "@performant-software/semantic-components": "^2.2.2-beta.6", + "@performant-software/shared-components": "^2.2.2-beta.6", "react": ">= 16.13.1 < 19.0.0", "react-dom": ">= 16.13.1 < 19.0.0" }, diff --git a/packages/core-data/package.json b/packages/core-data/package.json index 7952abab..a385d35b 100644 --- a/packages/core-data/package.json +++ b/packages/core-data/package.json @@ -1,6 +1,6 @@ { "name": "@performant-software/core-data", - "version": "2.2.2-beta.5", + "version": "2.2.2-beta.6", "description": "A package of components used with the Core Data platform.", "license": "MIT", "main": "./dist/index.cjs.js", @@ -37,8 +37,8 @@ "underscore": "^1.13.2" }, "peerDependencies": { - "@performant-software/shared-components": "^2.2.2-beta.5", - "@performant-software/geospatial": "^2.2.2-beta.5", + "@performant-software/shared-components": "^2.2.2-beta.6", + "@performant-software/geospatial": "^2.2.2-beta.6", "@peripleo/maplibre": "^0.5.2", "@peripleo/peripleo": "^0.5.2", "react": ">= 16.13.1 < 19.0.0", diff --git a/packages/geospatial/package.json b/packages/geospatial/package.json index f9e09a76..ee081c41 100644 --- a/packages/geospatial/package.json +++ b/packages/geospatial/package.json @@ -1,6 +1,6 @@ { "name": "@performant-software/geospatial", - "version": "2.2.2-beta.5", + "version": "2.2.2-beta.6", "description": "A package of components for all things map-related.", "license": "MIT", "main": "./dist/index.cjs.js", diff --git a/packages/semantic-ui/package.json b/packages/semantic-ui/package.json index 5941977f..a01659b7 100644 --- a/packages/semantic-ui/package.json +++ b/packages/semantic-ui/package.json @@ -1,6 +1,6 @@ { "name": "@performant-software/semantic-components", - "version": "2.2.2-beta.5", + "version": "2.2.2-beta.6", "description": "A package of shared components based on the Semantic UI Framework.", "license": "MIT", "main": "./dist/index.cjs.js", @@ -35,7 +35,7 @@ "zotero-translation-client": "^5.0.1" }, "peerDependencies": { - "@performant-software/shared-components": "^2.2.2-beta.5", + "@performant-software/shared-components": "^2.2.2-beta.6", "@samvera/clover-iiif": "^2.3.2", "react": ">= 16.13.1 < 19.0.0", "react-dnd": "^11.1.3", diff --git a/packages/shared/package.json b/packages/shared/package.json index 7640fd8c..ceec39af 100644 --- a/packages/shared/package.json +++ b/packages/shared/package.json @@ -1,6 +1,6 @@ { "name": "@performant-software/shared-components", - "version": "2.2.2-beta.5", + "version": "2.2.2-beta.6", "description": "A package of shared, framework agnostic, components.", "license": "MIT", "main": "./dist/index.cjs.js", diff --git a/packages/user-defined-fields/package.json b/packages/user-defined-fields/package.json index 5e516a01..8c5411bf 100644 --- a/packages/user-defined-fields/package.json +++ b/packages/user-defined-fields/package.json @@ -1,6 +1,6 @@ { "name": "@performant-software/user-defined-fields", - "version": "2.2.2-beta.5", + "version": "2.2.2-beta.6", "description": "A package of components used for allowing end users to define fields on models. Use with the \"user_defined_fields\" gem.", "license": "MIT", "main": "./dist/index.cjs.js", @@ -23,8 +23,8 @@ "underscore": "^1.13.2" }, "peerDependencies": { - "@performant-software/semantic-components": "^2.2.2-beta.5", - "@performant-software/shared-components": "^2.2.2-beta.5", + "@performant-software/semantic-components": "^2.2.2-beta.6", + "@performant-software/shared-components": "^2.2.2-beta.6", "react": ">= 16.13.1 < 19.0.0", "react-dom": ">= 16.13.1 < 19.0.0" }, diff --git a/packages/visualize/package.json b/packages/visualize/package.json index 3707a758..8178ddfb 100644 --- a/packages/visualize/package.json +++ b/packages/visualize/package.json @@ -1,6 +1,6 @@ { "name": "@performant-software/visualize", - "version": "2.2.2-beta.5", + "version": "2.2.2-beta.6", "description": "A package of components used for data visualization", "license": "MIT", "main": "./dist/index.cjs.js", diff --git a/react-components.json b/react-components.json index bd51ddc3..29238912 100644 --- a/react-components.json +++ b/react-components.json @@ -8,5 +8,5 @@ "packages/user-defined-fields", "packages/visualize" ], - "version": "2.2.2-beta.5" + "version": "2.2.2-beta.6" } From f198d78e75633485c4beb277511cbfee5db14863 Mon Sep 17 00:00:00 2001 From: dleadbetter <> Date: Mon, 13 May 2024 11:04:07 -0400 Subject: [PATCH 16/22] CDC #157 - Updating useUserDefinedFields hook to use uuid value for column name --- packages/user-defined-fields/src/hooks/UserDefinedFields.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/user-defined-fields/src/hooks/UserDefinedFields.js b/packages/user-defined-fields/src/hooks/UserDefinedFields.js index 46560fd5..f0af0e39 100644 --- a/packages/user-defined-fields/src/hooks/UserDefinedFields.js +++ b/packages/user-defined-fields/src/hooks/UserDefinedFields.js @@ -56,7 +56,7 @@ const useUserDefinedColumns = (defineableId, defineableType, options = {}) => { _.each(fields, (field) => { const column = { - name: field.column_name, + name: field.uuid, label: field.column_name, hidden: true, sortable From 588f91101803f19517819f626a8a9e88e502a168 Mon Sep 17 00:00:00 2001 From: dleadbetter <> Date: Mon, 13 May 2024 11:27:52 -0400 Subject: [PATCH 17/22] CDC #157 - Publishing v2.2.2-beta.7 --- packages/controlled-vocabulary/package.json | 6 +++--- packages/core-data/package.json | 6 +++--- packages/geospatial/package.json | 2 +- packages/semantic-ui/package.json | 4 ++-- packages/shared/package.json | 2 +- packages/user-defined-fields/package.json | 6 +++--- packages/visualize/package.json | 2 +- react-components.json | 2 +- 8 files changed, 15 insertions(+), 15 deletions(-) diff --git a/packages/controlled-vocabulary/package.json b/packages/controlled-vocabulary/package.json index 9dffe476..f4f299db 100644 --- a/packages/controlled-vocabulary/package.json +++ b/packages/controlled-vocabulary/package.json @@ -1,6 +1,6 @@ { "name": "@performant-software/controlled-vocabulary", - "version": "2.2.2-beta.6", + "version": "2.2.2-beta.7", "description": "A package of components to allow user to configure dropdown elements. Use with the \"controlled_vocabulary\" gem.", "license": "MIT", "main": "./dist/index.cjs.js", @@ -23,8 +23,8 @@ "underscore": "^1.13.2" }, "peerDependencies": { - "@performant-software/semantic-components": "^2.2.2-beta.6", - "@performant-software/shared-components": "^2.2.2-beta.6", + "@performant-software/semantic-components": "^2.2.2-beta.7", + "@performant-software/shared-components": "^2.2.2-beta.7", "react": ">= 16.13.1 < 19.0.0", "react-dom": ">= 16.13.1 < 19.0.0" }, diff --git a/packages/core-data/package.json b/packages/core-data/package.json index a385d35b..5d56f388 100644 --- a/packages/core-data/package.json +++ b/packages/core-data/package.json @@ -1,6 +1,6 @@ { "name": "@performant-software/core-data", - "version": "2.2.2-beta.6", + "version": "2.2.2-beta.7", "description": "A package of components used with the Core Data platform.", "license": "MIT", "main": "./dist/index.cjs.js", @@ -37,8 +37,8 @@ "underscore": "^1.13.2" }, "peerDependencies": { - "@performant-software/shared-components": "^2.2.2-beta.6", - "@performant-software/geospatial": "^2.2.2-beta.6", + "@performant-software/shared-components": "^2.2.2-beta.7", + "@performant-software/geospatial": "^2.2.2-beta.7", "@peripleo/maplibre": "^0.5.2", "@peripleo/peripleo": "^0.5.2", "react": ">= 16.13.1 < 19.0.0", diff --git a/packages/geospatial/package.json b/packages/geospatial/package.json index ee081c41..155ed7bb 100644 --- a/packages/geospatial/package.json +++ b/packages/geospatial/package.json @@ -1,6 +1,6 @@ { "name": "@performant-software/geospatial", - "version": "2.2.2-beta.6", + "version": "2.2.2-beta.7", "description": "A package of components for all things map-related.", "license": "MIT", "main": "./dist/index.cjs.js", diff --git a/packages/semantic-ui/package.json b/packages/semantic-ui/package.json index a01659b7..71dc0ec5 100644 --- a/packages/semantic-ui/package.json +++ b/packages/semantic-ui/package.json @@ -1,6 +1,6 @@ { "name": "@performant-software/semantic-components", - "version": "2.2.2-beta.6", + "version": "2.2.2-beta.7", "description": "A package of shared components based on the Semantic UI Framework.", "license": "MIT", "main": "./dist/index.cjs.js", @@ -35,7 +35,7 @@ "zotero-translation-client": "^5.0.1" }, "peerDependencies": { - "@performant-software/shared-components": "^2.2.2-beta.6", + "@performant-software/shared-components": "^2.2.2-beta.7", "@samvera/clover-iiif": "^2.3.2", "react": ">= 16.13.1 < 19.0.0", "react-dnd": "^11.1.3", diff --git a/packages/shared/package.json b/packages/shared/package.json index ceec39af..be81b722 100644 --- a/packages/shared/package.json +++ b/packages/shared/package.json @@ -1,6 +1,6 @@ { "name": "@performant-software/shared-components", - "version": "2.2.2-beta.6", + "version": "2.2.2-beta.7", "description": "A package of shared, framework agnostic, components.", "license": "MIT", "main": "./dist/index.cjs.js", diff --git a/packages/user-defined-fields/package.json b/packages/user-defined-fields/package.json index 8c5411bf..2dd3b483 100644 --- a/packages/user-defined-fields/package.json +++ b/packages/user-defined-fields/package.json @@ -1,6 +1,6 @@ { "name": "@performant-software/user-defined-fields", - "version": "2.2.2-beta.6", + "version": "2.2.2-beta.7", "description": "A package of components used for allowing end users to define fields on models. Use with the \"user_defined_fields\" gem.", "license": "MIT", "main": "./dist/index.cjs.js", @@ -23,8 +23,8 @@ "underscore": "^1.13.2" }, "peerDependencies": { - "@performant-software/semantic-components": "^2.2.2-beta.6", - "@performant-software/shared-components": "^2.2.2-beta.6", + "@performant-software/semantic-components": "^2.2.2-beta.7", + "@performant-software/shared-components": "^2.2.2-beta.7", "react": ">= 16.13.1 < 19.0.0", "react-dom": ">= 16.13.1 < 19.0.0" }, diff --git a/packages/visualize/package.json b/packages/visualize/package.json index 8178ddfb..3d623326 100644 --- a/packages/visualize/package.json +++ b/packages/visualize/package.json @@ -1,6 +1,6 @@ { "name": "@performant-software/visualize", - "version": "2.2.2-beta.6", + "version": "2.2.2-beta.7", "description": "A package of components used for data visualization", "license": "MIT", "main": "./dist/index.cjs.js", diff --git a/react-components.json b/react-components.json index 29238912..936461bd 100644 --- a/react-components.json +++ b/react-components.json @@ -8,5 +8,5 @@ "packages/user-defined-fields", "packages/visualize" ], - "version": "2.2.2-beta.6" + "version": "2.2.2-beta.7" } From 6d3c7466a43bb431b07ce7351e92106fb086265d Mon Sep 17 00:00:00 2001 From: dleadbetter <> Date: Mon, 13 May 2024 11:28:25 -0400 Subject: [PATCH 18/22] CDC #157 - Adjusting DataTableColumnSelector to not add columns no longer included in props --- .../src/components/DataTableColumnSelector.js | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/packages/semantic-ui/src/components/DataTableColumnSelector.js b/packages/semantic-ui/src/components/DataTableColumnSelector.js index 6e82ffbd..5f4f4c0a 100644 --- a/packages/semantic-ui/src/components/DataTableColumnSelector.js +++ b/packages/semantic-ui/src/components/DataTableColumnSelector.js @@ -112,11 +112,15 @@ const useColumnSelector = (WrappedComponent: ComponentType) => ( }; } - // Iterate over the session columns to preserve the ordering - const columns = _.map(session.columns, (column) => ({ - ...(_.findWhere(props.columns, { name: column.name }) || {}), - ...column - })); + const columns = []; + + // Iterate over the session columns to preserve the ordering. + _.each(session.columns, (column) => { + const findColumn = _.findWhere(props.columns, { name: column.name }); + if (findColumn) { + columns.push({ ...findColumn, ...column }); + } + }); // Append any new columns not stored in the session const columnNames = _.pluck(columns, 'name'); From 71cbe9ab6b7dc20c564071dccd1b2af715789e7e Mon Sep 17 00:00:00 2001 From: dleadbetter <> Date: Mon, 13 May 2024 13:09:56 -0400 Subject: [PATCH 19/22] CDC #157 - Publishing v2.2.2-beta.8 --- packages/controlled-vocabulary/package.json | 6 +++--- packages/core-data/package.json | 6 +++--- packages/geospatial/package.json | 2 +- packages/semantic-ui/package.json | 4 ++-- packages/shared/package.json | 2 +- packages/user-defined-fields/package.json | 6 +++--- packages/visualize/package.json | 2 +- react-components.json | 2 +- 8 files changed, 15 insertions(+), 15 deletions(-) diff --git a/packages/controlled-vocabulary/package.json b/packages/controlled-vocabulary/package.json index f4f299db..fe62214d 100644 --- a/packages/controlled-vocabulary/package.json +++ b/packages/controlled-vocabulary/package.json @@ -1,6 +1,6 @@ { "name": "@performant-software/controlled-vocabulary", - "version": "2.2.2-beta.7", + "version": "2.2.2-beta.8", "description": "A package of components to allow user to configure dropdown elements. Use with the \"controlled_vocabulary\" gem.", "license": "MIT", "main": "./dist/index.cjs.js", @@ -23,8 +23,8 @@ "underscore": "^1.13.2" }, "peerDependencies": { - "@performant-software/semantic-components": "^2.2.2-beta.7", - "@performant-software/shared-components": "^2.2.2-beta.7", + "@performant-software/semantic-components": "^2.2.2-beta.8", + "@performant-software/shared-components": "^2.2.2-beta.8", "react": ">= 16.13.1 < 19.0.0", "react-dom": ">= 16.13.1 < 19.0.0" }, diff --git a/packages/core-data/package.json b/packages/core-data/package.json index 5d56f388..f7a515bc 100644 --- a/packages/core-data/package.json +++ b/packages/core-data/package.json @@ -1,6 +1,6 @@ { "name": "@performant-software/core-data", - "version": "2.2.2-beta.7", + "version": "2.2.2-beta.8", "description": "A package of components used with the Core Data platform.", "license": "MIT", "main": "./dist/index.cjs.js", @@ -37,8 +37,8 @@ "underscore": "^1.13.2" }, "peerDependencies": { - "@performant-software/shared-components": "^2.2.2-beta.7", - "@performant-software/geospatial": "^2.2.2-beta.7", + "@performant-software/shared-components": "^2.2.2-beta.8", + "@performant-software/geospatial": "^2.2.2-beta.8", "@peripleo/maplibre": "^0.5.2", "@peripleo/peripleo": "^0.5.2", "react": ">= 16.13.1 < 19.0.0", diff --git a/packages/geospatial/package.json b/packages/geospatial/package.json index 155ed7bb..1e6afeea 100644 --- a/packages/geospatial/package.json +++ b/packages/geospatial/package.json @@ -1,6 +1,6 @@ { "name": "@performant-software/geospatial", - "version": "2.2.2-beta.7", + "version": "2.2.2-beta.8", "description": "A package of components for all things map-related.", "license": "MIT", "main": "./dist/index.cjs.js", diff --git a/packages/semantic-ui/package.json b/packages/semantic-ui/package.json index 71dc0ec5..969d2703 100644 --- a/packages/semantic-ui/package.json +++ b/packages/semantic-ui/package.json @@ -1,6 +1,6 @@ { "name": "@performant-software/semantic-components", - "version": "2.2.2-beta.7", + "version": "2.2.2-beta.8", "description": "A package of shared components based on the Semantic UI Framework.", "license": "MIT", "main": "./dist/index.cjs.js", @@ -35,7 +35,7 @@ "zotero-translation-client": "^5.0.1" }, "peerDependencies": { - "@performant-software/shared-components": "^2.2.2-beta.7", + "@performant-software/shared-components": "^2.2.2-beta.8", "@samvera/clover-iiif": "^2.3.2", "react": ">= 16.13.1 < 19.0.0", "react-dnd": "^11.1.3", diff --git a/packages/shared/package.json b/packages/shared/package.json index be81b722..4f13ca73 100644 --- a/packages/shared/package.json +++ b/packages/shared/package.json @@ -1,6 +1,6 @@ { "name": "@performant-software/shared-components", - "version": "2.2.2-beta.7", + "version": "2.2.2-beta.8", "description": "A package of shared, framework agnostic, components.", "license": "MIT", "main": "./dist/index.cjs.js", diff --git a/packages/user-defined-fields/package.json b/packages/user-defined-fields/package.json index 2dd3b483..9037cdd6 100644 --- a/packages/user-defined-fields/package.json +++ b/packages/user-defined-fields/package.json @@ -1,6 +1,6 @@ { "name": "@performant-software/user-defined-fields", - "version": "2.2.2-beta.7", + "version": "2.2.2-beta.8", "description": "A package of components used for allowing end users to define fields on models. Use with the \"user_defined_fields\" gem.", "license": "MIT", "main": "./dist/index.cjs.js", @@ -23,8 +23,8 @@ "underscore": "^1.13.2" }, "peerDependencies": { - "@performant-software/semantic-components": "^2.2.2-beta.7", - "@performant-software/shared-components": "^2.2.2-beta.7", + "@performant-software/semantic-components": "^2.2.2-beta.8", + "@performant-software/shared-components": "^2.2.2-beta.8", "react": ">= 16.13.1 < 19.0.0", "react-dom": ">= 16.13.1 < 19.0.0" }, diff --git a/packages/visualize/package.json b/packages/visualize/package.json index 3d623326..d426b413 100644 --- a/packages/visualize/package.json +++ b/packages/visualize/package.json @@ -1,6 +1,6 @@ { "name": "@performant-software/visualize", - "version": "2.2.2-beta.7", + "version": "2.2.2-beta.8", "description": "A package of components used for data visualization", "license": "MIT", "main": "./dist/index.cjs.js", diff --git a/react-components.json b/react-components.json index 936461bd..5f2acf0a 100644 --- a/react-components.json +++ b/react-components.json @@ -8,5 +8,5 @@ "packages/user-defined-fields", "packages/visualize" ], - "version": "2.2.2-beta.7" + "version": "2.2.2-beta.8" } From f72f9c28bfe05ca7c1d960c09e4d8c6d136fedfc Mon Sep 17 00:00:00 2001 From: dleadbetter <> Date: Tue, 14 May 2024 09:43:03 -0400 Subject: [PATCH 20/22] CDC #157 - Adding "dimmable" prop to ItemList component --- packages/semantic-ui/src/components/ItemList.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/packages/semantic-ui/src/components/ItemList.js b/packages/semantic-ui/src/components/ItemList.js index de5c9b76..76ddb7d3 100644 --- a/packages/semantic-ui/src/components/ItemList.js +++ b/packages/semantic-ui/src/components/ItemList.js @@ -15,6 +15,11 @@ type Sort = { }; type Props = DataListProps & ItemsProps & { + /** + * If `true`, a dimmer will be displayed over the list component. + */ + dimmable?: boolean, + /** * Callback fired when the sort dropdown is changed. This prop is provided by the DataList * higher-order component. @@ -94,7 +99,7 @@ const ItemList = useDataList((props: Props) => { return ( <> { }); ItemList.defaultProps = { + dimmable: true, filters: {}, searchable: true, }; From f2c48fd38a187459d1dc9827a0edbc514d6f78d9 Mon Sep 17 00:00:00 2001 From: dleadbetter <> Date: Tue, 14 May 2024 13:27:50 -0400 Subject: [PATCH 21/22] CDC #157 - Publishing v2.2.2-beta.9 --- packages/controlled-vocabulary/package.json | 6 +++--- packages/core-data/package.json | 6 +++--- packages/geospatial/package.json | 2 +- packages/semantic-ui/package.json | 4 ++-- packages/shared/package.json | 2 +- packages/user-defined-fields/package.json | 6 +++--- packages/visualize/package.json | 2 +- react-components.json | 2 +- 8 files changed, 15 insertions(+), 15 deletions(-) diff --git a/packages/controlled-vocabulary/package.json b/packages/controlled-vocabulary/package.json index fe62214d..4441dba1 100644 --- a/packages/controlled-vocabulary/package.json +++ b/packages/controlled-vocabulary/package.json @@ -1,6 +1,6 @@ { "name": "@performant-software/controlled-vocabulary", - "version": "2.2.2-beta.8", + "version": "2.2.2-beta.9", "description": "A package of components to allow user to configure dropdown elements. Use with the \"controlled_vocabulary\" gem.", "license": "MIT", "main": "./dist/index.cjs.js", @@ -23,8 +23,8 @@ "underscore": "^1.13.2" }, "peerDependencies": { - "@performant-software/semantic-components": "^2.2.2-beta.8", - "@performant-software/shared-components": "^2.2.2-beta.8", + "@performant-software/semantic-components": "^2.2.2-beta.9", + "@performant-software/shared-components": "^2.2.2-beta.9", "react": ">= 16.13.1 < 19.0.0", "react-dom": ">= 16.13.1 < 19.0.0" }, diff --git a/packages/core-data/package.json b/packages/core-data/package.json index f7a515bc..915725bd 100644 --- a/packages/core-data/package.json +++ b/packages/core-data/package.json @@ -1,6 +1,6 @@ { "name": "@performant-software/core-data", - "version": "2.2.2-beta.8", + "version": "2.2.2-beta.9", "description": "A package of components used with the Core Data platform.", "license": "MIT", "main": "./dist/index.cjs.js", @@ -37,8 +37,8 @@ "underscore": "^1.13.2" }, "peerDependencies": { - "@performant-software/shared-components": "^2.2.2-beta.8", - "@performant-software/geospatial": "^2.2.2-beta.8", + "@performant-software/shared-components": "^2.2.2-beta.9", + "@performant-software/geospatial": "^2.2.2-beta.9", "@peripleo/maplibre": "^0.5.2", "@peripleo/peripleo": "^0.5.2", "react": ">= 16.13.1 < 19.0.0", diff --git a/packages/geospatial/package.json b/packages/geospatial/package.json index 1e6afeea..09e367c9 100644 --- a/packages/geospatial/package.json +++ b/packages/geospatial/package.json @@ -1,6 +1,6 @@ { "name": "@performant-software/geospatial", - "version": "2.2.2-beta.8", + "version": "2.2.2-beta.9", "description": "A package of components for all things map-related.", "license": "MIT", "main": "./dist/index.cjs.js", diff --git a/packages/semantic-ui/package.json b/packages/semantic-ui/package.json index 969d2703..f0212303 100644 --- a/packages/semantic-ui/package.json +++ b/packages/semantic-ui/package.json @@ -1,6 +1,6 @@ { "name": "@performant-software/semantic-components", - "version": "2.2.2-beta.8", + "version": "2.2.2-beta.9", "description": "A package of shared components based on the Semantic UI Framework.", "license": "MIT", "main": "./dist/index.cjs.js", @@ -35,7 +35,7 @@ "zotero-translation-client": "^5.0.1" }, "peerDependencies": { - "@performant-software/shared-components": "^2.2.2-beta.8", + "@performant-software/shared-components": "^2.2.2-beta.9", "@samvera/clover-iiif": "^2.3.2", "react": ">= 16.13.1 < 19.0.0", "react-dnd": "^11.1.3", diff --git a/packages/shared/package.json b/packages/shared/package.json index 4f13ca73..7ab7f0fa 100644 --- a/packages/shared/package.json +++ b/packages/shared/package.json @@ -1,6 +1,6 @@ { "name": "@performant-software/shared-components", - "version": "2.2.2-beta.8", + "version": "2.2.2-beta.9", "description": "A package of shared, framework agnostic, components.", "license": "MIT", "main": "./dist/index.cjs.js", diff --git a/packages/user-defined-fields/package.json b/packages/user-defined-fields/package.json index 9037cdd6..206ca527 100644 --- a/packages/user-defined-fields/package.json +++ b/packages/user-defined-fields/package.json @@ -1,6 +1,6 @@ { "name": "@performant-software/user-defined-fields", - "version": "2.2.2-beta.8", + "version": "2.2.2-beta.9", "description": "A package of components used for allowing end users to define fields on models. Use with the \"user_defined_fields\" gem.", "license": "MIT", "main": "./dist/index.cjs.js", @@ -23,8 +23,8 @@ "underscore": "^1.13.2" }, "peerDependencies": { - "@performant-software/semantic-components": "^2.2.2-beta.8", - "@performant-software/shared-components": "^2.2.2-beta.8", + "@performant-software/semantic-components": "^2.2.2-beta.9", + "@performant-software/shared-components": "^2.2.2-beta.9", "react": ">= 16.13.1 < 19.0.0", "react-dom": ">= 16.13.1 < 19.0.0" }, diff --git a/packages/visualize/package.json b/packages/visualize/package.json index d426b413..e1129e23 100644 --- a/packages/visualize/package.json +++ b/packages/visualize/package.json @@ -1,6 +1,6 @@ { "name": "@performant-software/visualize", - "version": "2.2.2-beta.8", + "version": "2.2.2-beta.9", "description": "A package of components used for data visualization", "license": "MIT", "main": "./dist/index.cjs.js", diff --git a/react-components.json b/react-components.json index 5f2acf0a..7875d836 100644 --- a/react-components.json +++ b/react-components.json @@ -8,5 +8,5 @@ "packages/user-defined-fields", "packages/visualize" ], - "version": "2.2.2-beta.8" + "version": "2.2.2-beta.9" } From ff4834b544a9ec0cd4fa051dc0fd177700e4391c Mon Sep 17 00:00:00 2001 From: dleadbetter <> Date: Tue, 14 May 2024 14:24:15 -0400 Subject: [PATCH 22/22] CDC #157 - Publishing v2.2.2 --- packages/controlled-vocabulary/package.json | 6 +++--- packages/core-data/package.json | 6 +++--- packages/geospatial/package.json | 2 +- packages/semantic-ui/package.json | 4 ++-- packages/shared/package.json | 2 +- packages/user-defined-fields/package.json | 6 +++--- packages/visualize/package.json | 2 +- react-components.json | 2 +- 8 files changed, 15 insertions(+), 15 deletions(-) diff --git a/packages/controlled-vocabulary/package.json b/packages/controlled-vocabulary/package.json index 4441dba1..22c4ff8b 100644 --- a/packages/controlled-vocabulary/package.json +++ b/packages/controlled-vocabulary/package.json @@ -1,6 +1,6 @@ { "name": "@performant-software/controlled-vocabulary", - "version": "2.2.2-beta.9", + "version": "2.2.2", "description": "A package of components to allow user to configure dropdown elements. Use with the \"controlled_vocabulary\" gem.", "license": "MIT", "main": "./dist/index.cjs.js", @@ -23,8 +23,8 @@ "underscore": "^1.13.2" }, "peerDependencies": { - "@performant-software/semantic-components": "^2.2.2-beta.9", - "@performant-software/shared-components": "^2.2.2-beta.9", + "@performant-software/semantic-components": "^2.2.2", + "@performant-software/shared-components": "^2.2.2", "react": ">= 16.13.1 < 19.0.0", "react-dom": ">= 16.13.1 < 19.0.0" }, diff --git a/packages/core-data/package.json b/packages/core-data/package.json index 915725bd..844efab2 100644 --- a/packages/core-data/package.json +++ b/packages/core-data/package.json @@ -1,6 +1,6 @@ { "name": "@performant-software/core-data", - "version": "2.2.2-beta.9", + "version": "2.2.2", "description": "A package of components used with the Core Data platform.", "license": "MIT", "main": "./dist/index.cjs.js", @@ -37,8 +37,8 @@ "underscore": "^1.13.2" }, "peerDependencies": { - "@performant-software/shared-components": "^2.2.2-beta.9", - "@performant-software/geospatial": "^2.2.2-beta.9", + "@performant-software/shared-components": "^2.2.2", + "@performant-software/geospatial": "^2.2.2", "@peripleo/maplibre": "^0.5.2", "@peripleo/peripleo": "^0.5.2", "react": ">= 16.13.1 < 19.0.0", diff --git a/packages/geospatial/package.json b/packages/geospatial/package.json index 09e367c9..4d94cd76 100644 --- a/packages/geospatial/package.json +++ b/packages/geospatial/package.json @@ -1,6 +1,6 @@ { "name": "@performant-software/geospatial", - "version": "2.2.2-beta.9", + "version": "2.2.2", "description": "A package of components for all things map-related.", "license": "MIT", "main": "./dist/index.cjs.js", diff --git a/packages/semantic-ui/package.json b/packages/semantic-ui/package.json index f0212303..c8360851 100644 --- a/packages/semantic-ui/package.json +++ b/packages/semantic-ui/package.json @@ -1,6 +1,6 @@ { "name": "@performant-software/semantic-components", - "version": "2.2.2-beta.9", + "version": "2.2.2", "description": "A package of shared components based on the Semantic UI Framework.", "license": "MIT", "main": "./dist/index.cjs.js", @@ -35,7 +35,7 @@ "zotero-translation-client": "^5.0.1" }, "peerDependencies": { - "@performant-software/shared-components": "^2.2.2-beta.9", + "@performant-software/shared-components": "^2.2.2", "@samvera/clover-iiif": "^2.3.2", "react": ">= 16.13.1 < 19.0.0", "react-dnd": "^11.1.3", diff --git a/packages/shared/package.json b/packages/shared/package.json index 7ab7f0fa..1c3abfec 100644 --- a/packages/shared/package.json +++ b/packages/shared/package.json @@ -1,6 +1,6 @@ { "name": "@performant-software/shared-components", - "version": "2.2.2-beta.9", + "version": "2.2.2", "description": "A package of shared, framework agnostic, components.", "license": "MIT", "main": "./dist/index.cjs.js", diff --git a/packages/user-defined-fields/package.json b/packages/user-defined-fields/package.json index 206ca527..2fde1144 100644 --- a/packages/user-defined-fields/package.json +++ b/packages/user-defined-fields/package.json @@ -1,6 +1,6 @@ { "name": "@performant-software/user-defined-fields", - "version": "2.2.2-beta.9", + "version": "2.2.2", "description": "A package of components used for allowing end users to define fields on models. Use with the \"user_defined_fields\" gem.", "license": "MIT", "main": "./dist/index.cjs.js", @@ -23,8 +23,8 @@ "underscore": "^1.13.2" }, "peerDependencies": { - "@performant-software/semantic-components": "^2.2.2-beta.9", - "@performant-software/shared-components": "^2.2.2-beta.9", + "@performant-software/semantic-components": "^2.2.2", + "@performant-software/shared-components": "^2.2.2", "react": ">= 16.13.1 < 19.0.0", "react-dom": ">= 16.13.1 < 19.0.0" }, diff --git a/packages/visualize/package.json b/packages/visualize/package.json index e1129e23..2b86dd38 100644 --- a/packages/visualize/package.json +++ b/packages/visualize/package.json @@ -1,6 +1,6 @@ { "name": "@performant-software/visualize", - "version": "2.2.2-beta.9", + "version": "2.2.2", "description": "A package of components used for data visualization", "license": "MIT", "main": "./dist/index.cjs.js", diff --git a/react-components.json b/react-components.json index 7875d836..eb3b3601 100644 --- a/react-components.json +++ b/react-components.json @@ -8,5 +8,5 @@ "packages/user-defined-fields", "packages/visualize" ], - "version": "2.2.2-beta.9" + "version": "2.2.2" }