Skip to content
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

Fixing top bar #125

Merged
merged 106 commits into from
Dec 14, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
106 commits
Select commit Hold shift + click to select a range
44026ce
class and fields defined
DenFlyvendeGed Oct 26, 2023
6aa3d5a
Made general Dialog component
tr0ub1eM4k3r Oct 30, 2023
e2236b9
created EngineStore
DenFlyvendeGed Oct 31, 2023
5d34b62
Made EngineSeperate component
SolarEarth37 Oct 31, 2023
9b02fbd
Engine store functions implemented
DenFlyvendeGed Oct 31, 2023
5417b3b
added function comments
DenFlyvendeGed Oct 31, 2023
49c641c
Updated syntax
DenFlyvendeGed Nov 2, 2023
ca19632
Merge branch '80-Create-class-for-engines-group5' of https://github.c…
tr0ub1eM4k3r Nov 2, 2023
4e1536a
updated getEngine
DenFlyvendeGed Nov 2, 2023
1973926
fixed overflow
DenFlyvendeGed Nov 2, 2023
0265823
added tests
DenFlyvendeGed Nov 2, 2023
3178c69
created more test cases
DenFlyvendeGed Nov 2, 2023
4380085
Merge branch 'main' of https://github.com/ECDAR-AAU-SW-P5/Ecdar-GUI-W…
DenFlyvendeGed Nov 2, 2023
24a2647
Formated
DenFlyvendeGed Nov 2, 2023
9db7a9a
Cleanup
DenFlyvendeGed Nov 2, 2023
31ae3b4
Added adding and deleting engines from the view
tr0ub1eM4k3r Nov 2, 2023
19fa937
Merge branch '80-Create-class-for-engines-group5' of https://github.c…
tr0ub1eM4k3r Nov 3, 2023
478e504
Made DTO for engines
tr0ub1eM4k3r Nov 6, 2023
31c5647
Merge branch '81-feature-frontend-for-engine-configuration-group5' of…
tr0ub1eM4k3r Nov 7, 2023
b8fb464
Made engineDTO work
tr0ub1eM4k3r Nov 7, 2023
d2389a3
Added functionality for saving engines in the ui
tr0ub1eM4k3r Nov 7, 2023
5245406
Made general css for the Engine UI
SolarEarth37 Nov 8, 2023
d72a5ca
Made CSS for engine delete button and UI
SolarEarth37 Nov 9, 2023
999e3ff
Added Google icons to deletion UI
SolarEarth37 Nov 9, 2023
4c6bc54
lint fixes
tr0ub1eM4k3r Nov 9, 2023
afd67e8
Merge branch '81-feature-frontend-for-engine-configuration-group5' of…
tr0ub1eM4k3r Nov 9, 2023
14dc709
lint changes
tr0ub1eM4k3r Nov 9, 2023
168e77c
Fixed delete UI buttons
SolarEarth37 Nov 9, 2023
1f29530
Merge branches '81-feature-frontend-for-engine-configuration-group5' …
SolarEarth37 Nov 9, 2023
d211c16
Fixed issue where deleted engine will get added
tr0ub1eM4k3r Nov 9, 2023
f9f7395
Made you unable to delete the last engine
tr0ub1eM4k3r Nov 9, 2023
168c025
made dialog backdrop
tr0ub1eM4k3r Nov 9, 2023
cce7526
Merge branch 'main' of
tr0ub1eM4k3r Nov 9, 2023
6b99890
Made engineUI openable from the topbar
tr0ub1eM4k3r Nov 9, 2023
389bb2f
Incorporated global CSS in Engine UI
SolarEarth37 Nov 9, 2023
061216e
typo
DenFlyvendeGed Nov 13, 2023
be42942
Merge branch '80-Create-class-for-engines-group5' of https://github.c…
tr0ub1eM4k3r Nov 13, 2023
e100fa0
Fixed lint issues
tr0ub1eM4k3r Nov 13, 2023
3e3766f
Merge branch 'main' of https://github.com/ECDAR-AAU-SW-P5/Ecdar-GUI-W…
tr0ub1eM4k3r Nov 13, 2023
8c8f31d
Removed unnecessary code
tr0ub1eM4k3r Nov 13, 2023
9874b23
Changed file names to be more style guide fitting
tr0ub1eM4k3r Nov 13, 2023
962b49e
Made ports min and max
tr0ub1eM4k3r Nov 13, 2023
ae08857
Added comments for functions
tr0ub1eM4k3r Nov 13, 2023
f61833c
Changed naming of interface
tr0ub1eM4k3r Nov 13, 2023
3bbd132
Changed spelling
tr0ub1eM4k3r Nov 16, 2023
d7113a5
Added increased usability when deleing engnies
tr0ub1eM4k3r Nov 16, 2023
f8d8311
Added issue with deleting the last engine
tr0ub1eM4k3r Nov 16, 2023
b591e72
Merge branch 'main' of https://github.com/ECDAR-AAU-SW-P5/Ecdar-GUI-Web
tr0ub1eM4k3r Nov 16, 2023
ad14aeb
lint
tr0ub1eM4k3r Nov 16, 2023
4f2feb0
Rename iEngineStorageObject.ts to IEngineStorageObject.ts
tr0ub1eM4k3r Nov 16, 2023
8d5e4b2
Rename iEngineUIComponent.ts to IEngineUIComponent.ts
tr0ub1eM4k3r Nov 16, 2023
daaa6c6
Rename iModalComponent.ts to IModalComponent.ts
tr0ub1eM4k3r Nov 16, 2023
e2501ad
Fixed no prompt when closing with unsaved data
tr0ub1eM4k3r Nov 16, 2023
b544cfa
Merge branch '81-feature-frontend-for-engine-configuration-group5' of…
tr0ub1eM4k3r Nov 16, 2023
afa9281
Added highlighting of misinformation
tr0ub1eM4k3r Nov 17, 2023
6fc9979
Added interface for the IEngineSeperateComponent
tr0ub1eM4k3r Nov 17, 2023
7de36b9
Checkbox fixed - missing safari support
christian140398 Nov 20, 2023
b000929
Merge branch 'main' of https://github.com/ECDAR-AAU-SW-P5/Ecdar-GUI-W…
tr0ub1eM4k3r Nov 20, 2023
d27fd6d
Changed static implementation of the EngineStorage
tr0ub1eM4k3r Nov 20, 2023
438ebef
lint
tr0ub1eM4k3r Nov 20, 2023
08e50aa
Added functionality for closing Modal
tr0ub1eM4k3r Nov 20, 2023
8e39a30
Set ModalCloseOnBackdrop to false if not defined
tr0ub1eM4k3r Nov 20, 2023
58ab0d9
Changed Button component to be more flexible
tr0ub1eM4k3r Nov 21, 2023
9b8b4ee
Merged main
tr0ub1eM4k3r Nov 21, 2023
3c42222
Moved tabindex
tr0ub1eM4k3r Nov 21, 2023
0c022e6
Moved validation helper functions to own file
tr0ub1eM4k3r Nov 21, 2023
997d921
Merge remote-tracking branch 'origin/main' into fixingTopBar
christian140398 Nov 22, 2023
95beadb
format
christian140398 Nov 22, 2023
8532817
Merge branch 'main' into 81-feature-frontend-for-engine-configuration…
DenFlyvendeGed Nov 22, 2023
0f9a8b5
implementing test - Not DONE
christian140398 Nov 23, 2023
0e7c0c2
lint
christian140398 Nov 23, 2023
3795e32
Merge remote-tracking branch 'origin/main' into fixingTopBar
christian140398 Nov 23, 2023
a302010
Fixed TopBar + added tests
christian140398 Nov 23, 2023
5106d40
Better test name
christian140398 Nov 23, 2023
0630e97
Not Done
christian140398 Nov 28, 2023
fa02996
Merge branch 'main' of https://github.com/ECDAR-AAU-SW-P5/Ecdar-GUI-W…
tr0ub1eM4k3r Nov 29, 2023
c5d2d87
fixed topbar
christian140398 Nov 29, 2023
6486f28
Update package.json
christian140398 Nov 29, 2023
8626b21
Delete yarn-error.log
tr0ub1eM4k3r Dec 5, 2023
88ca945
Fixed issues with useBundle implementation
tr0ub1eM4k3r Dec 5, 2023
b5b738f
Merge branch '81-feature-frontend-for-engine-configuration-group5' of…
tr0ub1eM4k3r Dec 5, 2023
ee1aa88
Merge branch 'main' into 81-feature-frontend-for-engine-configuration…
tr0ub1eM4k3r Dec 5, 2023
964abd8
Changed color to css variable
tr0ub1eM4k3r Dec 5, 2023
b0ac549
Merge branch '81-feature-frontend-for-engine-configuration-group5' of…
christian140398 Dec 6, 2023
98e5494
About using modal
christian140398 Dec 7, 2023
97c215a
implemented about test
christian140398 Dec 7, 2023
c012cb3
venter på merge med #81
christian140398 Dec 11, 2023
98e2d10
venter merge med 81
christian140398 Dec 13, 2023
d72fe39
lint
christian140398 Dec 13, 2023
c801130
fixed comments
christian140398 Dec 13, 2023
a7dcd98
lint
christian140398 Dec 13, 2023
7cfaf84
lint
christian140398 Dec 14, 2023
738c81b
Added modal
KamyaPA Dec 14, 2023
4dbb5e0
removed engine and kept modal
christian140398 Dec 14, 2023
feeae37
removed more engine + lint
christian140398 Dec 14, 2023
d507b7a
Implemented modals as stores
KamyaPA Dec 14, 2023
3a50c82
yarn format
KamyaPA Dec 14, 2023
9296367
Moved showSettings
KamyaPA Dec 14, 2023
d53bac0
Streamline inheritance
atjn Dec 14, 2023
32aa319
Remove debug code
atjn Dec 14, 2023
84102c7
Merge branch 'modal' of https://github.com/ECDAR-AAU-SW-P5/Ecdar-GUI-…
christian140398 Dec 14, 2023
5cee7c2
Merged and fixed with modal branch
christian140398 Dec 14, 2023
e503281
added comments
christian140398 Dec 14, 2023
17e3a17
Merge branch 'main' into fixingTopBar
KamyaPA Dec 14, 2023
80b60de
Missed merge conflict
KamyaPA Dec 14, 2023
6f16600
Merge branch 'main' into fixingTopBar
atjn Dec 14, 2023
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
77 changes: 75 additions & 2 deletions src/lib/GlobalCssProperties.json
Original file line number Diff line number Diff line change
Expand Up @@ -95,8 +95,48 @@
0.39901960784,
0.43823529411
],
"--engine-ui-underline-color": ["display-p3", 1, 1, 1],
"--engine-ui-error-underline-color": [
"display-p3",
0.82745098039,
0.18431372549,
0.18431372549
],
"--engine-ui-input-text-placeholder-color": [
"display-p3",
0.8,
0.8,
0.8
],
"--engine-ui-scrollbar-thumb-background-color": [
"display-p3",
0.5608,
0.498,
0.4353
],
"--engine-ui-scrollbar-thumb-color": [
"display-p3",
0.7137,
0.6941,
0.6706
],
"--engine-ui-text-color": ["display-p3", 1, 1, 1],
"--engine-ui-background-color": [
"display-p3",
0.2862745098,
0.34901960784,
0.38823529411
],
"--engine-ui-button-color": [
"display-p3",
0.2862745098,
0.34901960784,
0.38823529411
],
"--settings-danger-button-color": ["srgb", 0.498, 0.0902, 0.0549],
"--settings-safe-button-color": ["srgb", 0.3255, 0.498, 0.2667]
"--settings-safe-button-color": ["srgb", 0.3255, 0.498, 0.2667],
"--dropdown-button-color": ["srgb", 1, 1, 1],
"--dropdown-text-color": ["srgb", 0, 0, 0]
},
"fontSize": {
"--sidebar-fontsize": [1, "rem"],
Expand Down Expand Up @@ -206,7 +246,40 @@
0.13490196078,
0.14666666666,
0.17019607843
]
],
"--engine-ui-underline-color": ["display-p3", 1, 1, 1],
"--engine-ui-error-underline-color": [
"display-p3",
0.82745098039,
0.18431372549,
0.18431372549
],
"--engine-ui-input-text-placeholder-color": [
"display-p3",
0.7333,
0.7333,
0.7333
],
"--engine-ui-scrollbar-thumb-background-color": [
"display-p3",
0.95,
0.95,
0.95
],
"--engine-ui-scrollbar-thumb-color": ["display-p3", 0, 0, 0],
"--engine-ui-background-color": [
"display-p3",
0.08490196078,
0.09666666666,
0.12019607843
],
"--engine-ui-button-color": [
"display-p3",
0.08490196078,
0.09666666666,
0.12019607843
],
"--engine-ui-text-color": ["display-p3", 1, 1, 1]
}
},
{
Expand Down
10 changes: 10 additions & 0 deletions src/lib/classes/styling/ZodSchemas/CSSVariables.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,18 @@ export const ColorVariables = z
"--sidebar-text-color": ColorAttribute,
"--sidebar-element-color": ColorAttribute,
"--sidebar-element-hover-color": ColorAttribute,
"--engine-ui-underline-color": ColorAttribute,
"--engine-ui-error-underline-color": ColorAttribute,
"--engine-ui-input-text-placeholder-color": ColorAttribute,
"--engine-ui-scrollbar-thumb-background-color": ColorAttribute,
"--engine-ui-scrollbar-thumb-color": ColorAttribute,
"--engine-ui-text-color": ColorAttribute,
"--engine-ui-background-color": ColorAttribute,
"--engine-ui-button-color": ColorAttribute,
"--settings-danger-button-color": ColorAttribute,
"--settings-safe-button-color": ColorAttribute,
"--dropdown-button-color": ColorAttribute,
"--dropdown-text-color": ColorAttribute,
})
.strict();

