Skip to content

Initial implementation of ASD Dashboard with customizable boards, views and widgets #1

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 124 commits into from
Jun 12, 2025
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
124 commits
Select commit Hold shift + click to select a range
1fae275
dashboard 0.1
Oct 1, 2024
cd6ed97
Use CSS order to change the order of elements
Oct 1, 2024
5e93f47
Restore widgets from localstorage
Oct 1, 2024
da71752
Split logic into feature files. Saved WidgetState after creating, res…
Oct 1, 2024
c26fcb6
Updated styles to utilize screen space as much as possible. Remobed h…
Oct 1, 2024
759a41d
Basis resize buttons implemented
Oct 1, 2024
7fc8972
Resize button and service worker
Oct 1, 2024
8d196e4
NodeJS or Python
Oct 1, 2024
54f3eaf
Correct arrow/unicode usage
Oct 1, 2024
1a70aa4
Impl: emojilist with unicode representations of our icons including a…
Oct 1, 2024
3b3da7e
More eoji widgets and fixed some incorrect unicode references
Oct 2, 2024
300ea2d
More emoji icons
Oct 2, 2024
69d7982
Migrating flex to grid CSS
Oct 2, 2024
44c8fe6
removed redundant main css
Oct 2, 2024
c6578c6
Migrated create and add widget functions from flex to grid
Oct 2, 2024
a5d78b7
css grid style migraton semi stable. Update localstorage and have a r…
Oct 2, 2024
791da45
Improve class naming for widget ordering
Oct 2, 2024
e51d888
Convert hor and ver resizing to grid css
Oct 2, 2024
76db786
save-boardboard->save-widget-order
Oct 2, 2024
5c31ae1
More naming convention improvements
Oct 2, 2024
edcb35e
Now we use the correct JavaScript Unicode escape sequence our unicode…
Oct 2, 2024
dbf349a
CSS update for wide and ultra wide screens
Oct 2, 2024
3b0f123
Correct SPA to PWA
Oct 2, 2024
659de60
Impl: hide MenuResizeBlock
Oct 2, 2024
86a4251
Create a widget-menu to contain all widget buttons for better element…
Oct 2, 2024
44110bc
mouseenter and mouseleave don't bubble like mouseover and mouseout, w…
Oct 2, 2024
d47ffb9
Added an event to catch the mouse leaving resize-menu-block. Now we c…
Oct 2, 2024
824eda7
Package.json and .gitignore
Oct 2, 2024
4be0a51
Emoji upd
Oct 2, 2024
1bbd4cd
Very messy but working drag and drop
Oct 2, 2024
b7ed48d
Smooth workign drag and drop by using overlays to prevent any iframe …
Oct 2, 2024
e475934
Cleanup and restore of the reset and add-widget feature. Aligned the …
Oct 2, 2024
cd3905c
Board ordering works again
Oct 2, 2024
633b681
fullscreenToggle
Oct 2, 2024
df9cca7
Design tuning
Oct 2, 2024
559930b
Docs
Oct 2, 2024
013c78f
Limiting widget via config.json works as expected.
Oct 3, 2024
8272d13
resize-menu-block options are mapped via services.json config min and…
Oct 4, 2024
14ba697
cleanup and cache config.json
Oct 4, 2024
fb50641
Moving files to dedicated folders, updating imports, cleaning unused …
Oct 5, 2024
0d76249
Moved files to src
Oct 5, 2024
ac20993
Fixed fullscreen after AI mess
Oct 5, 2024
4d05ca3
Ignore config and add config/services example files
Oct 5, 2024
d79ae64
First lint-fix
Oct 5, 2024
cb0a31e
Standard lint fixes
Oct 5, 2024
69aa6bc
Zero lint errors
Oct 5, 2024
e3151e1
Almost succesfull tests :D
Oct 9, 2024
51dffe3
- Mocked 3 iframe endpoints
Oct 11, 2024
ca20c67
Found the reason for tests not being able to verify order. We no use …
Oct 12, 2024
3e80067
feat: Add stable UI tests for ASD Dashboard features
Oct 12, 2024
a6749c7
Updated README
Oct 12, 2024
438ddc2
Cleanup config
Oct 12, 2024
b4c110f
husky init
Oct 12, 2024
1ecca9b
Playwright CI
Oct 12, 2024
30cdae2
Back to npm, less installation needed and project will remain small i…
Oct 12, 2024
14f1cba
Yarn -> npm
Oct 12, 2024
7ca5b03
Stabilized test, improved css and namingconvention
Oct 12, 2024
137536f
Fixed .resize-menu-block to no longer be confined within the bounds o…
Oct 12, 2024
265a3a5
Mock config.json
Oct 12, 2024
1fbcdba
Drafted a configuration file with boards, views and widgetStates in m…
Oct 12, 2024
039b718
- deleted widget-order-selector
Oct 12, 2024
e45059c
Major cleanup and focusing on reducing board and widget complexity.
Oct 12, 2024
7a686fb
Correct savedWidgetState if null, look for the board. This solved tes…
Oct 12, 2024
99ae818
Basic view, cannot load widgets in the view yet.
Oct 12, 2024
070fefb
Pretty garbage so far but I managed to switch to a secondboard it's v…
Oct 12, 2024
0b8eeb9
Can finally add widgets to the view and any new views of boards other…
Oct 12, 2024
86e5825
Stabilization
Oct 12, 2024
578b63b
The view-selector updates accordingly without showing views from the …
Oct 12, 2024
3024f43
loadDashboardFromConfig: true
Oct 12, 2024
7e46881
Config correction
Oct 12, 2024
ac59da8
Loading defaults from config.json 40% working
Oct 12, 2024
8c20893
Loaded dashboard with 2 views from config.
Oct 12, 2024
c7966cb
Action: Start the server using `npm start`.
Oct 12, 2024
e364264
localStorage Edit modal and CSS splitting.
Oct 12, 2024
895b7a4
Can save and edit localstorage.
Oct 12, 2024
731bc9b
Edit modal can only be opened once.
Oct 12, 2024
019492b
Finished src/component/modal/localStorageModal.js
Oct 12, 2024
279b34c
Update README.md
kwuite Oct 12, 2024
302cd8f
Board and View Dropdown to safe UI space
Oct 13, 2024
51b3aba
Shared dropdown logic
Oct 13, 2024
8b8d657
Solve missing metadata issue
Oct 13, 2024
3ab7aad
READNE upd
Oct 13, 2024
481a743
Fixed missing config elements in test
Oct 13, 2024
dcf8033
README upd
Oct 13, 2024
38f349d
consolidated both controls and controls-panel into a new menu design
Oct 13, 2024
8babb8e
Improved UI controls for admin aprts like sservice worker and localst…
Oct 13, 2024
c2c85e9
Now we have a notification component. Helps reduce negative impact of…
Oct 13, 2024
38c7a1e
Board DropDown Playwright spec
Oct 13, 2024
937965e
View Dropdown Playwright spec
Oct 13, 2024
13bec75
Implemented logic to merge Playwright videos
Oct 13, 2024
ade9755
Add titles to playwright videos.
Oct 13, 2024
35d7052
Resizing via corner is now a thing.
Oct 13, 2024
282a6db
Resizing Playwright testcase.
Oct 13, 2024
778fb0b
Optimized style and ensured widget resize method adheres to both serv…
Oct 13, 2024
d0e2986
Logger class for cleaning up logs but keep most of them for debugging…
Oct 13, 2024
86e1c88
Finally clean a clean controlled console.
Oct 13, 2024
1fbffc8
Fixed resizeMenuBlock not saving because of sync to async function sw…
Oct 13, 2024
24feb01
Stable test again.
Oct 13, 2024
5500b6d
localStorageEditor.spec.ts
Oct 13, 2024
718026e
Fixed Firefox test for localStorageEditor.spec.ts
Oct 13, 2024
e5d0dcc
Test spec name change from ASD dashboard to Widget
Oct 13, 2024
61f0f75
README upd
Oct 13, 2024
66ac248
README human correction
Oct 14, 2024
6eff5ef
Clarified License
Oct 15, 2024
5878843
Merge main and fix commit history?
Oct 15, 2024
bfd3b9a
Removed duplicate sentence.
Oct 15, 2024
80f1e1e
removed them ref
Oct 15, 2024
7f97941
Saving state when switching or creating views and boards so we always…
Oct 15, 2024
21da1eb
Semi stabilized saving lastUsedView and lastUsedBoard. Implemented wi…
Oct 15, 2024
2e487df
Stability patches
Oct 15, 2024
fe87a9f
Lazyload iframes
Oct 15, 2024
9fb5830
Add test case should generate widgets with unique and persistent UUIDs
Oct 15, 2024
d5af941
Increase widgets for testing
Oct 15, 2024
9405e8e
Allow dropping of widgets in open space.
Oct 15, 2024
81b3ef3
bigger buttons
Oct 15, 2024
a73b2c7
Menu refactoring and consolidating unicode char usage
Oct 15, 2024
0908d6e
Localstorage Editor update
Oct 15, 2024
276aacc
Localstorage Editor update
Oct 15, 2024
c52d044
Renamed Recovery Modal to ServiceLaunch and improved CSS
Oct 15, 2024
a25ec34
Prevent lastUsedBoards to be used if they do not exist. Minor fixes.
Oct 15, 2024
9b352cb
Stability patches
Oct 15, 2024
326691f
Stable Cypress localStorage logic and testing
Oct 15, 2024
cd9118c
Improved resizeHandle test but not no avail for Firefox
Oct 16, 2024
a5b5ae2
32 Passed green checks multiple times in a row with Chrome and Webkit…
Oct 16, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Add test case should generate widgets with unique and persistent UUIDs
  • Loading branch information
