Skip to content

Commit d2e6059

Browse files
committed
feat(dashboard-lib): Start fixing components
1 parent 95e7d08 commit d2e6059

23 files changed

+1386
-79
lines changed

gravitee-apim-portal-webui-next/package.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,8 @@
4848
"@angular/router": "19.2.4",
4949
"@asciidoctor/core": "3.0.4",
5050
"@asyncapi/web-component": "2.6.3",
51+
"@danielmoncada/angular-datetime-picker": "^20.0.1",
52+
"@danielmoncada/angular-datetime-picker-moment-adapter": "^7.0.1",
5153
"@emoji-mart/data": "1.2.1",
5254
"@fontsource/dm-mono": "5.2.5",
5355
"@fontsource/dm-sans": "5.2.5",
@@ -75,6 +77,7 @@
7577
"marked-extended-tables": "1.1.1",
7678
"marked-gfm-heading-id": "3.2.0",
7779
"marked-highlight": "2.2.1",
80+
"moment": "^2.30.1",
7881
"ng2-charts": "8.0.0",
7982
"ngx-dynamic-hooks": "3.1.2",
8083
"ngx-infinite-scroll": "19.0.0",

gravitee-apim-portal-webui-next/projects/gravitee-dashboard/package.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,10 @@
88
"chart.js": "4.3.0",
99
"ng2-charts": "8.0.0",
1010
"@angular/material": "19.2.7",
11-
"@angular/cdk": "19.2.7"
11+
"@angular/cdk": "19.2.7",
12+
"@danielmoncada/angular-datetime-picker": "19.0.0",
13+
"@danielmoncada/angular-datetime-picker-moment-adapter": "6.0.2",
14+
"moment": "2.30.1"
1215
},
1316
"dependencies": {
1417
"tslib": "2.3.1"

gravitee-apim-portal-webui-next/projects/gravitee-dashboard/src/lib/components/filter/dropdown-search/dropdown-search-overlay/dropdown-search-overlay.component.html

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
<!-- Search input -->
2020
<div class="gio-select-search__search">
2121
<mat-form-field class="gio-select-search__search-field" appearance="outline">
22-
<mat-icon matPrefix svgIcon="gio:search"></mat-icon>
22+
<mat-icon matPrefix svgIcon="gio:search" />
2323
<input matInput [formControl]="searchControl" [placeholder]="placeholder" #searchInput />
2424
@if (searchControl.value) {
2525
<button matSuffix mat-icon-button type="button" (click)="searchControl.setValue('')" [attr.aria-label]="'Clear search'">
@@ -38,19 +38,19 @@
3838
[disabled]="option.disabled"
3939
[value]="option.value"
4040
class="gio-select-search__option-checkbox"
41-
color="primary"
42-
/>
41+
color="primary" />
4342
<span class="gio-select-search__option-label">{{ option.label }}</span>
4443
</div>
4544
}
4645

4746
@if (isLoading) {
4847
<div class="gio-select-search__loading-more">
49-
<gio-loader />
48+
<!-- <gio-loader />-->
49+
Loading...
5050
</div>
5151
} @else if (options().length === 0) {
5252
<div class="gio-select-search__option disabled-option">
53-
<mat-checkbox disabled checked="false" class="gio-select-search__option-checkbox"> </mat-checkbox>
53+
<mat-checkbox disabled checked="false" class="checkbox" />
5454
<span class="gio-select-search__option-label">No options available</span>
5555
</div>
5656
}
@@ -61,8 +61,7 @@
6161
type="button"
6262
[disabled]="selectedValues.length === 0"
6363
(click)="clearSelection()"
64-
[attr.aria-label]="'Clear selection'"
65-
>
64+
[attr.aria-label]="'Clear selection'">
6665
Clear Selection
6766
@if (selectedValues.length > 0) {
6867
({{ selectedValues.length }})
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
/*
2+
* Copyright (C) 2025 The Gravitee team (http://gravitee.io)
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
@use '@angular/material' as mat;
17+
//@use '@gravitee/ui-particles-angular' as gio;
18+
19+
.gio-select-search-overlay {
20+
max-width: 280px;
21+
}
22+
23+
.gio-select-search {
24+
&__search {
25+
padding: 16px;
26+
//border-bottom: 1px solid mat.m2-get-color-from-palette(gio.$mat-smoke-palette, 'lighter20');
27+
width: 100%;
28+
}
29+
30+
&__search-field {
31+
width: 100%;
32+
margin: 0;
33+
}
34+
35+
&__options {
36+
max-height: 250px;
37+
overflow-y: scroll;
38+
padding-left: 8px;
39+
}
40+
41+
&__loading-more {
42+
display: flex;
43+
justify-content: center;
44+
align-items: center;
45+
padding: 16px;
46+
47+
gio-loader {
48+
width: 24px;
49+
height: 24px;
50+
}
51+
}
52+
53+
&__option {
54+
display: flex;
55+
align-items: center;
56+
cursor: pointer;
57+
58+
&-label {
59+
flex: 1;
60+
}
61+
}
62+
63+
&__clear-selection {
64+
//border-top: 1px solid mat.m2-get-color-from-palette(gio.$mat-smoke-palette, 'lighter20');
65+
height: 70px;
66+
padding-left: 10px;
67+
display: flex;
68+
flex-flow: column;
69+
align-items: flex-start;
70+
justify-content: center;
71+
}
72+
}
73+
74+
.disabled-option {
75+
//color: mat.m2-get-color-from-palette(gio.$mat-smoke-palette, 'default');
76+
cursor: auto;
77+
}

gravitee-apim-portal-webui-next/projects/gravitee-dashboard/src/lib/components/filter/dropdown-search/dropdown-search-overlay/dropdown-search-overlay.component.spec.ts

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,18 @@
1+
/*
2+
* Copyright (C) 2025 The Gravitee team (http://gravitee.io)
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
116
import { ComponentFixture, TestBed } from '@angular/core/testing';
217

318
import { DropdownSearchOverlayComponent } from './dropdown-search-overlay.component';
@@ -8,9 +23,8 @@ describe('DropdownSearchOverlayComponent', () => {
823

924
beforeEach(async () => {
1025
await TestBed.configureTestingModule({
11-
imports: [DropdownSearchOverlayComponent]
12-
})
13-
.compileComponents();
26+
imports: [DropdownSearchOverlayComponent],
27+
}).compileComponents();
1428

1529
fixture = TestBed.createComponent(DropdownSearchOverlayComponent);
1630
component = fixture.componentInstance;

gravitee-apim-portal-webui-next/projects/gravitee-dashboard/src/lib/components/filter/dropdown-search/dropdown-search-overlay/dropdown-search-overlay.component.ts

Lines changed: 26 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,32 @@
1-
import { Component, ElementRef, signal, ViewChild, AfterViewInit, DestroyRef, inject, OnInit } from '@angular/core';
1+
/*
2+
* Copyright (C) 2025 The Gravitee team (http://gravitee.io)
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
import { CdkScrollable } from '@angular/cdk/scrolling';
217
import { CommonModule } from '@angular/common';
18+
import { Component, ElementRef, signal, ViewChild, AfterViewInit, DestroyRef, inject, OnInit } from '@angular/core';
19+
import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
320
import { ReactiveFormsModule, FormControl } from '@angular/forms';
21+
import { MatButtonModule } from '@angular/material/button';
22+
import { MatCardModule } from '@angular/material/card';
23+
import { MatCheckboxModule } from '@angular/material/checkbox';
24+
import { MatOptionModule } from '@angular/material/core';
425
import { MatFormFieldModule } from '@angular/material/form-field';
526
import { MatIconModule } from '@angular/material/icon';
627
import { MatInputModule } from '@angular/material/input';
7-
import { MatButtonModule } from '@angular/material/button';
8-
import { MatCheckboxModule } from '@angular/material/checkbox';
9-
import { GioIconsModule, GioLoaderModule } from '@gravitee/ui-particles-angular';
10-
import { distinctUntilChanged, startWith, tap } from 'rxjs/operators';
11-
import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
1228
import { Subject } from 'rxjs';
13-
import { MatOptionModule } from '@angular/material/core';
14-
import { MatCardModule } from '@angular/material/card';
15-
import { CdkScrollable } from '@angular/cdk/scrolling';
29+
import { distinctUntilChanged, startWith, tap } from 'rxjs/operators';
1630

1731
export interface SelectOption {
1832
value: string;
@@ -30,8 +44,6 @@ export interface SelectOption {
3044
MatInputModule,
3145
MatButtonModule,
3246
MatCheckboxModule,
33-
GioIconsModule,
34-
GioLoaderModule,
3547
MatOptionModule,
3648
MatCardModule,
3749
CdkScrollable,
@@ -40,6 +52,9 @@ export interface SelectOption {
4052
styleUrl: './dropdown-search-overlay.component.scss',
4153
})
4254
export class DropdownSearchOverlayComponent implements OnInit, AfterViewInit {
55+
@ViewChild('searchInput', { static: false }) searchInput!: ElementRef<HTMLInputElement>;
56+
@ViewChild(CdkScrollable) scrollable: CdkScrollable | undefined;
57+
4358
// Input from gio-select-search component
4459
options = signal<SelectOption[]>([]);
4560
selectedValues: string[] = [];
@@ -49,9 +64,6 @@ export class DropdownSearchOverlayComponent implements OnInit, AfterViewInit {
4964

5065
searchControl = new FormControl('');
5166

52-
@ViewChild('searchInput', { static: false }) searchInput!: ElementRef<HTMLInputElement>;
53-
@ViewChild(CdkScrollable) scrollable: CdkScrollable | undefined;
54-
5567
// Output to gio-select-search component
5668
selectionChange = new Subject<string>();
5769
clearSelectionChange = new Subject<void>();
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<!--
22
3-
Copyright (C) 2025 The Gravitee team (http://gravitee.io)
3+
Copyright (C) 2015 The Gravitee team (http://gravitee.io)
44
55
Licensed under the Apache License, Version 2.0 (the "License");
66
you may not use this file except in compliance with the License.
@@ -15,18 +15,27 @@
1515
limitations under the License.
1616
1717
-->
18-
<p>dropdown-search works!</p>
19-
<mat-chip-set aria-label="Dog selection">
20-
<mat-chip>
21-
<img matChipAvatar src="https://material.angular.dev/assets/img/examples/shiba1.jpg" alt="Photo of a Shiba Inu" />
22-
Dog one
23-
</mat-chip>
24-
<mat-chip>
25-
<img matChipAvatar src="https://material.angular.dev/assets/img/examples/shiba1.jpg" alt="Photo of a Shiba Inu" />
26-
Dog two
27-
</mat-chip>
28-
<mat-chip>
29-
<img matChipAvatar src="https://material.angular.dev/assets/img/examples/shiba1.jpg" alt="Photo of a Shiba Inu" />
30-
Dog three
31-
</mat-chip>
32-
</mat-chip-set>
18+
<div
19+
#trigger
20+
class="gio-select-search__trigger"
21+
[class.disabled]="isDisabled"
22+
[class.opened]="isOpen()"
23+
(click)="toggleOverlay($event)"
24+
tabindex="-1"
25+
role="listbox"
26+
[attr.aria-multiselectable]="multiple"
27+
[attr.aria-expanded]="isOpen()"
28+
[attr.aria-haspopup]="true"
29+
[attr.aria-label]="label()">
30+
<span class="gio-select-search__trigger__label">
31+
{{ label() }}
32+
33+
@if (selectedCount() > 0) {
34+
<span class="gio-select-search__trigger__count">
35+
{{ selectedCount() }}
36+
</span>
37+
}
38+
</span>
39+
40+
<mat-icon class="search" [class.opened-icon]="isOpen()"> expand_more </mat-icon>
41+
</div>
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,76 @@
11
/*
22
* Copyright (C) 2025 The Gravitee team (http://gravitee.io)
3-
*
3+
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
66
* You may obtain a copy of the License at
7-
*
7+
*
88
* http://www.apache.org/licenses/LICENSE-2.0
9-
*
9+
*
1010
* Unless required by applicable law or agreed to in writing, software
1111
* distributed under the License is distributed on an "AS IS" BASIS,
1212
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1313
* See the License for the specific language governing permissions and
1414
* limitations under the License.
1515
*/
16+
@use '@angular/material' as mat;
17+
18+
:host {
19+
display: block;
20+
}
21+
22+
.gio-select-search {
23+
&__trigger {
24+
display: flex;
25+
align-items: center;
26+
justify-content: space-between;
27+
padding: 8px 12px;
28+
border: 1px solid var(--mdc-outlined-text-field-outline-color);
29+
border-radius: 4px;
30+
cursor: pointer;
31+
min-height: var(--mat-form-field-container-height);
32+
transition: border-color 0.2s ease;
33+
34+
&:hover:not(.disabled) {
35+
//border-color: mat.m2-get-color-from-palette(gio.$mat-smoke-palette, darker80);
36+
}
37+
38+
&.disabled {
39+
opacity: 0.4;
40+
cursor: not-allowed;
41+
}
42+
43+
&__label {
44+
flex: 1;
45+
display: flex;
46+
gap: 8px;
47+
align-items: center;
48+
}
49+
50+
&__count {
51+
//color: mat.m2-get-color-from-palette(gio.$mat-primary-palette, default-contrast);
52+
//background-color: mat.m2-get-color-from-palette(gio.$mat-primary-palette, default);
53+
border-radius: 50%;
54+
height: 24px;
55+
width: 24px;
56+
text-align: center;
57+
display: flex;
58+
align-items: center;
59+
justify-content: center;
60+
}
61+
62+
&__arrow {
63+
margin-left: 8px;
64+
color: var(--mat-select-enabled-arrow-color);
65+
}
66+
}
67+
}
68+
.opened {
69+
//border-color: mat.m2-get-color-from-palette(gio.$mat-smoke-palette, darker80);
70+
border-width: 2px;
71+
padding: 7px 11px;
72+
}
73+
74+
.opened-icon {
75+
//color: mat.m2-get-color-from-palette(gio.$mat-smoke-palette, darker80);
76+
}

0 commit comments

Comments
 (0)