mirror of
https://github.com/andwati/zitadel.git
synced 2026-11-17 19:05:13 +00:00
feat(console): actions and flows (#2559)
* features, page, table, create dialog, i18n * trigger actions service, add action dialog * display flows, add flow dialog, duration pipe, i18n * optim flow layout, action presets * delete actions, flows, layout * drag drop list, fix update * lint * stylelint * fix template rest * actions, drag, fix hasrole * stylelint * toast, i18n * missing italian translations * it * fix ActionSearchQueries Co-authored-by: Livio Amstutz <[email protected]>
This commit is contained in:
co-authored by
Livio Amstutz
parent
b80751d7f7
commit
06e1af4f78
@@ -0,0 +1,18 @@
|
||||
import { CommonModule } from '@angular/common';
|
||||
import { NgModule } from '@angular/core';
|
||||
|
||||
import { DurationToSecondsPipe } from './duration-to-seconds.pipe';
|
||||
|
||||
|
||||
@NgModule({
|
||||
declarations: [
|
||||
DurationToSecondsPipe,
|
||||
],
|
||||
imports: [
|
||||
CommonModule,
|
||||
],
|
||||
exports: [
|
||||
DurationToSecondsPipe,
|
||||
],
|
||||
})
|
||||
export class DurationToSecondsPipeModule { }
|
||||
@@ -0,0 +1,25 @@
|
||||
import { Pipe, PipeTransform } from '@angular/core';
|
||||
import { Duration } from 'google-protobuf/google/protobuf/duration_pb';
|
||||
|
||||
@Pipe({
|
||||
name: 'durationToSeconds',
|
||||
})
|
||||
export class DurationToSecondsPipe implements PipeTransform {
|
||||
|
||||
transform(value?: Duration.AsObject, ...args: unknown[]): unknown {
|
||||
if (value) {
|
||||
return this.durationToSeconds(value);
|
||||
} else {
|
||||
return '';
|
||||
}
|
||||
}
|
||||
|
||||
private durationToSeconds(date: Duration.AsObject): any {
|
||||
if (date?.seconds !== undefined && date?.nanos !== undefined) {
|
||||
const ms = (date.seconds * 1000 + date.nanos / 1000 / 1000);
|
||||
const secs = ms / 1000;
|
||||
return `${secs.toFixed(2)} sec`
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user