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

New toasts and icons #5551

Merged
merged 25 commits into from
Feb 14, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
41646b9
refactor(toast): Update UI, dont use NGBm create toast types and defi…
FilipLeitner Feb 10, 2025
32bd68b
feat(config): Add possiblity to anchor toasts to screen or map
FilipLeitner Feb 10, 2025
c6d827d
refactor: Adjust to toast message component changes
FilipLeitner Feb 10, 2025
8f53ca2
refactor(hslayers): Simplify local state vars
FilipLeitner Feb 10, 2025
c80d8ae
refactor(css): Remove whhg font, replace it with fontawesome and crea…
FilipLeitner Feb 10, 2025
ab1473a
refactor:Use fontawesome icons
FilipLeitner Feb 11, 2025
f88e7f3
refactor(icons): Use npm fontawesome package instead of local files
FilipLeitner Feb 11, 2025
2fa68dd
fix(icons): Correct path for icon font css file
FilipLeitner Feb 11, 2025
5273672
fix(query): Better track by property
FilipLeitner Feb 11, 2025
12553ec
refactor(icons): Dont try to include any whgg icons
FilipLeitner Feb 11, 2025
054eb1e
chore(scirpts): Add subset icon script
FilipLeitner Feb 11, 2025
2f7de5c
refactor(toast): More appropriate icons
FilipLeitner Feb 11, 2025
ae32cec
refactor(toasts): Danger toast message as default
FilipLeitner Feb 11, 2025
f068c1d
refactor(toasts): Handle overflowing toasts
FilipLeitner Feb 11, 2025
e80b11f
chore: Rename fontawesome folder to icons
FilipLeitner Feb 12, 2025
341e4fd
fix(icons): Include icon css in build and fix paths
FilipLeitner Feb 12, 2025
7df4e1f
refactor(icons): Modify subset icon script to be usable via cmd line …
FilipLeitner Feb 12, 2025
c8a7e9b
refactor(test-app): Generate and use custom icons
FilipLeitner Feb 12, 2025
cbb69b6
test: Update e2e tests
FilipLeitner Feb 12, 2025
982ce99
fix(layermanager): Animated layer group chevrons
FilipLeitner Feb 14, 2025
0791caa
refactor(sidebar): Sidebar description font weight change
FilipLeitner Feb 14, 2025
68a74b3
refactor: Add eraser, replace ban, move query styles to component
FilipLeitner Feb 14, 2025
b50a75f
refactor(icons): Change cesium toggle icon
FilipLeitner Feb 14, 2025
50f0c83
chore(test-app): Remove test icons
FilipLeitner Feb 14, 2025
b1e3f2d
fix(icons): Revert change of icon-primary to fa-primary
FilipLeitner Feb 14, 2025
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
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -32,3 +32,5 @@ cypress/screenshots
cypress/downloads/*
cypress/tests/__image_snapshots__
.cursorignore
.cursorrules
.venv/
3 changes: 2 additions & 1 deletion angular.json
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,8 @@
}
],
"styles": [
"projects/hslayers/css/hslayers-ng.scss"
"projects/hslayers/css/hslayers-ng.scss",
"projects/test-app/custom-fa-icons.css"
],
"scripts": [],
"customWebpackConfig": {
Expand Down
6 changes: 3 additions & 3 deletions cypress/tests/layer-editor.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,22 +7,22 @@ describe('Hslayers application', () => {
});

it('Should not be possible to change base/thematic type for vector layer', () => {
cy.get('[data-test="Points"] span.icon-settingsthree-gears ').click();
cy.get('[data-test="Points"] span.fa-gears ').click();
cy.get('hs-layer-editor form').within(() => {
cy.get('hs-layer-type-switcher-widget').should('exist');
cy.get('hs-layer-type-switcher-widget div').should('not.exist');
});
});

it('Should be possible to find base/thematic type toggle for WMS layer', () => {
cy.get('[data-test="EVI"] span.icon-settingsthree-gears ').click();
cy.get('[data-test="EVI"] span.fa-gears ').click();
cy.get('hs-layer-editor form').within(() => {
cy.get('hs-layer-type-switcher-widget div').should('exist');
});
});

it.only('Should be possible to change type of WMS layer back and forth', () => {
cy.get('[data-test="EVI"] span.icon-settingsthree-gears ').click();
cy.get('[data-test="EVI"] span.fa-gears ').click();

//Change to BASE
cy.get('hs-layer-editor form hs-layer-type-switcher-widget div')
Expand Down
6 changes: 3 additions & 3 deletions cypress/tests/layermanager.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ describe('Hslayers application', () => {
//Enable EVI layer and zoom to its extent
cy.get('[data-test="EVI"] button.hs-lm-item-visibility').click();
cy.wait(2000);
cy.get('[data-test="EVI"] span.icon-settingsthree-gears ').click();
cy.get('[data-test="EVI"] span.fa-gears ').click();
cy.get('.card-footer button[title="Zoom to layer"]').click();

/**
Expand All @@ -92,7 +92,7 @@ describe('Hslayers application', () => {

//Zoom to different layer
cy.get(
'[data-test="Latvian municipalities (1 sub-layer)"] span.icon-settingsthree-gears ',
'[data-test="Latvian municipalities (1 sub-layer)"] span.fa-gears ',
).click();
cy.get('.card-footer button[title="Zoom to layer"]').click();

Expand All @@ -102,7 +102,7 @@ describe('Hslayers application', () => {
throw new Error('UNexpected getMap request was intercepted.');
} else {
//Ignore extent eg. allow requests to be made no matter the extent
cy.get('[data-test="EVI"] span.icon-settingsthree-gears ').click();
cy.get('[data-test="EVI"] span.fa-gears ').click();
cy.get(
'hs-layer-editor hs-extent-widget #hs-layer-extent-toggle',
).click();
Expand Down
4 changes: 2 additions & 2 deletions cypress/tests/sidebar.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,12 +46,12 @@ describe('Hslayers application', () => {
/**
* This changes based on current test-app config
*/
it('Only 9 sidebar panels should be visible', () => {
it('Only 6 sidebar panels should be visible', () => {
cy.viewport(600, 1000);
// Wait for the layout to update
cy.wait(500);
cy.get('hs-sidebar span.hs-sidebar-item:not(.hs-panel-hidden)')
.its('length')
.should('equal', 9);
.should('equal', 6);
});
});
13 changes: 12 additions & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 4 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,8 @@
"commit": "git-cz",
"deps-graph": "madge --exclude '.*(layer-extensions)\\.ts$' --dot projects/decoupling-test-app/src/hslayers-app/hslayers-app.module.ts > graph.gv",
"proxy": "cd ./projects/hslayers-server && node server.js -l",
"prepare-release": "cd ./scripts && bump-version.sh"
"prepare-release": "cd ./scripts && bump-version.sh",
"subset-icons": "python projects/hslayers/css/icons/create-fa-icons.py"
},
"private": true,
"dependencies": {
Expand Down Expand Up @@ -104,6 +105,7 @@
"@compodoc/compodoc": "^1.1.26",
"@cypress/schematic": "^3.0.0",
"@eslint/compat": "^1.2.6",
"@fortawesome/fontawesome-free": "^6.7.2",
"@frsource/cypress-plugin-visual-regression-diff": "^3.2.14",
"@types/jasmine": "^5.1.5",
"@types/jasminewd2": "~2.0.12",
Expand Down Expand Up @@ -156,4 +158,4 @@
"path": false,
"fs": false
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@
<button class="btn rounded-0 hs-toolbar-button btn-3d-toggle btn-outline-secondary"
[ngClass]="{'btn-3d-active': hsCesiumService.visible}" [title]="'TOOLBAR.toggle3d' | translateHs"
(click)="hsCesiumService.toggleCesiumMap();loseFocus($event.target)">
<i class="icon-globealt"></i>
<i class="fa-solid fa-globe"></i>
</button>
</div>
</div>
Original file line number Diff line number Diff line change
Expand Up @@ -31,28 +31,28 @@
</ul><!-- Tab panes -->
</div>
<div class="col-3 text-end">
<!-- <button type="button" class="btn btn-sm" (click)="toggleExpansion()"><i
[ngClass]="{'icon-calcminus': viewExpanded, 'icon-calcplus':!viewExpanded}"></i>
</button> -->
<button type="button" class="btn btn-sm" (click)="toggleExpansion()">
<i [ngClass]="{'fa-solid fa-square-minus': viewExpanded, 'fa-solid fa-square-plus':!viewExpanded}"></i>
</button>
</div>
</div>
</div>
</div>
</div>
@if (hsSensorsService.units.length > 0) {
<ul class="list-group">
@for (unit of filterQuery(query); track unit) {
<li class="list-group-item">
<!-- TODO: Remove function call from template -->
<hs-sensor-unit-list-item [unit]="unit" [expanded]="viewExpanded" [view-mode]="viewMode">
</hs-sensor-unit-list-item>
</li>
@if (hsSensorsService.units.length > 0) {
<ul class="list-group">
@for (unit of filterQuery(query); track unit) {
<li class="list-group-item">
<!-- TODO: Remove function call from template -->
<hs-sensor-unit-list-item [unit]="unit" [expanded]="viewExpanded" [view-mode]="viewMode">
</hs-sensor-unit-list-item>
</li>
}
</ul>
}
</ul>
}
@else {
<div class="alert alert-warning m-2 text-center" role="alert">
{{'SENSORS.noUnitsFound' | translateHs}}
@else {
<div class="alert alert-warning m-2 text-center" role="alert">
{{'SENSORS.noUnitsFound' | translateHs}}
</div>
}
</div>
</div>
}
</div>
</div>
}
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ <h4 class="modal-title">
[placeholder]="'COMMON.from' | translateHs" #d="ngbDatepicker"
[(ngModel)]="customInterval.fromTime" (dateSelect)="customIntervalChanged()" />
<button class="btn btn-sm btn-outline-secondary" (click)="d.toggle()" type="button"><i
class="icon-calendarthree"></i></button>
class="fa-solid fa-calendar"></i></button>
</div>
</div>
<div class="m-1">
Expand All @@ -79,12 +79,12 @@ <h4 class="modal-title">
[placeholder]="'COMMON.to' | translateHs" #d2="ngbDatepicker"
[(ngModel)]="customInterval.toTime" (dateSelect)="customIntervalChanged()" />
<button class="btn btn-sm btn-outline-secondary" (click)="d2.toggle()" type="button"><i
class="icon-calendarthree"></i></button>
class="fa-solid fa-calendar"></i></button>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import {TranslateCustomPipe} from 'hslayers-ng/services/language';
>
@if (!loading) {
<span class="d-flex justify-content-center align-items-baseline gap-1">
<i class="icon-plus"> </i>{{ 'COMMON.addToMap' | translateHs }}
<i class="fa-solid fa-plus"> </i>{{ 'COMMON.addToMap' | translateHs }}
</span>
} @else {
<span>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,11 @@ import {TranslateCustomPipe} from 'hslayers-ng/services/language';
[title]="'COMMON.copyToClipboard' | translateHs"
(click)="copyToClipBoard()"
>
<i [class.icon-check]="showCheck" [class.icon-copy]="!showCheck"></i>
<i
class="fa-solid"
[class.fa-square-check]="showCheck"
[class.fa-copy]="!showCheck"
></i>
</button>
`,
styles: `
Expand All @@ -42,7 +46,7 @@ export class HsClipboardTextComponent {
'COMMON.copyToClipboard',
'COMMON.copyToClipboardFailure',
{
toastStyleClasses: 'bg-danger text-white',
type: 'danger',
},
);
return;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ <h4 class="modal-title">{{'COMPOSITIONS.cswDialog.loadComposition' | translateHs
<button ngbAccordionButton
class="accordion-button justify-content-between">{{service.title}}
<span class="ml-auto pe-3">
<i class="icon-trash text-secondary" role="button"
<i class="fa-solid fa-trash text-secondary" role="button"
(click)="$event.stopPropagation();removeService(service)"
[title]="'COMMON.delete' | translateHs"></i>
</span>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ <h4 class="modal-title">{{'COMMON.selectAndSavePermissions' | translateHs}}: {{d
<button (click)="close()" type="button"
class="btn btn-success align-items-center d-flex justify-content-around gap-2">{{'COMMON.done' |
translateHs }}
<i class="icon-check"></i>
<i class="fa-solid fa-square-check"></i>
</button>
}
@case ('error') {
Expand All @@ -39,4 +39,4 @@ <h4 class="modal-title">{{'COMMON.selectAndSavePermissions' | translateHs}}: {{d
</div>
</div>
</div>
</div>
</div>
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<div class="p-1">
<div ngbDropdown class="d-inline-block" #menu="ngbDropdown">
<button class="btn btn-outline-primary btn-sm" [title]="'STYLER.addFilter' | translateHs" ngbDropdownToggle>
<span class="icon-plus"></span>
<span class="fa-solid fa-plus"></span>
</button>
<div ngbDropdownMenu>
@for (filter of filterOptions; track filter) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
</div>
<div>
<button class="btn btn-outline-danger btn-sm rounded-0" style="height: 100%" (click)="remove()">
<span class="icon-trash"></span>
<span class="fa-solid fa-trash"></span>
</button>
</div>

Expand Down
4 changes: 2 additions & 2 deletions projects/hslayers/common/filters/filter.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<hs-add-filter-button (clicks)="hsFiltersService.add($event.type, true, filter)"></hs-add-filter-button>
<button class="btn btn-outline-danger btn-sm m-1" [title]="'STYLER.removeFilter' | translateHs"
(click)="remove()">
<span class="icon-trash"></span>
<span class="fa-solid fa-trash"></span>
</button>
</div>
@for (item of filter; track item; let i = $index) {
Expand All @@ -22,4 +22,4 @@
@if (filter.length > 1 && !(hsFiltersService.isLogOp(filter))) {
<hs-comparison-filter [filter]="filter" (changes)="emitChange()" [parent]="parent"></hs-comparison-filter>
}<!-- TODO: Remove function call from template -->
</div>
</div>
2 changes: 1 addition & 1 deletion projects/hslayers/common/filters/filters.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
<hs-add-filter-button (clicks)="add($event.type, true)"></hs-add-filter-button>
<button class="btn btn-outline-danger btn-sm m-1" [title]="'STYLER.removeFilter' | translateHs"
(click)="remove()">
<span class="icon-trash"></span>
<span class="fa-solid fa-trash"></span>
</button>
</div>
@for (item of rule.filter; track item; let i = $index) {
Expand Down
2 changes: 1 addition & 1 deletion projects/hslayers/common/filters/filters.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ export class HsFiltersService {
'STYLER.removeFilter',
message,
{
toastStyleClasses: 'text-bg-warning',
type: 'warning',
serviceCalledFrom: 'HsFiltersService',
},
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@
@if (type === "arcgis" && data.serviceExpanded) {
<button type="button" class="btn btn-sm px-2 border-0 d-flex" (click)="collapseServices()"
[title]="'COMMON.back' | translateHs">
<i class="glyphicon icon-chevron-left text-black-50"></i>
<i class="fa-solid fa-chevron-left text-black-50"></i>
<span class="text-black-50 fw-bold">{{
"COMMON.back" | translateHs
}}</span>
Expand All @@ -78,7 +78,7 @@
<td (click)="expandService(service)" data-toggle="tooltip"
[title]="'ADDDATA.requestServiceLayers' | translateHs" style="cursor: pointer">
{{ service.name }}
<span style="font-size: x-small"><i class="icon-chevron-right"></i></span>
<span style="font-size: x-small"><i class="fa-solid fa-chevron-right"></i></span>
</td>
</tr>
</tbody>
Expand Down Expand Up @@ -144,4 +144,4 @@
</div>
</div>
}
</div>
</div>
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
<ul class="nav nav-tabs justify-content-end my-2 mb-3">
<button (click)="resetToDefault()" class="btn btn-light btn-sm position-absolute text-secondary" type="button" style="left: 0;
transform: translateX(50%);" [title]="'COMMON.resetToDefault' | translateHs">
<i class="icon-fatredo"></i>
<i class="fa-solid fa-rotate-right"></i>
</button>
@for (option of grantingOptions; track $index) {
<li class="nav-item" (click)="changeGrantingOptions(option)">
Expand Down Expand Up @@ -81,4 +81,4 @@
</div>
}
</div>
}
}
4 changes: 2 additions & 2 deletions projects/hslayers/common/pager/pager.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
<div class="btn-group">
<button class="but-title-sm m-1" data-toggle="tooltip"
[title]="'ADDDATA.CATALOGUE.theNumberOfRecords' | translateHs ">
<i class="icon-question-sign"></i>
<i class="fa-solid fa-circle-question"></i>
</button>
<button ngbDropdownToggle type="button" data-cy="hs-pager-menu-toggle"
class="btn btn-outline-secondary btn-sm dropdown-toggle dropdown-toggle-split rounded-0"
Expand All @@ -46,4 +46,4 @@
</li>
</ul>
</div>
}
}
Loading
Loading