Expand Down
12 changes: 9 additions & 3 deletions src/lib/components/overlayMenu/elements/Button.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,23 @@
export let icon: ComponentType;

export let text: string;

export let backgroundColor: string = "var(--dropdown-button-color)";

export let buttonColor: string = "var(--dropdown-text-color))";
</script>

<button on:click={click}>
<button
on:click={click}
style="background-color: {backgroundColor}; color: {buttonColor}"
>
<svelte:component this={icon} ariaLabel="" class="icon" tabindex="-1" />
<p>{text}</p>
</button>

<style>
button {
border: 0;
background-color: #fff;
display: flex;
align-items: center;
height: 2em;
Expand All @@ -30,6 +36,6 @@
}

button:hover {
background-color: #eee;
filter: brightness(0.9);
}
</style>
3 changes: 1 addition & 2 deletions src/lib/components/topBar/DropDownButton.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,14 @@
strokeWidth: "1.5",
size: "15",
variation: "filled",
color: color,
};
setContext("iconContext", iconContext);
</script>

<!--Make each dropdown item, into button-->

<button class="dropdown-item" on:click>
<svelte:component this={icon}></svelte:component>
<svelte:component this={icon} {color}></svelte:component>
<div class="align-text">{name}</div>
</button>

Expand Down
20 changes: 12 additions & 8 deletions src/lib/components/topBar/TopBar.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@
} from "svelte-google-materialdesign-icons";
import SettingsView from "$lib/components/settings/SettingsView.svelte";
import { showSettings } from "$lib/components/settings/showSettings";
import AboutUi from "./aboutUI/AboutUI.svelte";
import { showAboutUI } from "$lib/components/topBar/aboutUI/showAboutUI";

