Skip to content

Commit

Permalink
feat(platform): rename flag to default-httl
Browse files Browse the repository at this point in the history
Related to #3869
Related to #4062
  • Loading branch information
nikku committed Feb 27, 2024
1 parent bdde3f6 commit c741995
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 10 deletions.
8 changes: 4 additions & 4 deletions client/src/app/TabsProvider.js
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down Expand Up @@ -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))
);
}
8 changes: 5 additions & 3 deletions client/src/app/__tests__/TabsProviderSpec.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import Flags, {
CLOUD_ENGINE_VERSION,
PLATFORM_ENGINE_VERSION,
DISABLE_HTTL_HINT,
DEFAULT_HISTORY_TTL
DEFAULT_HTTL
} from '../../util/Flags';

import {
Expand Down Expand Up @@ -1135,6 +1135,7 @@ describe('TabsProvider', function() {
expect(tabsProvider.hasProvider('cmmn')).to.be.true;
});


it('should disable HTTL hint', async function() {

// given
Expand All @@ -1160,6 +1161,7 @@ describe('TabsProvider', function() {
expect(customLinter.getPlugins()).to.have.length(1);
});


it('should return default history ttl', function() {

// given
Expand All @@ -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();

Expand All @@ -1189,7 +1192,6 @@ describe('TabsProvider', function() {
expect(contents).to.include('historyTimeToLive="30"');
});


});


Expand Down
2 changes: 1 addition & 1 deletion client/src/app/tabs/bpmn/__tests__/DiagramSpec.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}');
});

});
Expand Down
2 changes: 1 addition & 1 deletion client/src/app/tabs/bpmn/diagram.bpmn
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<bpmn:definitions xmlns:bpmn="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:dc="http://www.omg.org/spec/DD/20100524/DC" xmlns:camunda="http://camunda.org/schema/1.0/bpmn" id="Definitions_{{ ID }}" targetNamespace="http://bpmn.io/schema/bpmn" xmlns:modeler="http://camunda.org/schema/modeler/1.0" exporter="{{ EXPORTER_NAME }}" exporterVersion="{{ EXPORTER_VERSION }}" modeler:executionPlatform="Camunda Platform" modeler:executionPlatformVersion="{{ CAMUNDA_PLATFORM_VERSION }}">
<bpmn:process id="Process_{{ ID:process }}" isExecutable="true" camunda:historyTimeToLive="{{ DEFAULT_HISTORY_TTL }}">
<bpmn:process id="Process_{{ ID:process }}" isExecutable="true" camunda:historyTimeToLive="{{ DEFAULT_HTTL }}">
<bpmn:startEvent id="StartEvent_1" />
</bpmn:process>
<bpmndi:BPMNDiagram id="BPMNDiagram_1">
Expand Down
2 changes: 1 addition & 1 deletion client/src/util/Flags.js
Original file line number Diff line number Diff line change
Expand Up @@ -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';

0 comments on commit c741995

Please sign in to comment.