Skip to content
This repository was archived by the owner on May 5, 2021. It is now read-only.

Commit 1ca0602

Browse files
sebgeelendmo-odoo
authored andcommitted
[IMP] better and more consistent variables naming
1 parent c5c0330 commit 1ca0602

File tree

4 files changed

+26
-26
lines changed

4 files changed

+26
-26
lines changed

packages/plugin-dialog/src/DialogZoneDomObjectRenderer.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ export class DialogZoneDomObjectRenderer extends AbstractRenderer<DomObject> {
4747
clone.addEventListener('click', (ev: MouseEvent): void => {
4848
const target = ev.target as Element;
4949
if (target.classList.contains('jw-close')) {
50-
this.engine.editor.execCommand('hide', { componentID: componentId });
50+
this.engine.editor.execCommand('hide', { componentId: componentId });
5151
}
5252
});
5353
return clone;

packages/plugin-dialog/test/Dialog.test.ts

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ describe('Dialog', async () => {
7878

7979
it('should add a vNode in the dialog and show it', async () => {
8080
await editor.plugins.get(Layout).add('aaa', 'float');
81-
await editor.execCommand('show', { componentID: 'aaa' });
81+
await editor.execCommand('show', { componentId: 'aaa' });
8282
expect(container.innerHTML.replace(/[\s\n]+/g, ' ')).to.equal(
8383
[
8484
'<jw-editor>',
@@ -97,7 +97,7 @@ describe('Dialog', async () => {
9797
});
9898
it('should add a vNode in dialog because dialog is the default zone', async () => {
9999
await editor.plugins.get(Layout).add('aaa', 'not available zone');
100-
await editor.execCommand('show', { componentID: 'aaa' });
100+
await editor.execCommand('show', { componentId: 'aaa' });
101101
expect(container.innerHTML.replace(/[\s\n]+/g, ' ')).to.equal(
102102
[
103103
'<jw-editor>',
@@ -116,10 +116,10 @@ describe('Dialog', async () => {
116116
});
117117
it('should add 2 vNodes in the dialog and show it', async () => {
118118
await editor.plugins.get(Layout).add('aaa', 'float');
119-
await editor.execCommand('show', { componentID: 'aaa' });
119+
await editor.execCommand('show', { componentId: 'aaa' });
120120

121121
await editor.plugins.get(Layout).add('bbb', 'not available zone');
122-
await editor.execCommand('show', { componentID: 'bbb' });
122+
await editor.execCommand('show', { componentId: 'bbb' });
123123

124124
expect(container.innerHTML.replace(/[\s\n]+/g, ' ')).to.equal(
125125
[
@@ -147,10 +147,10 @@ describe('Dialog', async () => {
147147
});
148148
it('should close 2 dialogs with the X button', async () => {
149149
await editor.plugins.get(Layout).add('aaa', 'float');
150-
await editor.execCommand('show', { componentID: 'aaa' });
150+
await editor.execCommand('show', { componentId: 'aaa' });
151151

152152
await editor.plugins.get(Layout).add('bbb', 'not available zone');
153-
await editor.execCommand('show', { componentID: 'bbb' });
153+
await editor.execCommand('show', { componentId: 'bbb' });
154154

155155
await click(
156156
Array.from(container.querySelectorAll('jw-dialog jw-button.jw-close')).pop(),
@@ -190,10 +190,10 @@ describe('Dialog', async () => {
190190
});
191191
it('should close 2 dialogs it with the backdrop', async () => {
192192
await editor.plugins.get(Layout).add('aaa', 'float');
193-
await editor.execCommand('show', { componentID: 'aaa' });
193+
await editor.execCommand('show', { componentId: 'aaa' });
194194

195195
await editor.plugins.get(Layout).add('bbb', 'not available zone');
196-
await editor.execCommand('show', { componentID: 'bbb' });
196+
await editor.execCommand('show', { componentId: 'bbb' });
197197

198198
await click(
199199
Array.from(container.querySelectorAll('jw-dialog jw-backdrop.jw-close')).pop(),
@@ -232,7 +232,7 @@ describe('Dialog', async () => {
232232
});
233233
it('should close a dialog and re-open a dialog', async () => {
234234
await editor.plugins.get(Layout).add('aaa', 'float');
235-
await editor.execCommand('show', { componentID: 'aaa' });
235+
await editor.execCommand('show', { componentId: 'aaa' });
236236

237237
await click(
238238
Array.from(container.querySelectorAll('jw-dialog jw-button.jw-close')).pop(),
@@ -243,7 +243,7 @@ describe('Dialog', async () => {
243243
);
244244

245245
await editor.plugins.get(Layout).add('bbb', 'not available zone');
246-
await editor.execCommand('show', { componentID: 'bbb' });
246+
await editor.execCommand('show', { componentId: 'bbb' });
247247

248248
expect(container.innerHTML.replace(/[\s\n]+/g, ' ')).to.equal(
249249
[
@@ -264,7 +264,7 @@ describe('Dialog', async () => {
264264
});
265265
it('should not close the dialog if click in content', async () => {
266266
await editor.plugins.get(Layout).add('bbb', 'not available zone');
267-
await editor.execCommand('show', { componentID: 'bbb' });
267+
await editor.execCommand('show', { componentId: 'bbb' });
268268

269269
await click(Array.from(container.querySelectorAll('jw-dialog jw-content')).pop());
270270

@@ -288,13 +288,13 @@ describe('Dialog', async () => {
288288
it('should hide a vNode in dialog (without remove the vNode)', async () => {
289289
await editor.plugins.get(Layout).add('bbb', 'not available zone');
290290

291-
await editor.execCommand('hide', { componentID: 'bbb' });
291+
await editor.execCommand('hide', { componentId: 'bbb' });
292292

293293
expect(container.innerHTML).to.equal(
294294
['<jw-editor>', '<main></main>', '</jw-editor>'].join(''),
295295
);
296296

297-
await editor.execCommand('show', { componentID: 'bbb' });
297+
await editor.execCommand('show', { componentId: 'bbb' });
298298

299299
expect(container.innerHTML.replace(/[\s\n]+/g, ' ')).to.equal(
300300
[
@@ -383,7 +383,7 @@ describe('Dialog', async () => {
383383
const domLayoutEngine = editor.plugins.get(Layout).engines.dom as DomLayoutEngine;
384384
const vNode = domLayoutEngine.getNodes(container.querySelector('section')).pop();
385385

386-
await editor.execCommand('hide', { componentID: 'custom' });
386+
await editor.execCommand('hide', { componentId: 'custom' });
387387
expect(container.innerHTML).to.equal(
388388
['<jw-editor>', '<main></main>', '</jw-editor>'].join(''),
389389
);

packages/plugin-dom-layout/test/DomLayout.test.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4890,13 +4890,13 @@ describe('DomLayout', () => {
48904890
});
48914891
it('should hide a component', async () => {
48924892
await editor.plugins.get(Layout).add('aaa', 'main');
4893-
await editor.execCommand('hide', { componentID: 'aaa' });
4893+
await editor.execCommand('hide', { componentId: 'aaa' });
48944894
expect(container.innerHTML).to.equal('<jw-editor></jw-editor>');
48954895
});
48964896
it('should show a component', async () => {
48974897
await editor.plugins.get(Layout).add('aaa', 'main');
4898-
await editor.execCommand('hide', { componentID: 'aaa' });
4899-
await editor.execCommand('show', { componentID: 'aaa' });
4898+
await editor.execCommand('hide', { componentId: 'aaa' });
4899+
await editor.execCommand('show', { componentId: 'aaa' });
49004900
expect(container.innerHTML).to.equal('<jw-editor><div><area></div></jw-editor>');
49014901
});
49024902
it('should remove a component', async () => {
@@ -4912,7 +4912,7 @@ describe('DomLayout', () => {
49124912
await layout.add('aaa', 'main');
49134913
const node = zoneMain.children().pop();
49144914
expect(!!zoneMain.hidden.get(node)).to.equal(false, 'Component is visible');
4915-
await editor.execCommand('hide', { componentID: 'aaa' });
4915+
await editor.execCommand('hide', { componentId: 'aaa' });
49164916
expect(zoneMain.hidden.get(node)).to.equal(true, 'Component is hidden');
49174917
await layout.remove('aaa');
49184918
expect(zoneMain.hidden.get(node)).to.equal(undefined);

packages/plugin-layout/src/Layout.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -56,12 +56,12 @@ export class Layout<T extends LayoutConfig = LayoutConfig> extends JWPlugin<T> {
5656
/**
5757
* Remove a component (instance or clonse) from the zone.
5858
*
59-
* @param componentID
59+
* @param componentId
6060
*/
61-
async remove(componentID: ComponentId): Promise<void> {
61+
async remove(componentId: ComponentId): Promise<void> {
6262
const promises = [];
6363
for (const layoutEngine of Object.values(this.engines)) {
64-
promises.push(layoutEngine.remove(componentID));
64+
promises.push(layoutEngine.remove(componentId));
6565
}
6666
await Promise.all(promises);
6767
}
@@ -70,10 +70,10 @@ export class Layout<T extends LayoutConfig = LayoutConfig> extends JWPlugin<T> {
7070
*
7171
* @param params
7272
*/
73-
async show(params: { componentID: ComponentId }): Promise<void> {
73+
async show(params: { componentId: ComponentId }): Promise<void> {
7474
const promises = [];
7575
for (const layoutEngine of Object.values(this.engines)) {
76-
promises.push(layoutEngine.show(params.componentID));
76+
promises.push(layoutEngine.show(params.componentId));
7777
}
7878
await Promise.all(promises);
7979
}
@@ -82,10 +82,10 @@ export class Layout<T extends LayoutConfig = LayoutConfig> extends JWPlugin<T> {
8282
*
8383
* @param params
8484
*/
85-
async hide(params: { componentID: ComponentId }): Promise<void> {
85+
async hide(params: { componentId: ComponentId }): Promise<void> {
8686
const promises = [];
8787
for (const layoutEngine of Object.values(this.engines)) {
88-
promises.push(layoutEngine.hide(params.componentID));
88+
promises.push(layoutEngine.hide(params.componentId));
8989
}
9090
await Promise.all(promises);
9191
}

0 commit comments

Comments
 (0)