Skip to content

Commit

Permalink
use uuid for value id
Browse files Browse the repository at this point in the history
  • Loading branch information
mfacar committed Aug 28, 2024
1 parent fd5dbc3 commit aa8d6d9
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions app/react/Metadata/components/MetadataFormFields.js
Original file line number Diff line number Diff line change
@@ -1,18 +1,19 @@
/* eslint-disable max-statements */
/* eslint-disable max-lines */
import { FormGroup } from 'app/Forms';
import { t, Translate } from 'app/I18N';
import { preloadOptionsLimit } from 'shared/config';
import React, { Component } from 'react';
import Immutable from 'immutable';
import PropTypes from 'prop-types';
import React, { Component } from 'react';
import { bindActionCreators } from 'redux';
import { connect } from 'react-redux';
import { Field, actions as formActions } from 'react-redux-form';
import { propertyTypes } from 'shared/propertyTypes';
import uuid from 'node-uuid';
import { FormGroup } from 'app/Forms';
import { t, Translate } from 'app/I18N';
import { getSuggestions } from 'app/Metadata/actions/actions';
import { generateID } from 'shared/IDGenerator';
import { bindActionCreators } from 'redux';
import Tip from 'app/Layout/Tip';
import { propertyTypes } from 'shared/propertyTypes';
import { preloadOptionsLimit } from 'shared/config';
import { generateID } from 'shared/IDGenerator';

import { saveThesaurus } from 'app/Thesauri/actions/thesauriActions';
import { sanitizeThesauri } from 'app/V2/Routes/Settings/Thesauri/helpers';
Expand Down Expand Up @@ -84,7 +85,7 @@ class MetadataFormFields extends Component {
async onAddThesauriValueSaved(thesauri, newValue, _model, isMultiSelect) {
const { model, push, change } = this.props;
const newThesauri = thesauri.toJS();
const newValueItem = { label: newValue.value };
const newValueItem = { label: newValue.value, id: uuid.v4() };
if (newValue.group === 'root') {
newThesauri.values.push(newValueItem);
} else {
Expand Down

0 comments on commit aa8d6d9

Please sign in to comment.