upgrade angualr, fix keep session attribute
This commit is contained in:
+13
-14
@@ -35,6 +35,7 @@ import { VoucherDialog } from './pages/account/voucher/voucher.component';
|
||||
import { InfoComponent } from './pages/account/info/info.component';
|
||||
import { AliasesComponent } from './pages/account/aliases/aliases.component';
|
||||
import { DomainsComponent } from './pages/account/domains/domains.component';
|
||||
import { DyndnsComponent } from './pages/account/dyndns/dyndns.component';
|
||||
import { ProfileComponent } from './pages/account/profile/profile.component';
|
||||
import { PasswordComponent } from './pages/password/password.component';
|
||||
import { PasswordResetComponent } from './pages/password-reset/password-reset.component';
|
||||
@@ -62,10 +63,12 @@ import { DurationpickerComponent } from './ui/durationpicker/durationpicker.comp
|
||||
import { InviteCodeComponent } from './pages/invites/code/code.component';
|
||||
import { InviteEditComponent } from './pages/invites/edit/invite.edit';
|
||||
import { MatPaginatorIntl } from '@angular/material/paginator';
|
||||
import { NgxMatDateAdapter, NGX_MAT_DATE_FORMATS } from '@angular-material-components/datetime-picker';
|
||||
import { NgxMatMomentAdapter } from '@angular-material-components/moment-adapter';
|
||||
import { JukeboxComponent } from './pages/jukebox/jukebox.compontent';
|
||||
import { FormLoginOidcComponent } from './pages/form-login-oidc/form-login-oidc.component';
|
||||
import { MatDatepickerModule } from '@angular/material/datepicker';
|
||||
import { MomentDateModule } from '@angular/material-moment-adapter';
|
||||
import { MAT_DATE_FORMATS } from '@angular/material/core';
|
||||
import { DatetimepickerComponent } from './ui/datetimepicker/datetimepicker.component';
|
||||
|
||||
|
||||
export function init_app(i18n: I18nService) {
|
||||
@@ -109,6 +112,7 @@ export class XhrInterceptor implements HttpInterceptor {
|
||||
InfoComponent,
|
||||
AliasesComponent,
|
||||
DomainsComponent,
|
||||
DyndnsComponent,
|
||||
ProfileComponent,
|
||||
PasswordComponent,
|
||||
PasswordResetComponent,
|
||||
@@ -126,6 +130,7 @@ export class XhrInterceptor implements HttpInterceptor {
|
||||
UrlShortenerComponent, UrlShortenerShareDialog, UrlShortenerEditDialog, UrlShortenerPasswordComponent,
|
||||
BorrowComponent, BorrowItemsComponent, BorrowItemEditComponent, BorrowRequestsComponent, BorrowRequestEditComponent, BorrowProvingComponent, BorrowProvingResultDialog,
|
||||
DividerComponent, DividertestComponent,
|
||||
DatetimepickerComponent,
|
||||
DurationpickerComponent,
|
||||
JukeboxComponent
|
||||
],
|
||||
@@ -139,7 +144,8 @@ export class XhrInterceptor implements HttpInterceptor {
|
||||
FormsModule,
|
||||
ReactiveFormsModule,
|
||||
QrCodeModule,
|
||||
|
||||
MatDatepickerModule,
|
||||
MomentDateModule
|
||||
],
|
||||
exports: [MaterialModule],
|
||||
providers: [{ provide: APP_INITIALIZER, useFactory: init_app, deps: [I18nService], multi: true }, { provide: HTTP_INTERCEPTORS, useClass: XhrInterceptor, multi: true }, DatePipe,
|
||||
@@ -149,15 +155,8 @@ export class XhrInterceptor implements HttpInterceptor {
|
||||
service.injectI18n(i18n)
|
||||
return service;
|
||||
}, deps: [I18nService]
|
||||
},
|
||||
{
|
||||
provide: NgxMatDateAdapter,
|
||||
useClass: NgxMatMomentAdapter,
|
||||
useFactory: (i18n: I18nService) => {
|
||||
return new NgxMatMomentAdapter(i18n.getLocale(), { strict: true });
|
||||
}, deps: [I18nService]
|
||||
}, {
|
||||
provide: NGX_MAT_DATE_FORMATS, useFactory: (i18n: I18nService) => {
|
||||
provide: MAT_DATE_FORMATS, useFactory: (i18n: I18nService) => {
|
||||
const datetimeformat = i18n.get('format.datetime', []);
|
||||
return {
|
||||
parse: {
|
||||
@@ -165,9 +164,9 @@ export class XhrInterceptor implements HttpInterceptor {
|
||||
},
|
||||
display: {
|
||||
dateInput: datetimeformat,
|
||||
monthYearLabel: "MMM YYYY",
|
||||
dateA11yLabel: "LL",
|
||||
monthYearA11yLabel: "MMMM YYYY"
|
||||
monthYearLabel: 'MMM YYYY',
|
||||
dateA11yLabel: 'LL',
|
||||
monthYearA11yLabel: 'MMMM YYYY'
|
||||
}
|
||||
};
|
||||
}, deps: [I18nService]
|
||||
|
||||
Reference in New Issue
Block a user