Skip to content

Commit f41c7cd

Browse files
authored
[OGUI-1763] Scrolling resets on object tree when source is layoutList or about page (#3263)
* moves the scrollable option to section parent * issue was presenting itself as scroll reset in the table of objectTree page when the user would navigate from layoutList or about pages * all pages were updated and now: * scroll is not reseting anymore * yellow blinking behaviour is now correctly appearing only for newly displayed nodes in object tree * tests timeouts have been either updated (to cover all tests) or added as some suits were missing it. Because of this, some tests were being cancelled by parent without being ran. Thus, some tests were failing and those were fixed
1 parent cb1f4da commit f41c7cd

File tree

8 files changed

+73
-55
lines changed

8 files changed

+73
-55
lines changed

QualityControl/public/common/header.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,9 @@ import { filtersPanel } from './filters/filterViews.js';
3333
export default (model) => {
3434
const specific = headerSpecific(model) || {};
3535
const { centerCol, rightCol, subRow } = specific;
36-
36+
const id = `qcg-header-${model.page}`;
3737
return h('.flex-col', [
38-
h('.flex-row.p2.items-center', { id: 'qcg-header' }, [
38+
h('.flex-row.p2.items-center', { id, key: id }, [
3939
commonHeader(model),
4040
centerCol || h('.flex-grow'),
4141
rightCol || h('.w-25'),

QualityControl/public/object/objectTreePage.js

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,11 +29,14 @@ import { downloadRootImageButton } from '../common/downloadRootImageButton.js';
2929
* @returns {vnode} - virtual node element
3030
*/
3131
export default (model) => {
32-
const { object, router } = model;
32+
const { object } = model;
3333
const { leftPanelWidthPercent } = object;
34-
return h('.h-100.flex-column', { key: `${router.params.page}` }, [
35-
h('.flex-row.flex-grow', [
36-
h('.scroll-y.flex-column', {
34+
return h('.flex-column.h-100', {
35+
key: 'object-tree-page-container',
36+
}, [
37+
h('.flex-row', { style: 'flex-grow: 1; height: 0;' }, [
38+
h('.flex-column.scroll-y', {
39+
key: 'object-tree-scroll-container',
3740
style: {
3841
width: object.selected ? `${leftPanelWidthPercent}%` : '100%',
3942
},

QualityControl/public/pages/aboutView/AboutViewPage.js

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,20 @@ import { h } from '/js/src/index.js';
1919

2020
/**
2121
* Shows a page to view framework information
22-
* @param {Model} model - root model of the application
22+
* @param {AboutViewModel} aboutViewModel - root model of the application
2323
* @returns {vnode} - virtual node element
2424
*/
25-
export default (model) => h(
26-
'.p2.absolute-fill.text-center',
27-
servicesLoadingPanel(model.aboutViewModel.services[ServiceStatus.LOADING]),
28-
servicesResolvedPanel(model.aboutViewModel.services[ServiceStatus.ERROR], 'error'),
29-
servicesResolvedPanel(model.aboutViewModel.services[ServiceStatus.SUCCESS], 'success'),
30-
);
25+
export default (aboutViewModel) => {
26+
const { services } = aboutViewModel;
27+
return [
28+
h(
29+
'.flex-column.flex-grow.p2.text-center',
30+
{ key: 'about-view-page' },
31+
[
32+
servicesLoadingPanel(services[ServiceStatus.LOADING]),
33+
servicesResolvedPanel(services[ServiceStatus.ERROR], 'error'),
34+
servicesResolvedPanel(services[ServiceStatus.SUCCESS], 'success'),
35+
],
36+
),
37+
];
38+
};

QualityControl/public/pages/layoutListView/LayoutListPage.js

Lines changed: 20 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -23,33 +23,25 @@ import { filtersPanelPopover } from './filtersPanelPopover.js';
2323
* @import LayoutListModel from './model/LayoutListModel.js';
2424
*/
2525
export default (layoutListModel) => [
26-
h('.scroll-y.absolute-fill', [
27-
h(
28-
'.flex-row.text-right.m2',
29-
[
30-
filtersPanelPopover(layoutListModel.searchFilterModel),
31-
h(
32-
'input.form-control.form-inline.mh1.w-33',
33-
{
34-
placeholder: 'Layout name',
35-
type: 'text',
36-
value: layoutListModel.searchFilterModel.searchInput,
37-
oninput: (e) => {
38-
layoutListModel.search(e.target.value);
39-
},
40-
},
41-
),
42-
h('.p1', [
43-
h(
44-
'.mh1',
45-
layoutListModel.searchFilterModel.stringifyActiveFiltersFriendly(),
46-
),
47-
]),
48-
],
49-
),
50-
51-
h('', {
52-
style: 'display: flex; flex-direction: column',
53-
}, Array.from(layoutListModel.folders.values()).map(FolderComponent)),
26+
h('.flex-row.text-right.m2', [
27+
filtersPanelPopover(layoutListModel.searchFilterModel),
28+
h('input.form-control.form-inline.mh1.w-33', {
29+
placeholder: 'Layout name',
30+
type: 'text',
31+
value: layoutListModel.searchFilterModel.searchInput,
32+
oninput: (e) => {
33+
layoutListModel.search(e.target.value);
34+
},
35+
}),
36+
h('.p1', [
37+
h(
38+
'.mh1',
39+
layoutListModel.searchFilterModel.stringifyActiveFiltersFriendly(),
40+
),
41+
]),
5442
]),
43+
44+
h('', {
45+
key: 'layout-list-page-folders-container',
46+
}, Array.from(layoutListModel.folders.values()).map(FolderComponent)),
5547
];

QualityControl/public/view.js

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,13 @@ export default (model) => [
3636
model.isImportVisible && layoutImportModal(model),
3737
h('.absolute-fill.flex-column', [
3838
h('header.shadow-level2.level2', [header(model)]),
39-
h('.flex-grow.flex-row.outline-gray', [
39+
h('.flex-row.flex-grow', {
40+
key: 'main-content',
41+
}, [
4042
sidebar(model),
41-
h('section.outline-gray.flex-grow.relative', page(model)),
43+
h('section', {
44+
style: 'flex-grow: 1; position: relative; overflow: auto;',
45+
}, page(model)),
4246
]),
4347
]),
4448
notification(model.notification),
@@ -55,7 +59,7 @@ function page(model) {
5559
case 'layoutShow': return layoutViewPage(model);
5660
case 'objectTree': return objectTreePage(model);
5761
case 'objectView': return ObjectViewPage(model.objectViewModel);
58-
case 'about': return AboutViewPage(model);
62+
case 'about': return AboutViewPage(model.aboutViewModel);
5963

6064
// Should be seen only at the first start when the view is not yet really to be shown (data loading)
6165
default: return null;

QualityControl/test/public/features/filterTest.test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -254,7 +254,7 @@ export const filterTests = async (url, page, timeout = 5000, testParent) => {
254254
});
255255

256256
await testParent.test('ObjectTree infoPanel should show filtered object versions', { timeout }, async () => {
257-
const versionsPath = '.outline-gray.flex-grow.relative select option';
257+
const versionsPath = 'section select option';
258258
await page.locator('tr:last-of-type td').click();
259259
await page.waitForSelector(versionsPath);
260260

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,14 +30,14 @@ export const layoutListPageTests = async (url, page, timeout = 5000, testParent)
3030
const allLayoutIndex = 2;
3131
const allLayoutIndex2 = 3;
3232

33-
const basePath = (index) => `section > div > div:nth-child(${index})`;
33+
const basePath = (index) => `section > div:nth-child(${index})`;
3434
const toggleFolderPath = (index, index2) => index2 ? `${basePath(index)} > div:nth-child(${index2}) > div > b` :
3535
`${basePath(index)} div > b`;
3636
const cardPath = (index, cardIndex) => `${basePath(index)} .card:nth-child(${cardIndex})`;
3737
const cardLayoutLinkPath = (cardPath) => `${cardPath} a`;
3838
const cardOfficialButtonPath = (cardPath) => `${cardPath} > .cardHeader > button`;
3939

40-
const filterPath = 'section > div > div:nth-child(1) > input';
40+
const filterPath = 'section > div > input';
4141
const filterObjectPath = 'input.form-control:nth-child(1)';
4242

4343
await testParent.test('should successfully load layoutList page "/"', { timeout }, async () => {

QualityControl/test/test-index.js

Lines changed: 19 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -104,20 +104,25 @@ const FRONT_END_PER_TEST_TIMEOUT = 5000; // each front-end test is allowed this
104104

105105
const INITIAL_PAGE_SETUP_TIMEOUT = FRONT_END_PER_TEST_TIMEOUT * 5;
106106
const QC_DRAWING_OPTIONS_TIMEOUT = FRONT_END_PER_TEST_TIMEOUT * 13;
107-
const LAYOUT_LIST_PAGE_TIMEOUT = FRONT_END_PER_TEST_TIMEOUT * 6;
108-
const OBJECT_TREE_PAGE_TIMEOUT = FRONT_END_PER_TEST_TIMEOUT * 6;
107+
const LAYOUT_LIST_PAGE_TIMEOUT = FRONT_END_PER_TEST_TIMEOUT * 17;
108+
const OBJECT_TREE_PAGE_TIMEOUT = FRONT_END_PER_TEST_TIMEOUT * 20;
109109
const OBJECT_VIEW_FROM_OBJECT_TREE_PAGE_TIMEOUT = FRONT_END_PER_TEST_TIMEOUT * 5;
110-
const OBJECT_VIEW_FROM_LAYOUT_SHOW_PAGE_TIMEOUT = FRONT_END_PER_TEST_TIMEOUT * 4;
110+
const OBJECT_VIEW_FROM_LAYOUT_SHOW_PAGE_TIMEOUT = FRONT_END_PER_TEST_TIMEOUT * 17;
111111
const LAYOUT_SHOW_PAGE_TIMEOUT = FRONT_END_PER_TEST_TIMEOUT * 23;
112112
const ABOUT_VIEW_PAGE_TIMEOUT = FRONT_END_PER_TEST_TIMEOUT * 4;
113+
const FILTER_TEST_TIMEOUT = FRONT_END_PER_TEST_TIMEOUT * 26;
114+
const RUN_MODE_TEST_TIMEOUT = FRONT_END_PER_TEST_TIMEOUT * 10;
113115

114116
const FRONT_END_TIMEOUT = INITIAL_PAGE_SETUP_TIMEOUT
115117
+ QC_DRAWING_OPTIONS_TIMEOUT
116118
+ LAYOUT_LIST_PAGE_TIMEOUT
117119
+ OBJECT_TREE_PAGE_TIMEOUT
118120
+ OBJECT_VIEW_FROM_OBJECT_TREE_PAGE_TIMEOUT
119121
+ OBJECT_VIEW_FROM_LAYOUT_SHOW_PAGE_TIMEOUT
120-
+ LAYOUT_SHOW_PAGE_TIMEOUT;
122+
+ LAYOUT_SHOW_PAGE_TIMEOUT
123+
+ ABOUT_VIEW_PAGE_TIMEOUT
124+
+ FILTER_TEST_TIMEOUT
125+
+ RUN_MODE_TEST_TIMEOUT;
121126

122127
const BACK_END_TIMEOUT = 10000; // back-end test suite timeout
123128

@@ -181,11 +186,17 @@ suite('All Tests - QCG', { timeout: FRONT_END_TIMEOUT + BACK_END_TIMEOUT }, asyn
181186
{ timeout: ABOUT_VIEW_PAGE_TIMEOUT },
182187
async (testParent) => await aboutPageTests(url, page, FRONT_END_PER_TEST_TIMEOUT, testParent),
183188
);
184-
test('should successfully import and run tests for filter', async (testParent) =>
185-
await filterTests(url, page, FRONT_END_PER_TEST_TIMEOUT, testParent));
189+
test(
190+
'should successfully import and run tests for filter',
191+
{ timeout: FILTER_TEST_TIMEOUT },
192+
async (testParent) => await filterTests(url, page, FRONT_END_PER_TEST_TIMEOUT, testParent),
193+
);
186194

187-
test('should successfully use run mode when available', async (testParent) =>
188-
await runModeTests(url, page, FRONT_END_PER_TEST_TIMEOUT, testParent));
195+
test(
196+
'should successfully use run mode when available',
197+
{ timeout: RUN_MODE_TEST_TIMEOUT },
198+
async (testParent) => await runModeTests(url, page, FRONT_END_PER_TEST_TIMEOUT, testParent),
199+
);
189200
});
190201

191202
suite('API - test suite', { timeout: FRONT_END_TIMEOUT }, async () => {

0 commit comments

Comments
 (0)