diff --git a/server-application-server/source/java/ch/systemsx/cisd/openbis/generic/server/dataaccess/db/HibernateSearchDAOV3Adaptor.java b/server-application-server/source/java/ch/systemsx/cisd/openbis/generic/server/dataaccess/db/HibernateSearchDAOV3Adaptor.java index ee950a9ec56f25a418d30def762506014ceffa79..9d2d3da1de4bce606b2e708272affa6dfa90a802 100644 --- a/server-application-server/source/java/ch/systemsx/cisd/openbis/generic/server/dataaccess/db/HibernateSearchDAOV3Adaptor.java +++ b/server-application-server/source/java/ch/systemsx/cisd/openbis/generic/server/dataaccess/db/HibernateSearchDAOV3Adaptor.java @@ -163,11 +163,20 @@ public class HibernateSearchDAOV3Adaptor implements IHibernateSearchDAO { Long registratorId =registratorIdByRecordIdentifierMap.get(matchingEntity.getIdentifier()); PersonPE registratorPersonPE = registratorsById.get(registratorId); Person registrator = new Person(); - registrator.setFirstName(registratorPersonPE.getFirstName()); - registrator.setLastName(registratorPersonPE.getLastName()); - registrator.setUserId(registratorPersonPE.getUserId()); - registrator.setEmail(registratorPersonPE.getEmail()); - registrator.setActive(registratorPersonPE.isActive()); + if (registratorPersonPE == null) + { + registrator.setFirstName("Missing"); + registrator.setLastName("Missing"); + registrator.setUserId("system"); + registrator.setEmail(""); + registrator.setActive(false); + } else { + registrator.setFirstName(registratorPersonPE.getFirstName()); + registrator.setLastName(registratorPersonPE.getLastName()); + registrator.setUserId(registratorPersonPE.getUserId()); + registrator.setEmail(registratorPersonPE.getEmail()); + registrator.setActive(registratorPersonPE.isActive()); + } matchingEntity.setRegistrator(registrator); } diff --git a/ui-admin/src/js/common/date.js b/ui-admin/src/js/common/date.js index 9f12472b5ffb8e8402d7bb088b37fb2e65f0cd98..472345695e25f601adbaea1340e969640ac9b449 100644 --- a/ui-admin/src/js/common/date.js +++ b/ui-admin/src/js/common/date.js @@ -8,7 +8,7 @@ const MILLIS_PER_DAY = 24 * MILLIS_PER_HOUR const MILLIS_PER_YEAR = 365 * MILLIS_PER_DAY function format(value) { - if (value === null) { + if (_.isNil(value)) { return '' } @@ -56,13 +56,24 @@ function duration(millis) { function inRange(value, from, to) { if (from || to) { - if (value === null || value === undefined) { + if (_.isNil(value)) { return false } - if (from && value.getTime() < from.getTime()) { + + var time = null + + if (_.isNumber(value)) { + time = value + } else if (_.isDate(value)) { + time = value.getTime() + } else { + return false + } + + if (from && time < from.getTime()) { return false } - if (to && value.getTime() > to.getTime()) { + if (to && time > to.getTime()) { return false } } diff --git a/ui-admin/src/js/common/messages.js b/ui-admin/src/js/common/messages.js index a50f1b8254687c532a985020b82aea36988c1485..ced3007384999ef4133b9fe0a5ea35b2a7eaa89c 100644 --- a/ui-admin/src/js/common/messages.js +++ b/ui-admin/src/js/common/messages.js @@ -141,6 +141,7 @@ const keys = { MATERIAL_TYPES: 'MATERIAL_TYPES', META_DATA: 'META_DATA', MINUTE_OR_MINUTES: 'MINUTE_OR_MINUTES', + MODIFICATION_DATE: 'MODIFICATION_DATE', MORE: 'MORE', NAME: 'NAME', NEW_COLLECTION_TYPE: 'NEW_COLLECTION_TYPE', @@ -436,6 +437,7 @@ const messages_en = { [keys.MATERIAL_TYPE]: 'Material Type', [keys.META_DATA]: 'Meta Data', [keys.MORE]: 'More', + [keys.MODIFICATION_DATE]: 'Modification Date', [keys.MINUTE_OR_MINUTES]: '${0} minute(s)', [keys.NAME]: 'Name', [keys.NEW_COLLECTION_TYPE]: 'New Collection Type', diff --git a/ui-admin/src/js/components/common/grid/GridUtil.js b/ui-admin/src/js/components/common/grid/GridUtil.js new file mode 100644 index 0000000000000000000000000000000000000000..26f4a454b4b664f1ac1e7504fcdc7416ca0977c6 --- /dev/null +++ b/ui-admin/src/js/components/common/grid/GridUtil.js @@ -0,0 +1,73 @@ +import _ from 'lodash' +import React from 'react' +import UserLink from '@src/js/components/common/link/UserLink.jsx' +import DateRangeField from '@src/js/components/common/form/DateRangeField.jsx' +import date from '@src/js/common/date.js' +import messages from '@src/js/common/messages.js' + +function userColumn(params) { + return { + ...params, + getValue: ({ row }) => _.get(row, params.path), + renderValue: ({ value }) => { + return <UserLink userId={value} /> + } + } +} + +function registratorColumn(params) { + return userColumn({ + ...params, + name: 'registrator', + label: messages.get(messages.REGISTRATOR), + path: params.path + }) +} + +function dateColumn(params) { + return { + ...params, + getValue: ({ row }) => _.get(row, params.path), + renderValue: ({ value }) => date.format(value), + renderFilter: ({ value, onChange }) => { + return ( + <DateRangeField value={value} variant='standard' onChange={onChange} /> + ) + }, + matchesValue: ({ value, filter, defaultMatches }) => { + if (_.isString(filter)) { + return defaultMatches(value, filter) + } else { + return date.inRange( + value, + filter.from ? filter.from.dateObject : null, + filter.to ? filter.to.dateObject : null + ) + } + } + } +} + +function registrationDateColumn(params) { + return dateColumn({ + ...params, + name: 'registrationDate', + label: messages.get(messages.REGISTRATION_DATE) + }) +} + +function modificationDateColumn(params) { + return dateColumn({ + ...params, + name: 'modificationDate', + label: messages.get(messages.MODIFICATION_DATE) + }) +} + +export default { + userColumn, + registratorColumn, + dateColumn, + registrationDateColumn, + modificationDateColumn +} diff --git a/ui-admin/src/js/components/database/browser/DatabaseBrowserCommon.js b/ui-admin/src/js/components/database/browser/DatabaseBrowserCommon.js index e8e452078ec4c44a6aed45b59712973b77a7c902..c147e29d23a619fea6868189df2412fdb5cb1fdd 100644 --- a/ui-admin/src/js/components/database/browser/DatabaseBrowserCommon.js +++ b/ui-admin/src/js/components/database/browser/DatabaseBrowserCommon.js @@ -1,4 +1,3 @@ -import BrowserCommon from '@src/js/components/common/browser/BrowserCommon.js' import objectType from '@src/js/common/consts/objectType.js' import messages from '@src/js/common/messages.js' diff --git a/ui-admin/src/js/components/tools/common/HistoryGrid.jsx b/ui-admin/src/js/components/tools/common/HistoryGrid.jsx index 05955d098395a31fcb79767f364a92ad4b4ae73e..a25bd0c7fcdecfa493890d6ef64e1e5ae71149f5 100644 --- a/ui-admin/src/js/components/tools/common/HistoryGrid.jsx +++ b/ui-admin/src/js/components/tools/common/HistoryGrid.jsx @@ -4,9 +4,8 @@ import autoBind from 'auto-bind' import GridWithOpenbis from '@src/js/components/common/grid/GridWithOpenbis.jsx' import GridExportOptions from '@src/js/components/common/grid/GridExportOptions.js' import GridFilterOptions from '@src/js/components/common/grid/GridFilterOptions.js' -import UserLink from '@src/js/components/common/link/UserLink.jsx' +import GridUtil from '@src/js/components/common/grid/GridUtil.js' import SelectField from '@src/js/components/common/form/SelectField.jsx' -import DateRangeField from '@src/js/components/common/form/DateRangeField.jsx' import FormUtil from '@src/js/components/common/form/FormUtil.js' import EntityType from '@src/js/components/common/dto/EntityType.js' import HistoryGridContentCell from '@src/js/components/tools/common/HistoryGridContentCell.jsx' @@ -162,28 +161,18 @@ class HistoryGrid extends React.PureComponent { sortable: false, getValue: ({ row }) => row.entityProject.value }, - { + GridUtil.userColumn({ name: 'entityRegistrator', label: messages.get(messages.ENTITY_REGISTRATOR), - sortable: false, - getValue: ({ row }) => row.entityRegistrator.value - }, - { + path: 'entityRegistrator.value', + sortable: false + }), + GridUtil.dateColumn({ name: 'entityRegistrationDate', label: messages.get(messages.ENTITY_REGISTRATION_DATE), - sortable: false, - getValue: ({ row }) => - date.format(row.entityRegistrationDate.value), - renderFilter: ({ value, onChange }) => { - return ( - <DateRangeField - value={value} - variant='standard' - onChange={onChange} - /> - ) - } - }, + path: 'entityRegistrationDate.value', + sortable: false + }), { name: 'reason', label: messages.get(messages.REASON), @@ -206,30 +195,11 @@ class HistoryGrid extends React.PureComponent { return <HistoryGridContentCell value={value} /> } }, - { - name: 'registrator', - label: messages.get(messages.USER), - sortable: false, - getValue: ({ row }) => row.registrator.value, - renderValue: ({ value }) => { - return <UserLink userId={value} /> - } - }, - { - name: 'registrationDate', - label: messages.get(messages.DATE), - sortable: true, - getValue: ({ row }) => date.format(row.registrationDate.value), - renderFilter: ({ value, onChange }) => { - return ( - <DateRangeField - value={value} - variant='standard' - onChange={onChange} - /> - ) - } - } + GridUtil.registratorColumn({ + path: 'registrator.value', + sortable: false + }), + GridUtil.registrationDateColumn({ path: 'registrationDate.value' }) ]} loadRows={this.load} sort='registrationDate' diff --git a/ui-admin/src/js/components/tools/common/PersonalAccessTokensGrid.jsx b/ui-admin/src/js/components/tools/common/PersonalAccessTokensGrid.jsx index 6591ac446bf8d1414388d7ad04cd439854168eed..d81279073e2b8ce45f05bf94abafe7615d5f8a6c 100644 --- a/ui-admin/src/js/components/tools/common/PersonalAccessTokensGrid.jsx +++ b/ui-admin/src/js/components/tools/common/PersonalAccessTokensGrid.jsx @@ -2,9 +2,8 @@ import _ from 'lodash' import React from 'react' import GridWithOpenbis from '@src/js/components/common/grid/GridWithOpenbis.jsx' import GridExportOptions from '@src/js/components/common/grid/GridExportOptions.js' -import DateRangeField from '@src/js/components/common/form/DateRangeField.jsx' +import GridUtil from '@src/js/components/common/grid/GridUtil.js' import SelectField from '@src/js/components/common/form/SelectField.jsx' -import UserLink from '@src/js/components/common/link/UserLink.jsx' import Message from '@src/js/components/common/form/Message.jsx' import ServerInformation from '@src/js/components/common/dto/ServerInformation.js' import AppController from '@src/js/components/AppController.js' @@ -41,14 +40,11 @@ class PersonalAccessTokensGrid extends React.PureComponent { getValue: ({ row }) => row.hash.value, nowrap: true }, - { + GridUtil.userColumn({ name: 'owner', label: messages.get(messages.OWNER), - getValue: ({ row }) => row.owner.value, - renderValue: ({ value }) => { - return <UserLink userId={value} /> - } - }, + path: 'owner.value' + }), { name: 'sessionName', label: messages.get(messages.SESSION_NAME), @@ -67,8 +63,16 @@ class PersonalAccessTokensGrid extends React.PureComponent { } } }, - dateColumn('validFromDate', messages.get(messages.VALID_FROM)), - dateColumn('validToDate', messages.get(messages.VALID_TO)), + GridUtil.dateColumn({ + name: 'validFromDate', + label: messages.get(messages.VALID_FROM), + path: 'validFromDate.value.dateObject' + }), + GridUtil.dateColumn({ + name: 'validToDate', + label: messages.get(messages.VALID_TO), + path: 'validToDate.value.dateObject' + }), { name: 'validityPeriod', label: messages.get(messages.VALIDITY_PERIOD), @@ -231,19 +235,15 @@ class PersonalAccessTokensGrid extends React.PureComponent { }, nowrap: true }, - { - name: 'registrator', - label: messages.get(messages.REGISTRATOR), - getValue: ({ row }) => row.registrator.value, - renderValue: ({ value }) => { - return <UserLink userId={value} /> - } - }, - dateColumn( - 'registrationDate', - messages.get(messages.REGISTRATION_DATE) - ), - dateColumn('accessDate', messages.get(messages.ACCESS_DATE)) + GridUtil.dateColumn({ + name: 'accessDate', + label: messages.get(messages.ACCESS_DATE), + path: 'accessDate.value.dateObject' + }), + GridUtil.registratorColumn({ path: 'registrator.value' }), + GridUtil.registrationDateColumn({ + path: 'registrationDate.value.dateObject' + }) ]} rows={rows} sortings={[ @@ -263,30 +263,4 @@ class PersonalAccessTokensGrid extends React.PureComponent { } } -function dateColumn(name, message) { - return { - name: name, - label: message, - getValue: ({ row }) => { - return date.format(row[name].value ? row[name].value.dateObject : null) - }, - renderFilter: ({ value, onChange }) => { - return ( - <DateRangeField value={value} variant='standard' onChange={onChange} /> - ) - }, - matchesValue: ({ row, value, filter, defaultMatches }) => { - if (_.isString(filter)) { - return defaultMatches(value, filter) - } else { - return date.inRange( - row[name].value ? row[name].value.dateObject : null, - filter.from ? filter.from.dateObject : null, - filter.to ? filter.to.dateObject : null - ) - } - } - } -} - export default PersonalAccessTokensGrid diff --git a/ui-admin/src/js/components/tools/common/PluginsGrid.jsx b/ui-admin/src/js/components/tools/common/PluginsGrid.jsx index 823b9a90eb018778a1fd1b356b0ef95267423fb3..15320be72bc6e582250d60b5e6f1850a156e7cae 100644 --- a/ui-admin/src/js/components/tools/common/PluginsGrid.jsx +++ b/ui-admin/src/js/components/tools/common/PluginsGrid.jsx @@ -1,8 +1,8 @@ import React from 'react' import GridWithOpenbis from '@src/js/components/common/grid/GridWithOpenbis.jsx' import GridExportOptions from '@src/js/components/common/grid/GridExportOptions.js' +import GridUtil from '@src/js/components/common/grid/GridUtil.js' import PluginLink from '@src/js/components/common/link/PluginLink.jsx' -import UserLink from '@src/js/components/common/link/UserLink.jsx' import EntityKind from '@src/js/components/common/dto/EntityKind.js' import openbis from '@src/js/services/openbis.js' import messages from '@src/js/common/messages.js' @@ -61,14 +61,8 @@ class PluginsGrid extends React.PureComponent { : '(' + messages.get(messages.ALL) + ')' } }, - { - name: 'registrator', - label: messages.get(messages.REGISTRATOR), - getValue: ({ row }) => row.registrator.value, - renderValue: ({ value }) => { - return <UserLink userId={value} /> - } - } + GridUtil.registratorColumn({ path: 'registrator.value' }), + GridUtil.registrationDateColumn({ path: 'registrationDate.value' }) ]} rows={rows} exportable={this.getExportable()} diff --git a/ui-admin/src/js/components/tools/common/QueriesGrid.jsx b/ui-admin/src/js/components/tools/common/QueriesGrid.jsx index c280fea6ebb05f56ed65d51b6a7d70e88b9a5d02..546cf1252c59c89909a08c4f16fe86a1f4d1ace1 100644 --- a/ui-admin/src/js/components/tools/common/QueriesGrid.jsx +++ b/ui-admin/src/js/components/tools/common/QueriesGrid.jsx @@ -1,8 +1,8 @@ import React from 'react' import GridWithOpenbis from '@src/js/components/common/grid/GridWithOpenbis.jsx' import GridExportOptions from '@src/js/components/common/grid/GridExportOptions.js' +import GridUtil from '@src/js/components/common/grid/GridUtil.js' import QueryLink from '@src/js/components/common/link/QueryLink.jsx' -import UserLink from '@src/js/components/common/link/UserLink.jsx' import QueryType from '@src/js/components/common/dto/QueryType.js' import messages from '@src/js/common/messages.js' import logger from '@src/js/common/logger.js' @@ -55,14 +55,8 @@ class QueriesGrid extends React.PureComponent { label: messages.get(messages.PUBLIC), getValue: ({ row }) => row.publicFlag.value }, - { - name: 'registrator', - label: messages.get(messages.REGISTRATOR), - getValue: ({ row }) => row.registrator.value, - renderValue: ({ value }) => { - return <UserLink userId={value} /> - } - } + GridUtil.registratorColumn({ path: 'registrator.value' }), + GridUtil.registrationDateColumn({ path: 'registrationDate.value' }) ]} rows={rows} exportable={{ diff --git a/ui-admin/src/js/components/tools/search/ToolSearch.jsx b/ui-admin/src/js/components/tools/search/ToolSearch.jsx index d163ea3f000d69842425aa5868900ec2bdbb47dc..60712c8a7da57a4e87f9f239bcddcb6bc976ec56 100644 --- a/ui-admin/src/js/components/tools/search/ToolSearch.jsx +++ b/ui-admin/src/js/components/tools/search/ToolSearch.jsx @@ -115,6 +115,9 @@ class ToolSearch extends React.Component { script: FormUtil.createField({ value: _.get(plugin, 'script') }), registrator: FormUtil.createField({ value: _.get(plugin, 'registrator.userId') + }), + registrationDate: FormUtil.createField({ + value: _.get(plugin, 'registrationDate') }) } }) @@ -158,6 +161,9 @@ class ToolSearch extends React.Component { }), registrator: FormUtil.createField({ value: _.get(query, 'registrator.userId') + }), + registrationDate: FormUtil.createField({ + value: _.get(query, 'registrationDate') }) })) diff --git a/ui-admin/src/js/components/types/common/EntityTypesGrid.jsx b/ui-admin/src/js/components/types/common/EntityTypesGrid.jsx index 0e4e388db2c307ed4f58912d6af2687f7c77f969..d7a0ebcfa1a6bd88e9a54270381ce0b44727ea89 100644 --- a/ui-admin/src/js/components/types/common/EntityTypesGrid.jsx +++ b/ui-admin/src/js/components/types/common/EntityTypesGrid.jsx @@ -1,5 +1,6 @@ import React from 'react' import GridWithOpenbis from '@src/js/components/common/grid/GridWithOpenbis.jsx' +import GridUtil from '@src/js/components/common/grid/GridUtil.js' import EntityTypeLink from '@src/js/components/common/link/EntityTypeLink.jsx' import PluginLink from '@src/js/components/common/link/PluginLink.jsx' import openbis from '@src/js/services/openbis.js' @@ -123,6 +124,8 @@ class EntityTypesGrid extends React.PureComponent { }) } + columns.push(GridUtil.modificationDateColumn({ path: 'modificationDate' })) + return columns } } diff --git a/ui-admin/src/js/components/types/common/PropertyTypesGrid.jsx b/ui-admin/src/js/components/types/common/PropertyTypesGrid.jsx index 9275a57b15e7a5cd3f6c97415553fee255b19db9..5d6dd88980cc9b588360216f369fd9342eb17f1e 100644 --- a/ui-admin/src/js/components/types/common/PropertyTypesGrid.jsx +++ b/ui-admin/src/js/components/types/common/PropertyTypesGrid.jsx @@ -1,6 +1,7 @@ import React from 'react' import GridWithOpenbis from '@src/js/components/common/grid/GridWithOpenbis.jsx' import GridExportOptions from '@src/js/components/common/grid/GridExportOptions.js' +import GridUtil from '@src/js/components/common/grid/GridUtil.js' import EntityTypeLink from '@src/js/components/common/link/EntityTypeLink.jsx' import VocabularyTypeLink from '@src/js/components/common/link/VocabularyTypeLink.jsx' import PropertyTypesGridUsagesCell from '@src/js/components/types/common/PropertyTypesGridUsagesCell.jsx' @@ -102,7 +103,9 @@ class PropertyTypesGrid extends React.PureComponent { renderValue: ({ row }) => { return <PropertyTypesGridUsagesCell value={row.usages} /> } - } + }, + GridUtil.registratorColumn({ path: 'registrator' }), + GridUtil.registrationDateColumn({ path: 'registrationDate' }) ]} rows={rows} sort='code' diff --git a/ui-admin/src/js/components/types/common/VocabularyTypesGrid.jsx b/ui-admin/src/js/components/types/common/VocabularyTypesGrid.jsx index 62019e7c0894bd74727e3d703412f0eb9c0b64e3..f05e5997b4e993015c88149c15ad930ceeaf4ccc 100644 --- a/ui-admin/src/js/components/types/common/VocabularyTypesGrid.jsx +++ b/ui-admin/src/js/components/types/common/VocabularyTypesGrid.jsx @@ -1,6 +1,7 @@ import React from 'react' import GridWithOpenbis from '@src/js/components/common/grid/GridWithOpenbis.jsx' import GridExportOptions from '@src/js/components/common/grid/GridExportOptions.js' +import GridUtil from '@src/js/components/common/grid/GridUtil.js' import VocabularyTypeLink from '@src/js/components/common/link/VocabularyTypeLink.jsx' import messages from '@src/js/common/messages.js' import logger from '@src/js/common/logger.js' @@ -36,7 +37,10 @@ class VocabularyTypesGrid extends React.PureComponent { name: 'urlTemplate', label: messages.get(messages.URL_TEMPLATE), getValue: ({ row }) => row.urlTemplate - } + }, + GridUtil.registratorColumn({ path: 'registrator' }), + GridUtil.registrationDateColumn({ path: 'registrationDate' }), + GridUtil.modificationDateColumn({ path: 'modificationDate' }) ]} rows={rows} sort='code' diff --git a/ui-admin/src/js/components/types/form/vocabularytype/VocabularyTypeForm.jsx b/ui-admin/src/js/components/types/form/vocabularytype/VocabularyTypeForm.jsx index d68bdd5a6dfeea1f82d91999af1373fd39dfbc4b..3c484b75698ebf249fcb2c2f365bc9e784951a11 100644 --- a/ui-admin/src/js/components/types/form/vocabularytype/VocabularyTypeForm.jsx +++ b/ui-admin/src/js/components/types/form/vocabularytype/VocabularyTypeForm.jsx @@ -5,6 +5,7 @@ import PageWithTwoPanels from '@src/js/components/common/page/PageWithTwoPanels. import GridWithOpenbis from '@src/js/components/common/grid/GridWithOpenbis.jsx' import GridExportOptions from '@src/js/components/common/grid/GridExportOptions.js' import GridContainer from '@src/js/components/common/grid/GridContainer.jsx' +import GridUtil from '@src/js/components/common/grid/GridUtil.js' import VocabularyTypeFormSelectionType from '@src/js/components/types/form/vocabularytype/VocabularyTypeFormSelectionType.js' import VocabularyTypeFormController from '@src/js/components/types/form/vocabularytype/VocabularyTypeFormController.js' import VocabularyTypeFormFacade from '@src/js/components/types/form/vocabularytype/VocabularyTypeFormFacade.js' @@ -34,7 +35,9 @@ const columns = [ name: 'official', label: messages.get(messages.OFFICIAL), getValue: ({ row }) => row.official.value - } + }, + GridUtil.registratorColumn({ path: 'registrator.value' }), + GridUtil.registrationDateColumn({ path: 'registrationDate.value' }) ] class VocabularyTypeForm extends React.PureComponent { diff --git a/ui-admin/src/js/components/types/form/vocabularytype/VocabularyTypeFormControllerAdd.js b/ui-admin/src/js/components/types/form/vocabularytype/VocabularyTypeFormControllerAdd.js index 187c7fa574a09c071fb69bd4088de684de89b8a5..511588bb7da277ead99701dcc9baaf7cf06f94b6 100644 --- a/ui-admin/src/js/components/types/form/vocabularytype/VocabularyTypeFormControllerAdd.js +++ b/ui-admin/src/js/components/types/form/vocabularytype/VocabularyTypeFormControllerAdd.js @@ -25,6 +25,10 @@ export default class VocabularyTypeFormControllerAdd { visible: false, enabled: false }), + registrationDate: FormUtil.createField({ + visible: false, + enabled: false + }), original: null } diff --git a/ui-admin/src/js/components/types/form/vocabularytype/VocabularyTypeFormControllerLoad.js b/ui-admin/src/js/components/types/form/vocabularytype/VocabularyTypeFormControllerLoad.js index da8af9ad50c96d7f55db8a15573760af82974308..11d10e69285864df28da908a403077e8e5ea75e1 100644 --- a/ui-admin/src/js/components/types/form/vocabularytype/VocabularyTypeFormControllerLoad.js +++ b/ui-admin/src/js/components/types/form/vocabularytype/VocabularyTypeFormControllerLoad.js @@ -112,6 +112,11 @@ export default class VocabularyTypeFormControllerLoad extends PageControllerLoad value: registrator, visible: false, enabled: false + }), + registrationDate: FormUtil.createField({ + value: _.get(loadedTerm, 'registrationDate', null), + visible: false, + enabled: false }) } term.original = _.cloneDeep(term) diff --git a/ui-admin/src/js/components/types/search/TypeSearch.jsx b/ui-admin/src/js/components/types/search/TypeSearch.jsx index 72987798c34b3d7d8d9c24bbaee2b6f4b1779bdd..7d70ec17d177663b617c683e5507c0cb7d0f41c7 100644 --- a/ui-admin/src/js/components/types/search/TypeSearch.jsx +++ b/ui-admin/src/js/components/types/search/TypeSearch.jsx @@ -83,7 +83,8 @@ class TypeSearch extends React.Component { subcodeUnique: _.get(object, 'subcodeUnique', false), autoGeneratedCode: _.get(object, 'autoGeneratedCode', false), generatedCodePrefix: _.get(object, 'generatedCodePrefix'), - validationPlugin: _.get(object, 'validationPlugin.name') + validationPlugin: _.get(object, 'validationPlugin.name'), + modificationDate: _.get(object, 'modificationDate') })) this.setState({ @@ -114,7 +115,8 @@ class TypeSearch extends React.Component { }, code: _.get(object, 'code'), description: _.get(object, 'description'), - validationPlugin: _.get(object, 'validationPlugin.name') + validationPlugin: _.get(object, 'validationPlugin.name'), + modificationDate: _.get(object, 'modificationDate') })) this.setState({ @@ -148,7 +150,8 @@ class TypeSearch extends React.Component { validationPlugin: _.get(object, 'validationPlugin.name'), mainDataSetPattern: _.get(object, 'mainDataSetPattern'), mainDataSetPath: _.get(object, 'mainDataSetPath'), - disallowDeletion: _.get(object, 'disallowDeletion', false) + disallowDeletion: _.get(object, 'disallowDeletion', false), + modificationDate: _.get(object, 'modificationDate') })) this.setState({ @@ -175,7 +178,8 @@ class TypeSearch extends React.Component { id: _.get(object, 'code'), code: _.get(object, 'code'), description: _.get(object, 'description'), - validationPlugin: _.get(object, 'validationPlugin.name') + validationPlugin: _.get(object, 'validationPlugin.name'), + modificationDate: _.get(object, 'modificationDate') })) this.setState({ @@ -188,9 +192,12 @@ class TypeSearch extends React.Component { return } + const fo = new openbis.VocabularyFetchOptions() + fo.withRegistrator() + const result = await openbis.searchVocabularies( new openbis.VocabularySearchCriteria(), - new openbis.VocabularyFetchOptions() + fo ) const types = util @@ -203,7 +210,10 @@ class TypeSearch extends React.Component { }, code: object.code, description: object.description, - urlTemplate: object.urlTemplate + urlTemplate: object.urlTemplate, + registrator: _.get(object, 'registrator.userId'), + registrationDate: _.get(object, 'registrationDate'), + modificationDate: _.get(object, 'modificationDate') })) this.setState({ @@ -237,7 +247,9 @@ class TypeSearch extends React.Component { sampleType: _.get(object, 'sampleType.code'), schema: _.get(object, 'schema'), transformation: _.get(object, 'transformation'), - usages: _.get(propertyTypeUsages, object.code) + usages: _.get(propertyTypeUsages, object.code), + registrator: _.get(object, 'registrator.userId'), + registrationDate: _.get(object, 'registrationDate') })) this.setState({ @@ -250,6 +262,7 @@ class TypeSearch extends React.Component { fo.withVocabulary() fo.withMaterialType() fo.withSampleType() + fo.withRegistrator() const propertyTypes = await openbis.searchPropertyTypes( new openbis.PropertyTypeSearchCriteria(), diff --git a/ui-admin/src/js/components/users/common/RolesGrid.jsx b/ui-admin/src/js/components/users/common/RolesGrid.jsx index 9b5858e162f72b8a8ac347b820ea1ba01f335199..f3b06e4b0a6a1f796b5ee29792fc744da844b4cb 100644 --- a/ui-admin/src/js/components/users/common/RolesGrid.jsx +++ b/ui-admin/src/js/components/users/common/RolesGrid.jsx @@ -4,6 +4,7 @@ import autoBind from 'auto-bind' import { withStyles } from '@material-ui/core/styles' import GridWithOpenbis from '@src/js/components/common/grid/GridWithOpenbis.jsx' import GridExportOptions from '@src/js/components/common/grid/GridExportOptions.js' +import GridUtil from '@src/js/components/common/grid/GridUtil.js' import UserLink from '@src/js/components/common/link/UserLink.jsx' import UserGroupLink from '@src/js/components/common/link/UserGroupLink.jsx' import openbis from '@src/js/services/openbis.js' @@ -45,6 +46,8 @@ class RolesGrid extends React.PureComponent { throw 'Unsupported id: ' + id } + columnNames.push('registrator', 'registrationDate') + const columns = this.getColumns().filter( column => columnNames.indexOf(column.name) !== -1 ) @@ -236,7 +239,9 @@ class RolesGrid extends React.PureComponent { this.compareProjectValue(params)) ) } - } + }, + GridUtil.registratorColumn({ path: 'registrator.value' }), + GridUtil.registrationDateColumn({ path: 'registrationDate.value' }) ] } diff --git a/ui-admin/src/js/components/users/common/UserGroupsGrid.jsx b/ui-admin/src/js/components/users/common/UserGroupsGrid.jsx index 3420e7b6d6f44023d6c76032f4665e1be212fc72..d6b0a27d418b78247b561acda924d47f1974a57f 100644 --- a/ui-admin/src/js/components/users/common/UserGroupsGrid.jsx +++ b/ui-admin/src/js/components/users/common/UserGroupsGrid.jsx @@ -1,6 +1,7 @@ import React from 'react' import GridWithOpenbis from '@src/js/components/common/grid/GridWithOpenbis.jsx' import GridExportOptions from '@src/js/components/common/grid/GridExportOptions.js' +import GridUtil from '@src/js/components/common/grid/GridUtil.js' import UserGroupLink from '@src/js/components/common/link/UserGroupLink.jsx' import messages from '@src/js/common/messages.js' import logger from '@src/js/common/logger.js' @@ -36,7 +37,10 @@ export default class GroupsGrid extends React.PureComponent { name: 'description', label: messages.get(messages.DESCRIPTION), getValue: ({ row }) => row.description.value - } + }, + GridUtil.registratorColumn({ path: 'registrator.value' }), + GridUtil.registrationDateColumn({ path: 'registrationDate.value' }), + GridUtil.modificationDateColumn({ path: 'modificationDate.value' }) ]} rows={rows} exportable={{ diff --git a/ui-admin/src/js/components/users/common/UsersGrid.jsx b/ui-admin/src/js/components/users/common/UsersGrid.jsx index fc400039c7f571a613f81fa0dc252812aa3b36c7..9e6d92306ff1cf3eb57c9a60a4d160066c205f7c 100644 --- a/ui-admin/src/js/components/users/common/UsersGrid.jsx +++ b/ui-admin/src/js/components/users/common/UsersGrid.jsx @@ -4,7 +4,7 @@ import autoBind from 'auto-bind' import { withStyles } from '@material-ui/core/styles' import GridWithOpenbis from '@src/js/components/common/grid/GridWithOpenbis.jsx' import GridExportOptions from '@src/js/components/common/grid/GridExportOptions.js' -import UserLink from '@src/js/components/common/link/UserLink.jsx' +import GridUtil from '@src/js/components/common/grid/GridUtil.js' import messages from '@src/js/common/messages.js' import logger from '@src/js/common/logger.js' @@ -30,14 +30,11 @@ class UsersGrid extends React.PureComponent { header={messages.get(messages.USERS)} sort='userId' columns={[ - { + GridUtil.userColumn({ name: 'userId', label: messages.get(messages.USER_ID), - getValue: ({ row }) => row.userId.value, - renderValue: ({ value }) => { - return <UserLink userId={value} /> - } - }, + path: 'userId.value' + }), { name: 'firstName', label: messages.get(messages.FIRST_NAME), @@ -63,7 +60,9 @@ class UsersGrid extends React.PureComponent { name: 'active', label: messages.get(messages.ACTIVE), getValue: ({ row }) => row.active.value - } + }, + GridUtil.registratorColumn({ path: 'registrator.value' }), + GridUtil.registrationDateColumn({ path: 'registrationDate.value' }) ]} rows={rows} exportable={{ diff --git a/ui-admin/src/js/components/users/form/common/RoleControllerAdd.js b/ui-admin/src/js/components/users/form/common/RoleControllerAdd.js index 0dbd7eff97195f61b46e6df401f3fac1a65c9bd8..fcfc754f845ceb105f6671097df1a9710524996d 100644 --- a/ui-admin/src/js/components/users/form/common/RoleControllerAdd.js +++ b/ui-admin/src/js/components/users/form/common/RoleControllerAdd.js @@ -27,6 +27,12 @@ export default class RoleControllerAdd { role: FormUtil.createField({ visible: false }), + registrator: FormUtil.createField({ + visible: false + }), + registrationDate: FormUtil.createField({ + visible: false + }), original: null } diff --git a/ui-admin/src/js/components/users/form/common/RoleControllerLoad.js b/ui-admin/src/js/components/users/form/common/RoleControllerLoad.js index 13b5ec3729f6bc95eea5b1514e5a873a5b5e2c7c..f85051d21ff57ab1f4ddcb8809e47e1e23b84502 100644 --- a/ui-admin/src/js/components/users/form/common/RoleControllerLoad.js +++ b/ui-admin/src/js/components/users/form/common/RoleControllerLoad.js @@ -52,6 +52,12 @@ export default class RoleControllerLoad { role: FormUtil.createField({ value: _.get(loadedRole, 'role', null), enabled: inheritedFrom === null + }), + registrator: FormUtil.createField({ + value: _.get(loadedRole, 'registrator.userId', null) + }), + registrationDate: FormUtil.createField({ + value: _.get(loadedRole, 'registrationDate', null) }) } role.original = _.cloneDeep(role) diff --git a/ui-admin/src/js/components/users/form/user/UserFormControllerAddGroup.js b/ui-admin/src/js/components/users/form/user/UserFormControllerAddGroup.js index b6faae8702d17cefae36d5f02c6233b39319e573..077602a9d35643ccf5d849a190ca24cc99c88561 100644 --- a/ui-admin/src/js/components/users/form/user/UserFormControllerAddGroup.js +++ b/ui-admin/src/js/components/users/form/user/UserFormControllerAddGroup.js @@ -16,6 +16,9 @@ export default class UserFormControllerAddGroup { id: _.uniqueId('group-'), code: FormUtil.createField({}), description: FormUtil.createField({}), + registrator: FormUtil.createField({}), + registrationDate: FormUtil.createField({}), + modificationDate: FormUtil.createField({}), original: null } diff --git a/ui-admin/src/js/components/users/form/user/UserFormControllerChange.js b/ui-admin/src/js/components/users/form/user/UserFormControllerChange.js index ff24b4716079edae502f961cb7ee18f5904052bc..78ade47d241fce3196fa026175b6f63bb962d8ce 100644 --- a/ui-admin/src/js/components/users/form/user/UserFormControllerChange.js +++ b/ui-admin/src/js/components/users/form/user/UserFormControllerChange.js @@ -75,6 +75,20 @@ export default class UserFormControllerChange extends PageControllerChange { description: { ...newGroup.description, value: groupDefinition.description + }, + registrator: { + ...newGroup.registrator, + value: groupDefinition.registrator + ? groupDefinition.registrator.userId + : null + }, + registrationDate: { + ...newGroup.registrationDate, + value: groupDefinition.registrationDate + }, + modificationDate: { + ...newGroup.modificationDate, + value: groupDefinition.modificationDate } }) diff --git a/ui-admin/src/js/components/users/form/user/UserFormControllerLoad.js b/ui-admin/src/js/components/users/form/user/UserFormControllerLoad.js index c03014d728c29050fc0f11f43e9d16579a0f0e5c..93ef5843c16b98e208c45be449ab95e9e7d4c622 100644 --- a/ui-admin/src/js/components/users/form/user/UserFormControllerLoad.js +++ b/ui-admin/src/js/components/users/form/user/UserFormControllerLoad.js @@ -127,6 +127,15 @@ export default class UserFormControllerLoad extends PageControllerLoad { }), description: FormUtil.createField({ value: _.get(loadedGroup, 'description', null) + }), + registrator: FormUtil.createField({ + value: _.get(loadedGroup, 'registrator.userId', null) + }), + registrationDate: FormUtil.createField({ + value: _.get(loadedGroup, 'registrationDate', null) + }), + modificationDate: FormUtil.createField({ + value: _.get(loadedGroup, 'modificationDate', null) }) } group.original = _.cloneDeep(group) diff --git a/ui-admin/src/js/components/users/form/user/UserFormControllerRecalculateInheritedRoles.js b/ui-admin/src/js/components/users/form/user/UserFormControllerRecalculateInheritedRoles.js index 15f3642045b7dbfeb99dc727236b0c5e2ab8cee3..dfbc544ea891aaf9edf0b3a8b92b34a614eb22b1 100644 --- a/ui-admin/src/js/components/users/form/user/UserFormControllerRecalculateInheritedRoles.js +++ b/ui-admin/src/js/components/users/form/user/UserFormControllerRecalculateInheritedRoles.js @@ -60,6 +60,14 @@ export default class UserFormControllerRecalculateInheritedRoles { role: FormUtil.createField({ value: _.get(roleDefinition, 'role'), enabled: false + }), + registrator: FormUtil.createField({ + value: _.get(roleDefinition, 'registrator.userId'), + enabled: false + }), + registrationDate: FormUtil.createField({ + value: _.get(roleDefinition, 'registrationDate'), + enabled: false }) } diff --git a/ui-admin/src/js/components/users/form/user/UserFormFacade.js b/ui-admin/src/js/components/users/form/user/UserFormFacade.js index 6a069b96ffb5eb5f034ed1696c6ef1c9b6a4e02b..a89e689bd5d5c1ccee9b8106fe6c0970ef2b3914 100644 --- a/ui-admin/src/js/components/users/form/user/UserFormFacade.js +++ b/ui-admin/src/js/components/users/form/user/UserFormFacade.js @@ -8,6 +8,7 @@ export default class UserFormFacade { fo.withRoleAssignments().withAuthorizationGroup() fo.withRoleAssignments().withSpace() fo.withRoleAssignments().withProject().withSpace() + fo.withRoleAssignments().withRegistrator() return openbis.getPersons([id], fo).then(map => { return map[userId] }) @@ -17,9 +18,11 @@ export default class UserFormFacade { const criteria = new openbis.AuthorizationGroupSearchCriteria() const fo = new openbis.AuthorizationGroupFetchOptions() fo.withUsers() + fo.withRegistrator() fo.withRoleAssignments().withAuthorizationGroup() fo.withRoleAssignments().withSpace() fo.withRoleAssignments().withProject().withSpace() + fo.withRoleAssignments().withRegistrator() return openbis.searchAuthorizationGroups(criteria, fo).then(result => { return result.getObjects().filter(group => { return group.getUsers().some(user => { @@ -32,9 +35,11 @@ export default class UserFormFacade { async loadGroups() { const criteria = new openbis.AuthorizationGroupSearchCriteria() const fo = new openbis.AuthorizationGroupFetchOptions() + fo.withRegistrator() fo.withRoleAssignments().withAuthorizationGroup() fo.withRoleAssignments().withSpace() fo.withRoleAssignments().withProject().withSpace() + fo.withRoleAssignments().withRegistrator() return openbis.searchAuthorizationGroups(criteria, fo).then(result => { return result.getObjects() }) diff --git a/ui-admin/src/js/components/users/form/usergroup/UserGroupFormControllerAddUser.js b/ui-admin/src/js/components/users/form/usergroup/UserGroupFormControllerAddUser.js index 4459acf6fc5f63e04a886af3384486db18506dd9..9e232700dee7e1f186cb266021417db81dfe85f2 100644 --- a/ui-admin/src/js/components/users/form/usergroup/UserGroupFormControllerAddUser.js +++ b/ui-admin/src/js/components/users/form/usergroup/UserGroupFormControllerAddUser.js @@ -20,6 +20,8 @@ export default class UserGroupFormControllerAddUser { email: FormUtil.createField({}), space: FormUtil.createField({}), active: FormUtil.createField({}), + registrator: FormUtil.createField({}), + registrationDate: FormUtil.createField({}), original: null } diff --git a/ui-admin/src/js/components/users/form/usergroup/UserGroupFormControllerChange.js b/ui-admin/src/js/components/users/form/usergroup/UserGroupFormControllerChange.js index ff765ec49018320378a132dc6a089c30d2c7927b..ae38b7742346aeeefdf94a6e33f06a2cbe388e5e 100644 --- a/ui-admin/src/js/components/users/form/usergroup/UserGroupFormControllerChange.js +++ b/ui-admin/src/js/components/users/form/usergroup/UserGroupFormControllerChange.js @@ -84,6 +84,14 @@ export default class UserGroupFormControllerChange extends PageControllerChange active: { ...newUser.active, value: user.active + }, + registrator: { + ...newUser.registrator, + value: user.registrator ? user.registrator.userId : null + }, + registrationDate: { + ...newUser.registrationDate, + value: user.registrationDate } }) } diff --git a/ui-admin/src/js/components/users/form/usergroup/UserGroupFormControllerLoad.js b/ui-admin/src/js/components/users/form/usergroup/UserGroupFormControllerLoad.js index 6445e6935d8d07206622468719c90df57434fcf1..2882cacc7d6397041ef7c94121a53b19a2a0e551 100644 --- a/ui-admin/src/js/components/users/form/usergroup/UserGroupFormControllerLoad.js +++ b/ui-admin/src/js/components/users/form/usergroup/UserGroupFormControllerLoad.js @@ -109,6 +109,12 @@ export default class UserGroupFormControllerLoad extends PageControllerLoad { }), active: FormUtil.createField({ value: _.get(loadedUser, 'active', null) + }), + registrator: FormUtil.createField({ + value: _.get(loadedUser, 'registrator.userId', null) + }), + registrationDate: FormUtil.createField({ + value: _.get(loadedUser, 'registrationDate', null) }) } user.original = _.cloneDeep(user) diff --git a/ui-admin/src/js/components/users/form/usergroup/UserGroupFormFacade.js b/ui-admin/src/js/components/users/form/usergroup/UserGroupFormFacade.js index f4b6db3a95d2c6951de4aa0ec0bb23fc236ef47a..7dc9c20b9ecb3ee4af5f08c295026d51c7db880f 100644 --- a/ui-admin/src/js/components/users/form/usergroup/UserGroupFormFacade.js +++ b/ui-admin/src/js/components/users/form/usergroup/UserGroupFormFacade.js @@ -5,8 +5,10 @@ export default class UserGroupFormFacade { const id = new openbis.AuthorizationGroupPermId(groupCode) const fo = new openbis.AuthorizationGroupFetchOptions() fo.withUsers().withSpace() + fo.withUsers().withRegistrator() fo.withRoleAssignments().withSpace() fo.withRoleAssignments().withProject().withSpace() + fo.withRoleAssignments().withRegistrator() return openbis.getAuthorizationGroups([id], fo).then(map => { return map[groupCode] }) @@ -16,6 +18,7 @@ export default class UserGroupFormFacade { const criteria = new openbis.PersonSearchCriteria() const fo = new openbis.PersonFetchOptions() fo.withSpace() + fo.withRegistrator() return openbis.searchPersons(criteria, fo).then(result => { return result.getObjects() }) diff --git a/ui-admin/src/js/components/users/search/UserSearch.jsx b/ui-admin/src/js/components/users/search/UserSearch.jsx index a362a8f616b957fbfe017e3808b8c758e04d8a99..5e7e41315f2a200c4e1906254e0ae627e84428e7 100644 --- a/ui-admin/src/js/components/users/search/UserSearch.jsx +++ b/ui-admin/src/js/components/users/search/UserSearch.jsx @@ -65,6 +65,7 @@ class UserSearch extends React.Component { const fo = new openbis.PersonFetchOptions() fo.withSpace() + fo.withRegistrator() const result = await openbis.searchPersons( new openbis.PersonSearchCriteria(), @@ -80,7 +81,13 @@ class UserSearch extends React.Component { lastName: FormUtil.createField({ value: _.get(object, 'lastName') }), email: FormUtil.createField({ value: _.get(object, 'email') }), space: FormUtil.createField({ value: _.get(object, 'space.code') }), - active: FormUtil.createField({ value: _.get(object, 'active') }) + active: FormUtil.createField({ value: _.get(object, 'active') }), + registrator: FormUtil.createField({ + value: _.get(object, 'registrator.userId') + }), + registrationDate: FormUtil.createField({ + value: _.get(object, 'registrationDate') + }) })) this.setState({ @@ -96,11 +103,13 @@ class UserSearch extends React.Component { const userFo = new openbis.PersonFetchOptions() userFo.withRoleAssignments().withSpace() userFo.withRoleAssignments().withProject().withSpace() + userFo.withRoleAssignments().withRegistrator() const groupFo = new openbis.AuthorizationGroupFetchOptions() groupFo.withUsers() groupFo.withRoleAssignments().withSpace() groupFo.withRoleAssignments().withProject().withSpace() + groupFo.withRoleAssignments().withRegistrator() const [userResult, groupResult] = await Promise.all([ openbis.searchPersons(new openbis.PersonSearchCriteria(), userFo), @@ -143,6 +152,12 @@ class UserSearch extends React.Component { project: FormUtil.createField({ value: project }), role: FormUtil.createField({ value: _.get(userAssignment, 'role', null) + }), + registrator: FormUtil.createField({ + value: _.get(userAssignment, 'registrator.userId') + }), + registrationDate: FormUtil.createField({ + value: _.get(userAssignment, 'registrationDate') }) }) }) @@ -184,6 +199,12 @@ class UserSearch extends React.Component { project: FormUtil.createField({ value: project }), role: FormUtil.createField({ value: _.get(groupAssignment, 'role', null) + }), + registrator: FormUtil.createField({ + value: _.get(groupAssignment, 'registrator.userId') + }), + registrationDate: FormUtil.createField({ + value: _.get(groupAssignment, 'registrationDate') }) }) }) @@ -200,9 +221,12 @@ class UserSearch extends React.Component { return } + const fo = new openbis.AuthorizationGroupFetchOptions() + fo.withRegistrator() + const result = await openbis.searchAuthorizationGroups( new openbis.AuthorizationGroupSearchCriteria(), - new openbis.AuthorizationGroupFetchOptions() + fo ) const userGroups = util @@ -212,6 +236,15 @@ class UserSearch extends React.Component { code: FormUtil.createField({ value: _.get(object, 'code') }), description: FormUtil.createField({ value: _.get(object, 'description') + }), + registrator: FormUtil.createField({ + value: _.get(object, 'registrator.userId') + }), + registrationDate: FormUtil.createField({ + value: _.get(object, 'registrationDate') + }), + modificationDate: FormUtil.createField({ + value: _.get(object, 'modificationDate') }) })) @@ -228,6 +261,7 @@ class UserSearch extends React.Component { const fo = new openbis.AuthorizationGroupFetchOptions() fo.withRoleAssignments().withSpace() fo.withRoleAssignments().withProject().withSpace() + fo.withRoleAssignments().withRegistrator() const result = await openbis.searchAuthorizationGroups( new openbis.AuthorizationGroupSearchCriteria(), @@ -266,6 +300,12 @@ class UserSearch extends React.Component { project: FormUtil.createField({ value: project }), role: FormUtil.createField({ value: _.get(roleAssignment, 'role', null) + }), + registrator: FormUtil.createField({ + value: _.get(roleAssignment, 'registrator.userId') + }), + registrationDate: FormUtil.createField({ + value: _.get(roleAssignment, 'registrationDate') }) }) }) diff --git a/ui-admin/srcTest/js/components/common/ComponentTest.js b/ui-admin/srcTest/js/components/common/ComponentTest.js index 4f765a84918bb6c73a0b502749ecae3cfbf25c82..d4eba67f5cd549feeeeee8e2e57b005178253d8c 100644 --- a/ui-admin/srcTest/js/components/common/ComponentTest.js +++ b/ui-admin/srcTest/js/components/common/ComponentTest.js @@ -3,6 +3,7 @@ import { mount } from 'enzyme' import AppController from '@src/js/components/AppController.js' import ComponentContext from '@srcTest/js/components/common/ComponentContext.js' import ThemeProvider from '@srcTest/js/components/common/theme/ThemeProvider.jsx' +import DatePickerProvider from '@src/js/components/common/date/DatePickerProvider.jsx' import openbis from '@srcTest/js/services/openbis.js' export default class ComponentTest { @@ -27,7 +28,9 @@ export default class ComponentTest { const reactWrapper = mount( <ThemeProvider> - {this.createComponentFn.apply(null, arguments)} + <DatePickerProvider> + {this.createComponentFn.apply(null, arguments)} + </DatePickerProvider> </ThemeProvider>, { attachTo: document.getElementsByTagName('div')[0] diff --git a/ui-admin/srcTest/js/components/tools/search/ToolSearchComponentLoad.test.js b/ui-admin/srcTest/js/components/tools/search/ToolSearchComponentLoad.test.js index 3ac995549720b26af7deade9454947340cc04fe0..199bce638a58b174e54bef4fafc143c84833e939 100644 --- a/ui-admin/srcTest/js/components/tools/search/ToolSearchComponentLoad.test.js +++ b/ui-admin/srcTest/js/components/tools/search/ToolSearchComponentLoad.test.js @@ -80,6 +80,10 @@ async function testLoadWithSearchText(resultsFound) { { name: 'registrator', label: 'Registrator' + }, + { + name: 'registrationDate', + label: 'Registration Date' } ], rows: [ @@ -124,6 +128,10 @@ async function testLoadWithSearchText(resultsFound) { { name: 'registrator', label: 'Registrator' + }, + { + name: 'registrationDate', + label: 'Registration Date' } ], rows: [ @@ -167,6 +175,10 @@ async function testLoadWithSearchText(resultsFound) { { name: 'registrator', label: 'Registrator' + }, + { + name: 'registrationDate', + label: 'Registration Date' } ], rows: [ @@ -230,6 +242,10 @@ async function testLoadWithObjectType(resultsFound) { { name: 'registrator', label: 'Registrator' + }, + { + name: 'registrationDate', + label: 'Registration Date' } ], rows: resultsFound diff --git a/ui-admin/srcTest/js/components/types/form/vocabularytype/VocabularyTypeFormComponentAddTerm.test.js b/ui-admin/srcTest/js/components/types/form/vocabularytype/VocabularyTypeFormComponentAddTerm.test.js index c14b0df3e1d01f32408b314e0bfd8c0ec9e57f7b..dcfaefd0ca09319495c9b4d34c2c6660373249b7 100644 --- a/ui-admin/srcTest/js/components/types/form/vocabularytype/VocabularyTypeFormComponentAddTerm.test.js +++ b/ui-admin/srcTest/js/components/types/form/vocabularytype/VocabularyTypeFormComponentAddTerm.test.js @@ -21,7 +21,9 @@ async function testAddTerm() { { name: 'code', sort: 'asc' }, { name: 'label', sort: null }, { name: 'description', sort: null }, - { name: 'official', sort: null } + { name: 'official', sort: null }, + { name: 'registrator', sort: null }, + { name: 'registrationDate', sort: null } ], rows: [ fixture.TEST_TERM_1_DTO, @@ -63,7 +65,9 @@ async function testAddTerm() { { name: 'code', sort: 'desc' }, { name: 'label', sort: null }, { name: 'description', sort: null }, - { name: 'official', sort: null } + { name: 'official', sort: null }, + { name: 'registrator', sort: null }, + { name: 'registrationDate', sort: null } ], rows: [ { diff --git a/ui-admin/srcTest/js/components/types/form/vocabularytype/VocabularyTypeFormComponentLoad.test.js b/ui-admin/srcTest/js/components/types/form/vocabularytype/VocabularyTypeFormComponentLoad.test.js index ee0e0a8b0946d05a21b71c5c5d36ca44f7db5dba..f66e74ef531bc02510510d2853456033695b142d 100644 --- a/ui-admin/srcTest/js/components/types/form/vocabularytype/VocabularyTypeFormComponentLoad.test.js +++ b/ui-admin/srcTest/js/components/types/form/vocabularytype/VocabularyTypeFormComponentLoad.test.js @@ -88,6 +88,18 @@ async function testLoadExisting() { label: 'Official', filter: null, sort: null + }, + { + name: 'registrator', + label: 'Registrator', + filter: null, + sort: null + }, + { + name: 'registrationDate', + label: 'Registration Date', + filter: null, + sort: null } ], rows: fixture.TEST_VOCABULARY_DTO.terms.map(term => ({ diff --git a/ui-admin/srcTest/js/components/types/form/vocabularytype/VocabularyTypeFormComponentSort.test.js b/ui-admin/srcTest/js/components/types/form/vocabularytype/VocabularyTypeFormComponentSort.test.js index 2df4e2453ad13bc6ffc569f965355ca7046a109f..0c09354128b6eee16edd98b6c486784430a09e55 100644 --- a/ui-admin/srcTest/js/components/types/form/vocabularytype/VocabularyTypeFormComponentSort.test.js +++ b/ui-admin/srcTest/js/components/types/form/vocabularytype/VocabularyTypeFormComponentSort.test.js @@ -41,7 +41,9 @@ async function testSort() { { name: 'code', sort: null }, { name: 'label', sort: 'asc' }, { name: 'description', sort: null }, - { name: 'official', sort: null } + { name: 'official', sort: null }, + { name: 'registrator', sort: null }, + { name: 'registrationDate', sort: null } ], rows: [ { values: { label: 'Term 1' } }, @@ -65,7 +67,9 @@ async function testSort() { { name: 'code', sort: null }, { name: 'label', sort: 'desc' }, { name: 'description', sort: null }, - { name: 'official', sort: null } + { name: 'official', sort: null }, + { name: 'registrator', sort: null }, + { name: 'registrationDate', sort: null } ], rows: [ { values: { label: 'term B' } }, diff --git a/ui-admin/srcTest/js/components/types/search/TypeSearchComponentLoad.test.js b/ui-admin/srcTest/js/components/types/search/TypeSearchComponentLoad.test.js index 30997a456294ae2d1330474de3e6ff24f50adfcf..98206ebfc4a14c80dc18dffd2580ae751728f137 100644 --- a/ui-admin/srcTest/js/components/types/search/TypeSearchComponentLoad.test.js +++ b/ui-admin/srcTest/js/components/types/search/TypeSearchComponentLoad.test.js @@ -87,6 +87,10 @@ async function testLoadWithSearchText(resultsFound) { { name: 'subcodeUnique', label: 'Unique Subcodes' + }, + { + name: 'modificationDate', + label: 'Modification Date' } ], rows: [ @@ -115,6 +119,10 @@ async function testLoadWithSearchText(resultsFound) { { name: 'validationPlugin', label: 'Validation Plugin' + }, + { + name: 'modificationDate', + label: 'Modification Date' } ], rows: [ @@ -152,6 +160,10 @@ async function testLoadWithSearchText(resultsFound) { { name: 'disallowDeletion', label: 'Disallow Deletion' + }, + { + name: 'modificationDate', + label: 'Modification Date' } ], rows: [ @@ -180,6 +192,10 @@ async function testLoadWithSearchText(resultsFound) { { name: 'validationPlugin', label: 'Validation Plugin' + }, + { + name: 'modificationDate', + label: 'Modification Date' } ], rows: [ @@ -205,6 +221,18 @@ async function testLoadWithSearchText(resultsFound) { { name: 'urlTemplate', label: 'URL Template' + }, + { + name: 'registrator', + label: 'Registrator' + }, + { + name: 'registrationDate', + label: 'Registration Date' + }, + { + name: 'modificationDate', + label: 'Modification Date' } ], rows: [ @@ -258,6 +286,14 @@ async function testLoadWithSearchText(resultsFound) { { name: 'usages', label: 'Usages' + }, + { + name: 'registrator', + label: 'Registrator' + }, + { + name: 'registrationDate', + label: 'Registration Date' } ], rows: [ @@ -327,6 +363,10 @@ async function testLoadWithObjectType(resultsFound) { { name: 'subcodeUnique', label: 'Unique Subcodes' + }, + { + name: 'modificationDate', + label: 'Modification Date' } ], rows: resultsFound diff --git a/ui-admin/srcTest/js/components/users/form/user/UserFormComponentLoad.test.js b/ui-admin/srcTest/js/components/users/form/user/UserFormComponentLoad.test.js index f158187895f1899f303f1e456b0ab2c2aee51eaf..cc9d1d98adee9ec3a6dcb5b0f9c6c75a64380e04 100644 --- a/ui-admin/srcTest/js/components/users/form/user/UserFormComponentLoad.test.js +++ b/ui-admin/srcTest/js/components/users/form/user/UserFormComponentLoad.test.js @@ -109,6 +109,24 @@ async function testLoadExisting() { label: 'Description', filter: null, sort: null + }, + { + name: 'registrator', + label: 'Registrator', + filter: null, + sort: null + }, + { + name: 'registrationDate', + label: 'Registration Date', + filter: null, + sort: null + }, + { + name: 'modificationDate', + label: 'Modification Date', + filter: null, + sort: null } ], rows: [ @@ -155,6 +173,18 @@ async function testLoadExisting() { label: 'Role', filter: null, sort: null + }, + { + name: 'registrator', + label: 'Registrator', + filter: null, + sort: null + }, + { + name: 'registrationDate', + label: 'Registration Date', + filter: null, + sort: null } ], rows: [ diff --git a/ui-admin/srcTest/js/components/users/form/user/UserFormComponentSortRoles.test.js b/ui-admin/srcTest/js/components/users/form/user/UserFormComponentSortRoles.test.js index 596fd36c5e43d97f51f3fe248f63dccdd05e3bb9..2828a4d4436a8a1dbea4246daa9dced94a9052b5 100644 --- a/ui-admin/srcTest/js/components/users/form/user/UserFormComponentSortRoles.test.js +++ b/ui-admin/srcTest/js/components/users/form/user/UserFormComponentSortRoles.test.js @@ -126,6 +126,14 @@ async function testSortRoles() { { name: 'role', sort: null + }, + { + name: 'registrator', + sort: null + }, + { + name: 'registrationDate', + sort: null } ], rows: [ @@ -164,6 +172,14 @@ async function testSortRoles() { { name: 'role', sort: null + }, + { + name: 'registrator', + sort: null + }, + { + name: 'registrationDate', + sort: null } ], rows: [ @@ -202,6 +218,14 @@ async function testSortRoles() { { name: 'role', sort: null + }, + { + name: 'registrator', + sort: null + }, + { + name: 'registrationDate', + sort: null } ], rows: [ @@ -240,6 +264,14 @@ async function testSortRoles() { { name: 'role', sort: null + }, + { + name: 'registrator', + sort: null + }, + { + name: 'registrationDate', + sort: null } ], rows: [ @@ -278,6 +310,14 @@ async function testSortRoles() { { name: 'role', sort: 'asc' + }, + { + name: 'registrator', + sort: null + }, + { + name: 'registrationDate', + sort: null } ], rows: [ diff --git a/ui-admin/srcTest/js/components/users/form/usergroup/UserGroupFormComponentLoad.test.js b/ui-admin/srcTest/js/components/users/form/usergroup/UserGroupFormComponentLoad.test.js index f2895757f2e8c5606011b8f9161461bee393bbca..cceb40940ed15fdae94005fa00d9e9d4c07d0b58 100644 --- a/ui-admin/srcTest/js/components/users/form/usergroup/UserGroupFormComponentLoad.test.js +++ b/ui-admin/srcTest/js/components/users/form/usergroup/UserGroupFormComponentLoad.test.js @@ -120,6 +120,18 @@ async function testLoadExisting() { label: 'Active', filter: null, sort: null + }, + { + name: 'registrator', + label: 'Registrator', + filter: null, + sort: null + }, + { + name: 'registrationDate', + label: 'Registration Date', + filter: null, + sort: null } ], rows: [inactiveUser, mySpaceUser, testSpaceUser].map(user => ({ @@ -160,6 +172,18 @@ async function testLoadExisting() { label: 'Role', filter: null, sort: null + }, + { + name: 'registrator', + label: 'Registrator', + filter: null, + sort: null + }, + { + name: 'registrationDate', + label: 'Registration Date', + filter: null, + sort: null } ], rows: [ diff --git a/ui-admin/srcTest/js/components/users/search/UserSearchComponentLoad.test.js b/ui-admin/srcTest/js/components/users/search/UserSearchComponentLoad.test.js index 9b30b114408d06bd33ac2bc915d0c891637cdd90..b481693130dd33f67cdf300ede75dcf0c4d91155 100644 --- a/ui-admin/srcTest/js/components/users/search/UserSearchComponentLoad.test.js +++ b/ui-admin/srcTest/js/components/users/search/UserSearchComponentLoad.test.js @@ -70,6 +70,14 @@ async function testLoadWithSearchText(resultsFound) { { name: 'active', label: 'Active' + }, + { + name: 'registrator', + label: 'Registrator' + }, + { + name: 'registrationDate', + label: 'Registration Date' } ], rows: [ @@ -120,6 +128,14 @@ async function testLoadWithSearchText(resultsFound) { { label: 'Role', name: 'role' + }, + { + name: 'registrator', + label: 'Registrator' + }, + { + name: 'registrationDate', + label: 'Registration Date' } ], rows: [ @@ -184,6 +200,18 @@ async function testLoadWithSearchText(resultsFound) { { name: 'description', label: 'Description' + }, + { + name: 'registrator', + label: 'Registrator' + }, + { + name: 'registrationDate', + label: 'Registration Date' + }, + { + name: 'modificationDate', + label: 'Modification Date' } ], rows: [ @@ -216,6 +244,14 @@ async function testLoadWithSearchText(resultsFound) { { label: 'Role', name: 'role' + }, + { + name: 'registrator', + label: 'Registrator' + }, + { + name: 'registrationDate', + label: 'Registration Date' } ], rows: [ @@ -298,6 +334,14 @@ async function testLoadWithObjectType(resultsFound) { { name: 'active', label: 'Active' + }, + { + name: 'registrator', + label: 'Registrator' + }, + { + name: 'registrationDate', + label: 'Registration Date' } ], rows: resultsFound @@ -360,6 +404,14 @@ async function testLoadWithObjectType(resultsFound) { { label: 'Role', name: 'role' + }, + { + name: 'registrator', + label: 'Registrator' + }, + { + name: 'registrationDate', + label: 'Registration Date' } ], rows: resultsFound