{datasetContainer.dataset && datasetContainer.dataset.klass_ols !== absOlsTermId(kind)
@@ -100,7 +100,7 @@ ContainerDatasetField.propTypes = {
id: PropTypes.number,
}).isRequired,
handleUndo: PropTypes.func.isRequired,
- kind: PropTypes.string.isRequired,
+ kind: PropTypes.string,
handleModalOpen: PropTypes.func.isRequired,
};
diff --git a/app/packs/src/components/reactQuill/ToolbarDropdown.js b/app/packs/src/components/reactQuill/ToolbarDropdown.js
index 0f748fb9ac..2e666f32c6 100644
--- a/app/packs/src/components/reactQuill/ToolbarDropdown.js
+++ b/app/packs/src/components/reactQuill/ToolbarDropdown.js
@@ -19,9 +19,6 @@ export default class ToolbarDropdown extends React.Component {
this.pickerSpan = React.createRef();
this.pickerLabel = React.createRef();
- const genId = Math.random().toString().substr(2, 10);
- this.ddQuillId = `ql-dropdown-${genId}`;
-
const sheets = document.styleSheets;
this.sheet = sheets[sheets.length - 1];
@@ -30,14 +27,6 @@ export default class ToolbarDropdown extends React.Component {
}
componentDidMount() {
- const cssRule = ".ql-snow .ql-picker." + this.ddQuillId + " .ql-picker-label::before, ." + this.ddQuillId + " .ql-picker.ql-size .ql-picker-item::before { content: attr(data-label); line-height: 25px; }";
-
- try {
- this.ruleId = this.sheet.insertRule(cssRule, this.sheet.cssRules.length);
- } catch (err) {
- console.log(err);
- }
-
const requiredWidth = this.getTextWidth() + 40;
this.pickerLabel.current.style.width = `${requiredWidth}px`;
@@ -50,14 +39,6 @@ export default class ToolbarDropdown extends React.Component {
});
}
- componentWillUnmount() {
- try {
- this.sheet.deleteRule(this.ruleId - 1);
- } catch (err) {
- console.log(err);
- }
- }
-
getTextWidth(font = "500 14px 'Helvetica Neue', 'Helvetica', 'Arial', sans-serif") {
const canvas = this.canvas || (this.canvas = document.createElement('canvas'));
const context = canvas.getContext('2d');
@@ -95,7 +76,7 @@ export default class ToolbarDropdown extends React.Component {
const { expanded } = this.state;
const expandedClass = expanded ? 'ql-expanded' : '';
- const className = `${this.ddQuillId} ql-picker ${expandedClass}`;
+ const className = `ql-picker ${expandedClass}`;
return (
diff --git a/app/packs/src/components/textTemplateToolbar/ToolbarTemplateCreator.js b/app/packs/src/components/textTemplateToolbar/ToolbarTemplateCreator.js
index 5a5c033fc3..bd9f8b0007 100644
--- a/app/packs/src/components/textTemplateToolbar/ToolbarTemplateCreator.js
+++ b/app/packs/src/components/textTemplateToolbar/ToolbarTemplateCreator.js
@@ -116,7 +116,7 @@ export default class ToolbarTemplateCreator extends React.Component {
const { updateTextTemplates } = this.props;
if (!updateTextTemplates) return;
- const iconTemplates = this.toolbarSelectRef.current.state.value;
+ const iconTemplates = this.toolbarSelectRef.current.state.selectValue;
const userTemplate = { _toolbar: iconTemplates.map(n => n.value) };
const { dropdownTemplates } = this.state;
@@ -126,7 +126,7 @@ export default class ToolbarTemplateCreator extends React.Component {
if (selectRefs.length === 0 || titleRefs.length === 0) return;
const selectRef = selectRefs[0].ref;
- const selectedValue = selectRef.current.state.value;
+ const selectedValue = selectRef.current.state.selectValue;
const tempName = template.name;
userTemplate[tempName] = selectedValue.map(v => v.value);
@@ -156,10 +156,9 @@ export default class ToolbarTemplateCreator extends React.Component {
const removeDropdown = () => this.removeDropdownTemplate(template);
return (
- <>
+
@@ -188,7 +187,7 @@ export default class ToolbarTemplateCreator extends React.Component {
- >
+
);
});
@@ -219,8 +218,8 @@ export default class ToolbarTemplateCreator extends React.Component {
defaultValue="Toolbar"
/>