Tony CHEMIT pushed to branch develop at ultreiaio / ird-observe Commits: 1ad00f06 by Tony Chemit at 2024-12-10T16:39:40+01:00 use proper callback for the dedicated option (we need to reload database to recompute all permissions) - - - - - a5305eba by Tony Chemit at 2024-12-10T17:08:44+01:00 fix content title text and icon when db is editable - - - - - 3774d827 by Tony Chemit at 2024-12-10T17:11:33+01:00 Merge branch 'feature/issue_2951' into develop L'option d'édition du référentiel d'une base locale nécessite un rechargement manuel de la source de données - Closes #2951 - - - - - 2 changed files: - client/core/src/main/java/fr/ird/observe/client/main/body/ClientConfigUI.java - client/datasource/editor/api/src/main/java/fr/ird/observe/client/datasource/editor/api/content/referential/ContentReferentialUIHandler.java Changes: ===================================== client/core/src/main/java/fr/ird/observe/client/main/body/ClientConfigUI.java ===================================== @@ -414,7 +414,7 @@ public class ClientConfigUI extends JXTitledPanel implements WithClientUIContext helper.addOption(ClientConfigOption.H2_CAN_MIGRATE).setOptionCallBack("application"); helper.addOption(ClientConfigOption.OBSTUNA_CAN_MIGRATE).setOptionCallBack("application"); helper.addOption(ClientConfigOption.H2_SERVER_PORT).setOptionCallBack("application"); - helper.addOption(ClientConfigOption.H2_CAN_EDIT_REFERENTIAL).setOptionCallBack("ui"); + helper.addOption(ClientConfigOption.H2_CAN_EDIT_REFERENTIAL).setOptionCallBack("db"); helper.addOption(ClientConfigOption.AVDTH_FORCE_IMPORT).setOptionCallBack("ui"); helper.addOption(ClientConfigOption.SHOW_SQL); ===================================== client/datasource/editor/api/src/main/java/fr/ird/observe/client/datasource/editor/api/content/referential/ContentReferentialUIHandler.java ===================================== @@ -207,6 +207,23 @@ public class ContentReferentialUIHandler<D extends ReferentialDto, R extends Ref } }; ChangeMode<U> changeMode = new ChangeMode<>(request, changeModeProducer, null) { + @Override + protected void rebuildTitle(U ui, ContentMode newValue) { + if (Objects.equals(newValue, ContentMode.READ) ) { + ContentReferentialUIModelStates<D, R> states = ui.getModel().getStates(); + boolean editable = states.isEditable(); + String titleSuffix; + if (editable) { + titleSuffix = I18n.t("observe.Common.action.updating"); + } else { + titleSuffix = I18n.t("observe.Common.action.notEditable"); + } + String contentTitle = states.getContentTitle() + " - " + titleSuffix; + ui.setTitle(contentTitle); + return; + } + super.rebuildTitle(ui, newValue); + } protected void rebuildAction(U ui, ContentMode newValue) { boolean editable; @@ -230,7 +247,7 @@ public class ContentReferentialUIHandler<D extends ReferentialDto, R extends Ref editable = states.isEditable(); if (editable) { tip = I18n.n("observe.data.Openable.action.editable.tip"); - icon = UIHelper.getContentActionIcon("locked"); + icon = UIHelper.getContentActionIcon("unlocked"); } else { tip = I18n.n("observe.data.Openable.action.notEditable.tip"); icon = UIHelper.getContentActionIcon("not-editable"); View it on GitLab: https://gitlab.com/ultreiaio/ird-observe/-/compare/5f4f009403f9958233e68599e... -- View it on GitLab: https://gitlab.com/ultreiaio/ird-observe/-/compare/5f4f009403f9958233e68599e... You're receiving this email because of your account on gitlab.com.