diff --git a/device-management-ui/package.json b/device-management-ui/package.json index 68421d1d..0ee24d52 100644 --- a/device-management-ui/package.json +++ b/device-management-ui/package.json @@ -35,6 +35,7 @@ "@angular/compiler-cli": "^15.2.0", "@angular/localize": "^15.2.0", "@types/jasmine": "~4.3.0", + "@types/lodash": "^4.14.197", "jasmine-core": "~4.5.0", "karma": "~6.4.0", "karma-chrome-launcher": "~3.1.0", diff --git a/device-management-ui/src/app/app.component.spec.ts b/device-management-ui/src/app/app.component.spec.ts index 505589a8..645c8629 100644 --- a/device-management-ui/src/app/app.component.spec.ts +++ b/device-management-ui/src/app/app.component.spec.ts @@ -1,3 +1,18 @@ +/* + * ******************************************************************************* + * * Copyright (c) 2023 Contributors to the Eclipse Foundation + * * + * * See the NOTICE file(s) distributed with this work for additional + * * information regarding copyright ownership. + * * + * * This program and the accompanying materials are made available under the + * * terms of the Eclipse Public License 2.0 which is available at + * * http://www.eclipse.org/legal/epl-2.0 + * * + * * SPDX-License-Identifier: EPL-2.0 + * ******************************************************************************* + */ + import { TestBed } from '@angular/core/testing'; import { AppComponent } from './app.component'; import {HttpClientTestingModule} from "@angular/common/http/testing"; diff --git a/device-management-ui/src/app/app.component.ts b/device-management-ui/src/app/app.component.ts index e9066607..458de961 100644 --- a/device-management-ui/src/app/app.component.ts +++ b/device-management-ui/src/app/app.component.ts @@ -1,3 +1,18 @@ +/* + * ******************************************************************************* + * * Copyright (c) 2023 Contributors to the Eclipse Foundation + * * + * * See the NOTICE file(s) distributed with this work for additional + * * information regarding copyright ownership. + * * + * * This program and the accompanying materials are made available under the + * * terms of the Eclipse Public License 2.0 which is available at + * * http://www.eclipse.org/legal/epl-2.0 + * * + * * SPDX-License-Identifier: EPL-2.0 + * ******************************************************************************* + */ + import { Component } from '@angular/core'; import './prototypes/string-prototype1' import {GoogleService} from "./services/google/google.service"; diff --git a/device-management-ui/src/app/app.module.ts b/device-management-ui/src/app/app.module.ts index 7affc594..bb0a5ef7 100644 --- a/device-management-ui/src/app/app.module.ts +++ b/device-management-ui/src/app/app.module.ts @@ -1,3 +1,18 @@ +/* + * ******************************************************************************* + * * Copyright (c) 2023 Contributors to the Eclipse Foundation + * * + * * See the NOTICE file(s) distributed with this work for additional + * * information regarding copyright ownership. + * * + * * This program and the accompanying materials are made available under the + * * terms of the Eclipse Public License 2.0 which is available at + * * http://www.eclipse.org/legal/epl-2.0 + * * + * * SPDX-License-Identifier: EPL-2.0 + * ******************************************************************************* + */ + import {NgModule} from '@angular/core'; import {BrowserModule} from '@angular/platform-browser'; import {NgbModule} from '@ng-bootstrap/ng-bootstrap'; @@ -42,11 +57,11 @@ import {SortableTableDirective} from './services/sortable-table/sortable-table.d import {FaIconLibrary, FontAwesomeModule} from "@fortawesome/angular-fontawesome"; import {fas} from "@fortawesome/free-solid-svg-icons"; import {ToastContainerComponent} from './components/toast-container/toast-container.component'; -import {ConfigAccordionComponent} from './components/devices/device-detail/list-config/config-accordion/config-accordion.component'; import {TruncatePipe} from './shared/truncate.pipe'; import {GatewayListComponent} from './components/gateways/gateway-list/gateway-list.component'; import { SelectDevicesComponent } from './components/modals/select-devices/select-devices.component'; import { CreateAndBindModalComponent } from './components/modals/create-and-bind-modal/create-and-bind-modal.component'; +import { PaginationComponent } from './components/pagination/pagination.component'; @NgModule({ declarations: [ @@ -72,11 +87,11 @@ import { CreateAndBindModalComponent } from './components/modals/create-and-bind LoaderSpinnerComponent, SortableTableDirective, ToastContainerComponent, - ConfigAccordionComponent, TruncatePipe, GatewayListComponent, SelectDevicesComponent, - CreateAndBindModalComponent + CreateAndBindModalComponent, + PaginationComponent ], imports: [ BrowserModule, diff --git a/device-management-ui/src/app/components/date-time/date-time-picker.component.spec.ts b/device-management-ui/src/app/components/date-time/date-time-picker.component.spec.ts index 9a4ecbfa..c8a10082 100644 --- a/device-management-ui/src/app/components/date-time/date-time-picker.component.spec.ts +++ b/device-management-ui/src/app/components/date-time/date-time-picker.component.spec.ts @@ -1,3 +1,18 @@ +/* + * ******************************************************************************* + * * Copyright (c) 2023 Contributors to the Eclipse Foundation + * * + * * See the NOTICE file(s) distributed with this work for additional + * * information regarding copyright ownership. + * * + * * This program and the accompanying materials are made available under the + * * terms of the Eclipse Public License 2.0 which is available at + * * http://www.eclipse.org/legal/epl-2.0 + * * + * * SPDX-License-Identifier: EPL-2.0 + * ******************************************************************************* + */ + import {ComponentFixture, TestBed} from '@angular/core/testing'; import {DateTimePickerComponent} from './date-time-picker.component'; diff --git a/device-management-ui/src/app/components/date-time/date-time-picker.component.ts b/device-management-ui/src/app/components/date-time/date-time-picker.component.ts index 3d7c6233..0bacec62 100644 --- a/device-management-ui/src/app/components/date-time/date-time-picker.component.ts +++ b/device-management-ui/src/app/components/date-time/date-time-picker.component.ts @@ -1,3 +1,18 @@ +/* + * ******************************************************************************* + * * Copyright (c) 2023 Contributors to the Eclipse Foundation + * * + * * See the NOTICE file(s) distributed with this work for additional + * * information regarding copyright ownership. + * * + * * This program and the accompanying materials are made available under the + * * terms of the Eclipse Public License 2.0 which is available at + * * http://www.eclipse.org/legal/epl-2.0 + * * + * * SPDX-License-Identifier: EPL-2.0 + * ******************************************************************************* + */ + import {Component, EventEmitter, Input, OnInit, Output} from '@angular/core'; import {NgbCalendar, NgbDateStruct} from "@ng-bootstrap/ng-bootstrap"; @@ -8,15 +23,13 @@ import {NgbCalendar, NgbDateStruct} from "@ng-bootstrap/ng-bootstrap"; }) export class DateTimePickerComponent implements OnInit { - @Input() - public secretDate: string | undefined = ''; + @Input() public secretDate: string | undefined = ''; - @Output() - public dateTime: EventEmitter = new EventEmitter(); - protected date: NgbDateStruct | any; - protected time: any = {hour: 0, minute: 0, second: 0}; + @Output() public dateTime: EventEmitter = new EventEmitter(); - protected maxDate: NgbDateStruct = {year: new Date().getUTCFullYear() + 100, month: 12, day: 31}; + public date: NgbDateStruct | any; + public time: any = {hour: 0, minute: 0, second: 0}; + public maxDate: NgbDateStruct = {year: new Date().getUTCFullYear() + 100, month: 12, day: 31}; constructor(private calendar: NgbCalendar) { } @@ -47,16 +60,16 @@ export class DateTimePickerComponent implements OnInit { }); } - protected showTimezoneOffsetMessage(): boolean { + public showTimezoneOffsetMessage(): boolean { return this.timezoneOffset !== 0; } - protected getTimezoneOffsetMessage() { + public getTimezoneOffsetMessage() { return 'Your timezone differ to UTC time, please be aware that the UTC time (%h hour) will be taken.' .replace('%h', String(this.timezoneOffset)); } - protected getTimeString(time: any): string { + public getTimeString(time: any): string { const paddedHour = String(time.hour).padStart(2, '0'); const paddedMinute = String(time.minute).padStart(2, '0'); const paddedSecond = String(time.second).padStart(2, '0'); diff --git a/device-management-ui/src/app/components/devices/device-detail/device-detail.component.html b/device-management-ui/src/app/components/devices/device-detail/device-detail.component.html index 12ed537c..87771c2b 100644 --- a/device-management-ui/src/app/components/devices/device-detail/device-detail.component.html +++ b/device-management-ui/src/app/components/devices/device-detail/device-detail.component.html @@ -21,30 +21,35 @@
-
-
-
-
-
@@ -65,7 +70,7 @@
- + Tenant ID:
@@ -74,7 +79,7 @@
- + Via:
@@ -83,7 +88,7 @@
- + Created (UTC):
@@ -96,7 +101,7 @@