let projectHandler: typeof ProjectHandler;

Expand All @@ -41,7 +43,7 @@
-->

<!--File top bar button-->
<div>
<div class="container">
<TopBarButton name="File">
<DropDownButton
icon={Note_add}
Expand Down Expand Up @@ -110,7 +112,7 @@
</div>

<!--Edit top bar button-->
<div>
<div class="container">
<TopBarButton name="Edit">
<DropDownButton
icon={Arrow_left}
Expand Down Expand Up @@ -144,7 +146,7 @@
</div>

<!--View top bar button-->
<div>
<div class="container">
<TopBarButton name="View">
<DropDownCheckBox
name="Project Panel"
Expand Down Expand Up @@ -190,7 +192,7 @@
</div>

<!--Options top bar button-->
<div>
<div class="container">
<TopBarButton name="Options">
<DropDownCheckBox
name="UI cache"
Expand All @@ -214,7 +216,7 @@
icon={Settings_input_composite}
name="Engine Options"
on:click={() => {
console.log("Engine Options");
console.log("Engine options");
}}
/>
<DropDownButton
Expand All @@ -228,7 +230,7 @@
</div>

<!--Help top bar button-->
<div>
<div class="container">
<TopBarButton name="Help">
<DropDownButton
icon={Help}
Expand All @@ -241,16 +243,18 @@
icon={Error}
name="About"
on:click={() => {
console.log("About");
$showAboutUI = true;
}}
/>
</TopBarButton>
</div>

