From c741995feaee879bea8d3be5f5a91363150cc167 Mon Sep 17 00:00:00 2001 From: Nico Rehwaldt Date: Tue, 27 Feb 2024 23:58:20 +0100 Subject: [PATCH] feat(platform): rename flag to `default-httl` Related to https://github.com/camunda/camunda-modeler/issues/3869 Related to https://github.com/camunda/camunda-modeler/issues/4062 --- client/src/app/TabsProvider.js | 8 ++++---- client/src/app/__tests__/TabsProviderSpec.js | 8 +++++--- client/src/app/tabs/bpmn/__tests__/DiagramSpec.js | 2 +- client/src/app/tabs/bpmn/diagram.bpmn | 2 +- client/src/util/Flags.js | 2 +- 5 files changed, 12 insertions(+), 10 deletions(-) diff --git a/client/src/app/TabsProvider.js b/client/src/app/TabsProvider.js index c494bc8119..a0ba350ed4 100644 --- a/client/src/app/TabsProvider.js +++ b/client/src/app/TabsProvider.js @@ -54,7 +54,7 @@ import Flags, { DISABLE_PLATFORM, DISABLE_CMMN, DISABLE_HTTL_HINT, - DEFAULT_HISTORY_TTL + DEFAULT_HTTL } from '../util/Flags'; import BPMNIcon from '../../resources/icons/file-types/BPMN-16x16.svg'; @@ -753,11 +753,11 @@ function DisableHTTLHintPlugin() { } function replaceHistoryTimeToLive(contents) { - if (!Flags.get(DEFAULT_HISTORY_TTL)) { - return contents.replace('camunda:historyTimeToLive="{{ DEFAULT_HISTORY_TTL }}"', ''); + if (!Flags.get(DEFAULT_HTTL)) { + return contents.replace('camunda:historyTimeToLive="{{ DEFAULT_HTTL }}"', ''); } return ( contents - .replace('{{ DEFAULT_HISTORY_TTL }}', Flags.get(DEFAULT_HISTORY_TTL)) + .replace('{{ DEFAULT_HTTL }}', Flags.get(DEFAULT_HTTL)) ); } diff --git a/client/src/app/__tests__/TabsProviderSpec.js b/client/src/app/__tests__/TabsProviderSpec.js index 348b4d78ad..77eff656b2 100644 --- a/client/src/app/__tests__/TabsProviderSpec.js +++ b/client/src/app/__tests__/TabsProviderSpec.js @@ -18,7 +18,7 @@ import Flags, { CLOUD_ENGINE_VERSION, PLATFORM_ENGINE_VERSION, DISABLE_HTTL_HINT, - DEFAULT_HISTORY_TTL + DEFAULT_HTTL } from '../../util/Flags'; import { @@ -1135,6 +1135,7 @@ describe('TabsProvider', function() { expect(tabsProvider.hasProvider('cmmn')).to.be.true; }); + it('should disable HTTL hint', async function() { // given @@ -1160,6 +1161,7 @@ describe('TabsProvider', function() { expect(customLinter.getPlugins()).to.have.length(1); }); + it('should return default history ttl', function() { // given @@ -1174,11 +1176,12 @@ describe('TabsProvider', function() { }); + it('should replace history ttl placeholder with version from flag (BPMN)', function() { // given Flags.init({ - [DEFAULT_HISTORY_TTL]: '30' + [DEFAULT_HTTL]: '30' }); const tabsProvider = new TabsProvider(); @@ -1189,7 +1192,6 @@ describe('TabsProvider', function() { expect(contents).to.include('historyTimeToLive="30"'); }); - }); diff --git a/client/src/app/tabs/bpmn/__tests__/DiagramSpec.js b/client/src/app/tabs/bpmn/__tests__/DiagramSpec.js index 5700b46789..ccf8aaebea 100644 --- a/client/src/app/tabs/bpmn/__tests__/DiagramSpec.js +++ b/client/src/app/tabs/bpmn/__tests__/DiagramSpec.js @@ -20,7 +20,7 @@ describe('tabs/bpmn', function() { // then expect(contents).to.contain('id="Definitions_{{ ID }}"'); expect(contents).to.contain('id="Process_{{ ID:process }}"'); - expect(contents).to.contain('historyTimeToLive="{{ DEFAULT_HISTORY_TTL }}'); + expect(contents).to.contain('historyTimeToLive="{{ DEFAULT_HTTL }}'); }); }); diff --git a/client/src/app/tabs/bpmn/diagram.bpmn b/client/src/app/tabs/bpmn/diagram.bpmn index ee949232a8..91381a5a6b 100644 --- a/client/src/app/tabs/bpmn/diagram.bpmn +++ b/client/src/app/tabs/bpmn/diagram.bpmn @@ -1,6 +1,6 @@ - + diff --git a/client/src/util/Flags.js b/client/src/util/Flags.js index 8760905e2a..c8d5be81c3 100644 --- a/client/src/util/Flags.js +++ b/client/src/util/Flags.js @@ -49,5 +49,5 @@ export const DISPLAY_VERSION = 'display-version'; export const CLOUD_ENGINE_VERSION = 'c8-engine-version'; export const PLATFORM_ENGINE_VERSION = 'c7-engine-version'; export const DISABLE_HTTL_HINT = 'disable-httl-hint'; -export const DEFAULT_HISTORY_TTL = 'default-history-ttl'; +export const DEFAULT_HTTL = 'default-httl';