Skip to content

Commit cb7fab4

Browse files
authored
Merge branch 'dev' into feature/CNF/OGUI-1701/session-service
2 parents 22dc803 + 67f5e31 commit cb7fab4

6 files changed

Lines changed: 99 additions & 44 deletions

File tree

QualityControl/package-lock.json

Lines changed: 41 additions & 38 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

QualityControl/package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,10 +47,10 @@
4747
"umzug": "^3.8.2"
4848
},
4949
"devDependencies": {
50-
"@eslint/js": "^9.36.0",
50+
"@eslint/js": "^9.37.0",
5151
"@stylistic/eslint-plugin-js": "^4.4.0",
52-
"eslint": "^9.36.0",
53-
"eslint-plugin-jsdoc": "^60.7.1",
52+
"eslint": "^9.37.0",
53+
"eslint-plugin-jsdoc": "^60.8.3",
5454
"globals": "^16.4.0",
5555
"nock": "^15.0.0",
5656
"puppeteer": "^24.23.0",

QualityControl/public/common/filters/model/FilterModel.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -189,8 +189,7 @@ export default class FilterModel extends Observable {
189189
*/
190190
async deactivateRunsMode(baseViewModel) {
191191
this.resetRunsMode();
192-
await baseViewModel.triggerFilter();
193-
this.notify();
192+
this.clearFilter(baseViewModel);
194193
}
195194

196195
/**

QualityControl/public/layout/Layout.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -258,6 +258,7 @@ export default class Layout extends BaseViewModel {
258258
}
259259
const result = await this.model.services.layout.saveLayout(this.item);
260260
if (result.isSuccess()) {
261+
await this.model.services.layout.getLayoutsByUserId(this.model.session.personid);
261262
this.model.notification.show(`Layout "${this.item.name}" has been saved successfully.`, 'success');
262263
} else {
263264
this.item = this.editOriginalClone;

QualityControl/test/public/features/runMode.test.js

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,16 @@ export const runModeTests = async (url, page, timeout = 5000, testParent) => {
142142
isRunModeActive = await page.evaluate(() => window.model.filterModel.isRunModeActivated);
143143
ok(!isRunModeActive, 'Run mode should be deactivated after clicking checkbox');
144144

145-
//check the filters element is back again
145+
//check the filters element is back again and run number and URL are cleared
146146
await page.locator('#filterElement');
147+
const currentUrl = await page.evaluate(() => window.location.href);
148+
ok(!currentUrl.includes('RunNumber=500001'), 'URL should not contain RunNumber parameter after disabling run mode');
149+
150+
//filterElement to be empty
151+
const filterElementContent = await page.evaluate(() => {
152+
const filterElement = document.querySelector('#runNumberFilter');
153+
return filterElement.textContent.trim();
154+
});
155+
strictEqual(filterElementContent, '', 'Filter element should be empty after disabling run mode');
147156
});
148157
};

QualityControl/test/public/pages/layout-show.test.js

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -435,6 +435,49 @@ export const layoutShowTests = async (url, page, timeout = 5000, testParent) =>
435435
const location2 = await page.evaluate(() => window.location);
436436
strictEqual(location2.search, `?page=layoutShow&layoutId=${LAYOUT_ID}&tab=test`);
437437
});
438+
439+
await testParent.test(
440+
'should update layout name in sidebar when name is changed and saved via JSON editor',
441+
{ timeout },
442+
async () => {
443+
const originalSidebarName = await page.evaluate(() => {
444+
const sidebarLayoutLink = document.querySelector('nav a.menu-item.w-wrapped.selected span:nth-child(2)');
445+
return sidebarLayoutLink ? sidebarLayoutLink.textContent.trim() : null;
446+
});
447+
448+
const editDropdownButtonPath = '.btn-group > div > button';
449+
await page.locator(editDropdownButtonPath).click();
450+
await delay(100);
451+
452+
const editViaJSONButtonPath = '#editByJson';
453+
await page.locator(editViaJSONButtonPath).click();
454+
await delay(100);
455+
456+
const currentJSON = await page.evaluate(() => {
457+
const textareaPath = 'body > div > div > div > div > textarea';
458+
return document.querySelector(textareaPath).value;
459+
});
460+
461+
const layoutData = JSON.parse(currentJSON);
462+
const newLayoutName = 'Updated Layout Name Test';
463+
layoutData.name = newLayoutName;
464+
465+
const textareaPath = '#layout-json-editor';
466+
await page.locator(textareaPath).fill(JSON.stringify(layoutData));
467+
468+
const updateButtonPath = '#updateLayoutButton';
469+
await page.locator(updateButtonPath).click();
470+
await delay(200);
471+
472+
const updatedSidebarName = await page.evaluate(() => {
473+
const sidebarLayoutLink = document.querySelector('nav a.menu-item.w-wrapped.selected span:nth-child(2)');
474+
return sidebarLayoutLink ? sidebarLayoutLink.textContent.trim() : null;
475+
});
476+
477+
strictEqual(updatedSidebarName, newLayoutName);
478+
ok(originalSidebarName !== updatedSidebarName, 'Sidebar name should have changed from original');
479+
},
480+
);
438481
};
439482

440483
const checkInvalidJSON = async (page, mockedJSON, errorMessage) => {

0 commit comments

Comments
 (0)