Skip to content

Commit

Permalink
Updated i18n tags
Browse files Browse the repository at this point in the history
  • Loading branch information
rmathis committed Aug 14, 2019
1 parent 76dcaa6 commit be60891
Show file tree
Hide file tree
Showing 5 changed files with 32 additions and 12 deletions.
5 changes: 5 additions & 0 deletions backend/src/main/resources/i18n/messages.properties
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ action.xml=XML
action.manage=Manage
action.close=Close
action.back-to-top=Back to Top
action.restore=Restore

value.enabled=Enabled
value.disabled=Disabled
Expand Down Expand Up @@ -416,6 +417,7 @@ label.check-to-select=Check to select
label.current=Current
label.restore=Restore
label.compare-selected=Compare Selected
label.restore-version=Restore Version ({ date })

label.saved=Saved
label.by=By
Expand Down Expand Up @@ -471,6 +473,9 @@ message.database-constraint=There was a database constraint problem processing t
message.no-filters=No Filters
message.no-filters-added=No filters have been added to this Metadata Provider

message.create-new-version-from-version=Create New Version from Version ({ date }) Settings
message.restoring-this-version-will-copy=Restoring this version will copy the Version ({ date }) configuration and create a new Version from the selected version settings. You can then edit the configuration before saving the new version.

tooltip.entity-id=Entity ID
tooltip.service-provider-name=Service Provider Name (Dashboard Display Only)
tooltip.force-authn=Disallows use (or reuse) of authentication results and login flows that don\u0027t provide a real-time proof of user presence in the login process
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
<td>
<button class="btn btn-text btn-link" (click)="restore.emit(version)" *ngIf="i > 0">
<i class="fa fa-undo"></i>&nbsp;
<translate-i18n key="label.restore">Restore</translate-i18n>
<translate-i18n key="action.restore">Restore</translate-i18n>
</button>
</td>
</tr>
Expand Down
6 changes: 4 additions & 2 deletions ui/src/app/metadata/configuration/configuration.module.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { NgModule, ModuleWithProviders } from '@angular/core';
import { CommonModule } from '@angular/common';
import { CommonModule, DatePipe } from '@angular/common';
import { StoreModule } from '@ngrx/store';
import { EffectsModule } from '@ngrx/effects';
import { RouterModule } from '@angular/router';
Expand Down Expand Up @@ -63,7 +63,9 @@ import { RestoreVersionEffects } from './effect/restore.effect';
SharedModule
],
exports: [],
providers: []
providers: [
DatePipe
]
})
export class MetadataConfigurationModule {
static forRoot(): ModuleWithProviders {
Expand Down
20 changes: 14 additions & 6 deletions ui/src/app/metadata/configuration/container/restore.component.html
Original file line number Diff line number Diff line change
@@ -1,14 +1,22 @@
<h2 class="mb-4">
Restore Version ({{ date$ | async | date:DATE_FORMAT }})
<translate-i18n key="label.restore-version" [params]="{ 'date': date }">
Restore Version ( date )
</translate-i18n>
</h2>
<div class="d-flex justify-content-center align-items-center">
<div class="card m-4 w-50">
<div class="card-body">
<h3 class="card-title">Create New Version from Version ({{ date$ | async | date:DATE_FORMAT }}) Settings</h3>
<p>Restoring this version will copy the Version ({{ date$ | async | date:DATE_FORMAT }}) configuration and create a new Version from the
selected version settings. You can then edit the configuration before saving the new version.</p>
<a [routerLink]="['../', 'history']" class="btn btn-light">Cancel</a>&nbsp;
<button class="btn btn-primary" (click)="restore()">Restore</button>
<h3 class="card-title"
translate="message.create-new-version-from-version"
[translateParams]="{ 'date': date }">
Create New Version from Version ( date ) Settings
</h3>
<p translate="message.restoring-this-version-will-copy"
[translateParams]="{ 'date': date }">
Restoring this version will copy the Version ( date ) configuration and create a new Version from the selected version settings. You can then edit the configuration before saving the new version.
</p>
<a [routerLink]="['../', 'history']" class="btn btn-light" translate="action.cancel">Cancel</a>&nbsp;
<button class="btn btn-primary" (click)="restore()" translate="action.restore">Restore</button>
</div>
</div>
</div>
11 changes: 8 additions & 3 deletions ui/src/app/metadata/configuration/container/restore.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import * as fromConfiguration from '../reducer';
import { CONFIG_DATE_FORMAT } from '../configuration.values';
import { RestoreVersionRequest } from '../action/restore.action';
import { withLatestFrom, map, takeUntil } from 'rxjs/operators';
import { DatePipe } from '@angular/common';

@Component({
selector: 'restore-component',
Expand All @@ -20,11 +21,11 @@ export class RestoreComponent implements OnDestroy {
restore$ = this.subj.asObservable();

date$ = this.store.select(fromConfiguration.getConfigurationVersionDate);

DATE_FORMAT = CONFIG_DATE_FORMAT;
date: string;

constructor(
private store: Store<fromConfiguration.ConfigurationState>
private store: Store<fromConfiguration.ConfigurationState>,
private datePipe: DatePipe
) {
this.restore$.pipe(
withLatestFrom(
Expand All @@ -34,6 +35,10 @@ export class RestoreComponent implements OnDestroy {
),
map(([restore, version, type, id]) => new RestoreVersionRequest({ id, type, version }))
).subscribe(this.store);

this.date$.pipe(takeUntil(this.subj)).subscribe(
(date) => this.date = this.datePipe.transform(date, CONFIG_DATE_FORMAT)
);
}

restore() {
Expand Down

0 comments on commit be60891

Please sign in to comment.