Skip to content

Commit

Permalink
Merge branch 'master' into STSMACOM-793
Browse files Browse the repository at this point in the history
  • Loading branch information
Dmytro-Melnyshyn committed Jan 5, 2024
2 parents af1e959 + 4e3c874 commit 08d477d
Showing 1 changed file with 11 additions and 13 deletions.
24 changes: 11 additions & 13 deletions lib/ControlledVocab/ControlledVocab.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,23 @@ import EditableList from '../EditableList';
import css from './ControlledVocab.css';
import makeRefdataActuatorsBoundTo from './actuators-refdata';

const getTenantFromRESTResource = (queryParams, pathComponents, resourceValues, logger, props) => {
const {
tenant,
stripes,
} = props;

return tenant || stripes.okapi.tenant;
};

class ControlledVocab extends React.Component {
static manifest = Object.freeze({
values: {
type: 'okapi',
path: '!{baseUrl}',
records: '!{records}',
throwErrors: false,
tenant: '%{tenant}',
tenant: getTenantFromRESTResource,
clientGeneratePk: '!{clientGeneratePk}',
PUT: {
path: '!{baseUrl}/%{activeRecord.id}',
Expand All @@ -55,7 +64,7 @@ class ControlledVocab extends React.Component {
type: 'okapi',
records: 'users',
path: 'users',
tenant: '%{tenant}',
tenant: getTenantFromRESTResource,
GET: {
params: {
query: (queryParams, pathComponents, resourceValues) => {
Expand All @@ -68,7 +77,6 @@ class ControlledVocab extends React.Component {
}
},
updaterIds: {},
tenant: {},
});

static propTypes = {
Expand Down Expand Up @@ -245,16 +253,6 @@ class ControlledVocab extends React.Component {
return null;
}

componentDidMount() {
const {
mutator,
tenant,
stripes,
} = this.props;

mutator.tenant.replace(tenant || stripes.okapi.tenant);
}

componentDidUpdate() {
// build a list of the ids of users who have updated CV items so
// we can look them up all at once
Expand Down

0 comments on commit 08d477d

Please sign in to comment.