<!-- Add modal component here -->
<SettingsView />
<AboutUi />

<style>
div {
.container {
height: 100%;
display: block;
float: left;
Expand Down
39 changes: 39 additions & 0 deletions src/lib/components/topBar/aboutUI/AboutUI.svelte
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
<script lang="ts">
import Modal from "$lib/components/modal/Modal.svelte";
import { showAboutUI } from "./showAboutUI";
</script>

<Modal show={$showAboutUI}>
<div>
<div class="box">
<h1>Ecdar v. 0.1</h1>
<p>Made by:</p>
<p>&nbsp; 5. Semester, Aalborg University 2023</p>
<p>
For more information, go to
<a href="https://www.ecdar.net/" target="_blank">
www.Ecdar.net</a
>
</p>
</div>
<button
on:click={() => {
$showAboutUI = false;
}}>Close</button
>
</div>
</Modal>

<style>
.box {
height: 10em;
width: 30em;
padding-left: 1em;
color: var(--text-color);
}

button {
margin-left: 30em;
margin-bottom: 1em;
}
</style>
3 changes: 3 additions & 0 deletions src/lib/components/topBar/aboutUI/showAboutUI.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import { writable } from "svelte/store";

export const showAboutUI = writable(false);
3 changes: 3 additions & 0 deletions src/lib/interfaces/IAboutUI.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
export default interface IAboutUIComponent {
showAboutUI: () => void;
}
4 changes: 4 additions & 0 deletions src/lib/interfaces/IModalComponent.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
export default interface IModalComponent {
closeModal: () => void;
showModal: () => void;
}
20 changes: 20 additions & 0 deletions tests/lib/components/topBar/aboutUI/about.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import { test, expect } from "@playwright/test";

test.beforeEach(async ({ page }) => {
await page.goto("/");
await page.click("#start-new-project");
});

test("Navigating to Help, then About", async ({ page }) => {
await page.getByRole("button", { name: "Help", exact: true }).click();

await page.getByRole("button", { name: "error About" }).click();

const aboutBox = await page
.locator("dialog")
.locator(".box")
.locator("h1")
.innerHTML();

expect(aboutBox).toBe("Ecdar v. 0.1");
});
29 changes: 29 additions & 0 deletions tests/lib/components/topBar/topbar.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
import { test, expect } from "@playwright/test";

test.beforeEach(async ({ page }) => {
await page.goto("/");
await page.click("#start-new-project");
});

test("Check and uncheck Project Panel checkbox", async ({ page }) => {
await page.getByRole("button", { name: "View", exact: true }).click();
let color = await page
.getByRole("button", { name: "done Project Panel" })
.locator("svg")
.getAttribute("fill");
expect(color).toBe("transparent");

await page.getByRole("button", { name: "done Project Panel" }).click();
color = await page
.getByRole("button", { name: "done Project Panel" })
.locator("svg")
.getAttribute("fill");
expect(color).toBe("black");

await page.getByRole("button", { name: "done Project Panel" }).click();
color = await page
.getByRole("button", { name: "done Project Panel" })
.locator("svg")
.getAttribute("fill");
expect(color).toBe("transparent");
});
Loading
Loading