kwuite committed Oct 15, 2024
commit 9fb5830183f01a275fa18f670a15850364331b96
41 changes: 39 additions & 2 deletions tests/addManageWidgets.spec.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { test, expect, type Page } from '@playwright/test';
import emojiList from '../src/ui/unicodeEmoji.js';
import { routeServicesConfig } from './shared/mocking.js';
import { addServices, selectServiceByName } from './shared/common.js';
import { addServices, selectServiceByName, addServicesByName } from './shared/common.js';
import { widgetUrlOne, widgetUrlTwo, widgetUrlThree, widgetUrlFour } from './shared/constant.js';


Expand All @@ -10,9 +10,21 @@ test.describe('Widgets', () => {
test.beforeEach(async ({ page }) => {
await routeServicesConfig(page)
await page.goto('/');
await page.evaluate(() => {
localStorage.setItem('log', 'widgetManagement');
});
});

test(`should be able to add 4 services and drag and drop ${emojiList.pinching.unicode}`, async ({ page }) => {
const logs: string[] = [];

// Listen for console events
page.on('console', msg => {
if (msg.type() === 'log') {
logs.push(msg.text());
}
});

const widgetCount = 4

// Add 4 services
Expand Down Expand Up @@ -132,8 +144,34 @@ test.describe('Widgets', () => {
// fourthWidget
expect(orderBeforeDragDrop[widgetUrlFour]).toBe("3");
expect(orderAfterReload[widgetUrlFour]).toBe("2");

const uuidLog = logs.find(log => log.includes('[widgetManagement][iframe.onload] Iframe loaded successfull'));
expect(uuidLog).toBeDefined();
});

test('should generate widgets with unique and persistent UUIDs', async ({ page }) => {
// Add multiple widgets
await addServicesByName(page, 'ASD-terminal',10);

// Collect UUIDs of all widgets
const widgetUUIDs = await page.locator('.widget-wrapper').evaluateAll(widgets =>
widgets.map(widget => widget.getAttribute('data-dataid'))
);

// Check that all UUIDs are defined
widgetUUIDs.forEach(uuid => expect(uuid).toBeDefined());

// Check that all UUIDs are unique
const uniqueUUIDs = new Set(widgetUUIDs);
expect(uniqueUUIDs.size).toEqual(widgetUUIDs.length);

// Reload and check if UUIDs persist
await page.reload();
const reloadedWidgetUUIDs = await page.locator('.widget-wrapper').evaluateAll(widgets =>
widgets.map(widget => widget.getAttribute('data-dataid'))
);
expect(reloadedWidgetUUIDs).toEqual(widgetUUIDs);
});

test(`should be able to change the widget url ${emojiList.link.unicode}`, async ({ page }) => {
await addServices(page, 2);
Expand Down Expand Up @@ -163,7 +201,6 @@ test.describe('Widgets', () => {
await expect(firstWidget).toHaveClass(/fullscreen/);
await page.keyboard.press('Escape');
await expect(firstWidget).not.toHaveClass(/fullscreen/);

});


Expand Down
6 changes: 3 additions & 3 deletions tests/boardDropdown.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ test.describe('Board Dropdown Functionality', () => {
await handleDialog(page, 'prompt', newBoardName);

await page.click('#board-dropdown .dropbtn');
await page.click('a[data-action="create"]');
await page.click('#board-control a[data-action="create"]');

// Assert that the new board appears in the dropdown
const boardSelector = await page.locator('#board-selector');
Expand All @@ -41,7 +41,7 @@ test.describe('Board Dropdown Functionality', () => {

// Assuming a board named 'Test Board' exists
await page.click('#board-dropdown .dropbtn');
await page.click('.dropdown-content a[data-action="rename"]');
await page.click('#board-control a[data-action="rename"]');

// Assert that the board name is updated in the dropdown
const boardSelector = await page.locator('#board-selector');
Expand All @@ -58,7 +58,7 @@ test.describe('Board Dropdown Functionality', () => {

// Assuming a board named 'Test Board' exists
await page.click('#board-dropdown .dropbtn');
await page.click('a[data-action="delete"]');
await page.click('#board-control a[data-action="delete"]');

// Assert that the board is removed from the dropdown
const boardSelector = await page.locator('#board-selector');
Expand Down
6 changes: 6 additions & 0 deletions tests/shared/common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,3 +32,9 @@ export async function getBoardsFromLocalStorage(page) {
return item ? JSON.parse(item) : [];
});
}

export async function addServicesByName(page: Page, serviceName: string, count: number) {
for (let i = 0; i < count; i++) {
await selectServiceByName(page, serviceName);
}
}