mirror of
https://github.com/andwati/zitadel.git
synced 2026-11-06 22:32:16 +00:00
feat(console): angular 11, replace ngx-moment with @angular/material-moment-adapter (#965)
* update core / cli * update material * lint * replace nx-moment with @angular/moment adapter
This commit is contained in:
+2
-2
@@ -1,4 +1,4 @@
|
||||
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing';
|
||||
|
||||
import { UserCreateMachineComponent } from './user-create-machine.component';
|
||||
|
||||
@@ -6,7 +6,7 @@ describe('UserCreateMachineComponent', () => {
|
||||
let component: UserCreateMachineComponent;
|
||||
let fixture: ComponentFixture<UserCreateMachineComponent>;
|
||||
|
||||
beforeEach(async(() => {
|
||||
beforeEach(waitForAsync(() => {
|
||||
TestBed.configureTestingModule({
|
||||
declarations: [UserCreateMachineComponent],
|
||||
})
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing';
|
||||
|
||||
import { UserCreateComponent } from './user-create.component';
|
||||
|
||||
@@ -6,7 +6,7 @@ describe('UserCreateComponent', () => {
|
||||
let component: UserCreateComponent;
|
||||
let fixture: ComponentFixture<UserCreateComponent>;
|
||||
|
||||
beforeEach(async(() => {
|
||||
beforeEach(waitForAsync(() => {
|
||||
TestBed.configureTestingModule({
|
||||
declarations: [UserCreateComponent],
|
||||
})
|
||||
|
||||
+2
-2
@@ -1,4 +1,4 @@
|
||||
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing';
|
||||
|
||||
import { AuthUserDetailComponent } from './auth-user-detail.component';
|
||||
|
||||
@@ -6,7 +6,7 @@ describe('AuthUserDetailComponent', () => {
|
||||
let component: AuthUserDetailComponent;
|
||||
let fixture: ComponentFixture<AuthUserDetailComponent>;
|
||||
|
||||
beforeEach(async(() => {
|
||||
beforeEach(waitForAsync(() => {
|
||||
TestBed.configureTestingModule({
|
||||
declarations: [AuthUserDetailComponent],
|
||||
})
|
||||
|
||||
+2
-2
@@ -1,4 +1,4 @@
|
||||
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing';
|
||||
|
||||
import { AuthUserMfaComponent } from './auth-user-mfa.component';
|
||||
|
||||
@@ -6,7 +6,7 @@ describe('AuthUserMfaComponent', () => {
|
||||
let component: AuthUserMfaComponent;
|
||||
let fixture: ComponentFixture<AuthUserMfaComponent>;
|
||||
|
||||
beforeEach(async(() => {
|
||||
beforeEach(waitForAsync(() => {
|
||||
TestBed.configureTestingModule({
|
||||
declarations: [AuthUserMfaComponent],
|
||||
})
|
||||
|
||||
+2
-2
@@ -1,4 +1,4 @@
|
||||
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing';
|
||||
|
||||
import { CodeDialogComponent } from './code-dialog.component';
|
||||
|
||||
@@ -6,7 +6,7 @@ describe('CodeDialogComponent', () => {
|
||||
let component: CodeDialogComponent;
|
||||
let fixture: ComponentFixture<CodeDialogComponent>;
|
||||
|
||||
beforeEach(async(() => {
|
||||
beforeEach(waitForAsync(() => {
|
||||
TestBed.configureTestingModule({
|
||||
declarations: [CodeDialogComponent],
|
||||
})
|
||||
|
||||
+2
-2
@@ -1,4 +1,4 @@
|
||||
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing';
|
||||
|
||||
import { ThemeSettingComponent } from './theme-setting.component';
|
||||
|
||||
@@ -6,7 +6,7 @@ describe('ThemeSettingComponent', () => {
|
||||
let component: ThemeSettingComponent;
|
||||
let fixture: ComponentFixture<ThemeSettingComponent>;
|
||||
|
||||
beforeEach(async(() => {
|
||||
beforeEach(waitForAsync(() => {
|
||||
TestBed.configureTestingModule({
|
||||
declarations: [ThemeSettingComponent],
|
||||
})
|
||||
|
||||
+2
-2
@@ -1,4 +1,4 @@
|
||||
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing';
|
||||
|
||||
import { DetailFormComponent } from './detail-form.component';
|
||||
|
||||
@@ -6,7 +6,7 @@ describe('DetailFormComponent', () => {
|
||||
let component: DetailFormComponent;
|
||||
let fixture: ComponentFixture<DetailFormComponent>;
|
||||
|
||||
beforeEach(async(() => {
|
||||
beforeEach(waitForAsync(() => {
|
||||
TestBed.configureTestingModule({
|
||||
declarations: [DetailFormComponent],
|
||||
})
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing';
|
||||
|
||||
import { DetailFormComponent } from './detail-form.component';
|
||||
|
||||
@@ -6,7 +6,7 @@ describe('DetailFormComponent', () => {
|
||||
let component: DetailFormComponent;
|
||||
let fixture: ComponentFixture<DetailFormComponent>;
|
||||
|
||||
beforeEach(async(() => {
|
||||
beforeEach(waitForAsync(() => {
|
||||
TestBed.configureTestingModule({
|
||||
declarations: [DetailFormComponent],
|
||||
})
|
||||
|
||||
+2
-2
@@ -1,4 +1,4 @@
|
||||
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing';
|
||||
|
||||
import { ExternalIdpsComponent } from './external-idps.component';
|
||||
|
||||
@@ -6,7 +6,7 @@ describe('ExternalIdpsComponent', () => {
|
||||
let component: ExternalIdpsComponent;
|
||||
let fixture: ComponentFixture<ExternalIdpsComponent>;
|
||||
|
||||
beforeEach(async(() => {
|
||||
beforeEach(waitForAsync(() => {
|
||||
TestBed.configureTestingModule({
|
||||
declarations: [ ExternalIdpsComponent ],
|
||||
})
|
||||
|
||||
+2
-2
@@ -1,4 +1,4 @@
|
||||
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing';
|
||||
|
||||
import { AddKeyDialogComponent } from './add-key-dialog.component';
|
||||
|
||||
@@ -6,7 +6,7 @@ describe('AddKeyDialogComponent', () => {
|
||||
let component: AddKeyDialogComponent;
|
||||
let fixture: ComponentFixture<AddKeyDialogComponent>;
|
||||
|
||||
beforeEach(async(() => {
|
||||
beforeEach(waitForAsync(() => {
|
||||
TestBed.configureTestingModule({
|
||||
declarations: [AddKeyDialogComponent],
|
||||
})
|
||||
|
||||
+4
-6
@@ -1,5 +1,6 @@
|
||||
import { Component, Inject, OnInit } from '@angular/core';
|
||||
import { Component, Inject } from '@angular/core';
|
||||
import { MAT_DIALOG_DATA, MatDialogRef } from '@angular/material/dialog';
|
||||
import { Moment } from 'moment';
|
||||
import { MachineKeyType } from 'src/app/proto/generated/management_pb';
|
||||
|
||||
@Component({
|
||||
@@ -7,11 +8,11 @@ import { MachineKeyType } from 'src/app/proto/generated/management_pb';
|
||||
templateUrl: './add-key-dialog.component.html',
|
||||
styleUrls: ['./add-key-dialog.component.scss'],
|
||||
})
|
||||
export class AddKeyDialogComponent implements OnInit {
|
||||
export class AddKeyDialogComponent {
|
||||
types: MachineKeyType[] = [
|
||||
MachineKeyType.MACHINEKEY_JSON,
|
||||
];
|
||||
date: any;
|
||||
date!: Moment;
|
||||
public type: MachineKeyType = MachineKeyType.MACHINEKEY_JSON;
|
||||
|
||||
constructor(
|
||||
@@ -19,9 +20,6 @@ export class AddKeyDialogComponent implements OnInit {
|
||||
@Inject(MAT_DIALOG_DATA) public data: any,
|
||||
) { }
|
||||
|
||||
ngOnInit(): void {
|
||||
}
|
||||
|
||||
public closeDialog(): void {
|
||||
this.dialogRef.close(false);
|
||||
}
|
||||
|
||||
+2
@@ -1,6 +1,7 @@
|
||||
import { CommonModule } from '@angular/common';
|
||||
import { NgModule } from '@angular/core';
|
||||
import { FormsModule } from '@angular/forms';
|
||||
import { MatMomentDateModule } from '@angular/material-moment-adapter';
|
||||
import { MatButtonModule } from '@angular/material/button';
|
||||
import { MatDatepickerModule } from '@angular/material/datepicker';
|
||||
import { MatFormFieldModule } from '@angular/material/form-field';
|
||||
@@ -23,6 +24,7 @@ import { AddKeyDialogComponent } from './add-key-dialog.component';
|
||||
MatIconModule,
|
||||
FormsModule,
|
||||
MatDatepickerModule,
|
||||
MatMomentDateModule,
|
||||
],
|
||||
})
|
||||
export class AddKeyDialogModule { }
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing';
|
||||
|
||||
import { MachineKeysComponent } from './machine-keys.component';
|
||||
|
||||
@@ -6,7 +6,7 @@ describe('MachineKeysComponent', () => {
|
||||
let component: MachineKeysComponent;
|
||||
let fixture: ComponentFixture<MachineKeysComponent>;
|
||||
|
||||
beforeEach(async(() => {
|
||||
beforeEach(waitForAsync(() => {
|
||||
TestBed.configureTestingModule({
|
||||
declarations: [MachineKeysComponent],
|
||||
})
|
||||
|
||||
@@ -5,6 +5,7 @@ import { MatPaginator, PageEvent } from '@angular/material/paginator';
|
||||
import { MatTableDataSource } from '@angular/material/table';
|
||||
import { TranslateService } from '@ngx-translate/core';
|
||||
import { Timestamp } from 'google-protobuf/google/protobuf/timestamp_pb';
|
||||
import { Moment } from 'moment';
|
||||
import { BehaviorSubject, Observable } from 'rxjs';
|
||||
import { MachineKeySearchResponse, MachineKeyType, MachineKeyView } from 'src/app/proto/generated/management_pb';
|
||||
import { ManagementService } from 'src/app/services/mgmt.service';
|
||||
@@ -84,10 +85,10 @@ export class MachineKeysComponent implements OnInit {
|
||||
|
||||
let date: Timestamp | undefined;
|
||||
|
||||
if (resp.date as Date) {
|
||||
if (resp.date as Moment) {
|
||||
const ts = new Timestamp();
|
||||
|
||||
const milliseconds = resp.date.getTime();
|
||||
console.log(resp.date.toDate().getTime());
|
||||
const milliseconds = resp.date.toDate().getTime();
|
||||
const seconds = Math.abs(milliseconds / 1000);
|
||||
const nanos = (milliseconds - seconds * 1000) * 1000 * 1000;
|
||||
ts.setSeconds(seconds);
|
||||
|
||||
+2
-2
@@ -1,4 +1,4 @@
|
||||
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing';
|
||||
|
||||
import { ShowKeyDialogComponent } from './show-key-dialog.component';
|
||||
|
||||
@@ -6,7 +6,7 @@ describe('ShowKeyDialogComponent', () => {
|
||||
let component: ShowKeyDialogComponent;
|
||||
let fixture: ComponentFixture<ShowKeyDialogComponent>;
|
||||
|
||||
beforeEach(async(() => {
|
||||
beforeEach(waitForAsync(() => {
|
||||
TestBed.configureTestingModule({
|
||||
declarations: [ShowKeyDialogComponent],
|
||||
})
|
||||
|
||||
+2
-2
@@ -1,4 +1,4 @@
|
||||
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing';
|
||||
|
||||
import { MembershipDetailComponent } from './membership-detail.component';
|
||||
|
||||
@@ -6,7 +6,7 @@ describe('MembershipDetailComponent', () => {
|
||||
let component: MembershipDetailComponent;
|
||||
let fixture: ComponentFixture<MembershipDetailComponent>;
|
||||
|
||||
beforeEach(async(() => {
|
||||
beforeEach(waitForAsync(() => {
|
||||
TestBed.configureTestingModule({
|
||||
declarations: [MembershipDetailComponent],
|
||||
})
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing';
|
||||
|
||||
import { MembershipsComponent } from './memberships.component';
|
||||
|
||||
@@ -6,7 +6,7 @@ describe('MembershipsComponent', () => {
|
||||
let component: MembershipsComponent;
|
||||
let fixture: ComponentFixture<MembershipsComponent>;
|
||||
|
||||
beforeEach(async(() => {
|
||||
beforeEach(waitForAsync(() => {
|
||||
TestBed.configureTestingModule({
|
||||
declarations: [MembershipsComponent],
|
||||
})
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing';
|
||||
|
||||
import { PasswordComponent } from './password.component';
|
||||
|
||||
@@ -6,7 +6,7 @@ describe('PasswordComponent', () => {
|
||||
let component: PasswordComponent;
|
||||
let fixture: ComponentFixture<PasswordComponent>;
|
||||
|
||||
beforeEach(async(() => {
|
||||
beforeEach(waitForAsync(() => {
|
||||
TestBed.configureTestingModule({
|
||||
declarations: [PasswordComponent],
|
||||
}).compileComponents();
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing';
|
||||
|
||||
import { UserDetailComponent } from './user-detail.component';
|
||||
|
||||
@@ -6,7 +6,7 @@ describe('UserDetailComponent', () => {
|
||||
let component: UserDetailComponent;
|
||||
let fixture: ComponentFixture<UserDetailComponent>;
|
||||
|
||||
beforeEach(async(() => {
|
||||
beforeEach(waitForAsync(() => {
|
||||
TestBed.configureTestingModule({
|
||||
declarations: [UserDetailComponent],
|
||||
}).compileComponents();
|
||||
|
||||
+2
-2
@@ -1,4 +1,4 @@
|
||||
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing';
|
||||
|
||||
import { UserMfaComponent } from './user-mfa.component';
|
||||
|
||||
@@ -6,7 +6,7 @@ describe('UserMfaComponent', () => {
|
||||
let component: UserMfaComponent;
|
||||
let fixture: ComponentFixture<UserMfaComponent>;
|
||||
|
||||
beforeEach(async(() => {
|
||||
beforeEach(waitForAsync(() => {
|
||||
TestBed.configureTestingModule({
|
||||
declarations: [UserMfaComponent],
|
||||
})
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing';
|
||||
|
||||
import { UserListComponent } from './user-list.component';
|
||||
|
||||
@@ -6,7 +6,7 @@ describe('UserListComponent', () => {
|
||||
let component: UserListComponent;
|
||||
let fixture: ComponentFixture<UserListComponent>;
|
||||
|
||||
beforeEach(async(() => {
|
||||
beforeEach(waitForAsync(() => {
|
||||
TestBed.configureTestingModule({
|
||||
declarations: [UserListComponent],
|
||||
})
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing';
|
||||
|
||||
import { UserTableComponent } from './user-table.component';
|
||||
|
||||
@@ -6,7 +6,7 @@ describe('UserTableComponent', () => {
|
||||
let component: UserTableComponent;
|
||||
let fixture: ComponentFixture<UserTableComponent>;
|
||||
|
||||
beforeEach(async(() => {
|
||||
beforeEach(waitForAsync(() => {
|
||||
TestBed.configureTestingModule({
|
||||
declarations: [UserTableComponent],
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user