Skip to content

Commit

Permalink
Merge pull request #896 from OnroerendErfgoed/bugfix/883_enable_conce…
Browse files Browse the repository at this point in the history
…ptscheme_buttons_in_admin_menu

Bugfix/883 enable conceptscheme buttons in admin menu
  • Loading branch information
goessebr authored Jul 19, 2024
2 parents 23d1604 + 249dabc commit 3d3b3d6
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 7 deletions.
9 changes: 9 additions & 0 deletions atramhasis/static/admin/src/app/ui/AppUi.js
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,15 @@ define([

router.startup('#');
},
refresh_conceptschemes: function () {
console.debug('AppUi::refresh_conceptschemes');
var message = 'Please manually reload the page to see the changes in the main menu.';
topic.publish('dGrowl', message, {
'title': 'New Provider added',
'sticky': false,
'channel': 'info'
});
},

/**
* Hide the 'Loading'-overlay.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -350,6 +350,7 @@ define([
'channel': 'info'
});
this._reset(true);
this.parentNode.refresh_conceptschemes();
}),
lang.hitch(this, function (error) {
var message = this._parseError(error);
Expand Down
14 changes: 10 additions & 4 deletions atramhasis/static/admin/src/app/ui/widgets/SearchPane.js
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ define([
if (this.appUi.canCreateProviders) {
domAttr.set(this.manageProvidersButton, 'disabled', false);
}
this._initSelectedConceptSchemeAdmin();
},

init: function (scheme, store) {
Expand Down Expand Up @@ -163,15 +164,20 @@ define([
this.emit('scheme.changed', {
schemeId: this.conceptSchemeSelect.value
});
// activate buttons for add and import, edit scheme
domAttr.set(this.addConceptButton, 'disabled', false);
domAttr.set(this.importConceptButton, 'disabled', false);
domAttr.set(this.editSchemeButton, 'disabled', false);
this._search();
}))
);
},

_initSelectedConceptSchemeAdmin: function () {
if (this.conceptSchemeList.length > 0) {
domAttr.set(this.addConceptButton, 'disabled', false);
domAttr.set(this.importConceptButton, 'disabled', false);
domAttr.set(this.editSchemeButton, 'disabled', false);
this._search();
}
},

_createContextMenu: function () {
var contextMenu = new Menu({});
var pane = this;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,7 @@
<div class="search-form">
<form data-dojo-attach-point="labelSearchForm" data-dojo-attach-event="onsubmit: _search">
<div class="large-10 columns">
<select data-dojo-attach-point="conceptSchemeSelect">
<option value="-1" selected disabled>Select thesaurus</option>
</select>
<select data-dojo-attach-point="conceptSchemeSelect"></select>
</div>
<div class="large-2 columns edit-scheme-button">
<button type="button" class="button tiny" href="#/conceptscheme/edit" data-dojo-attach-point="editSchemeButton"
Expand Down

0 comments on commit 3d3b3d6

Please sign in to comment.