Merge branch 'dmp-refactoring' of code-repo.d4science.org:MaDgiK-CITE/argos into dmp-refactoring
This commit is contained in:
commit
9142f1f32b
|
@ -13,13 +13,13 @@
|
|||
},
|
||||
"private": true,
|
||||
"dependencies": {
|
||||
"@angular/animations": "^18.0.1",
|
||||
"@angular/common": "^18.0.1",
|
||||
"@angular/compiler": "^18.0.1",
|
||||
"@angular/core": "^18.0.1",
|
||||
"@angular/forms": "^18.0.1",
|
||||
"@angular/material-moment-adapter": "^18.0.1",
|
||||
"@angular/platform-browser": "^18.0.1",
|
||||
"@angular/animations": "^18.0.2",
|
||||
"@angular/common": "^18.0.2",
|
||||
"@angular/compiler": "^18.0.2",
|
||||
"@angular/core": "^18.0.2",
|
||||
"@angular/forms": "^18.0.2",
|
||||
"@angular/material-moment-adapter": "^18.0.2",
|
||||
"@angular/platform-browser": "^18.0.2",
|
||||
"@kolkov/angular-editor": "^2.1.0",
|
||||
"@ngx-translate/core": "^15.0.0",
|
||||
"@ngx-translate/http-loader": "^8.0.0",
|
||||
|
@ -33,6 +33,8 @@
|
|||
"keycloak-js": "^24.0.5",
|
||||
"moment": "^2.30.1",
|
||||
"moment-timezone": "^0.5.45",
|
||||
"@mat-datetimepicker/core": "^13.0.2",
|
||||
"@mat-datetimepicker/moment": "^13.0.2",
|
||||
"ng-dialog-animation": "^9.0.4",
|
||||
"ng2-dragula": "^5.1.0",
|
||||
"ngx-colors": "^3.6.0",
|
||||
|
@ -44,25 +46,25 @@
|
|||
"rxjs": "^7.4.0",
|
||||
"tinymce": "^6.7.0",
|
||||
"ts-simple-nameof": "^1.3.1",
|
||||
"tslib": "^2.6.2",
|
||||
"tslib": "^2.6.3",
|
||||
"zone.js": "~0.14.4"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@angular-devkit/build-angular": "^18.0.2",
|
||||
"@angular/cdk": "^18.0.1",
|
||||
"@angular/cli": "18.0.2",
|
||||
"@angular/compiler-cli": "^18.0.1",
|
||||
"@angular/language-service": "^18.0.1",
|
||||
"@angular/material": "^18.0.1",
|
||||
"@angular/platform-browser-dynamic": "^18.0.1",
|
||||
"@angular/router": "^18.0.1",
|
||||
"@angular-devkit/build-angular": "^18.0.3",
|
||||
"@angular/cdk": "^18.0.2",
|
||||
"@angular/cli": "18.0.3",
|
||||
"@angular/compiler-cli": "^18.0.2",
|
||||
"@angular/language-service": "^18.0.2",
|
||||
"@angular/material": "^18.0.2",
|
||||
"@angular/platform-browser-dynamic": "^18.0.2",
|
||||
"@angular/router": "^18.0.2",
|
||||
"@types/dragula": "^3.7.5",
|
||||
"@types/file-saver": "^2.0.7",
|
||||
"@types/moment-timezone": "^0.5.13",
|
||||
"@types/node": "^20.14.1",
|
||||
"@types/node": "^20.14.2",
|
||||
"codelyzer": "^6.0.2",
|
||||
"ts-node": "~10.9.2",
|
||||
"tslint": "~6.1.0",
|
||||
"typescript": "^5.4.5"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -383,7 +383,9 @@ const tenantEnrichedRoutes: Routes = [
|
|||
path: 't/:tenant_code',
|
||||
data: {
|
||||
breadcrumb: true,
|
||||
hideItem: true
|
||||
...BreadcrumbService.generateRouteDataConfiguration({
|
||||
skipNavigation: true,
|
||||
})
|
||||
},
|
||||
children: [
|
||||
...appRoutes
|
||||
|
|
|
@ -24,6 +24,7 @@ import { TenantConfigurationType } from './core/common/enum/tenant-configuration
|
|||
import { CssColorsTenantConfiguration, TenantConfiguration } from './core/model/tenant-configuaration/tenant-configuration';
|
||||
import { nameof } from 'ts-simple-nameof';
|
||||
import { TenantHandlingService } from './core/services/tenant/tenant-handling.service';
|
||||
import { BreadcrumbService } from './ui/misc/breadcrumb/breadcrumb.service';
|
||||
|
||||
|
||||
declare const gapi: any;
|
||||
|
@ -63,7 +64,8 @@ export class AppComponent implements OnInit, AfterViewInit {
|
|||
private matomoService: MatomoService,
|
||||
private tenantConfigurationService: TenantConfigurationService,
|
||||
private sidenavService: SideNavService,
|
||||
private tenantHandlingService: TenantHandlingService
|
||||
private tenantHandlingService: TenantHandlingService,
|
||||
private breadcrumbService: BreadcrumbService
|
||||
) {
|
||||
this.initializeServices();
|
||||
this.matomoService.init();
|
||||
|
@ -186,6 +188,12 @@ export class AppComponent implements OnInit, AfterViewInit {
|
|||
filter(event => event instanceof NavigationEnd)
|
||||
)
|
||||
.subscribe((event: NavigationStart) => {
|
||||
|
||||
this.breadcrumbService.addExcludedParam('t', true);
|
||||
|
||||
if (this.authentication.getSelectedTenantName() && this.authentication.getSelectedTenantName() !== '')
|
||||
this.breadcrumbService.addIdResolvedValue(this.authentication.selectedTenant(), this.authentication.getSelectedTenantName());
|
||||
|
||||
const enrichedUrl = this.tenantHandlingService.getUrlEnrichedWithTenantCode(event.url, this.authentication.selectedTenant() ?? 'default');
|
||||
if (event.url != enrichedUrl) {
|
||||
this.router.navigateByUrl(enrichedUrl);
|
||||
|
@ -262,11 +270,6 @@ export class AppComponent implements OnInit, AfterViewInit {
|
|||
this.router.navigate(['/plans'], { queryParams: { /*refresh : Math.random() ,returnUrl: this.state.url*/ } });
|
||||
}
|
||||
|
||||
// ----------- UNCOMMENT TO ADD AGAIN GRANTS --------
|
||||
// goToGrants() {
|
||||
// this.router.navigate(['/grants'], { queryParams: { /*refresh : Math.random() ,returnUrl: this.state.url*/ } });
|
||||
// }
|
||||
|
||||
initializeServices() {
|
||||
this.translate.setDefaultLang(this.language.getDefaultLanguagesCode());
|
||||
this.authentication.currentAccountIsAuthenticated() && this.authentication.getUserProfileCulture() ? this.cultureService.cultureSelected(this.authentication.getUserProfileCulture()) : this.cultureService.cultureSelected(this.configurationService.defaultCulture);
|
||||
|
|
|
@ -4,7 +4,7 @@ import { APP_INITIALIZER, LOCALE_ID, NgModule } from '@angular/core';
|
|||
import { FormsModule, ReactiveFormsModule } from '@angular/forms';
|
||||
import { MAT_MOMENT_DATE_FORMATS, MatMomentDateModule } from '@angular/material-moment-adapter';
|
||||
import { DateAdapter, MAT_DATE_FORMATS, MAT_DATE_LOCALE } from '@angular/material/core';
|
||||
import { MAT_FORM_FIELD_DEFAULT_OPTIONS, MatFormFieldDefaultOptions } from '@angular/material/form-field';
|
||||
import { MAT_FORM_FIELD_DEFAULT_OPTIONS } from '@angular/material/form-field';
|
||||
import { BrowserModule, Title } from '@angular/platform-browser';
|
||||
import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
|
||||
import { AppRoutingModule } from '@app/app-routing.module';
|
||||
|
@ -12,16 +12,19 @@ import { AppComponent } from '@app/app.component';
|
|||
import { CoreServiceModule } from '@app/core/core-service.module';
|
||||
import { NotificationModule } from '@app/library/notification/notification.module';
|
||||
import { LoginModule } from '@app/ui/auth/login/login.module';
|
||||
// import { BreadcrumbModule } from '@app/ui/misc/breadcrumb/breadcrumb.module';
|
||||
import { ReloadHelperComponent } from '@app/ui/misc/reload-helper/reload-helper.component';
|
||||
import { NavbarModule } from '@app/ui/navbar/navbar.module';
|
||||
import { SidebarModule } from '@app/ui/sidebar/sidebar.module';
|
||||
import { MomentUtcDateAdapter } from '@common/date/moment-utc-date-adapter';
|
||||
import { MomentUtcDateTimeAdapter } from '@common/date/moment-utc-date-time.adapter';
|
||||
import { BaseHttpParams } from '@common/http/base-http-params';
|
||||
import { CommonHttpModule } from '@common/http/common-http.module';
|
||||
import { InterceptorType } from '@common/http/interceptors/interceptor-type';
|
||||
import { CommonUiModule } from '@common/ui/common-ui.module';
|
||||
import { DatetimeAdapter } from '@mat-datetimepicker/core';
|
||||
import { TranslateCompiler, TranslateLoader, TranslateModule } from '@ngx-translate/core';
|
||||
import { CoreNotificationServiceModule } from '@notification-service/services/core-service.module';
|
||||
import { CoreAnnotationServiceModule } from 'annotation-service/services/core-service.module';
|
||||
import { KeycloakAngularModule, KeycloakService } from 'keycloak-angular';
|
||||
import { DragulaModule } from 'ng2-dragula';
|
||||
import { CookieService } from 'ngx-cookie-service';
|
||||
|
@ -34,14 +37,12 @@ import { CultureService } from './core/services/culture/culture-service';
|
|||
import { LanguageHttpService } from './core/services/language/language.http.service';
|
||||
import { LanguageService } from './core/services/language/language.service';
|
||||
import { TranslateServerLoader } from './core/services/language/server.loader';
|
||||
import { MatomoService } from './core/services/matomo/matomo-service';
|
||||
import { GuidedTourModule } from './library/guided-tour/guided-tour.module';
|
||||
import { OpenDMPCustomTranslationCompiler } from './utilities/translate/opendmp-custom-translation-compiler';
|
||||
import { CoreAnnotationServiceModule } from 'annotation-service/services/core-service.module';
|
||||
import { CoreNotificationServiceModule } from '@notification-service/services/core-service.module';
|
||||
import { DepositOauth2DialogModule } from './ui/misc/deposit-oauth2-dialog/deposit-oauth2-dialog.module';
|
||||
import { AnalyticsService } from './core/services/matomo/analytics-service';
|
||||
import { MatomoService } from './core/services/matomo/matomo-service';
|
||||
import { TenantHandlingService } from './core/services/tenant/tenant-handling.service';
|
||||
import { GuidedTourModule } from './library/guided-tour/guided-tour.module';
|
||||
import { DepositOauth2DialogModule } from './ui/misc/deposit-oauth2-dialog/deposit-oauth2-dialog.module';
|
||||
import { OpenDMPCustomTranslationCompiler } from './utilities/translate/opendmp-custom-translation-compiler';
|
||||
|
||||
// AoT requires an exported function for factories
|
||||
export function HttpLoaderFactory(languageHttpService: LanguageHttpService) {
|
||||
|
@ -78,12 +79,7 @@ const cookieConfig: NgcCookieConsentConfig = {
|
|||
type: 'info'
|
||||
};
|
||||
|
||||
const appearance: MatFormFieldDefaultOptions = {
|
||||
appearance: 'outline'
|
||||
// appearance: 'standard'
|
||||
};
|
||||
|
||||
export function InstallationConfigurationFactory(appConfig: ConfigurationService, keycloak: KeycloakService, authService: AuthService, languageService: LanguageService, tenantHandlingService:TenantHandlingService) {
|
||||
export function InstallationConfigurationFactory(appConfig: ConfigurationService, keycloak: KeycloakService, authService: AuthService, languageService: LanguageService, tenantHandlingService: TenantHandlingService) {
|
||||
return () => appConfig.loadConfiguration().then(() => {
|
||||
return languageService.loadAvailableLanguages().toPromise();
|
||||
}).then(x => keycloak.init({
|
||||
|
@ -145,7 +141,6 @@ export function InstallationConfigurationFactory(appConfig: ConfigurationService
|
|||
LoginModule,
|
||||
//Ui
|
||||
NotificationModule,
|
||||
// BreadcrumbModule,
|
||||
ReactiveFormsModule,
|
||||
FormsModule,
|
||||
NavbarModule,
|
||||
|
@ -156,35 +151,39 @@ export function InstallationConfigurationFactory(appConfig: ConfigurationService
|
|||
DragulaModule.forRoot(),
|
||||
NgxMatomoModule.forRoot({
|
||||
mode: MatomoInitializationMode.AUTO_DEFERRED,
|
||||
})], providers: [
|
||||
ConfigurationService,
|
||||
{
|
||||
provide: APP_INITIALIZER,
|
||||
useFactory: InstallationConfigurationFactory,
|
||||
deps: [ConfigurationService, KeycloakService, AuthService, LanguageService, TenantHandlingService],
|
||||
multi: true
|
||||
},
|
||||
{
|
||||
provide: MAT_DATE_LOCALE,
|
||||
deps: [CultureService],
|
||||
useFactory: (cultureService) => cultureService.getCurrentCulture().name
|
||||
},
|
||||
{ provide: MAT_DATE_FORMATS, useValue: MAT_MOMENT_DATE_FORMATS },
|
||||
{ provide: DateAdapter, useClass: MomentUtcDateAdapter },
|
||||
{
|
||||
provide: LOCALE_ID,
|
||||
deps: [CultureService],
|
||||
useFactory: (cultureService) => cultureService.getCurrentCulture().name
|
||||
},
|
||||
{
|
||||
provide: MAT_FORM_FIELD_DEFAULT_OPTIONS,
|
||||
useValue: appearance
|
||||
},
|
||||
Title,
|
||||
CookieService,
|
||||
MatomoService,
|
||||
AnalyticsService,
|
||||
provideHttpClient(withInterceptorsFromDi())
|
||||
]
|
||||
})],
|
||||
providers: [
|
||||
ConfigurationService,
|
||||
{
|
||||
provide: APP_INITIALIZER,
|
||||
useFactory: InstallationConfigurationFactory,
|
||||
deps: [ConfigurationService, KeycloakService, AuthService, LanguageService, TenantHandlingService],
|
||||
multi: true
|
||||
},
|
||||
{
|
||||
provide: MAT_DATE_LOCALE,
|
||||
deps: [CultureService],
|
||||
useFactory: (cultureService) => cultureService.getCurrentCulture().name
|
||||
},
|
||||
{ provide: MAT_DATE_FORMATS, useValue: MAT_MOMENT_DATE_FORMATS },
|
||||
{ provide: DateAdapter, useClass: MomentUtcDateAdapter },
|
||||
{ provide: DatetimeAdapter, useClass: MomentUtcDateTimeAdapter },
|
||||
{
|
||||
provide: LOCALE_ID,
|
||||
deps: [CultureService, ConfigurationService],
|
||||
useFactory: (cultureService, installationConfigurationService) => cultureService.getCurrentCulture(installationConfigurationService).name
|
||||
},
|
||||
{
|
||||
provide: MAT_FORM_FIELD_DEFAULT_OPTIONS,
|
||||
useValue: {
|
||||
appearance: 'outline'
|
||||
}
|
||||
},
|
||||
Title,
|
||||
CookieService,
|
||||
MatomoService,
|
||||
AnalyticsService,
|
||||
provideHttpClient(withInterceptorsFromDi())
|
||||
]
|
||||
})
|
||||
export class AppModule { }
|
||||
|
|
|
@ -46,6 +46,7 @@ import { StorageFileService } from './services/storage-file/storage-file.service
|
|||
import { TenantConfigurationService } from './services/tenant-configuration/tenant-configuration.service';
|
||||
import { DefaultUserLocaleService } from './services/default-user-locale/default-user-locale.service';
|
||||
import { TenantHandlingService } from './services/tenant/tenant-handling.service';
|
||||
import { RouterUtilsService } from './services/router/router-utils.service';
|
||||
//
|
||||
//
|
||||
// This is shared module that provides all the services. Its imported only once on the AppModule.
|
||||
|
@ -111,7 +112,8 @@ export class CoreServiceModule {
|
|||
VisibilityRulesService,
|
||||
TenantConfigurationService,
|
||||
StorageFileService,
|
||||
TenantHandlingService
|
||||
TenantHandlingService,
|
||||
RouterUtilsService
|
||||
],
|
||||
};
|
||||
}
|
||||
|
|
|
@ -1,18 +1,17 @@
|
|||
import { DatePipe } from '@angular/common';
|
||||
import { NgModule } from '@angular/core';
|
||||
import { DateFormatPipe } from './pipes/date-format.pipe';
|
||||
import { DateTimeFormatPipe } from './pipes/date-time-format.pipe';
|
||||
import { ColumnClassPipe } from "@app/core/pipes/column-class.pipe";
|
||||
import { FieldValuePipe } from "@app/core/pipes/field-value.pipe";
|
||||
import { PipeService } from '@common/formatting/pipe.service';
|
||||
import { AppTitleCaseFormatPipe } from '@common/formatting/pipes/app-title-case-format.pipe';
|
||||
import { CultureInfoDisplayPipe } from './pipes/culture-info-display.pipe';
|
||||
import { DataTableDateTimeFormatPipe, DateTimeFormatPipe } from './pipes/date-time-format.pipe';
|
||||
import { JsonParserPipe } from './pipes/json-parser.pipe';
|
||||
import { NgForLimitPipe } from './pipes/ng-for-limit.pipe';
|
||||
import { RemoveHtmlTagsPipe } from './pipes/remove-html-tags.pipe';
|
||||
import { SumarizeTextPipe } from './pipes/sumarize-text.pipe';
|
||||
import { TimezoneInfoDisplayPipe } from './pipes/timezone-info-display.pipe';
|
||||
import { EnumUtils } from './services/utilities/enum-utils.service';
|
||||
import { JsonParserPipe } from './pipes/json-parser.pipe';
|
||||
import { DateTimeCultureFormatPipe } from './pipes/date-time-culture-format.pipe';
|
||||
import {FieldValuePipe} from "@app/core/pipes/field-value.pipe";
|
||||
import {ColumnClassPipe} from "@app/core/pipes/column-class.pipe";
|
||||
import { PipeService } from '@common/formatting/pipe.service';
|
||||
import { AppTitleCaseFormatPipe } from '@common/formatting/pipes/app-title-case-format.pipe';
|
||||
import { RemoveHtmlTagsPipe } from './pipes/remove-html-tags.pipe';
|
||||
|
||||
//
|
||||
//
|
||||
|
@ -27,9 +26,9 @@ import { RemoveHtmlTagsPipe } from './pipes/remove-html-tags.pipe';
|
|||
SumarizeTextPipe,
|
||||
RemoveHtmlTagsPipe,
|
||||
TimezoneInfoDisplayPipe,
|
||||
DateFormatPipe,
|
||||
CultureInfoDisplayPipe,
|
||||
DateTimeFormatPipe,
|
||||
DateTimeCultureFormatPipe,
|
||||
DataTableDateTimeFormatPipe,
|
||||
JsonParserPipe,
|
||||
FieldValuePipe,
|
||||
ColumnClassPipe,
|
||||
|
@ -40,9 +39,9 @@ import { RemoveHtmlTagsPipe } from './pipes/remove-html-tags.pipe';
|
|||
SumarizeTextPipe,
|
||||
RemoveHtmlTagsPipe,
|
||||
TimezoneInfoDisplayPipe,
|
||||
DateFormatPipe,
|
||||
CultureInfoDisplayPipe,
|
||||
DateTimeFormatPipe,
|
||||
DateTimeCultureFormatPipe,
|
||||
DataTableDateTimeFormatPipe,
|
||||
JsonParserPipe,
|
||||
FieldValuePipe,
|
||||
ColumnClassPipe,
|
||||
|
@ -56,9 +55,9 @@ import { RemoveHtmlTagsPipe } from './pipes/remove-html-tags.pipe';
|
|||
SumarizeTextPipe,
|
||||
RemoveHtmlTagsPipe,
|
||||
TimezoneInfoDisplayPipe,
|
||||
DateFormatPipe,
|
||||
CultureInfoDisplayPipe,
|
||||
DateTimeFormatPipe,
|
||||
DateTimeCultureFormatPipe,
|
||||
DataTableDateTimeFormatPipe,
|
||||
JsonParserPipe,
|
||||
FieldValuePipe,
|
||||
ColumnClassPipe,
|
||||
|
|
|
@ -1,5 +0,0 @@
|
|||
export interface CultureInfo {
|
||||
name: string;
|
||||
displayName: string;
|
||||
nativeName: string;
|
||||
}
|
|
@ -0,0 +1,11 @@
|
|||
import { Pipe, PipeTransform } from '@angular/core';
|
||||
import { CultureInfo } from '../services/culture/culture-service';
|
||||
|
||||
@Pipe({ name: 'cultureInfoDisplay' })
|
||||
export class CultureInfoDisplayPipe implements PipeTransform {
|
||||
constructor() { }
|
||||
|
||||
public transform(value: CultureInfo): any {
|
||||
return value.displayName + ' [' + value.name + ']';
|
||||
}
|
||||
}
|
|
@ -1,20 +0,0 @@
|
|||
import { DatePipe } from '@angular/common';
|
||||
import { Pipe, PipeTransform } from '@angular/core';
|
||||
import moment from 'moment';
|
||||
import 'moment-timezone';
|
||||
|
||||
@Pipe({
|
||||
name: 'dateFormatter'
|
||||
})
|
||||
export class DateFormatPipe implements PipeTransform {
|
||||
|
||||
constructor(private datePipe: DatePipe) {
|
||||
|
||||
}
|
||||
|
||||
transform(value: any, format?: string, locale?: string): string | null {
|
||||
// using timezone set in timezoneService by default. can be overwritten with pipe arguments
|
||||
const timezoneToUse = moment(value).tz('UTC').format('Z');
|
||||
return this.datePipe.transform(value, format, timezoneToUse, locale);
|
||||
}
|
||||
}
|
|
@ -1,95 +0,0 @@
|
|||
import { DatePipe, registerLocaleData } from '@angular/common';
|
||||
import localeEl from '@angular/common/locales/el';
|
||||
import localeDe from '@angular/common/locales/de';
|
||||
import localeEs from '@angular/common/locales/es';
|
||||
import localeSk from '@angular/common/locales/sk';
|
||||
import localeTr from '@angular/common/locales/tr';
|
||||
import localeSr from '@angular/common/locales/sr';
|
||||
import localePt from '@angular/common/locales/pt';
|
||||
import { Pipe, PipeTransform } from '@angular/core';
|
||||
import { LangChangeEvent, TranslateService } from '@ngx-translate/core';
|
||||
import 'moment-timezone';
|
||||
import { CultureInfo } from '../model/culture-info';
|
||||
import { LanguageService } from '../services/language/language.service';
|
||||
|
||||
const availableCultures: CultureInfo[] = require('../../../assets/localization/available-cultures.json');
|
||||
|
||||
@Pipe({
|
||||
name: 'dateTimeCultureFormatter',
|
||||
pure: false
|
||||
})
|
||||
export class DateTimeCultureFormatPipe implements PipeTransform {
|
||||
private cultureValues = new Map<string, CultureInfo>(); // cultures by name
|
||||
private cache;
|
||||
|
||||
constructor(private datePipe: DatePipe,
|
||||
private translate: TranslateService,
|
||||
private languageService: LanguageService) {
|
||||
|
||||
if (availableCultures) {
|
||||
this.cultureValues = new Map<string, CultureInfo>();
|
||||
availableCultures.forEach(culture => {
|
||||
this.cultureValues.set(culture.name, culture);
|
||||
});
|
||||
}
|
||||
|
||||
this.translate.onLangChange.subscribe(($event: LangChangeEvent) => {
|
||||
(<any>this).locale = $event.lang;
|
||||
this.cache = null;
|
||||
});
|
||||
}
|
||||
|
||||
transform(value: any, format?: string, timezone?: string): string | null {
|
||||
if (!this.cache) {
|
||||
const cultureName = this.languageService.getCurrentLanguage();
|
||||
let locale: string;
|
||||
switch (cultureName) {
|
||||
case 'en': {
|
||||
locale = this.cultureValues.get('en-US').name;
|
||||
break;
|
||||
}
|
||||
case 'gr': {
|
||||
locale = this.cultureValues.get('el-GR').name;
|
||||
registerLocaleData(localeEl);
|
||||
break;
|
||||
}
|
||||
case 'es': {
|
||||
locale = this.cultureValues.get('es-ES').name;
|
||||
registerLocaleData(localeEs);
|
||||
break;
|
||||
}
|
||||
case 'de': {
|
||||
locale = this.cultureValues.get('de-DE').name;
|
||||
registerLocaleData(localeDe);
|
||||
break;
|
||||
}
|
||||
case 'tr': {
|
||||
locale = this.cultureValues.get('tr-TR').name;
|
||||
registerLocaleData(localeTr);
|
||||
break;
|
||||
}
|
||||
case 'sk': {
|
||||
locale = this.cultureValues.get('sk-SK').name;
|
||||
registerLocaleData(localeSk);
|
||||
break;
|
||||
}
|
||||
case 'sr': {
|
||||
locale = this.cultureValues.get('sr-Latn-RS').name;
|
||||
registerLocaleData(localeSr);
|
||||
break;
|
||||
}
|
||||
case 'pt': {
|
||||
locale = this.cultureValues.get('pt-PT').name;
|
||||
registerLocaleData(localePt);
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
locale = this.cultureValues.get('en-US').name;
|
||||
break;
|
||||
}
|
||||
}
|
||||
this.cache = this.datePipe.transform(value, format, timezone, locale);
|
||||
}
|
||||
return this.cache;
|
||||
}
|
||||
}
|
|
@ -2,6 +2,7 @@ import { DatePipe } from '@angular/common';
|
|||
import { Pipe, PipeTransform } from '@angular/core';
|
||||
import moment from 'moment';
|
||||
import 'moment-timezone';
|
||||
import { CultureService } from '../services/culture/culture-service';
|
||||
import { TimezoneService } from '../services/timezone/timezone-service';
|
||||
|
||||
@Pipe({
|
||||
|
@ -9,13 +10,40 @@ import { TimezoneService } from '../services/timezone/timezone-service';
|
|||
})
|
||||
export class DateTimeFormatPipe implements PipeTransform {
|
||||
|
||||
constructor(private datePipe: DatePipe, private timezoneService: TimezoneService) {
|
||||
constructor(private datePipe: DatePipe, private timezoneService: TimezoneService, private cultureService: CultureService) {
|
||||
|
||||
}
|
||||
|
||||
transform(value: any, format?: string, timezone?: string, locale?: string): string | null {
|
||||
|
||||
// using timezone set in timezoneService by default. can be overwritten with pipe arguments
|
||||
const timezoneToUse = timezone ? timezone : moment(value).tz(this.timezoneService.getCurrentTimezone()).format('Z');
|
||||
return this.datePipe.transform(value, format, timezoneToUse, locale);
|
||||
let localeToUse = locale ? locale : this.cultureService.getCurrentCulture().name;
|
||||
|
||||
return this.datePipe.transform(value, format, timezoneToUse, localeToUse);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@Pipe({
|
||||
name: 'dataTableDateTimeFormatter'
|
||||
})
|
||||
// This is only used for the DataTable Column definition.
|
||||
// It's a hacky way to apply format to the pipe because it only supports passing a pipe instance and calls transform in it without params.
|
||||
export class DataTableDateTimeFormatPipe extends DateTimeFormatPipe implements PipeTransform {
|
||||
|
||||
format: string;
|
||||
|
||||
constructor(private _datePipe: DatePipe, private _timezoneService: TimezoneService, private _cultureService: CultureService) {
|
||||
super(_datePipe, _timezoneService, _cultureService);
|
||||
}
|
||||
|
||||
public withFormat(format: string): DataTableDateTimeFormatPipe {
|
||||
this.format = format;
|
||||
return this;
|
||||
}
|
||||
|
||||
transform(value: any): string | null {
|
||||
return super.transform(value, this.format);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,23 +1,24 @@
|
|||
import { DatePipe } from "@angular/common";
|
||||
import { Pipe, PipeTransform } from "@angular/core";
|
||||
import { Guid } from "@common/types/guid";
|
||||
import { TranslateService } from "@ngx-translate/core";
|
||||
import { Observable, map, of } from "rxjs";
|
||||
import { nameof } from "ts-simple-nameof";
|
||||
import { DescriptionTemplateFieldType } from "../common/enum/description-template-field-type";
|
||||
import { DescriptionTemplateField, DescriptionTemplateLabelAndMultiplicityData, DescriptionTemplateRadioBoxData, DescriptionTemplateReferenceTypeData, DescriptionTemplateSelectData } from "../model/description-template/description-template";
|
||||
import { DescriptionFieldPersist } from "../model/description/description";
|
||||
import { Observable, map, of } from "rxjs";
|
||||
import { Guid } from "@common/types/guid";
|
||||
import { DmpService } from "../services/dmp/dmp.service";
|
||||
import { DescriptionService } from "../services/description/description.service";
|
||||
import { StorageFileService } from "../services/storage-file/storage-file.service";
|
||||
import { nameof } from "ts-simple-nameof";
|
||||
import { StorageFile } from "../model/storage-file/storage-file";
|
||||
import { TranslateService } from "@ngx-translate/core";
|
||||
import { DescriptionService } from "../services/description/description.service";
|
||||
import { DmpService } from "../services/dmp/dmp.service";
|
||||
import { StorageFileService } from "../services/storage-file/storage-file.service";
|
||||
import { DateTimeFormatPipe } from "./date-time-format.pipe";
|
||||
|
||||
@Pipe({
|
||||
name: 'fieldValue'
|
||||
})
|
||||
export class FieldValuePipe implements PipeTransform {
|
||||
|
||||
constructor(private date: DatePipe,
|
||||
constructor(
|
||||
private dateTimeFormatPipe: DateTimeFormatPipe,
|
||||
private dmpService: DmpService,
|
||||
private storageFileService: StorageFileService,
|
||||
private descriptionService: DescriptionService,
|
||||
|
@ -39,7 +40,7 @@ export class FieldValuePipe implements PipeTransform {
|
|||
break;
|
||||
}
|
||||
case DescriptionTemplateFieldType.DATE_PICKER:
|
||||
return of(this.date.transform(controlValue.dateValue, 'dd/MM/yyyy'));
|
||||
return of(this.dateTimeFormatPipe.transform(controlValue.dateValue, 'dd/MM/yyyy'));
|
||||
case DescriptionTemplateFieldType.FREE_TEXT:
|
||||
return of(controlValue.textValue);
|
||||
case DescriptionTemplateFieldType.SELECT: {
|
||||
|
@ -76,18 +77,18 @@ export class FieldValuePipe implements PipeTransform {
|
|||
case DescriptionTemplateFieldType.INTERNAL_ENTRIES_DMPS: {
|
||||
const data = <DescriptionTemplateLabelAndMultiplicityData>field.data;
|
||||
if (!data?.multipleSelect && controlValue.textValue && controlValue.textValue.length > 0) {
|
||||
return this.dmpService.query(this.dmpService.buildAutocompleteLookup(null, null, [Guid.parse(controlValue.textValue)])).pipe(map(x => x.items?.map(y=> y.label).join(',')));
|
||||
return this.dmpService.query(this.dmpService.buildAutocompleteLookup(null, null, [Guid.parse(controlValue.textValue)])).pipe(map(x => x.items?.map(y => y.label).join(',')));
|
||||
} else if (data?.multipleSelect && controlValue.references && controlValue.textListValue && controlValue.textListValue.length > 0) {
|
||||
return this.dmpService.query(this.dmpService.buildAutocompleteLookup(null, null, controlValue.textListValue.map(x => Guid.parse(x)))).pipe(map(x => x.items?.map(y=> y.label).join(',')));
|
||||
return this.dmpService.query(this.dmpService.buildAutocompleteLookup(null, null, controlValue.textListValue.map(x => Guid.parse(x)))).pipe(map(x => x.items?.map(y => y.label).join(',')));
|
||||
}
|
||||
break;
|
||||
}
|
||||
case DescriptionTemplateFieldType.INTERNAL_ENTRIES_DESCRIPTIONS:
|
||||
const data = <DescriptionTemplateLabelAndMultiplicityData>field.data;
|
||||
if (!data?.multipleSelect && controlValue.textValue && controlValue.textValue.length > 0) {
|
||||
return this.descriptionService.query(this.descriptionService.buildAutocompleteLookup(null, null, [Guid.parse(controlValue.textValue)])).pipe(map(x => x.items?.map(y=> y.label).join(',')));
|
||||
return this.descriptionService.query(this.descriptionService.buildAutocompleteLookup(null, null, [Guid.parse(controlValue.textValue)])).pipe(map(x => x.items?.map(y => y.label).join(',')));
|
||||
} else if (data?.multipleSelect && controlValue.references && controlValue.textListValue && controlValue.textListValue.length > 0) {
|
||||
return this.descriptionService.query(this.descriptionService.buildAutocompleteLookup(null, null, controlValue.textListValue.map(x => Guid.parse(x)))).pipe(map(x => x.items?.map(y=> y.label).join(',')));
|
||||
return this.descriptionService.query(this.descriptionService.buildAutocompleteLookup(null, null, controlValue.textListValue.map(x => Guid.parse(x)))).pipe(map(x => x.items?.map(y => y.label).join(',')));
|
||||
}
|
||||
break;
|
||||
case DescriptionTemplateFieldType.UPLOAD: {
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
import { Lookup } from "@common/model/lookup";
|
||||
import { CultureInfo } from "../model/culture-info";
|
||||
|
||||
export class DefaultUserLocaleTimezoneLookup extends Lookup {
|
||||
like: string;
|
||||
|
|
|
@ -36,12 +36,7 @@ export class ConfigurationService extends BaseComponent {
|
|||
|
||||
private _defaultCulture: string;
|
||||
get defaultCulture(): string {
|
||||
return this._defaultCulture;
|
||||
}
|
||||
|
||||
private _defaultBlueprintId: Guid;
|
||||
get defaultBlueprintId(): Guid {
|
||||
return this._defaultBlueprintId;
|
||||
return this._defaultCulture || 'en';
|
||||
}
|
||||
|
||||
private _defaultTimezone: string;
|
||||
|
@ -49,6 +44,11 @@ export class ConfigurationService extends BaseComponent {
|
|||
return this._defaultTimezone || 'UTC';
|
||||
}
|
||||
|
||||
private _defaultBlueprintId: Guid;
|
||||
get defaultBlueprintId(): Guid {
|
||||
return this._defaultBlueprintId;
|
||||
}
|
||||
|
||||
private _logging: Logging;
|
||||
get logging(): Logging {
|
||||
return this._logging;
|
||||
|
|
|
@ -1,12 +1,17 @@
|
|||
import { registerLocaleData } from '@angular/common';
|
||||
import { Injectable } from '@angular/core';
|
||||
import { Observable, Subject } from 'rxjs';
|
||||
import { CultureInfo } from '../../model/culture-info';
|
||||
import { ConfigurationService } from '../configuration/configuration.service';
|
||||
import { LoggingService } from '../logging/logging-service';
|
||||
import { TypeUtils } from '../utilities/type-utils.service';
|
||||
|
||||
const availableCultures: CultureInfo[] = require('../../../../assets/localization/available-cultures.json');
|
||||
|
||||
export interface CultureInfo {
|
||||
name: string;
|
||||
displayName: string;
|
||||
}
|
||||
|
||||
@Injectable()
|
||||
export class CultureService {
|
||||
|
||||
|
@ -57,41 +62,263 @@ export class CultureService {
|
|||
// Set angular locale based on user selection.
|
||||
// This is a very hacky way to map cultures with angular cultures, since there is no mapping. We first try to
|
||||
// use the culture with the specialization (ex en-US), and if not exists we import the base culture (first part).
|
||||
// let locale = newCulture.name;
|
||||
// const base = import(
|
||||
// /* webpackExclude: /\.d\.ts$/ */
|
||||
// /* webpackMode: "lazy-once" */
|
||||
// /* webpackChunkName: "i18n-base" */
|
||||
// `@angular/common/locales/${locale}.mjs`)//.then(m => m[basePkg]);
|
||||
|
||||
// const extra = import(
|
||||
// /* webpackExclude: /\.d\.ts$/ */
|
||||
// /* webpackMode: "lazy-once" */
|
||||
// /* webpackChunkName: "i18n-extra" */
|
||||
// `@angular/common/locales/extra/${locale.split('-')[0]}.mjs`)//.then(m => m[extraPkg]);
|
||||
|
||||
|
||||
// import(`/node_modules/ @angular/common/locales/${locale}.mjs`).catch(reason => {
|
||||
// this.logger.error('Could not load locale: ' + locale);
|
||||
// }).then(selectedLocale => {
|
||||
// if (selectedLocale) {
|
||||
// registerLocaleData(selectedLocale.default);
|
||||
// } else {
|
||||
// locale = newCulture.name.split('-')[0];
|
||||
// import(`/node_modules/@angular/common/locales/${locale}.mjs`).catch(reason => {
|
||||
// this.logger.error('Could not load locale: ' + locale);
|
||||
// }).then(selectedDefaultLocale => {
|
||||
// registerLocaleData(selectedDefaultLocale.default);
|
||||
// });
|
||||
// }
|
||||
// });
|
||||
let locale = newCulture.name;
|
||||
this.loadLocale(locale);
|
||||
}
|
||||
|
||||
getCultureChangeObservable(): Observable<CultureInfo> {
|
||||
return this.cultureChangeSubject.asObservable();
|
||||
}
|
||||
|
||||
getCurrentCulture(): CultureInfo {
|
||||
return this.currentCulture || this.cultureValues.get('en-US'); //TODO: fix this
|
||||
getCurrentCulture(installationConfigurationService?: ConfigurationService): CultureInfo {
|
||||
if (this.currentCulture == null && installationConfigurationService != null) {
|
||||
this.cultureSelected(installationConfigurationService.defaultCulture);
|
||||
}
|
||||
return this.currentCulture;
|
||||
}
|
||||
|
||||
private loadLocale(locale: string) {
|
||||
switch (locale) {
|
||||
|
||||
case 'af':
|
||||
import('@angular/common/locales/af').then(data => {
|
||||
registerLocaleData(data.default);
|
||||
});
|
||||
break;
|
||||
case 'am':
|
||||
import('@angular/common/locales/am').then(data => {
|
||||
registerLocaleData(data.default);
|
||||
});
|
||||
break;
|
||||
case 'ar-SA':
|
||||
import('@angular/common/locales/ar-SA').then(data => {
|
||||
registerLocaleData(data.default);
|
||||
});;
|
||||
break;
|
||||
case 'bg':
|
||||
import('@angular/common/locales/bg').then(data => {
|
||||
registerLocaleData(data.default);
|
||||
});
|
||||
break;
|
||||
case 'cs':
|
||||
import('@angular/common/locales/cs').then(data => {
|
||||
registerLocaleData(data.default);
|
||||
});
|
||||
break;
|
||||
case 'da':
|
||||
import('@angular/common/locales/da').then(data => {
|
||||
registerLocaleData(data.default);
|
||||
});
|
||||
break;
|
||||
case 'de':
|
||||
import('@angular/common/locales/de').then(data => {
|
||||
registerLocaleData(data.default);
|
||||
});
|
||||
break;
|
||||
case 'el':
|
||||
import('@angular/common/locales/el').then(data => {
|
||||
registerLocaleData(data.default);
|
||||
});
|
||||
break;
|
||||
case 'en-GB':
|
||||
import('@angular/common/locales/en-GB').then(data => {
|
||||
registerLocaleData(data.default);
|
||||
});
|
||||
break;
|
||||
case 'es-419':
|
||||
import('@angular/common/locales/es-419').then(data => {
|
||||
registerLocaleData(data.default);
|
||||
});
|
||||
break;
|
||||
case 'es':
|
||||
import('@angular/common/locales/es').then(data => {
|
||||
registerLocaleData(data.default);
|
||||
});
|
||||
break;
|
||||
case 'et':
|
||||
import('@angular/common/locales/et').then(data => {
|
||||
registerLocaleData(data.default);
|
||||
});
|
||||
break;
|
||||
case 'fa':
|
||||
import('@angular/common/locales/fa').then(data => {
|
||||
registerLocaleData(data.default);
|
||||
});
|
||||
break;
|
||||
case 'fi':
|
||||
import('@angular/common/locales/fi').then(data => {
|
||||
registerLocaleData(data.default);
|
||||
});
|
||||
break;
|
||||
case 'fil':
|
||||
import('@angular/common/locales/fil').then(data => {
|
||||
registerLocaleData(data.default);
|
||||
});
|
||||
break;
|
||||
case 'fr-CA':
|
||||
import('@angular/common/locales/fr-CA').then(data => {
|
||||
registerLocaleData(data.default);
|
||||
});
|
||||
break;
|
||||
case 'fr':
|
||||
import('@angular/common/locales/fr').then(data => {
|
||||
registerLocaleData(data.default);
|
||||
});
|
||||
break;
|
||||
case 'he':
|
||||
import('@angular/common/locales/he').then(data => {
|
||||
registerLocaleData(data.default);
|
||||
});
|
||||
break;
|
||||
case 'hi':
|
||||
import('@angular/common/locales/hi').then(data => {
|
||||
registerLocaleData(data.default);
|
||||
});
|
||||
break;
|
||||
case 'hr':
|
||||
import('@angular/common/locales/hr').then(data => {
|
||||
registerLocaleData(data.default);
|
||||
});
|
||||
break;
|
||||
case 'hu':
|
||||
import('@angular/common/locales/hu').then(data => {
|
||||
registerLocaleData(data.default);
|
||||
});
|
||||
break;
|
||||
case 'id':
|
||||
import('@angular/common/locales/id').then(data => {
|
||||
registerLocaleData(data.default);
|
||||
});
|
||||
break;
|
||||
case 'is':
|
||||
import('@angular/common/locales/is').then(data => {
|
||||
registerLocaleData(data.default);
|
||||
});
|
||||
break;
|
||||
case 'it':
|
||||
import('@angular/common/locales/it').then(data => {
|
||||
registerLocaleData(data.default);
|
||||
});
|
||||
break;
|
||||
case 'ja':
|
||||
import('@angular/common/locales/ja').then(data => {
|
||||
registerLocaleData(data.default);
|
||||
});
|
||||
break;
|
||||
case 'ko':
|
||||
import('@angular/common/locales/ko').then(data => {
|
||||
registerLocaleData(data.default);
|
||||
});
|
||||
break;
|
||||
case 'lt':
|
||||
import('@angular/common/locales/lt').then(data => {
|
||||
registerLocaleData(data.default);
|
||||
});
|
||||
break;
|
||||
case 'lv':
|
||||
import('@angular/common/locales/lv').then(data => {
|
||||
registerLocaleData(data.default);
|
||||
});
|
||||
break;
|
||||
case 'ms':
|
||||
import('@angular/common/locales/ms').then(data => {
|
||||
registerLocaleData(data.default);
|
||||
});
|
||||
break;
|
||||
case 'ne':
|
||||
import('@angular/common/locales/ne').then(data => {
|
||||
registerLocaleData(data.default);
|
||||
});
|
||||
break;
|
||||
case 'nl':
|
||||
import('@angular/common/locales/nl').then(data => {
|
||||
registerLocaleData(data.default);
|
||||
});
|
||||
case 'no':
|
||||
import('@angular/common/locales/no').then(data => {
|
||||
registerLocaleData(data.default);
|
||||
});
|
||||
break;
|
||||
case 'pl':
|
||||
import('@angular/common/locales/pl').then(data => {
|
||||
registerLocaleData(data.default);
|
||||
});
|
||||
break;
|
||||
case 'pt':
|
||||
import('@angular/common/locales/pt').then(data => {
|
||||
registerLocaleData(data.default);
|
||||
});
|
||||
break;
|
||||
case 'pt-PT':
|
||||
import('@angular/common/locales/pt-PT').then(data => {
|
||||
registerLocaleData(data.default);
|
||||
});
|
||||
break;
|
||||
case 'ro':
|
||||
import('@angular/common/locales/ro').then(data => {
|
||||
registerLocaleData(data.default);
|
||||
});
|
||||
break;
|
||||
case 'ru':
|
||||
import('@angular/common/locales/ru').then(data => {
|
||||
registerLocaleData(data.default);
|
||||
});
|
||||
break;
|
||||
case 'sk':
|
||||
import('@angular/common/locales/sk').then(data => {
|
||||
registerLocaleData(data.default);
|
||||
});
|
||||
break;
|
||||
case 'sl':
|
||||
import('@angular/common/locales/sl').then(data => {
|
||||
registerLocaleData(data.default);
|
||||
});
|
||||
break;
|
||||
case 'sv':
|
||||
import('@angular/common/locales/sv').then(data => {
|
||||
registerLocaleData(data.default);
|
||||
});
|
||||
break;
|
||||
case 'sw-KE':
|
||||
import('@angular/common/locales/sw-KE').then(data => {
|
||||
registerLocaleData(data.default);
|
||||
});
|
||||
break;
|
||||
case 'sw':
|
||||
import('@angular/common/locales/sw').then(data => {
|
||||
registerLocaleData(data.default);
|
||||
});
|
||||
break;
|
||||
case 'th':
|
||||
import('@angular/common/locales/th').then(data => {
|
||||
registerLocaleData(data.default);
|
||||
});
|
||||
break;
|
||||
case 'tr':
|
||||
import('@angular/common/locales/tr').then(data => {
|
||||
registerLocaleData(data.default);
|
||||
});
|
||||
break;
|
||||
case 'uk':
|
||||
import('@angular/common/locales/uk').then(data => {
|
||||
registerLocaleData(data.default);
|
||||
});
|
||||
break;
|
||||
case 'vi':
|
||||
import('@angular/common/locales/vi').then(data => {
|
||||
registerLocaleData(data.default);
|
||||
});
|
||||
break;
|
||||
case 'zh':
|
||||
import('@angular/common/locales/zh').then(data => {
|
||||
registerLocaleData(data.default);
|
||||
});
|
||||
break;
|
||||
default:
|
||||
import('@angular/common/locales/en').then(data => {
|
||||
registerLocaleData(data.default);
|
||||
});
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,41 +1,40 @@
|
|||
import { Injectable } from '@angular/core';
|
||||
import { TimezoneInfoDisplayPipe } from '@app/core/pipes/timezone-info-display.pipe';
|
||||
import { DefaultUserLocaleCultureLookup, DefaultUserLocaleTimezoneLookup } from '@app/core/query/default-user-locale.lookup';
|
||||
import { SingleAutoCompleteConfiguration } from '@app/library/auto-complete/single/single-auto-complete-configuration';
|
||||
import moment from 'moment';
|
||||
import { Observable, of } from 'rxjs';
|
||||
import { map } from 'rxjs/operators';
|
||||
import moment from 'moment';
|
||||
import { DefaultUserLocaleCultureLookup, DefaultUserLocaleTimezoneLookup } from '@app/core/query/default-user-locale.lookup';
|
||||
import { TimezoneInfoDisplayPipe } from '@app/core/pipes/timezone-info-display.pipe';
|
||||
import { CultureInfo } from '@app/core/model/culture-info';
|
||||
import { CultureService } from '../culture/culture-service';
|
||||
import { CultureInfo, CultureService } from '../culture/culture-service';
|
||||
|
||||
@Injectable()
|
||||
export class DefaultUserLocaleService {
|
||||
|
||||
constructor(
|
||||
private timezoneInfoDisplayPipe: TimezoneInfoDisplayPipe,
|
||||
private cultureService: CultureService
|
||||
) { }
|
||||
private timezoneInfoDisplayPipe: TimezoneInfoDisplayPipe,
|
||||
private cultureService: CultureService
|
||||
) { }
|
||||
|
||||
|
||||
queryTimezone(q: DefaultUserLocaleTimezoneLookup): Observable<string[]> {
|
||||
let timezones = of(moment.tz.names().sort((x, y) => x.localeCompare(y)));
|
||||
let timezones = of(moment.tz.names().sort((x, y) => x.localeCompare(y)));
|
||||
|
||||
if (q.like) {
|
||||
if (q.like) {
|
||||
let likeValue = q.like.toLowerCase();
|
||||
timezones = timezones.pipe(map((items: string[]) => {
|
||||
let filteredItems: string[] = items.filter(i => this.timezoneInfoDisplayPipe.transform(i).toLowerCase().includes(likeValue));
|
||||
if (filteredItems != null && filteredItems?.length > 0) return filteredItems;
|
||||
else return null;
|
||||
}));
|
||||
}
|
||||
timezones = timezones.pipe(map((items: string[]) => {
|
||||
let filteredItems: string[] = items.filter(i => this.timezoneInfoDisplayPipe.transform(i).toLowerCase().includes(likeValue));
|
||||
if (filteredItems != null && filteredItems?.length > 0) return filteredItems;
|
||||
else return null;
|
||||
}));
|
||||
}
|
||||
|
||||
if (q.selectedItem) {
|
||||
timezones = timezones.pipe(map((items: string[]) => {
|
||||
let filteredItem: string = items.find(i => i === q.selectedItem);
|
||||
if (filteredItem != null) return [filteredItem];
|
||||
else return null;
|
||||
}));
|
||||
}
|
||||
if (q.selectedItem) {
|
||||
timezones = timezones.pipe(map((items: string[]) => {
|
||||
let filteredItem: string = items.find(i => i === q.selectedItem);
|
||||
if (filteredItem != null) return [filteredItem];
|
||||
else return null;
|
||||
}));
|
||||
}
|
||||
|
||||
return timezones;
|
||||
}
|
||||
|
@ -45,35 +44,35 @@ export class DefaultUserLocaleService {
|
|||
|
||||
if (q.like) {
|
||||
let likeValue = q.like.toLowerCase();
|
||||
cultures = cultures.pipe(map((items: CultureInfo[]) => {
|
||||
let filteredItems = items.filter(i => {
|
||||
const displayValue = `${i?.displayName} - ${i?.nativeName}`;
|
||||
cultures = cultures.pipe(map((items: CultureInfo[]) => {
|
||||
let filteredItems = items.filter(i => {
|
||||
const displayValue = `${i?.displayName} - ${i?.name}`;
|
||||
if (displayValue.toLowerCase().includes(likeValue)) {
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
});
|
||||
if (filteredItems != null && filteredItems?.length > 0) return filteredItems;
|
||||
else return null;
|
||||
}));
|
||||
}
|
||||
if (filteredItems != null && filteredItems?.length > 0) return filteredItems;
|
||||
else return null;
|
||||
}));
|
||||
}
|
||||
|
||||
if (q.selectedItem) {
|
||||
let selectedItemValue = q.selectedItem.toLowerCase();
|
||||
cultures = cultures.pipe(map((items: CultureInfo[]) => {
|
||||
let selected = items.find(i => {
|
||||
let selected = items.find(i => {
|
||||
if (i.name.toLowerCase().includes(selectedItemValue)) {
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
});
|
||||
if (selected != null) {
|
||||
return [selected];
|
||||
if (selected != null) {
|
||||
return [selected];
|
||||
}
|
||||
else return null;
|
||||
}));
|
||||
else return null;
|
||||
}));
|
||||
}
|
||||
|
||||
return cultures;
|
||||
|
@ -85,32 +84,32 @@ export class DefaultUserLocaleService {
|
|||
//
|
||||
singleTimezoneAutocompleteConfiguration: SingleAutoCompleteConfiguration = {
|
||||
initialItems: (data?: any) => this.queryTimezone(this.buildTimezoneAutocompleteLookup(null)),
|
||||
filterFn: (searchQuery: string, data?: any) => this.queryTimezone(this.buildTimezoneAutocompleteLookup(searchQuery)),
|
||||
getSelectedItem: (selectedItem: string) => this.queryTimezone(this.buildTimezoneAutocompleteLookup(null, selectedItem)),
|
||||
displayFn: (item: string) => this.getTimezoneDisplayFn(item),
|
||||
titleFn: (item: string) => this.timezoneInfoDisplayPipe.transform(item),
|
||||
valueAssign: (item: string) => item,
|
||||
filterFn: (searchQuery: string, data?: any) => this.queryTimezone(this.buildTimezoneAutocompleteLookup(searchQuery)),
|
||||
getSelectedItem: (selectedItem: string) => this.queryTimezone(this.buildTimezoneAutocompleteLookup(null, selectedItem)),
|
||||
displayFn: (item: string) => this.getTimezoneDisplayFn(item),
|
||||
titleFn: (item: string) => this.timezoneInfoDisplayPipe.transform(item),
|
||||
valueAssign: (item: string) => item,
|
||||
};
|
||||
|
||||
private buildTimezoneAutocompleteLookup(like?: string, selectedItem?: string): DefaultUserLocaleTimezoneLookup {
|
||||
const lookup: DefaultUserLocaleTimezoneLookup = new DefaultUserLocaleTimezoneLookup();
|
||||
lookup.page = { size: 100, offset: 0 };
|
||||
if (like) { lookup.like = like; }
|
||||
if (selectedItem) { lookup.selectedItem = selectedItem }
|
||||
if (selectedItem) { lookup.selectedItem = selectedItem }
|
||||
return lookup;
|
||||
}
|
||||
|
||||
|
||||
getTimezoneDisplayFn(value: any) {
|
||||
return Array.isArray(value) ? this.timezoneInfoDisplayPipe.transform(value[0]) : this.timezoneInfoDisplayPipe.transform(value);
|
||||
}
|
||||
|
||||
|
||||
|
||||
singleCultureAutocompleteConfiguration: SingleAutoCompleteConfiguration = {
|
||||
initialItems: (data?: any) => this.queryCulture(this.buildCultureAutocompleteLookup(null)),
|
||||
filterFn: (searchQuery: string, data?: any) => this.queryCulture(this.buildCultureAutocompleteLookup(searchQuery)),
|
||||
getSelectedItem: (selectedItem: string) =>this.queryCulture(this.buildCultureAutocompleteLookup(null, selectedItem)),
|
||||
displayFn: (item: any) => this.getCultureDisplayFn(item),
|
||||
titleFn: (item: CultureInfo) => this.getCultureTitleFn(item),
|
||||
getSelectedItem: (selectedItem: string) => this.queryCulture(this.buildCultureAutocompleteLookup(null, selectedItem)),
|
||||
displayFn: (item: any) => this.getCultureDisplayFn(item),
|
||||
titleFn: (item: CultureInfo) => this.getCultureTitleFn(item),
|
||||
valueAssign: (item: CultureInfo) => item.name,
|
||||
};
|
||||
|
||||
|
@ -118,12 +117,12 @@ export class DefaultUserLocaleService {
|
|||
const lookup: DefaultUserLocaleCultureLookup = new DefaultUserLocaleCultureLookup();
|
||||
lookup.page = { size: 100, offset: 0 };
|
||||
if (like) { lookup.like = like; }
|
||||
if (selectedItem) { lookup.selectedItem = selectedItem }
|
||||
if (selectedItem) { lookup.selectedItem = selectedItem }
|
||||
return lookup;
|
||||
}
|
||||
|
||||
|
||||
private getCultureTitleFn(culture: any): string {
|
||||
return `${culture?.displayName} - ${culture?.nativeName}`;
|
||||
return `${culture?.displayName} - ${culture?.name}`;
|
||||
}
|
||||
|
||||
private getCultureDisplayFn(culture: any): string {
|
||||
|
|
|
@ -0,0 +1,22 @@
|
|||
import { Injectable } from '@angular/core';
|
||||
import { AuthService } from '../auth/auth.service';
|
||||
import { TenantHandlingService } from '../tenant/tenant-handling.service';
|
||||
|
||||
@Injectable()
|
||||
export class RouterUtilsService {
|
||||
|
||||
constructor(
|
||||
private tenantHandlingService: TenantHandlingService,
|
||||
private authService: AuthService
|
||||
) {
|
||||
}
|
||||
|
||||
generateUrl(url: string | string[]): string {
|
||||
const tenant = this.authService.selectedTenant() ?? 'default';
|
||||
if (Array.isArray(url)) {
|
||||
return this.tenantHandlingService.getUrlEnrichedWithTenantCode(url.join(''), tenant)
|
||||
} else {
|
||||
return this.tenantHandlingService.getUrlEnrichedWithTenantCode(url, tenant);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -38,7 +38,7 @@ export class TimezoneService {
|
|||
|
||||
public buildDateTime(params: {
|
||||
time: string,
|
||||
date: moment.Moment
|
||||
date: moment.Moment | string
|
||||
}): moment.Moment {
|
||||
|
||||
const { time, date } = params;
|
||||
|
@ -48,7 +48,7 @@ export class TimezoneService {
|
|||
}
|
||||
|
||||
const momentTime = moment.duration(time);
|
||||
const momentDate = moment(date.toString());
|
||||
const momentDate = moment(date);
|
||||
|
||||
const toReturn = moment.utc({
|
||||
year: momentDate.year(),
|
||||
|
@ -66,13 +66,16 @@ export class TimezoneService {
|
|||
dateTime: moment.Moment,
|
||||
}): { date: moment.Moment, time: string } | null {
|
||||
|
||||
|
||||
const { dateTime } = params
|
||||
|
||||
if (!dateTime) {
|
||||
return null;
|
||||
}
|
||||
|
||||
const dateTimeMoment = moment(dateTime.toString()).tz(this.getCurrentTimezone());
|
||||
|
||||
const dateTimeMoment = moment(dateTime).tz(this.getCurrentTimezone());
|
||||
|
||||
|
||||
const date =
|
||||
moment.utc({
|
||||
|
@ -84,9 +87,13 @@ export class TimezoneService {
|
|||
const hours = dateTimeMoment.hour();
|
||||
const minutes = dateTimeMoment.minute();
|
||||
|
||||
|
||||
const hoursString = hours > 10 ? hours.toString() : `0${hours}`
|
||||
const minutesString = hours > 10 ? minutes.toString() : `0${minutes}`
|
||||
|
||||
|
||||
|
||||
|
||||
return {
|
||||
date,
|
||||
time: `${hoursString}:${minutesString}:00`
|
||||
|
|
|
@ -50,6 +50,9 @@ const routes: Routes = [
|
|||
authContext: {
|
||||
permissions: [AppPermission.EditDescriptionTemplate]
|
||||
},
|
||||
...BreadcrumbService.generateRouteDataConfiguration({
|
||||
skipNavigation: true
|
||||
}),
|
||||
getFromTitleService: true,
|
||||
usePrefix: false,
|
||||
action: 'clone'
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
|
||||
import { CdkStep, StepperSelectionEvent } from '@angular/cdk/stepper';
|
||||
import { DatePipe } from '@angular/common';
|
||||
import { Component, OnInit, QueryList, ViewChild } from '@angular/core';
|
||||
import { FormArray, FormControl, FormGroup, UntypedFormArray, UntypedFormGroup } from '@angular/forms';
|
||||
import { MatDialog } from '@angular/material/dialog';
|
||||
|
@ -124,7 +123,6 @@ export class DescriptionTemplateEditorComponent extends BaseEditor<DescriptionTe
|
|||
protected uiNotificationService: UiNotificationService,
|
||||
protected httpErrorHandlingService: HttpErrorHandlingService,
|
||||
protected filterService: FilterService,
|
||||
protected datePipe: DatePipe,
|
||||
protected route: ActivatedRoute,
|
||||
protected queryParamsService: QueryParamsService,
|
||||
protected lockService: LockService,
|
||||
|
@ -148,7 +146,7 @@ export class DescriptionTemplateEditorComponent extends BaseEditor<DescriptionTe
|
|||
} else {
|
||||
titleService.setTitle('DESCRIPTION-TEMPLATE-EDITOR.TITLE-EDIT-DESCRIPTION-TEMPLATE');
|
||||
}
|
||||
super(dialog, language, formService, router, uiNotificationService, httpErrorHandlingService, filterService, datePipe, route, queryParamsService, lockService, authService, configurationService);
|
||||
super(dialog, language, formService, router, uiNotificationService, httpErrorHandlingService, filterService, route, queryParamsService, lockService, authService, configurationService);
|
||||
}
|
||||
|
||||
ngOnInit(): void {
|
||||
|
|
|
@ -14,7 +14,7 @@
|
|||
</div>
|
||||
|
||||
<div class="col-auto">
|
||||
<button mat-raised-button class="create-btn" *ngIf="authService.hasPermission(authService.permissionEnum.EditDescriptionTemplate)" [routerLink]="['/description-templates/new']">
|
||||
<button mat-raised-button class="create-btn" *ngIf="authService.hasPermission(authService.permissionEnum.EditDescriptionTemplate)" [routerLink]="[routerUtils.generateUrl('/description-templates/new')]">
|
||||
<mat-icon>add</mat-icon>
|
||||
{{'DESCRIPTION-TEMPLATE-LISTING.CREATE-DESCRIPTION-TEMPLATE' | translate}}
|
||||
</button>
|
||||
|
@ -36,16 +36,15 @@
|
|||
|
||||
<ng-template #listItemTemplate let-item="item" let-isColumnSelected="isColumnSelected">
|
||||
|
||||
|
||||
<div class="d-flex align-items-center p-3 gap-1-rem">
|
||||
<div class="row">
|
||||
<ng-container *ngIf="isColumnSelected('label')">
|
||||
<a class="buttonLinkClass" [routerLink]="'./' + item?.id" class="col-12" (click)="$event.stopPropagation()">{{item?.label | nullifyValue}}</a>
|
||||
<a class="buttonLinkClass" [routerLink]="[routerUtils.generateUrl(['./', item?.id])]" class="col-12" (click)="$event.stopPropagation()">{{item?.label | nullifyValue}}</a>
|
||||
<br />
|
||||
</ng-container>
|
||||
|
||||
<ng-container *ngIf="isColumnSelected('description')">
|
||||
<a class="buttonLinkClass" [routerLink]="'./' + item?.id" class="col-12" (click)="$event.stopPropagation()">{{item?.description | nullifyValue}}</a>
|
||||
<a class="buttonLinkClass" [routerLink]="[routerUtils.generateUrl(['./', item?.id])]" class="col-12" (click)="$event.stopPropagation()">{{item?.description | nullifyValue}}</a>
|
||||
<br />
|
||||
</ng-container>
|
||||
|
||||
|
@ -93,16 +92,16 @@
|
|||
<mat-icon>more_horiz</mat-icon>
|
||||
</button>
|
||||
<mat-menu #actionsMenu="matMenu">
|
||||
<button *ngIf="row.status !== descriptionTemplateStatuses.Finalized" mat-menu-item [routerLink]="['/description-templates/', row.id]">
|
||||
<button *ngIf="row.status !== descriptionTemplateStatuses.Finalized" mat-menu-item [routerLink]="routerUtils.generateUrl(['/description-templates/', row.id])">
|
||||
<mat-icon>edit</mat-icon>{{'DESCRIPTION-TEMPLATE-LISTING.ACTIONS.EDIT' | translate}}
|
||||
</button>
|
||||
<button *ngIf="row.belongsToCurrentTenant != false" mat-menu-item [routerLink]="['/description-templates/new-version/', row.id]">
|
||||
<button *ngIf="row.belongsToCurrentTenant != false" mat-menu-item [routerLink]="routerUtils.generateUrl('/description-templates/new-version/', row.id)">
|
||||
<mat-icon>queue</mat-icon>{{'DESCRIPTION-TEMPLATE-LISTING.ACTIONS.NEW-VERSION' | translate}}
|
||||
</button>
|
||||
<button mat-menu-item [routerLink]="['/description-templates/clone/', row.id]">
|
||||
<button mat-menu-item [routerLink]="routerUtils.generateUrl(['/description-templates/clone/', row.id])">
|
||||
<mat-icon>content_copy</mat-icon>{{'DESCRIPTION-TEMPLATE-LISTING.ACTIONS.CLONE' | translate}}
|
||||
</button>
|
||||
<button mat-menu-item [routerLink]="['/description-templates/versions/', row.groupId]">
|
||||
<button mat-menu-item [routerLink]="routerUtils.generateUrl(['/description-templates/versions/', row.groupId])">
|
||||
<mat-icon>library_books</mat-icon>
|
||||
{{'DESCRIPTION-TEMPLATE-LISTING.ACTIONS.VIEW-VERSIONS' | translate}}
|
||||
</button>
|
||||
|
|
|
@ -17,7 +17,7 @@ import { FileUtils } from '@app/core/services/utilities/file-utils.service';
|
|||
import { QueryParamsService } from '@app/core/services/utilities/query-params.service';
|
||||
import { BaseListingComponent } from '@common/base/base-listing-component';
|
||||
import { PipeService } from '@common/formatting/pipe.service';
|
||||
import { DataTableDateTimeFormatPipe } from '@common/formatting/pipes/date-time-format.pipe';
|
||||
import { DataTableDateTimeFormatPipe } from '@app/core/pipes/date-time-format.pipe';
|
||||
import { IsActiveTypePipe } from '@common/formatting/pipes/is-active-type.pipe';
|
||||
import { QueryResult } from '@common/model/query-result';
|
||||
import { ConfirmationDialogComponent } from '@common/modules/confirmation-dialog/confirmation-dialog.component';
|
||||
|
@ -30,6 +30,7 @@ import { Observable } from 'rxjs';
|
|||
import { takeUntil } from 'rxjs/operators';
|
||||
import { nameof } from 'ts-simple-nameof';
|
||||
import { ImportDescriptionTemplateDialogComponent } from './import-description-template/import-description-template.dialog.component';
|
||||
import { RouterUtilsService } from '@app/core/services/router/router-utils.service';
|
||||
|
||||
|
||||
@Component({
|
||||
|
@ -78,7 +79,8 @@ export class DescriptionTemplateListingComponent extends BaseListingComponent<De
|
|||
private dialog: MatDialog,
|
||||
private fileUtils: FileUtils,
|
||||
private sumarizeTextPipe: SumarizeTextPipe,
|
||||
private analyticsService: AnalyticsService
|
||||
private analyticsService: AnalyticsService,
|
||||
public routerUtils: RouterUtilsService,
|
||||
) {
|
||||
super(router, route, uiNotificationService, httpErrorHandlingService, queryParamsService);
|
||||
// Lookup setup
|
||||
|
|
|
@ -1,19 +1,23 @@
|
|||
import { DatePipe } from '@angular/common';
|
||||
import { Component, OnInit } from '@angular/core';
|
||||
import { UntypedFormGroup } from '@angular/forms';
|
||||
import { MatDialog } from '@angular/material/dialog';
|
||||
import { Title } from '@angular/platform-browser';
|
||||
import { ActivatedRoute, Router } from '@angular/router';
|
||||
import { DescriptionTemplateTypeStatus } from '@app/core/common/enum/description-template-type-status';
|
||||
import { IsActive } from '@app/core/common/enum/is-active.enum';
|
||||
import { AppPermission } from '@app/core/common/enum/permission.enum';
|
||||
import { DescriptionTemplateType, DescriptionTemplateTypePersist } from '@app/core/model/description-template-type/description-template-type';
|
||||
import { AuthService } from '@app/core/services/auth/auth.service';
|
||||
import { ConfigurationService } from '@app/core/services/configuration/configuration.service';
|
||||
import { DescriptionTemplateTypeService } from '@app/core/services/description-template-type/description-template-type.service';
|
||||
import { LockService } from '@app/core/services/lock/lock.service';
|
||||
import { LoggingService } from '@app/core/services/logging/logging-service';
|
||||
import { SnackBarNotificationLevel, UiNotificationService } from '@app/core/services/notification/ui-notification-service';
|
||||
import { EnumUtils } from '@app/core/services/utilities/enum-utils.service';
|
||||
import { QueryParamsService } from '@app/core/services/utilities/query-params.service';
|
||||
import { BaseEditor } from '@common/base/base-editor';
|
||||
import { FormService } from '@common/forms/form-service';
|
||||
import { FormValidationErrorsDialogComponent } from '@common/forms/form-validation-errors-dialog/form-validation-errors-dialog.component';
|
||||
import { ConfirmationDialogComponent } from '@common/modules/confirmation-dialog/confirmation-dialog.component';
|
||||
import { HttpErrorHandlingService } from '@common/modules/errors/error-handling/http-error-handling.service';
|
||||
import { FilterService } from '@common/modules/text-filter/filter-service';
|
||||
|
@ -23,11 +27,6 @@ import { map, takeUntil } from 'rxjs/operators';
|
|||
import { DescriptionTemplateTypeEditorModel } from './description-template-type-editor.model';
|
||||
import { DescriptionTemplateTypeEditorResolver } from './description-template-type-editor.resolver';
|
||||
import { DescriptionTemplateTypeEditorService } from './description-template-type-editor.service';
|
||||
import { ConfigurationService } from '@app/core/services/configuration/configuration.service';
|
||||
import { LockService } from '@app/core/services/lock/lock.service';
|
||||
import { FormValidationErrorsDialogComponent } from '@common/forms/form-validation-errors-dialog/form-validation-errors-dialog.component';
|
||||
import { DescriptionTemplateTypeStatus } from '@app/core/common/enum/description-template-type-status';
|
||||
import { Title } from '@angular/platform-browser';
|
||||
|
||||
@Component({
|
||||
templateUrl: './description-template-type-editor.component.html',
|
||||
|
@ -69,7 +68,6 @@ export class DescriptionTemplateTypeEditorComponent extends BaseEditor<Descripti
|
|||
protected uiNotificationService: UiNotificationService,
|
||||
protected httpErrorHandlingService: HttpErrorHandlingService,
|
||||
protected filterService: FilterService,
|
||||
protected datePipe: DatePipe,
|
||||
protected route: ActivatedRoute,
|
||||
protected queryParamsService: QueryParamsService,
|
||||
protected lockService: LockService,
|
||||
|
@ -82,14 +80,14 @@ export class DescriptionTemplateTypeEditorComponent extends BaseEditor<Descripti
|
|||
private descriptionTemplateTypeEditorService: DescriptionTemplateTypeEditorService,
|
||||
public titleService: Title
|
||||
) {
|
||||
|
||||
const descriptionLabel:string = route.snapshot.data['entity']?.name;
|
||||
|
||||
const descriptionLabel: string = route.snapshot.data['entity']?.name;
|
||||
if (descriptionLabel) {
|
||||
titleService.setTitle(descriptionLabel);
|
||||
} else {
|
||||
titleService.setTitle('DESCRIPTION-TEMPLATE-TYPE-EDITOR.TITLE-EDIT-DESCRIPTION-TEMPLATE-TYPE');
|
||||
}
|
||||
super(dialog, language, formService, router, uiNotificationService, httpErrorHandlingService, filterService, datePipe, route, queryParamsService, lockService, authService, configurationService);
|
||||
super(dialog, language, formService, router, uiNotificationService, httpErrorHandlingService, filterService, route, queryParamsService, lockService, authService, configurationService);
|
||||
}
|
||||
|
||||
ngOnInit(): void {
|
||||
|
@ -223,6 +221,7 @@ export class DescriptionTemplateTypeEditorComponent extends BaseEditor<Descripti
|
|||
if (result) {
|
||||
this.formGroup.get('status').setValue(DescriptionTemplateTypeStatus.Finalized);
|
||||
this.formSubmit();
|
||||
}});
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
<div class="col-auto">
|
||||
<button mat-raised-button class="create-btn"
|
||||
*ngIf="authService.hasPermission(authService.permissionEnum.EditDescriptionTemplateType)"
|
||||
[routerLink]="['/description-template-type/new']">
|
||||
[routerLink]="routerUtils.generateUrl(['/description-template-type/new'])">
|
||||
<mat-icon>add</mat-icon>
|
||||
{{'DESCRIPTION-TEMPLATE-TYPE-LISTING.CREATE-TYPE' | translate}}
|
||||
</button>
|
||||
|
@ -42,7 +42,7 @@
|
|||
<div class="d-flex align-items-center p-3 gap-1-rem">
|
||||
<div class="row">
|
||||
<ng-container *ngIf="isColumnSelected('name')">
|
||||
<a class="buttonLinkClass" [routerLink]="'./' + item?.id" class="col-12"
|
||||
<a class="buttonLinkClass" [routerLink]="routerUtils.generateUrl('./' + item?.id)" class="col-12"
|
||||
(click)="$event.stopPropagation()">{{item?.name | nullifyValue}}</a>
|
||||
<br />
|
||||
</ng-container>
|
||||
|
@ -93,7 +93,7 @@
|
|||
<mat-icon>more_horiz</mat-icon>
|
||||
</button>
|
||||
<mat-menu #actionsMenu="matMenu">
|
||||
<button *ngIf="!isFinalized(row)" mat-menu-item [routerLink]="['/description-template-type/' + row.id]">
|
||||
<button *ngIf="!isFinalized(row)" mat-menu-item [routerLink]="routerUtils.generateUrl(['/description-template-type/' + row.id])">
|
||||
<mat-icon>edit</mat-icon>{{'DESCRIPTION-TEMPLATE-TYPE-LISTING.ACTIONS.EDIT' | translate}}
|
||||
</button>
|
||||
<button *ngIf="row.belongsToCurrentTenant != false" mat-menu-item (click)="deleteType(row.id)">
|
||||
|
|
|
@ -8,11 +8,12 @@ import { DescriptionTemplateTypeLookup } from '@app/core/query/description-templ
|
|||
import { AuthService } from '@app/core/services/auth/auth.service';
|
||||
import { DescriptionTemplateTypeService } from '@app/core/services/description-template-type/description-template-type.service';
|
||||
import { SnackBarNotificationLevel, UiNotificationService } from '@app/core/services/notification/ui-notification-service';
|
||||
import { RouterUtilsService } from '@app/core/services/router/router-utils.service';
|
||||
import { EnumUtils } from '@app/core/services/utilities/enum-utils.service';
|
||||
import { QueryParamsService } from '@app/core/services/utilities/query-params.service';
|
||||
import { BaseListingComponent } from '@common/base/base-listing-component';
|
||||
import { PipeService } from '@common/formatting/pipe.service';
|
||||
import { DataTableDateTimeFormatPipe } from '@common/formatting/pipes/date-time-format.pipe';
|
||||
import { DataTableDateTimeFormatPipe } from '@app/core/pipes/date-time-format.pipe';
|
||||
import { IsActiveTypePipe } from '@common/formatting/pipes/is-active-type.pipe';
|
||||
import { QueryResult } from '@common/model/query-result';
|
||||
import { ConfirmationDialogComponent } from '@common/modules/confirmation-dialog/confirmation-dialog.component';
|
||||
|
@ -52,6 +53,7 @@ export class DescriptionTemplateTypeListingComponent extends BaseListingComponen
|
|||
rowIdentity = x => x.id;
|
||||
|
||||
constructor(
|
||||
public routerUtils: RouterUtilsService,
|
||||
protected router: Router,
|
||||
protected route: ActivatedRoute,
|
||||
protected uiNotificationService: UiNotificationService,
|
||||
|
|
|
@ -48,7 +48,7 @@ const routes: Routes = [
|
|||
},
|
||||
data: {
|
||||
...BreadcrumbService.generateRouteDataConfiguration({
|
||||
title: 'BREADCRUMBS.EDIT-DMP-BLUEPRINT'
|
||||
skipNavigation: true
|
||||
}),
|
||||
authContext: {
|
||||
permissions: [AppPermission.EditDmpBlueprint]
|
||||
|
@ -68,7 +68,7 @@ const routes: Routes = [
|
|||
},
|
||||
data: {
|
||||
...BreadcrumbService.generateRouteDataConfiguration({
|
||||
title: 'BREADCRUMBS.EDIT-DMP-BLUEPRINT'
|
||||
skipNavigation: true
|
||||
}),
|
||||
authContext: {
|
||||
permissions: [AppPermission.EditDmpBlueprint]
|
||||
|
|
|
@ -1,14 +1,11 @@
|
|||
|
||||
import { CdkDragDrop, moveItemInArray } from '@angular/cdk/drag-drop';
|
||||
import { Component, OnInit } from '@angular/core';
|
||||
import { FormArray, UntypedFormArray, UntypedFormGroup } from '@angular/forms';
|
||||
import { MatDialog } from '@angular/material/dialog';
|
||||
import { ActivatedRoute, Router } from '@angular/router';
|
||||
import { DmpBlueprintService } from '@app/core/services/dmp/dmp-blueprint.service';
|
||||
import { SnackBarNotificationLevel, UiNotificationService } from '@app/core/services/notification/ui-notification-service';
|
||||
import { EnumUtils } from '@app/core/services/utilities/enum-utils.service';
|
||||
import { CdkDragDrop, moveItemInArray } from '@angular/cdk/drag-drop';
|
||||
import { DatePipe } from '@angular/common';
|
||||
import { MatCheckboxChange } from '@angular/material/checkbox';
|
||||
import { MatDialog } from '@angular/material/dialog';
|
||||
import { Title } from '@angular/platform-browser';
|
||||
import { ActivatedRoute, Router } from '@angular/router';
|
||||
import { DmpBlueprintFieldCategory } from '@app/core/common/enum/dmp-blueprint-field-category';
|
||||
import { DmpBlueprintExtraFieldDataType } from '@app/core/common/enum/dmp-blueprint-field-type';
|
||||
import { DmpBlueprintStatus } from '@app/core/common/enum/dmp-blueprint-status';
|
||||
|
@ -21,11 +18,15 @@ import { DmpBlueprint, DmpBlueprintPersist, NewVersionDmpBlueprintPersist, Syste
|
|||
import { AuthService } from '@app/core/services/auth/auth.service';
|
||||
import { ConfigurationService } from '@app/core/services/configuration/configuration.service';
|
||||
import { DescriptionTemplateService } from '@app/core/services/description-template/description-template.service';
|
||||
import { DmpBlueprintService } from '@app/core/services/dmp/dmp-blueprint.service';
|
||||
import { LockService } from '@app/core/services/lock/lock.service';
|
||||
import { LoggingService } from '@app/core/services/logging/logging-service';
|
||||
import { AnalyticsService } from '@app/core/services/matomo/analytics-service';
|
||||
import { SnackBarNotificationLevel, UiNotificationService } from '@app/core/services/notification/ui-notification-service';
|
||||
import { PrefillingSourceService } from '@app/core/services/prefilling-source/prefilling-source.service';
|
||||
import { ReferenceTypeService } from '@app/core/services/reference-type/reference-type.service';
|
||||
import { SemanticsService } from '@app/core/services/semantic/semantics.service';
|
||||
import { EnumUtils } from '@app/core/services/utilities/enum-utils.service';
|
||||
import { FileUtils } from '@app/core/services/utilities/file-utils.service';
|
||||
import { QueryParamsService } from '@app/core/services/utilities/query-params.service';
|
||||
import { SingleAutoCompleteConfiguration } from '@app/library/auto-complete/single/single-auto-complete-configuration';
|
||||
|
@ -43,8 +44,6 @@ import { DescriptionTemplatePreviewDialogComponent } from '../../description-tem
|
|||
import { DmpBlueprintEditorModel, FieldInSectionEditorModel } from './dmp-blueprint-editor.model';
|
||||
import { DmpBlueprintEditorResolver } from './dmp-blueprint-editor.resolver';
|
||||
import { DmpBlueprintEditorService } from './dmp-blueprint-editor.service';
|
||||
import { Title } from '@angular/platform-browser';
|
||||
import { AnalyticsService } from '@app/core/services/matomo/analytics-service';
|
||||
|
||||
|
||||
@Component({
|
||||
|
@ -62,8 +61,8 @@ export class DmpBlueprintEditorComponent extends BaseEditor<DmpBlueprintEditorMo
|
|||
formGroup: UntypedFormGroup = null;
|
||||
showInactiveDetails = false;
|
||||
|
||||
hoveredSectionIndex:number = -1;
|
||||
hoveredDescriptionTemplateIndex:number = -1;
|
||||
hoveredSectionIndex: number = -1;
|
||||
hoveredDescriptionTemplateIndex: number = -1;
|
||||
|
||||
dmpBlueprintSectionFieldCategory = DmpBlueprintFieldCategory;
|
||||
dmpBlueprintSystemFieldType = DmpBlueprintSystemFieldType;
|
||||
|
@ -117,7 +116,6 @@ export class DmpBlueprintEditorComponent extends BaseEditor<DmpBlueprintEditorMo
|
|||
protected uiNotificationService: UiNotificationService,
|
||||
protected httpErrorHandlingService: HttpErrorHandlingService,
|
||||
protected filterService: FilterService,
|
||||
protected datePipe: DatePipe,
|
||||
protected route: ActivatedRoute,
|
||||
protected queryParamsService: QueryParamsService,
|
||||
protected lockService: LockService,
|
||||
|
@ -136,13 +134,13 @@ export class DmpBlueprintEditorComponent extends BaseEditor<DmpBlueprintEditorMo
|
|||
public titleService: Title,
|
||||
private analyticsService: AnalyticsService,
|
||||
) {
|
||||
const descriptionLabel:string = route.snapshot.data['entity']?.label;
|
||||
const descriptionLabel: string = route.snapshot.data['entity']?.label;
|
||||
if (descriptionLabel) {
|
||||
titleService.setTitle(descriptionLabel);
|
||||
} else {
|
||||
titleService.setTitle('DMP-BLUEPRINT-EDITOR.TITLE-EDIT-BLUEPRINT');
|
||||
}
|
||||
super(dialog, language, formService, router, uiNotificationService, httpErrorHandlingService, filterService, datePipe, route, queryParamsService, lockService, authService, configurationService);
|
||||
super(dialog, language, formService, router, uiNotificationService, httpErrorHandlingService, filterService, route, queryParamsService, lockService, authService, configurationService);
|
||||
}
|
||||
|
||||
ngOnInit(): void {
|
||||
|
@ -222,7 +220,7 @@ export class DmpBlueprintEditorComponent extends BaseEditor<DmpBlueprintEditorMo
|
|||
}
|
||||
|
||||
persistEntity(onSuccess?: (response) => void): void {
|
||||
if ( this.isNewVersion == false) {
|
||||
if (this.isNewVersion == false) {
|
||||
const formData = this.formService.getValue(this.formGroup.value) as DmpBlueprintPersist;
|
||||
|
||||
this.dmpBlueprintService.persist(formData)
|
||||
|
@ -482,7 +480,7 @@ export class DmpBlueprintEditorComponent extends BaseEditor<DmpBlueprintEditorMo
|
|||
panelClass: 'custom-modalbox'
|
||||
});
|
||||
dialogRef.afterClosed().pipe(takeUntil(this._destroyed)).subscribe(groupId => {
|
||||
if (groupId){
|
||||
if (groupId) {
|
||||
((this.formGroup.get('definition').get('sections') as UntypedFormArray).at(sectionIndex).get('descriptionTemplates') as UntypedFormArray).at(descriptionTemplateIndex).get('descriptionTemplateGroupId').patchValue(groupId);
|
||||
}
|
||||
});
|
||||
|
@ -525,12 +523,12 @@ export class DmpBlueprintEditorComponent extends BaseEditor<DmpBlueprintEditorMo
|
|||
const dmpBlueprint: DmpBlueprintPersist = this.formGroup.value;
|
||||
return dmpBlueprint.definition.sections.some(section => section.fields.some(field => (field.category == DmpBlueprintFieldCategory.System) && (field as SystemFieldInSection).systemFieldType === DmpBlueprintSystemFieldType.Description));
|
||||
}
|
||||
|
||||
|
||||
hasLanguage(): boolean {
|
||||
const dmpBlueprint: DmpBlueprintPersist = this.formGroup.value;
|
||||
return dmpBlueprint.definition.sections.some(section => section.fields.some(field => (field.category == DmpBlueprintFieldCategory.System) && (field as SystemFieldInSection).systemFieldType === DmpBlueprintSystemFieldType.Language));
|
||||
}
|
||||
|
||||
|
||||
hasAccess(): boolean {
|
||||
const dmpBlueprint: DmpBlueprintPersist = this.formGroup.value;
|
||||
return dmpBlueprint.definition.sections.some(section => section.fields.some(field => (field.category == DmpBlueprintFieldCategory.System) && (field as SystemFieldInSection).systemFieldType === DmpBlueprintSystemFieldType.AccessRights));
|
||||
|
@ -562,7 +560,7 @@ export class DmpBlueprintEditorComponent extends BaseEditor<DmpBlueprintEditorMo
|
|||
finalize() {
|
||||
if (this.checkValidity() || !this.hasDescriptionTemplates()) {
|
||||
this.formGroup.get('status').setValue(DmpBlueprintStatus.Finalized);
|
||||
if(this.isNewVersion) this.isNewVersion = false;
|
||||
if (this.isNewVersion) this.isNewVersion = false;
|
||||
this.formSubmit();
|
||||
}
|
||||
}
|
||||
|
@ -578,6 +576,6 @@ export class DmpBlueprintEditorComponent extends BaseEditor<DmpBlueprintEditorMo
|
|||
|
||||
FileSaver.saveAs(blob, filename);
|
||||
},
|
||||
error => this.httpErrorHandlingService.handleBackedRequestError(error));
|
||||
error => this.httpErrorHandlingService.handleBackedRequestError(error));
|
||||
}
|
||||
}
|
||||
|
|
|
@ -14,7 +14,7 @@
|
|||
</div>
|
||||
|
||||
<div class="col-auto">
|
||||
<button mat-raised-button class="create-btn" *ngIf="authService.hasPermission(authService.permissionEnum.EditDescriptionTemplateType)" [routerLink]="['/dmp-blueprints/new']">
|
||||
<button mat-raised-button class="create-btn" *ngIf="authService.hasPermission(authService.permissionEnum.EditDescriptionTemplateType)" [routerLink]="routerUtils.generateUrl(['/dmp-blueprints/new'])">
|
||||
<mat-icon>add</mat-icon>
|
||||
{{'DMP-BLUEPRINT-LISTING.CREATE-DMP-BLUEPRINT' | translate}}
|
||||
</button>
|
||||
|
@ -40,7 +40,7 @@
|
|||
<div class="d-flex align-items-center p-3 gap-1-rem">
|
||||
<div class="row">
|
||||
<ng-container *ngIf="isColumnSelected('label')">
|
||||
<a class="buttonLinkClass" [routerLink]="'./' + item?.id" class="col-12" (click)="$event.stopPropagation()">{{item?.label | nullifyValue}}</a>
|
||||
<a class="buttonLinkClass" [routerLink]="routerUtils.generateUrl('./' + item?.id)" class="col-12" (click)="$event.stopPropagation()">{{item?.label | nullifyValue}}</a>
|
||||
<br />
|
||||
</ng-container>
|
||||
|
||||
|
@ -88,16 +88,16 @@
|
|||
<mat-icon>more_horiz</mat-icon>
|
||||
</button>
|
||||
<mat-menu #actionsMenu="matMenu">
|
||||
<button *ngIf="(row.status != null && row.status === dmpBlueprintStatuses.Draft)" mat-menu-item [routerLink]="['/dmp-blueprints/', row.id]">
|
||||
<button *ngIf="(row.status != null && row.status === dmpBlueprintStatuses.Draft)" mat-menu-item [routerLink]="routerUtils.generateUrl(['/dmp-blueprints/', row.id])">
|
||||
<mat-icon>edit</mat-icon>{{'DMP-BLUEPRINT-LISTING.ACTIONS.EDIT' | translate}}
|
||||
</button>
|
||||
<button *ngIf="row.belongsToCurrentTenant != false && (row.status === dmpBlueprintStatuses.Finalized || row.status == null)" mat-menu-item [routerLink]="['/dmp-blueprints/new-version' , row.id]">
|
||||
<button *ngIf="row.belongsToCurrentTenant != false && (row.status === dmpBlueprintStatuses.Finalized || row.status == null)" mat-menu-item [routerLink]="routerUtils.generateUrl(['/dmp-blueprints/new-version' , row.id])">
|
||||
<mat-icon>queue</mat-icon>{{'DMP-BLUEPRINT-LISTING.ACTIONS.NEW-VERSION' | translate}}
|
||||
</button>
|
||||
<button mat-menu-item [routerLink]="['/dmp-blueprints/clone' , row.id]">
|
||||
<button mat-menu-item [routerLink]="routerUtils.generateUrl(['/dmp-blueprints/clone/' , row.id])">
|
||||
<mat-icon>content_copy</mat-icon>{{'DMP-BLUEPRINT-LISTING.ACTIONS.CLONE' | translate}}
|
||||
</button>
|
||||
<button mat-menu-item [routerLink]="['/dmp-blueprints/versions' , row.groupId]">
|
||||
<button mat-menu-item [routerLink]="routerUtils.generateUrl(['/dmp-blueprints/versions/' , row.groupId])">
|
||||
<mat-icon>library_books</mat-icon>
|
||||
{{'DMP-BLUEPRINT-LISTING.ACTIONS.VIEW-VERSIONS' | translate}}
|
||||
</button>
|
||||
|
|
|
@ -16,7 +16,7 @@ import { FileUtils } from '@app/core/services/utilities/file-utils.service';
|
|||
import { QueryParamsService } from '@app/core/services/utilities/query-params.service';
|
||||
import { BaseListingComponent } from '@common/base/base-listing-component';
|
||||
import { PipeService } from '@common/formatting/pipe.service';
|
||||
import { DataTableDateTimeFormatPipe } from '@common/formatting/pipes/date-time-format.pipe';
|
||||
import { DataTableDateTimeFormatPipe } from '@app/core/pipes/date-time-format.pipe';
|
||||
import { IsActiveTypePipe } from '@common/formatting/pipes/is-active-type.pipe';
|
||||
import { QueryResult } from '@common/model/query-result';
|
||||
import { ConfirmationDialogComponent } from '@common/modules/confirmation-dialog/confirmation-dialog.component';
|
||||
|
@ -29,6 +29,7 @@ import { Observable } from 'rxjs';
|
|||
import { takeUntil } from 'rxjs/operators';
|
||||
import { nameof } from 'ts-simple-nameof';
|
||||
import { ImportDmpBlueprintDialogComponent } from './import-dmp-blueprint/import-dmp-blueprint.dialog.component';
|
||||
import { RouterUtilsService } from '@app/core/services/router/router-utils.service';
|
||||
|
||||
|
||||
@Component({
|
||||
|
@ -63,6 +64,7 @@ export class DmpBlueprintListingComponent extends BaseListingComponent<DmpBluepr
|
|||
rowIdentity = x => x.id;
|
||||
|
||||
constructor(
|
||||
public routerUtils: RouterUtilsService,
|
||||
protected router: Router,
|
||||
protected route: ActivatedRoute,
|
||||
protected uiNotificationService: UiNotificationService,
|
||||
|
|
|
@ -6,7 +6,7 @@ import { EnumUtils } from '@app/core/services/utilities/enum-utils.service';
|
|||
import { QueryParamsService } from '@app/core/services/utilities/query-params.service';
|
||||
import { BaseListingComponent } from '@common/base/base-listing-component';
|
||||
import { PipeService } from '@common/formatting/pipe.service';
|
||||
import { DataTableDateTimeFormatPipe } from '@common/formatting/pipes/date-time-format.pipe';
|
||||
import { DataTableDateTimeFormatPipe } from '@app/core/pipes/date-time-format.pipe';
|
||||
import { QueryResult } from '@common/model/query-result';
|
||||
import { ConfirmationDialogComponent } from '@common/modules/confirmation-dialog/confirmation-dialog.component';
|
||||
import { HttpErrorHandlingService } from '@common/modules/errors/error-handling/http-error-handling.service';
|
||||
|
|
|
@ -1,16 +1,21 @@
|
|||
|
||||
import { Component, OnInit } from '@angular/core';
|
||||
import { UntypedFormGroup } from '@angular/forms';
|
||||
import { MatCheckboxChange } from '@angular/material/checkbox';
|
||||
import { MatDialog } from '@angular/material/dialog';
|
||||
import { Title } from '@angular/platform-browser';
|
||||
import { ActivatedRoute, Router } from '@angular/router';
|
||||
import { SnackBarNotificationLevel, UiNotificationService } from '@app/core/services/notification/ui-notification-service';
|
||||
import { EnumUtils } from '@app/core/services/utilities/enum-utils.service';
|
||||
import { DatePipe } from '@angular/common';
|
||||
import { IsActive } from '@app/core/common/enum/is-active.enum';
|
||||
import { AppPermission } from '@app/core/common/enum/permission.enum';
|
||||
import { Language, LanguagePersist } from '@app/core/model/language/language';
|
||||
import { AuthService } from '@app/core/services/auth/auth.service';
|
||||
import { ConfigurationService } from '@app/core/services/configuration/configuration.service';
|
||||
import { LanguageHttpService } from '@app/core/services/language/language.http.service';
|
||||
import { LockService } from '@app/core/services/lock/lock.service';
|
||||
import { LoggingService } from '@app/core/services/logging/logging-service';
|
||||
import { AnalyticsService } from '@app/core/services/matomo/analytics-service';
|
||||
import { SnackBarNotificationLevel, UiNotificationService } from '@app/core/services/notification/ui-notification-service';
|
||||
import { EnumUtils } from '@app/core/services/utilities/enum-utils.service';
|
||||
import { FileUtils } from '@app/core/services/utilities/file-utils.service';
|
||||
import { QueryParamsService } from '@app/core/services/utilities/query-params.service';
|
||||
import { BaseEditor } from '@common/base/base-editor';
|
||||
|
@ -21,15 +26,9 @@ import { FilterService } from '@common/modules/text-filter/filter-service';
|
|||
import { Guid } from '@common/types/guid';
|
||||
import { TranslateService } from '@ngx-translate/core';
|
||||
import { map, takeUntil } from 'rxjs/operators';
|
||||
import { LanguageEditorModel } from './language-editor.model';
|
||||
import { LanguageEditorResolver } from './language-editor.resolver';
|
||||
import { LanguageEditorService } from './language-editor.service';
|
||||
import { LanguageEditorModel } from './language-editor.model';
|
||||
import { LanguageHttpService } from '@app/core/services/language/language.http.service';
|
||||
import { MatCheckboxChange } from '@angular/material/checkbox';
|
||||
import { ConfigurationService } from '@app/core/services/configuration/configuration.service';
|
||||
import { LockService } from '@app/core/services/lock/lock.service';
|
||||
import { Title } from '@angular/platform-browser';
|
||||
import { AnalyticsService } from '@app/core/services/matomo/analytics-service';
|
||||
|
||||
|
||||
@Component({
|
||||
|
@ -73,7 +72,6 @@ export class LanguageEditorComponent extends BaseEditor<LanguageEditorModel, Lan
|
|||
protected uiNotificationService: UiNotificationService,
|
||||
protected httpErrorHandlingService: HttpErrorHandlingService,
|
||||
protected filterService: FilterService,
|
||||
protected datePipe: DatePipe,
|
||||
protected route: ActivatedRoute,
|
||||
protected queryParamsService: QueryParamsService,
|
||||
protected lockService: LockService,
|
||||
|
@ -88,13 +86,13 @@ export class LanguageEditorComponent extends BaseEditor<LanguageEditorModel, Lan
|
|||
private titleService: Title,
|
||||
private analyticsService: AnalyticsService
|
||||
) {
|
||||
const descriptionLabel:string = route.snapshot.data['entity']?.code;
|
||||
const descriptionLabel: string = route.snapshot.data['entity']?.code;
|
||||
if (descriptionLabel) {
|
||||
titleService.setTitle(descriptionLabel);
|
||||
} else {
|
||||
titleService.setTitle('LANGUAGE-EDITOR.TITLE-EDIT-LANGUAGE');
|
||||
}
|
||||
super(dialog, language, formService, router, uiNotificationService, httpErrorHandlingService, filterService, datePipe, route, queryParamsService, lockService, authService, configurationService);
|
||||
super(dialog, language, formService, router, uiNotificationService, httpErrorHandlingService, filterService, route, queryParamsService, lockService, authService, configurationService);
|
||||
}
|
||||
|
||||
ngOnInit(): void {
|
||||
|
@ -102,7 +100,7 @@ export class LanguageEditorComponent extends BaseEditor<LanguageEditorModel, Lan
|
|||
super.ngOnInit();
|
||||
this.languageHttpService.queryAvailableCodes(this.languageHttpService.buildAutocompleteLookup())
|
||||
.pipe(takeUntil(this._destroyed))
|
||||
.subscribe(
|
||||
.subscribe(
|
||||
data => this.availableLanguageCodes = data.items,
|
||||
error => {
|
||||
this.router.navigate(['/languages']);
|
||||
|
@ -122,7 +120,7 @@ export class LanguageEditorComponent extends BaseEditor<LanguageEditorModel, Lan
|
|||
|
||||
prepareForm(data: Language) {
|
||||
try {
|
||||
if(data && data.payload){
|
||||
if (data && data.payload) {
|
||||
this.currentPayload = data.payload;
|
||||
}
|
||||
this.editorModel = data ? new LanguageEditorModel().fromModel(data) : new LanguageEditorModel();
|
||||
|
@ -206,18 +204,18 @@ export class LanguageEditorComponent extends BaseEditor<LanguageEditorModel, Lan
|
|||
this.formService.validateAllFormFields(this.formGroup);
|
||||
}
|
||||
|
||||
public overrideFromFile(matCheckBox: MatCheckboxChange, code: string){
|
||||
if(matCheckBox.checked == true){
|
||||
public overrideFromFile(matCheckBox: MatCheckboxChange, code: string) {
|
||||
if (matCheckBox.checked == true) {
|
||||
this.languageHttpService.getSingleWithCode(code, LanguageEditorResolver.lookupFields())
|
||||
.pipe(takeUntil(this._destroyed))
|
||||
.subscribe(language => {
|
||||
this.formGroup.get('payload').patchValue(language.payload);
|
||||
},
|
||||
error => {
|
||||
matCheckBox.source.checked = false;
|
||||
this.httpErrorHandlingService.handleBackedRequestError(error);
|
||||
});
|
||||
}else{
|
||||
.pipe(takeUntil(this._destroyed))
|
||||
.subscribe(language => {
|
||||
this.formGroup.get('payload').patchValue(language.payload);
|
||||
},
|
||||
error => {
|
||||
matCheckBox.source.checked = false;
|
||||
this.httpErrorHandlingService.handleBackedRequestError(error);
|
||||
});
|
||||
} else {
|
||||
this.formGroup.get('payload').patchValue(this.currentPayload);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
<div class="col-auto">
|
||||
<button mat-raised-button class="create-btn"
|
||||
*ngIf="authService.hasPermission(authService.permissionEnum.EditLanguage)"
|
||||
[routerLink]="['/languages/new']">
|
||||
[routerLink]="routerUtils.generateUrl(['/languages/new'])">
|
||||
<mat-icon>add</mat-icon>
|
||||
{{'LANGUAGE-LISTING.CREATE' | translate}}
|
||||
</button>
|
||||
|
@ -39,7 +39,7 @@
|
|||
<div class="d-flex align-items-center p-3 gap-1-rem">
|
||||
<div class="row">
|
||||
<ng-container *ngIf="isColumnSelected('code')">
|
||||
<a class="buttonLinkClass" [routerLink]="'./' + item?.id" class="col-12"
|
||||
<a class="buttonLinkClass" [routerLink]="routerUtils.generateUrl('./' + item?.id)" class="col-12"
|
||||
(click)="$event.stopPropagation()">{{item?.code | nullifyValue}}</a>
|
||||
<br />
|
||||
</ng-container>
|
||||
|
@ -81,7 +81,7 @@
|
|||
<mat-icon>more_horiz</mat-icon>
|
||||
</button>
|
||||
<mat-menu #actionsMenu="matMenu">
|
||||
<button mat-menu-item [routerLink]="['/language/' + row.id]">
|
||||
<button mat-menu-item [routerLink]="routerUtils.generateUrl(['/languages/', row.id])">
|
||||
<mat-icon>edit</mat-icon>{{'LANGUAGE-LISTING.ACTIONS.EDIT' | translate}}
|
||||
</button>
|
||||
<button *ngIf="row.belongsToCurrentTenant != false" mat-menu-item (click)="deleteType(row.id)">
|
||||
|
|
|
@ -7,11 +7,12 @@ import { LanguageLookup } from '@app/core/query/language.lookup';
|
|||
import { AuthService } from '@app/core/services/auth/auth.service';
|
||||
import { LanguageHttpService } from '@app/core/services/language/language.http.service';
|
||||
import { SnackBarNotificationLevel, UiNotificationService } from '@app/core/services/notification/ui-notification-service';
|
||||
import { RouterUtilsService } from '@app/core/services/router/router-utils.service';
|
||||
import { EnumUtils } from '@app/core/services/utilities/enum-utils.service';
|
||||
import { QueryParamsService } from '@app/core/services/utilities/query-params.service';
|
||||
import { BaseListingComponent } from '@common/base/base-listing-component';
|
||||
import { PipeService } from '@common/formatting/pipe.service';
|
||||
import { DataTableDateTimeFormatPipe } from '@common/formatting/pipes/date-time-format.pipe';
|
||||
import { DataTableDateTimeFormatPipe } from '@app/core/pipes/date-time-format.pipe';
|
||||
import { IsActiveTypePipe } from '@common/formatting/pipes/is-active-type.pipe';
|
||||
import { QueryResult } from '@common/model/query-result';
|
||||
import { ConfirmationDialogComponent } from '@common/modules/confirmation-dialog/confirmation-dialog.component';
|
||||
|
@ -49,6 +50,7 @@ export class LanguageListingComponent extends BaseListingComponent<Language, Lan
|
|||
rowIdentity = x => x.id;
|
||||
|
||||
constructor(
|
||||
public routerUtils: RouterUtilsService,
|
||||
protected router: Router,
|
||||
protected route: ActivatedRoute,
|
||||
protected uiNotificationService: UiNotificationService,
|
||||
|
|
|
@ -1,14 +1,10 @@
|
|||
|
||||
import { Component, OnInit } from '@angular/core';
|
||||
import { FormArray, FormGroup, UntypedFormGroup } from '@angular/forms';
|
||||
import { MatDialog } from '@angular/material/dialog';
|
||||
import { ActivatedRoute, Router } from '@angular/router';
|
||||
import { SnackBarNotificationLevel, UiNotificationService } from '@app/core/services/notification/ui-notification-service';
|
||||
import { PrefillingSourceService } from '@app/core/services/prefilling-source/prefilling-source.service';
|
||||
import { EnumUtils } from '@app/core/services/utilities/enum-utils.service';
|
||||
import { DatePipe } from '@angular/common';
|
||||
import { MatCheckboxChange } from '@angular/material/checkbox';
|
||||
import { MatDialog } from '@angular/material/dialog';
|
||||
import { Title } from '@angular/platform-browser';
|
||||
import { ActivatedRoute, Router } from '@angular/router';
|
||||
import { IsActive } from '@app/core/common/enum/is-active.enum';
|
||||
import { AppPermission } from '@app/core/common/enum/permission.enum';
|
||||
import { PrefillingSource, PrefillingSourcePersist } from '@app/core/model/prefilling-source/prefilling-source';
|
||||
|
@ -17,6 +13,9 @@ import { ConfigurationService } from '@app/core/services/configuration/configura
|
|||
import { LockService } from '@app/core/services/lock/lock.service';
|
||||
import { LoggingService } from '@app/core/services/logging/logging-service';
|
||||
import { AnalyticsService } from '@app/core/services/matomo/analytics-service';
|
||||
import { SnackBarNotificationLevel, UiNotificationService } from '@app/core/services/notification/ui-notification-service';
|
||||
import { PrefillingSourceService } from '@app/core/services/prefilling-source/prefilling-source.service';
|
||||
import { EnumUtils } from '@app/core/services/utilities/enum-utils.service';
|
||||
import { QueryParamsService } from '@app/core/services/utilities/query-params.service';
|
||||
import { ResultFieldsMappingConfigurationEditorModel } from '@app/ui/external-fetcher/external-fetcher-source-editor.model';
|
||||
import { BaseEditor } from '@common/base/base-editor';
|
||||
|
@ -65,7 +64,6 @@ export class PrefillingSourceEditorComponent extends BaseEditor<PrefillingSource
|
|||
protected uiNotificationService: UiNotificationService,
|
||||
protected httpErrorHandlingService: HttpErrorHandlingService,
|
||||
protected filterService: FilterService,
|
||||
protected datePipe: DatePipe,
|
||||
protected route: ActivatedRoute,
|
||||
protected queryParamsService: QueryParamsService,
|
||||
protected lockService: LockService,
|
||||
|
@ -85,7 +83,7 @@ export class PrefillingSourceEditorComponent extends BaseEditor<PrefillingSource
|
|||
} else {
|
||||
titleService.setTitle('PREFILLING-SOURCE-EDITOR.TITLE-EDIT-PREFILLING-SOURCE');
|
||||
}
|
||||
super(dialog, language, formService, router, uiNotificationService, httpErrorHandlingService, filterService, datePipe, route, queryParamsService, lockService, authService, configurationService);
|
||||
super(dialog, language, formService, router, uiNotificationService, httpErrorHandlingService, filterService, route, queryParamsService, lockService, authService, configurationService);
|
||||
}
|
||||
|
||||
ngOnInit(): void {
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
<div class="col-auto">
|
||||
<button mat-raised-button class="create-btn"
|
||||
*ngIf="authService.hasPermission(authService.permissionEnum.EditPrefillingSource)"
|
||||
[routerLink]="['/prefilling-sources/new']">
|
||||
[routerLink]="routerUtils.generateUrl(['/prefilling-sources/new'])">
|
||||
<mat-icon>add</mat-icon>
|
||||
{{'PREFILLING-SOURCE-LISTING.CREATE' | translate}}
|
||||
</button>
|
||||
|
@ -40,7 +40,7 @@
|
|||
<div class="d-flex align-items-center p-3 gap-1-rem">
|
||||
<div class="row">
|
||||
<ng-container *ngIf="isColumnSelected('name')">
|
||||
<a class="buttonLinkClass" [routerLink]="'./' + item?.id" class="col-12"
|
||||
<a class="buttonLinkClass" [routerLink]="routerUtils.generateUrl('./' + item?.id)" class="col-12"
|
||||
(click)="$event.stopPropagation()">{{item?.name | nullifyValue}}</a>
|
||||
<br />
|
||||
</ng-container>
|
||||
|
@ -83,7 +83,7 @@
|
|||
<mat-icon>more_horiz</mat-icon>
|
||||
</button>
|
||||
<mat-menu #actionsMenu="matMenu">
|
||||
<button mat-menu-item [routerLink]="['/prefilling-sources/' + row.id]">
|
||||
<button mat-menu-item [routerLink]="routerUtils.generateUrl(['/prefilling-sources/', row.id])">
|
||||
<mat-icon>edit</mat-icon>{{'PREFILLING-SOURCE-LISTING.ACTIONS.EDIT' | translate}}
|
||||
</button>
|
||||
<button *ngIf="row.belongsToCurrentTenant != false" mat-menu-item (click)="deleteType(row.id)">
|
||||
|
|
|
@ -11,7 +11,7 @@ import { EnumUtils } from '@app/core/services/utilities/enum-utils.service';
|
|||
import { QueryParamsService } from '@app/core/services/utilities/query-params.service';
|
||||
import { BaseListingComponent } from '@common/base/base-listing-component';
|
||||
import { PipeService } from '@common/formatting/pipe.service';
|
||||
import { DataTableDateTimeFormatPipe } from '@common/formatting/pipes/date-time-format.pipe';
|
||||
import { DataTableDateTimeFormatPipe } from '@app/core/pipes/date-time-format.pipe';
|
||||
import { QueryResult } from '@common/model/query-result';
|
||||
import { ConfirmationDialogComponent } from '@common/modules/confirmation-dialog/confirmation-dialog.component';
|
||||
import { HttpErrorHandlingService } from '@common/modules/errors/error-handling/http-error-handling.service';
|
||||
|
@ -22,6 +22,7 @@ import { Observable } from 'rxjs';
|
|||
import { takeUntil } from 'rxjs/operators';
|
||||
import { nameof } from 'ts-simple-nameof';
|
||||
import { IsActiveTypePipe } from '@common/formatting/pipes/is-active-type.pipe';
|
||||
import { RouterUtilsService } from '@app/core/services/router/router-utils.service';
|
||||
|
||||
@Component({
|
||||
templateUrl: './prefilling-source-listing.component.html',
|
||||
|
@ -50,6 +51,7 @@ export class PrefillingSourceListingComponent extends BaseListingComponent<Prefi
|
|||
rowIdentity = x => x.id;
|
||||
|
||||
constructor(
|
||||
public routerUtils: RouterUtilsService,
|
||||
protected router: Router,
|
||||
protected route: ActivatedRoute,
|
||||
protected uiNotificationService: UiNotificationService,
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
|
||||
import { DatePipe } from '@angular/common';
|
||||
import { Component, OnInit } from '@angular/core';
|
||||
import { FormArray, UntypedFormGroup } from '@angular/forms';
|
||||
import { MatDialog } from '@angular/material/dialog';
|
||||
|
@ -77,7 +76,6 @@ export class ReferenceTypeEditorComponent extends BaseEditor<ReferenceTypeEditor
|
|||
protected uiNotificationService: UiNotificationService,
|
||||
protected httpErrorHandlingService: HttpErrorHandlingService,
|
||||
protected filterService: FilterService,
|
||||
protected datePipe: DatePipe,
|
||||
protected route: ActivatedRoute,
|
||||
protected queryParamsService: QueryParamsService,
|
||||
protected lockService: LockService,
|
||||
|
@ -96,7 +94,7 @@ export class ReferenceTypeEditorComponent extends BaseEditor<ReferenceTypeEditor
|
|||
} else {
|
||||
titleService.setTitle('REFERENCE-TYPE-EDITOR.TITLE-EDIT-REFERENCE-TYPE');
|
||||
}
|
||||
super(dialog, language, formService, router, uiNotificationService, httpErrorHandlingService, filterService, datePipe, route, queryParamsService, lockService, authService, configurationService);
|
||||
super(dialog, language, formService, router, uiNotificationService, httpErrorHandlingService, filterService, route, queryParamsService, lockService, authService, configurationService);
|
||||
}
|
||||
|
||||
ngOnInit(): void {
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
<div class="col-auto">
|
||||
<button mat-raised-button class="create-btn"
|
||||
*ngIf="authService.hasPermission(authService.permissionEnum.EditReferenceType)"
|
||||
[routerLink]="['/reference-type/new']">
|
||||
[routerLink]="routerUtils.generateUrl(['/reference-type/new'])">
|
||||
<mat-icon>add</mat-icon>
|
||||
{{'REFERENCE-TYPE-LISTING.CREATE-TYPE' | translate}}
|
||||
</button>
|
||||
|
@ -44,7 +44,7 @@
|
|||
<div class="d-flex align-items-center p-3 gap-1-rem">
|
||||
<div class="row">
|
||||
<ng-container *ngIf="isColumnSelected('name')">
|
||||
<a class="buttonLinkClass" [routerLink]="'./' + item?.id" class="col-12"
|
||||
<a class="buttonLinkClass" [routerLink]="routerUtils.generateUrl('./' + item?.id)" class="col-12"
|
||||
(click)="$event.stopPropagation()">{{item?.name | nullifyValue}}</a>
|
||||
<br />
|
||||
</ng-container>
|
||||
|
@ -96,7 +96,7 @@
|
|||
<mat-icon>more_horiz</mat-icon>
|
||||
</button>
|
||||
<mat-menu #actionsMenu="matMenu">
|
||||
<button mat-menu-item [routerLink]="['/reference-type/' + row.id]">
|
||||
<button mat-menu-item [routerLink]="routerUtils.generateUrl(['/reference-type/' + row.id])">
|
||||
<mat-icon>edit</mat-icon>{{'REFERENCE-TYPE-LISTING.ACTIONS.EDIT' | translate}}
|
||||
</button>
|
||||
<button *ngIf="row.belongsToCurrentTenant != false" mat-menu-item (click)="deleteType(row.id)">
|
||||
|
|
|
@ -11,7 +11,7 @@ import { EnumUtils } from '@app/core/services/utilities/enum-utils.service';
|
|||
import { QueryParamsService } from '@app/core/services/utilities/query-params.service';
|
||||
import { BaseListingComponent } from '@common/base/base-listing-component';
|
||||
import { PipeService } from '@common/formatting/pipe.service';
|
||||
import { DataTableDateTimeFormatPipe } from '@common/formatting/pipes/date-time-format.pipe';
|
||||
import { DataTableDateTimeFormatPipe } from '@app/core/pipes/date-time-format.pipe';
|
||||
import { QueryResult } from '@common/model/query-result';
|
||||
import { ConfirmationDialogComponent } from '@common/modules/confirmation-dialog/confirmation-dialog.component';
|
||||
import { HttpErrorHandlingService } from '@common/modules/errors/error-handling/http-error-handling.service';
|
||||
|
@ -22,6 +22,7 @@ import { Observable } from 'rxjs';
|
|||
import { takeUntil } from 'rxjs/operators';
|
||||
import { nameof } from 'ts-simple-nameof';
|
||||
import { IsActiveTypePipe } from '@common/formatting/pipes/is-active-type.pipe';
|
||||
import { RouterUtilsService } from '@app/core/services/router/router-utils.service';
|
||||
|
||||
@Component({
|
||||
templateUrl: './reference-type-listing.component.html',
|
||||
|
@ -50,6 +51,7 @@ export class ReferenceTypeListingComponent extends BaseListingComponent<Referenc
|
|||
rowIdentity = x => x.id;
|
||||
|
||||
constructor(
|
||||
public routerUtils: RouterUtilsService,
|
||||
protected router: Router,
|
||||
protected route: ActivatedRoute,
|
||||
protected uiNotificationService: UiNotificationService,
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
|
||||
import { DatePipe } from '@angular/common';
|
||||
import { Component, OnInit } from '@angular/core';
|
||||
import { FormArray, UntypedFormGroup } from '@angular/forms';
|
||||
import { MatDialog } from '@angular/material/dialog';
|
||||
|
@ -75,7 +74,6 @@ export class ReferenceEditorComponent extends BaseEditor<ReferenceEditorModel, R
|
|||
protected uiNotificationService: UiNotificationService,
|
||||
protected httpErrorHandlingService: HttpErrorHandlingService,
|
||||
protected filterService: FilterService,
|
||||
protected datePipe: DatePipe,
|
||||
protected route: ActivatedRoute,
|
||||
protected queryParamsService: QueryParamsService,
|
||||
protected lockService: LockService,
|
||||
|
@ -98,7 +96,7 @@ export class ReferenceEditorComponent extends BaseEditor<ReferenceEditorModel, R
|
|||
} else {
|
||||
titleService.setTitle('REFERENCE-EDITOR.TITLE-EDIT-REFERENCE');
|
||||
}
|
||||
super(dialog, language, formService, router, uiNotificationService, httpErrorHandlingService, filterService, datePipe, route, queryParamsService, lockService, authService, configurationService);
|
||||
super(dialog, language, formService, router, uiNotificationService, httpErrorHandlingService, filterService, route, queryParamsService, lockService, authService, configurationService);
|
||||
}
|
||||
|
||||
ngOnInit(): void {
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
<div class="col-auto">
|
||||
<button mat-raised-button class="create-btn"
|
||||
*ngIf="authService.hasPermission(authService.permissionEnum.EditReference)"
|
||||
[routerLink]="['/references/new']">
|
||||
[routerLink]="routerUtils.generateUrl(['/references/new/'])">
|
||||
<mat-icon>add</mat-icon>
|
||||
{{'REFERENCE-LISTING.CREATE' | translate}}
|
||||
</button>
|
||||
|
@ -42,7 +42,7 @@
|
|||
<div class="d-flex align-items-center p-3 gap-1-rem">
|
||||
<div class="row">
|
||||
<ng-container *ngIf="isColumnSelected('label')">
|
||||
<a class="buttonLinkClass" [routerLink]="'./' + item?.id" class="col-12"
|
||||
<a class="buttonLinkClass" [routerLink]="routerUtils.generateUrl('./' + item?.id)" class="col-12"
|
||||
(click)="$event.stopPropagation()">{{item?.label | nullifyValue}}</a>
|
||||
<br />
|
||||
</ng-container>
|
||||
|
@ -105,7 +105,7 @@
|
|||
<mat-icon>more_horiz</mat-icon>
|
||||
</button>
|
||||
<mat-menu #actionsMenu="matMenu">
|
||||
<button mat-menu-item [routerLink]="['/tenant/' + row.id]">
|
||||
<button mat-menu-item [routerLink]="routerUtils.generateUrl(['/references/', row.id])">
|
||||
<mat-icon>edit</mat-icon>{{'REFERENCE-LISTING.ACTIONS.EDIT' | translate}}
|
||||
</button>
|
||||
<button *ngIf="row.belongsToCurrentTenant != false" mat-menu-item (click)="deleteType(row.id)">
|
||||
|
|
|
@ -8,11 +8,12 @@ import { ReferenceLookup } from '@app/core/query/reference.lookup';
|
|||
import { AuthService } from '@app/core/services/auth/auth.service';
|
||||
import { SnackBarNotificationLevel, UiNotificationService } from '@app/core/services/notification/ui-notification-service';
|
||||
import { ReferenceService } from '@app/core/services/reference/reference.service';
|
||||
import { RouterUtilsService } from '@app/core/services/router/router-utils.service';
|
||||
import { EnumUtils } from '@app/core/services/utilities/enum-utils.service';
|
||||
import { QueryParamsService } from '@app/core/services/utilities/query-params.service';
|
||||
import { BaseListingComponent } from '@common/base/base-listing-component';
|
||||
import { PipeService } from '@common/formatting/pipe.service';
|
||||
import { DataTableDateTimeFormatPipe } from '@common/formatting/pipes/date-time-format.pipe';
|
||||
import { DataTableDateTimeFormatPipe } from '@app/core/pipes/date-time-format.pipe';
|
||||
import { IsActiveTypePipe } from '@common/formatting/pipes/is-active-type.pipe';
|
||||
import { ReferenceSourceTypePipe } from '@common/formatting/pipes/reference-source-type.pipe';
|
||||
import { QueryResult } from '@common/model/query-result';
|
||||
|
@ -53,6 +54,7 @@ export class ReferenceListingComponent extends BaseListingComponent<Reference, R
|
|||
rowIdentity = x => x.id;
|
||||
|
||||
constructor(
|
||||
public routerUtils: RouterUtilsService,
|
||||
protected router: Router,
|
||||
protected route: ActivatedRoute,
|
||||
protected uiNotificationService: UiNotificationService,
|
||||
|
|
|
@ -18,12 +18,6 @@
|
|||
[configuration]="singleCultureAutocompleteConfiguration">
|
||||
</app-single-auto-complete>
|
||||
|
||||
<!-- <mat-select [formControl]="this.formGroup.get('defaultUserLocale')?.get('culture')" name="culture">
|
||||
<mat-option *ngFor="let culture of cultures" [value]="culture.name">
|
||||
{{ culture.displayName }} - {{ culture.nativeName }}
|
||||
</mat-option>
|
||||
</mat-select> -->
|
||||
|
||||
<mat-error *ngIf="formGroup.get('defaultUserLocale')?.get('culture').hasError('required')">{{'GENERAL.VALIDATION.REQUIRED' | translate}}</mat-error>
|
||||
<mat-error *ngIf="formGroup.get('defaultUserLocale')?.get('culture')?.hasError('backendError')">{{formGroup.get('defaultUserLocale')?.get('culture')?.getError('backendError').message}}</mat-error>
|
||||
</mat-form-field>
|
||||
|
|
|
@ -5,10 +5,9 @@ import { UntypedFormGroup } from '@angular/forms';
|
|||
import { MatDialog } from '@angular/material/dialog';
|
||||
import { AppPermission } from '@app/core/common/enum/permission.enum';
|
||||
import { TenantConfigurationType } from '@app/core/common/enum/tenant-configuration-type';
|
||||
import { CultureInfo } from '@app/core/model/culture-info';
|
||||
import { TenantConfiguration, TenantConfigurationPersist } from '@app/core/model/tenant-configuaration/tenant-configuration';
|
||||
import { AuthService } from '@app/core/services/auth/auth.service';
|
||||
import { CultureService } from '@app/core/services/culture/culture-service';
|
||||
import { CultureInfo, CultureService } from '@app/core/services/culture/culture-service';
|
||||
import { DefaultUserLocaleService } from '@app/core/services/default-user-locale/default-user-locale.service';
|
||||
import { LanguageService } from '@app/core/services/language/language.service';
|
||||
import { LoggingService } from '@app/core/services/logging/logging-service';
|
||||
|
@ -219,14 +218,4 @@ export class DefaultUserLocaleEditorComponent extends BasePendingChangesComponen
|
|||
this.formService.validateAllFormFields(this.formGroup);
|
||||
}
|
||||
|
||||
displayCultureFn(culture?: CultureInfo): string | undefined {
|
||||
|
||||
if (culture == null
|
||||
|| culture.displayName == null
|
||||
|| culture.nativeName == null)
|
||||
return undefined;
|
||||
|
||||
return culture.displayName + '-' + culture.nativeName;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -3,8 +3,6 @@
|
|||
<div class="col-md-10 offset-md-1 tenant-editor">
|
||||
<div class="row align-items-center mb-4 mt-4" *ngIf="formGroup">
|
||||
<div class="col-md col-12">
|
||||
<h3 *ngIf="isNew && !isClone">{{'TENANT-EDITOR.NEW' | translate}}</h3>
|
||||
<h3 *ngIf="!isNew && editorModel">{{ editorModel.name }}</h3>
|
||||
<app-navigation-breadcrumb />
|
||||
</div>
|
||||
<div class="col-auto">
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
|
||||
import { DatePipe } from '@angular/common';
|
||||
import { Component, OnInit } from '@angular/core';
|
||||
import { UntypedFormGroup } from '@angular/forms';
|
||||
import { MatDialog } from '@angular/material/dialog';
|
||||
|
@ -71,7 +70,6 @@ export class TenantEditorComponent extends BaseEditor<TenantEditorModel, Tenant>
|
|||
protected uiNotificationService: UiNotificationService,
|
||||
protected httpErrorHandlingService: HttpErrorHandlingService,
|
||||
protected filterService: FilterService,
|
||||
protected datePipe: DatePipe,
|
||||
protected route: ActivatedRoute,
|
||||
protected queryParamsService: QueryParamsService,
|
||||
protected lockService: LockService,
|
||||
|
@ -85,7 +83,7 @@ export class TenantEditorComponent extends BaseEditor<TenantEditorModel, Tenant>
|
|||
private fileUtils: FileUtils,
|
||||
private analyticsService: AnalyticsService
|
||||
) {
|
||||
super(dialog, language, formService, router, uiNotificationService, httpErrorHandlingService, filterService, datePipe, route, queryParamsService, lockService, authService, configurationService);
|
||||
super(dialog, language, formService, router, uiNotificationService, httpErrorHandlingService, filterService, route, queryParamsService, lockService, authService, configurationService);
|
||||
}
|
||||
|
||||
ngOnInit(): void {
|
||||
|
|
|
@ -4,14 +4,13 @@
|
|||
|
||||
<div class="row mb-4 mt-4">
|
||||
<div class="col">
|
||||
<h4>{{'TENANT-LISTING.TITLE' | translate}}</h4>
|
||||
<app-navigation-breadcrumb />
|
||||
|
||||
</div>
|
||||
<div class="col-auto">
|
||||
<button mat-raised-button class="create-btn"
|
||||
*ngIf="authService.hasPermission(authService.permissionEnum.EditTenant)"
|
||||
[routerLink]="['/tenants/new']">
|
||||
[routerLink]="routerUtils.generateUrl(['/tenants/new'])">
|
||||
<mat-icon>add</mat-icon>
|
||||
{{'TENANT-LISTING.CREATE' | translate}}
|
||||
</button>
|
||||
|
@ -42,7 +41,7 @@
|
|||
<div class="d-flex align-items-center p-3 gap-1-rem">
|
||||
<div class="row">
|
||||
<ng-container *ngIf="isColumnSelected('name')">
|
||||
<a class="buttonLinkClass" [routerLink]="'./' + item?.id" class="col-12"
|
||||
<a class="buttonLinkClass" [routerLink]="routerUtils.generateUrl('./' + item?.id)" class="col-12"
|
||||
(click)="$event.stopPropagation()">{{item?.name | nullifyValue}}</a>
|
||||
<br />
|
||||
</ng-container>
|
||||
|
@ -85,7 +84,7 @@
|
|||
<mat-icon>more_horiz</mat-icon>
|
||||
</button>
|
||||
<mat-menu #actionsMenu="matMenu">
|
||||
<button mat-menu-item [routerLink]="['/tenant/' + row.id]">
|
||||
<button mat-menu-item [routerLink]="routerUtils.generateUrl(['/tenants/' + row.id])">
|
||||
<mat-icon>edit</mat-icon>{{'TENANT-LISTING.ACTIONS.EDIT' | translate}}
|
||||
</button>
|
||||
<button mat-menu-item (click)="deleteType(row.id)">
|
||||
|
|
|
@ -11,7 +11,7 @@ import { EnumUtils } from '@app/core/services/utilities/enum-utils.service';
|
|||
import { QueryParamsService } from '@app/core/services/utilities/query-params.service';
|
||||
import { BaseListingComponent } from '@common/base/base-listing-component';
|
||||
import { PipeService } from '@common/formatting/pipe.service';
|
||||
import { DataTableDateTimeFormatPipe } from '@common/formatting/pipes/date-time-format.pipe';
|
||||
import { DataTableDateTimeFormatPipe } from '@app/core/pipes/date-time-format.pipe';
|
||||
import { QueryResult } from '@common/model/query-result';
|
||||
import { ConfirmationDialogComponent } from '@common/modules/confirmation-dialog/confirmation-dialog.component';
|
||||
import { HttpErrorHandlingService } from '@common/modules/errors/error-handling/http-error-handling.service';
|
||||
|
@ -22,6 +22,7 @@ import { Observable } from 'rxjs';
|
|||
import { takeUntil } from 'rxjs/operators';
|
||||
import { nameof } from 'ts-simple-nameof';
|
||||
import { IsActiveTypePipe } from '@common/formatting/pipes/is-active-type.pipe';
|
||||
import { RouterUtilsService } from '@app/core/services/router/router-utils.service';
|
||||
|
||||
@Component({
|
||||
templateUrl: './tenant-listing.component.html',
|
||||
|
@ -49,6 +50,7 @@ export class TenantListingComponent extends BaseListingComponent<Tenant, TenantL
|
|||
rowIdentity = x => x.id;
|
||||
|
||||
constructor(
|
||||
public routerUtils: RouterUtilsService,
|
||||
protected router: Router,
|
||||
protected route: ActivatedRoute,
|
||||
protected uiNotificationService: UiNotificationService,
|
||||
|
|
|
@ -37,9 +37,6 @@ const routes: Routes = [
|
|||
'entity': TenantEditorResolver
|
||||
},
|
||||
data: {
|
||||
...BreadcrumbService.generateRouteDataConfiguration({
|
||||
title: 'BREADCRUMBS.EDIT-TENANT'
|
||||
}),
|
||||
authContext: {
|
||||
permissions: [AppPermission.EditTenant]
|
||||
}
|
||||
|
|
|
@ -3,7 +3,6 @@
|
|||
<div class="col-md-10 offset-md-1">
|
||||
<div class="row mb-4 mt-4">
|
||||
<div class="col">
|
||||
<h4>{{'USER-LISTING.TITLE' | translate}}</h4>
|
||||
<app-navigation-breadcrumb />
|
||||
|
||||
</div>
|
||||
|
@ -30,7 +29,7 @@
|
|||
<div class="d-flex align-items-center p-3 gap-1-rem">
|
||||
<div class="row">
|
||||
<ng-container *ngIf="isColumnSelected('name')">
|
||||
<a class="buttonLinkClass" [routerLink]="'./' + item?.id" class="col-12" (click)="$event.stopPropagation()">{{item?.name | nullifyValue}}</a>
|
||||
<a class="buttonLinkClass" [routerLink]="routerUtils.generateUrl('./' + item?.id)" class="col-12" (click)="$event.stopPropagation()">{{item?.name | nullifyValue}}</a>
|
||||
<br />
|
||||
</ng-container>
|
||||
|
||||
|
|
|
@ -12,7 +12,7 @@ import { FileUtils } from '@app/core/services/utilities/file-utils.service';
|
|||
import { QueryParamsService } from '@app/core/services/utilities/query-params.service';
|
||||
import { BaseListingComponent } from '@common/base/base-listing-component';
|
||||
import { PipeService } from '@common/formatting/pipe.service';
|
||||
import { DataTableDateTimeFormatPipe } from '@common/formatting/pipes/date-time-format.pipe';
|
||||
import { DataTableDateTimeFormatPipe } from '@app/core/pipes/date-time-format.pipe';
|
||||
import { IsActiveTypePipe } from '@common/formatting/pipes/is-active-type.pipe';
|
||||
import { QueryResult } from '@common/model/query-result';
|
||||
import { ConfirmationDialogComponent } from '@common/modules/confirmation-dialog/confirmation-dialog.component';
|
||||
|
|
|
@ -92,7 +92,7 @@
|
|||
<div class="col">
|
||||
<div class="row">
|
||||
<span class="col user">{{getParentAnnotation(thread).author.name}}</span>
|
||||
<div class="col-auto annotation-time">{{getParentAnnotation(thread).timeStamp | date: "d MMMM, y 'at' h:mm a"}}</div>
|
||||
<div class="col-auto annotation-time">{{getParentAnnotation(thread).timeStamp | dateTimeFormatter: "d MMMM, y 'at' h:mm a"}}</div>
|
||||
</div>
|
||||
<div class="row pt-1">
|
||||
<div class="col-12 annotation-full-text">{{getParentAnnotation(thread).payload}}</div>
|
||||
|
@ -134,8 +134,7 @@
|
|||
<div class="col">
|
||||
<div class="row">
|
||||
<span class="col user">{{annotation.author.name}}</span>
|
||||
<div class="col-auto annotation-time">{{annotation.timeStamp | date:"d MMMM, y 'at' h:mm a"}}</div>
|
||||
<!-- <div class="col annotation-time">{{annotation.timeStamp | date:'EEEE, MMMM d, y, h:mm a'}}</div> -->
|
||||
<div class="col-auto annotation-time">{{annotation.timeStamp | dateTimeFormatter:"d MMMM, y 'at' h:mm a"}}</div>
|
||||
</div>
|
||||
|
||||
<div class="row pt-1 pb-1">
|
||||
|
|
|
@ -94,11 +94,11 @@
|
|||
</div>
|
||||
<div class="col-auto col-xl-12">
|
||||
<div class="counter-zero" style="width: fit-content;"><span>0</span></div>
|
||||
<a [routerLink]="['/plans']" class="link">{{'DASHBOARD.DMPS' | translate}}</a>
|
||||
<a [routerLink]="routerUtils.generateUrl(['/plans'])" class="link">{{'DASHBOARD.DMPS' | translate}}</a>
|
||||
</div>
|
||||
<div class="col-auto col-xl-12">
|
||||
<div class="counter-zero" style="width: fit-content;"><span>0</span></div>
|
||||
<a [routerLink]="['/descriptions']" class="link">{{'DASHBOARD.DESCRIPTIONS' | translate}}</a>
|
||||
<a [routerLink]="routerUtils.generateUrl(['/descriptions'])" class="link">{{'DASHBOARD.DESCRIPTIONS' | translate}}</a>
|
||||
</div>
|
||||
<div class="col-auto col-xl-12">
|
||||
<div class="counter-zero" style="width: fit-content;"><span>0</span></div>
|
||||
|
@ -119,13 +119,13 @@
|
|||
<div [ngClass]="{'counter': dashboardStatistics?.dmpCount != 0, 'counter-zero': dashboardStatistics?.dmpCount == 0}" style="width: fit-content;">
|
||||
<span>{{dashboardStatistics?.dmpCount}}</span>
|
||||
</div>
|
||||
<a [routerLink]="['/plans']" class="link">{{'DASHBOARD.DMPS' | translate}}</a>
|
||||
<a [routerLink]="routerUtils.generateUrl(['/plans'])" class="link">{{'DASHBOARD.DMPS' | translate}}</a>
|
||||
</div>
|
||||
<div class="col-auto col-xl-12">
|
||||
<div [ngClass]="{'counter': dashboardStatistics?.descriptionCount != 0, 'counter-zero': dashboardStatistics?.descriptionCount == 0}" style="width: fit-content;">
|
||||
<span>{{dashboardStatistics?.descriptionCount}}</span>
|
||||
</div>
|
||||
<a [routerLink]="['/descriptions']" class="link">{{'DASHBOARD.DESCRIPTIONS' | translate}}</a>
|
||||
<a [routerLink]="routerUtils.generateUrl(['/descriptions'])" class="link">{{'DASHBOARD.DESCRIPTIONS' | translate}}</a>
|
||||
</div>
|
||||
<div class="col-auto col-xl-12">
|
||||
<div [ngClass]="{'counter': grantCount != 0, 'counter-zero': grantCount == 0}" style="width: fit-content;">
|
||||
|
|
|
@ -18,6 +18,7 @@ import { takeUntil } from 'rxjs/operators';
|
|||
import { StartNewDescriptionDialogComponent } from '../description/start-new-description-dialog/start-new-description-dialog.component';
|
||||
import { StartNewDmpDialogComponent } from '../dmp/new/start-new-dmp-dialogue/start-new-dmp-dialog.component';
|
||||
import { AnalyticsService } from '@app/core/services/matomo/analytics-service';
|
||||
import { RouterUtilsService } from '@app/core/services/router/router-utils.service';
|
||||
|
||||
|
||||
@Component({
|
||||
|
@ -35,6 +36,7 @@ export class DashboardComponent extends BaseComponent implements OnInit {
|
|||
isIntroCardVisible = true;
|
||||
|
||||
constructor(
|
||||
public routerUtils: RouterUtilsService,
|
||||
private router: Router,
|
||||
private route: ActivatedRoute,
|
||||
private dashboardService: DashboardService,
|
||||
|
|
|
@ -19,7 +19,7 @@
|
|||
<div class="col-auto description-to-dmp">{{'DESCRIPTION-EDITOR.TO-DMP' | translate}}</div>
|
||||
<div class="dmp-title p-0">: {{ item?.dmp?.label }}</div>
|
||||
<div class="col-auto d-flex align-items-center">
|
||||
<a [routerLink]="['/plans/overview/' + item.dmp.id]" target="_blank" class="pointer open-in-new-icon">
|
||||
<a [routerLink]="routerUtils.generateUrl(['/plans/overview/', item.dmp.id])" target="_blank" class="pointer open-in-new-icon">
|
||||
<mat-icon class="size-18">open_in_new</mat-icon>
|
||||
</a>
|
||||
</div>
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
import { DatePipe } from '@angular/common';
|
||||
import { ChangeDetectorRef, Component, OnInit, ViewChild } from '@angular/core';
|
||||
import { AbstractControl, UntypedFormArray, UntypedFormGroup } from '@angular/forms';
|
||||
import { MatDialog } from '@angular/material/dialog';
|
||||
|
@ -29,7 +28,6 @@ import {
|
|||
import { EnumUtils } from '@app/core/services/utilities/enum-utils.service';
|
||||
import { QueryParamsService } from '@app/core/services/utilities/query-params.service';
|
||||
import { VisibilityRulesService } from '@app/ui/description/editor/description-form/visibility-rules/visibility-rules.service';
|
||||
import { BreadcrumbService } from '@app/ui/misc/breadcrumb/breadcrumb.service';
|
||||
import { BaseEditor } from '@common/base/base-editor';
|
||||
import { FormService } from '@common/forms/form-service';
|
||||
import { FormValidationErrorsDialogComponent } from '@common/forms/form-validation-errors-dialog/form-validation-errors-dialog.component';
|
||||
|
@ -45,9 +43,9 @@ import { DescriptionEditorResolver } from './description-editor.resolver';
|
|||
import { DescriptionEditorService } from './description-editor.service';
|
||||
import { PrefillDescriptionDialogComponent } from './prefill-description/prefill-description.component';
|
||||
import { ToCEntry } from './table-of-contents/models/toc-entry';
|
||||
import { ToCEntryType } from './table-of-contents/models/toc-entry-type.enum';
|
||||
import { TableOfContentsService } from './table-of-contents/services/table-of-contents-service';
|
||||
import { TableOfContentsComponent } from './table-of-contents/table-of-contents.component';
|
||||
import { RouterUtilsService } from '@app/core/services/router/router-utils.service';
|
||||
|
||||
@Component({
|
||||
selector: 'app-description-editor-component',
|
||||
|
@ -82,6 +80,7 @@ export class DescriptionEditorComponent extends BaseEditor<DescriptionEditorMode
|
|||
|
||||
constructor(
|
||||
// BaseFormEditor injected dependencies
|
||||
public routerUtils: RouterUtilsService,
|
||||
protected dialog: MatDialog,
|
||||
protected language: TranslateService,
|
||||
protected formService: FormService,
|
||||
|
@ -89,7 +88,6 @@ export class DescriptionEditorComponent extends BaseEditor<DescriptionEditorMode
|
|||
protected uiNotificationService: UiNotificationService,
|
||||
protected httpErrorHandlingService: HttpErrorHandlingService,
|
||||
protected filterService: FilterService,
|
||||
protected datePipe: DatePipe,
|
||||
protected route: ActivatedRoute,
|
||||
protected queryParamsService: QueryParamsService,
|
||||
protected lockService: LockService,
|
||||
|
@ -114,7 +112,7 @@ export class DescriptionEditorComponent extends BaseEditor<DescriptionEditorMode
|
|||
} else {
|
||||
titleService.setTitle('DESCRIPTION-EDITOR.TITLE-EDIT-DESCRIPTION');
|
||||
}
|
||||
super(dialog, language, formService, router, uiNotificationService, httpErrorHandlingService, filterService, datePipe, route, queryParamsService, lockService, authService, configurationService);
|
||||
super(dialog, language, formService, router, uiNotificationService, httpErrorHandlingService, filterService, route, queryParamsService, lockService, authService, configurationService);
|
||||
}
|
||||
|
||||
ngOnInit(): void {
|
||||
|
@ -368,7 +366,7 @@ export class DescriptionEditorComponent extends BaseEditor<DescriptionEditorMode
|
|||
dialogRef.afterClosed().pipe(takeUntil(this._destroyed)).subscribe(result => {
|
||||
if (result) {
|
||||
setTimeout(x => {
|
||||
if (this.isNew) this._resetFields();
|
||||
if (this.isNew) this._resetFields();
|
||||
else this.refreshOnNavigateToData(this.editorModel?.id);
|
||||
});
|
||||
}
|
||||
|
|
|
@ -167,10 +167,9 @@ export class DescriptionEditorResolver extends BaseEditorResolver {
|
|||
} else if (dmpId != null && dmpSectionId != null && copyDmpId == null) {
|
||||
return this.dmpService.getSingle(Guid.parse(dmpId), DescriptionEditorResolver.dmpLookupFields())
|
||||
.pipe(tap(x => {
|
||||
this.breadcrumbService.addIdResolvedValue(`${x.id}/${dmpSectionId}`, this.language.instant("DESCRIPTION-EDITOR.TITLE-NEW"));
|
||||
|
||||
this.breadcrumbService.addExcludedParam(dmpId, true);
|
||||
this.breadcrumbService.addIdResolvedValue(dmpSectionId, this.language.instant("DESCRIPTION-EDITOR.TITLE-NEW"));
|
||||
}), takeUntil(this._destroyed), map(dmp => {
|
||||
|
||||
const description: Description = {};
|
||||
description.dmp = dmp;
|
||||
description.dmpDescriptionTemplate = {
|
||||
|
@ -180,7 +179,12 @@ export class DescriptionEditorResolver extends BaseEditorResolver {
|
|||
}));
|
||||
} else if (copyDmpId != null && id != null && dmpSectionId != null) {
|
||||
return this.dmpService.getSingle(Guid.parse(copyDmpId), DescriptionEditorResolver.dmpLookupFields()).pipe(tap(x => this.breadcrumbService.addIdResolvedValue(x.id?.toString(), x.label)), takeUntil(this._destroyed), concatMap(dmp => {
|
||||
return this.descriptionService.getSingle(Guid.parse(id), DescriptionEditorResolver.cloneLookupFields()).pipe(tap(x => this.breadcrumbService.addIdResolvedValue(x.id?.toString(), x.label)), takeUntil(this._destroyed), map(description => {
|
||||
return this.descriptionService.getSingle(Guid.parse(id), DescriptionEditorResolver.cloneLookupFields())
|
||||
.pipe(tap(x => {
|
||||
this.breadcrumbService.addExcludedParam(copyDmpId, true)
|
||||
this.breadcrumbService.addExcludedParam(dmpSectionId, true)
|
||||
this.breadcrumbService.addIdResolvedValue(id, x.label)
|
||||
}), takeUntil(this._destroyed), map(description => {
|
||||
|
||||
description.id = null;
|
||||
description.hash = null;
|
||||
|
|
|
@ -65,7 +65,10 @@ const routes: Routes = [
|
|||
breadcrumbs: true,
|
||||
title: 'DESCRIPTION-EDITOR.TITLE-NEW',
|
||||
getFromTitleService: true,
|
||||
usePrefix: false
|
||||
usePrefix: false,
|
||||
...BreadcrumbService.generateRouteDataConfiguration({
|
||||
skipNavigation: true
|
||||
})
|
||||
}
|
||||
},
|
||||
];
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
<!-- <div class="card mt-0" [style.display]="isVisible ? 'block' : 'none'"> -->
|
||||
<!-- <a class="col-auto d-flex" (click)="closeCard()"><span class="ml-auto pt-3 material-icons clear-icon">clear</span></a> -->
|
||||
<div class="card-content info-text mb-0">
|
||||
<p>{{'DESCRIPTION-LISTING.TEXT-INFO' | translate}} <u class="pointer" [routerLink]="['/explore-descriptions']">{{'DESCRIPTION-LISTING.LINK-PUBLIC-DATASETS' | translate}}</u> {{'DESCRIPTION-LISTING.TEXT-INFO-REST' | translate}}</p>
|
||||
<p>{{'DESCRIPTION-LISTING.TEXT-INFO' | translate}} <u class="pointer" [routerLink]="routerUtils.generateUrl(['/explore-descriptions'])">{{'DESCRIPTION-LISTING.LINK-PUBLIC-DATASETS' | translate}}</u> {{'DESCRIPTION-LISTING.TEXT-INFO-REST' | translate}}</p>
|
||||
<p class="mt-4 pt-2">{{'DESCRIPTION-LISTING.TEXT-INFO-PAR' | translate}}
|
||||
<div class="d-flex">
|
||||
<button mat-raised-button class="add-description align-self-center yellow-btn" (click)="addNewDescription()">
|
||||
|
|
|
@ -34,6 +34,7 @@ import { TranslateService } from '@ngx-translate/core';
|
|||
import { debounceTime, takeUntil } from 'rxjs/operators';
|
||||
import { nameof } from 'ts-simple-nameof';
|
||||
import { StartNewDescriptionDialogComponent } from '../start-new-description-dialog/start-new-description-dialog.component';
|
||||
import { RouterUtilsService } from '@app/core/services/router/router-utils.service';
|
||||
|
||||
@Component({
|
||||
selector: 'app-description-listing-component',
|
||||
|
@ -87,6 +88,7 @@ export class DescriptionListingComponent extends BaseComponent implements OnInit
|
|||
}
|
||||
|
||||
constructor(
|
||||
public routerUtils: RouterUtilsService,
|
||||
private descriptionService: DescriptionService,
|
||||
private router: Router,
|
||||
private route: ActivatedRoute,
|
||||
|
|
|
@ -2,8 +2,8 @@
|
|||
<a [routerLink]="getItemLink()" class="pointer">
|
||||
<div class="d-flex flex-direction-row">
|
||||
<div class="col-auto description-label">{{'DESCRIPTION-LISTING.DESCRIPTION' | translate}}</div>
|
||||
<div *ngIf="!isPublic" class="col-auto ml-auto edited-date">{{'DESCRIPTION-LISTING.STATES.EDITED' | translate}}: {{description.updatedAt | dateTimeCultureFormatter: "d MMMM y"}}</div>
|
||||
<div *ngIf="isPublic" class="col-auto ml-auto edited-date">{{'DESCRIPTION-LISTING.STATES.PUBLISHED' | translate}}: {{description.finalizedAt | dateTimeCultureFormatter: "d MMMM y"}}</div>
|
||||
<div *ngIf="!isPublic" class="col-auto ml-auto edited-date">{{'DESCRIPTION-LISTING.STATES.EDITED' | translate}}: {{description.updatedAt | dateTimeFormatter: "d MMMM y"}}</div>
|
||||
<div *ngIf="isPublic" class="col-auto ml-auto edited-date">{{'DESCRIPTION-LISTING.STATES.PUBLISHED' | translate}}: {{description.finalizedAt | dateTimeFormatter: "d MMMM y"}}</div>
|
||||
</div>
|
||||
<div *ngIf="description.status === descriptionStatusEnum.Finalized" class="col-auto description-title">{{description.label}}</div>
|
||||
<div *ngIf="description.status === descriptionStatusEnum.Draft" class="col-auto description-title-draft">{{description.label}}</div>
|
||||
|
|
|
@ -28,6 +28,7 @@ import { AppPermission } from '@app/core/common/enum/permission.enum';
|
|||
import { FileTransformerEntityType } from '@app/core/common/enum/file-transformer-entity-type';
|
||||
import { AnalyticsService } from '@app/core/services/matomo/analytics-service';
|
||||
import { HttpErrorHandlingService } from '@common/modules/errors/error-handling/http-error-handling.service';
|
||||
import { RouterUtilsService } from '@app/core/services/router/router-utils.service';
|
||||
|
||||
@Component({
|
||||
selector: 'app-description-listing-item-component',
|
||||
|
@ -53,6 +54,7 @@ export class DescriptionListingItemComponent extends BaseComponent implements On
|
|||
|
||||
|
||||
constructor(
|
||||
public routerUtils: RouterUtilsService,
|
||||
private router: Router,
|
||||
public enumUtils: EnumUtils,
|
||||
private descriptionService: DescriptionService,
|
||||
|
@ -116,9 +118,8 @@ export class DescriptionListingItemComponent extends BaseComponent implements On
|
|||
return this.authService.currentAccountIsAuthenticated();
|
||||
}
|
||||
|
||||
getItemLink(): string[] {
|
||||
// return this.isPublic ? [`/descriptions/publicEdit/${this.description.id}`] : [`/descriptions/edit/${this.description.id}`];
|
||||
return this.isPublic ? ['/explore-descriptions/overview/public/' + this.description.id] : ['/descriptions/overview/' + this.description.id];
|
||||
getItemLink(): string {
|
||||
return this.isPublic ? this.routerUtils.generateUrl(['/explore-descriptions/overview/public/', this.description.id.toString()]) : this.routerUtils.generateUrl(['/descriptions/overview/', this.description.id.toString()]);
|
||||
}
|
||||
|
||||
getDmpLink(): string[] {
|
||||
|
|
|
@ -34,7 +34,7 @@
|
|||
</div>
|
||||
<div *ngIf="isLocked" class="col-auto"><span>.</span></div>
|
||||
<div class="col-auto d-flex mr-2">{{'DESCRIPTION-OVERVIEW.EDITED' | translate}} :
|
||||
{{description.updatedAt | dateTimeCultureFormatter: "d MMMM y"}}
|
||||
{{description.updatedAt | dateTimeFormatter: "d MMMM y"}}
|
||||
</div>
|
||||
<div *ngIf="description.status === descriptionStatusEnum.Finalized" class="col-auto d-flex">
|
||||
<div class="d-flex flex-row uppercase">
|
||||
|
|
|
@ -165,6 +165,7 @@ export class DescriptionOverviewComponent extends BaseComponent implements OnIni
|
|||
this.descriptionService.getPublicSingle(publicId, this.lookupFields())
|
||||
.pipe(takeUntil(this._destroyed))
|
||||
.subscribe(data => {
|
||||
this.breadcrumbService.addExcludedParam('public', true);
|
||||
this.breadcrumbService.addIdResolvedValue(data.id.toString(), data.label);
|
||||
|
||||
this.description = data;
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
import { DatePipe } from '@angular/common';
|
||||
import { Component, Inject } from '@angular/core';
|
||||
import { UntypedFormGroup } from '@angular/forms';
|
||||
import { MAT_DIALOG_DATA, MatDialog, MatDialogRef } from '@angular/material/dialog';
|
||||
import { DmpStatus } from '@app/core/common/enum/dmp-status';
|
||||
import { IsActive } from '@app/core/common/enum/is-active.enum';
|
||||
import { DescriptionTemplatesInSection, DmpBlueprint, DmpBlueprintDefinition, DmpBlueprintDefinitionSection } from '@app/core/model/dmp-blueprint/dmp-blueprint';
|
||||
import { DmpBlueprintDefinitionSection } from '@app/core/model/dmp-blueprint/dmp-blueprint';
|
||||
import { Dmp } from '@app/core/model/dmp/dmp';
|
||||
import { DateTimeFormatPipe } from '@app/core/pipes/date-time-format.pipe';
|
||||
import { DmpDescriptionTemplateLookup } from '@app/core/query/dmp-description-template.lookup';
|
||||
import { DmpLookup } from '@app/core/query/dmp.lookup';
|
||||
import { DmpService } from '@app/core/services/dmp/dmp.service';
|
||||
|
@ -33,7 +33,7 @@ export class StartNewDescriptionDialogComponent extends BaseComponent {
|
|||
filterFn: (searchQuery: string, data?: any) => this.dmpService.query(this.buildAutocompleteLookup(searchQuery)).pipe(map(x => x.items)),
|
||||
getSelectedItem: (selectedItem: any) => this.dmpService.query(this.buildAutocompleteLookup(null, null, [selectedItem])).pipe(map(x => x.items[0])),
|
||||
displayFn: (item: Dmp) => item.label,
|
||||
subtitleFn: (item: Dmp) => `${this.language.instant('DASHBOARD.ADD-NEW-DATASET.OPTIONS.CREATED-AT')} ${this.datePipe.transform(item.createdAt ,'dd/MM/yyyy')}`,
|
||||
subtitleFn: (item: Dmp) => `${this.language.instant('DASHBOARD.ADD-NEW-DATASET.OPTIONS.CREATED-AT')} ${this.dateTimeFormatPipe.transform(item.createdAt, 'dd/MM/yyyy')}`,
|
||||
titleFn: (item: Dmp) => item.label,
|
||||
valueAssign: (item: Dmp) => item.id,
|
||||
};
|
||||
|
@ -65,7 +65,7 @@ export class StartNewDescriptionDialogComponent extends BaseComponent {
|
|||
private language: TranslateService,
|
||||
private dmpService: DmpService,
|
||||
private filterService: FilterService,
|
||||
private datePipe: DatePipe
|
||||
private dateTimeFormatPipe: DateTimeFormatPipe
|
||||
) {
|
||||
super();
|
||||
this.formGroup = data.formGroup;
|
||||
|
|
|
@ -115,7 +115,7 @@
|
|||
</ol>
|
||||
<ul *ngIf="item.id && section.hasTemplates && canEditSection(section.id) && !formGroup.disabled" class="add-description-option">
|
||||
<li>
|
||||
<a class="add-description-action" [ngClass]="{'drag-handle-disabled': !hasDescriptionTemplates(section) || !hasValidMultiplicity(section)}" [routerLink]="hasDescriptionTemplates(section) && hasValidMultiplicity(section) ? ['/descriptions/edit/' + item.id + '/' + section.id] : null">
|
||||
<a class="add-description-action" [ngClass]="{'drag-handle-disabled': !hasDescriptionTemplates(section) || !hasValidMultiplicity(section)}" [routerLink]="hasDescriptionTemplates(section) && hasValidMultiplicity(section) ? this.routerUtils.generateUrl(['/descriptions/edit/', item.id, '/', section.id]) : null">
|
||||
<ng-container *ngIf="!hasDescriptionTemplates(section)" >
|
||||
<mat-icon [matTooltipDisabled]="hasDescriptionTemplates(section)" [matTooltip]="'DMP-EDITOR.DESCRIPTION-TEMPLATES.EMPTY' | translate">add</mat-icon>{{'DMP-EDITOR.ACTIONS.ADD-DESCRIPTION-IN-SECTION' | translate}}
|
||||
</ng-container>
|
||||
|
@ -234,12 +234,12 @@
|
|||
</div>
|
||||
</div>
|
||||
<div *ngIf="canSave || isNew" class="col-12 col-xl-auto">
|
||||
<button [disabled]="!this.canSave" mat-icon-button class="action-list-icon" matTooltip="{{'DMP-EDITOR.ACTIONS.SEARCH-CONTACT' | translate}}" (click)="searchContact(contactIndex, field)" [disabled]="formGroup.disabled">
|
||||
<button mat-icon-button class="action-list-icon" matTooltip="{{'DMP-EDITOR.ACTIONS.SEARCH-CONTACT' | translate}}" (click)="searchContact(contactIndex, field)" [disabled]="formGroup.disabled || !this.canSave">
|
||||
<mat-icon>search</mat-icon>
|
||||
</button>
|
||||
</div>
|
||||
<div *ngIf="canSave || isNew" class="col-12 col-xl-auto">
|
||||
<button [disabled]="!this.canSave" mat-icon-button class="action-list-icon" matTooltip="{{'DMP-EDITOR.ACTIONS.REMOVE-CONTACT' | translate}}" (click)="removeContact(contactIndex)" [disabled]="formGroup.disabled">
|
||||
<button mat-icon-button class="action-list-icon" matTooltip="{{'DMP-EDITOR.ACTIONS.REMOVE-CONTACT' | translate}}" (click)="removeContact(contactIndex)" [disabled]="formGroup.disabled || !this.canSave">
|
||||
<mat-icon>delete</mat-icon>
|
||||
</button>
|
||||
</div>
|
||||
|
@ -249,7 +249,7 @@
|
|||
</div>
|
||||
<div class="row">
|
||||
<div class="col">
|
||||
<button mat-icon-button (click)="addContact()" [disabled]="isFinalized || (!this.canSave && !isNew)">
|
||||
<button mat-icon-button (click)="addContact()" [disabled]="formGroup.disabled || isFinalized || (!this.canSave && !isNew)">
|
||||
<mat-icon>add</mat-icon>
|
||||
</button>
|
||||
</div>
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
import { CdkDragDrop, moveItemInArray } from '@angular/cdk/drag-drop';
|
||||
import { DatePipe } from '@angular/common';
|
||||
import { Component, OnInit } from '@angular/core';
|
||||
import { FormArray, UntypedFormGroup } from '@angular/forms';
|
||||
import { MatDialog } from '@angular/material/dialog';
|
||||
import { Title } from '@angular/platform-browser';
|
||||
import { ActivatedRoute, Router } from '@angular/router';
|
||||
import { DescriptionStatus } from '@app/core/common/enum/description-status';
|
||||
import { DmpAccessType } from '@app/core/common/enum/dmp-access-type';
|
||||
|
@ -30,6 +30,7 @@ import { DmpBlueprintService } from '@app/core/services/dmp/dmp-blueprint.servic
|
|||
import { DmpService } from '@app/core/services/dmp/dmp.service';
|
||||
import { LockService } from '@app/core/services/lock/lock.service';
|
||||
import { LoggingService } from '@app/core/services/logging/logging-service';
|
||||
import { AnalyticsService } from '@app/core/services/matomo/analytics-service';
|
||||
import { SnackBarNotificationLevel, UiNotificationService } from '@app/core/services/notification/ui-notification-service';
|
||||
import { UserService } from '@app/core/services/user/user.service';
|
||||
import { EnumUtils } from '@app/core/services/utilities/enum-utils.service';
|
||||
|
@ -38,6 +39,7 @@ import { MultipleAutoCompleteConfiguration } from '@app/library/auto-complete/mu
|
|||
import { MultipleAutoCompleteCanRemoveItem } from '@app/library/auto-complete/multiple/multiple-auto-complete.component';
|
||||
import { SingleAutoCompleteConfiguration } from '@app/library/auto-complete/single/single-auto-complete-configuration';
|
||||
import { DescriptionTemplatePreviewDialogComponent } from '@app/ui/admin/description-template/description-template-preview/description-template-preview-dialog.component';
|
||||
import { BreadcrumbService } from '@app/ui/misc/breadcrumb/breadcrumb.service';
|
||||
import { BaseEditor } from '@common/base/base-editor';
|
||||
import { FormService } from '@common/forms/form-service';
|
||||
import { ConfirmationDialogComponent } from '@common/modules/confirmation-dialog/confirmation-dialog.component';
|
||||
|
@ -46,13 +48,11 @@ import { FilterService } from '@common/modules/text-filter/filter-service';
|
|||
import { Guid } from '@common/types/guid';
|
||||
import { TranslateService } from '@ngx-translate/core';
|
||||
import { map, takeUntil } from 'rxjs/operators';
|
||||
import { DmpContactPrefillDialogComponent } from '../dmp-contact-prefill-dialog/dmp-contact-prefill-dialog.component';
|
||||
import { DmpEditorModel, DmpFieldIndicator } from './dmp-editor.model';
|
||||
import { DmpEditorResolver } from './dmp-editor.resolver';
|
||||
import { DmpEditorService } from './dmp-editor.service';
|
||||
import { Title } from '@angular/platform-browser';
|
||||
import { AnalyticsService } from '@app/core/services/matomo/analytics-service';
|
||||
import { DmpContactPrefillDialogComponent } from '../dmp-contact-prefill-dialog/dmp-contact-prefill-dialog.component';
|
||||
import { BreadcrumbService } from '@app/ui/misc/breadcrumb/breadcrumb.service';
|
||||
import { RouterUtilsService } from '@app/core/services/router/router-utils.service';
|
||||
|
||||
@Component({
|
||||
selector: 'app-dmp-editor',
|
||||
|
@ -151,7 +151,6 @@ export class DmpEditorComponent extends BaseEditor<DmpEditorModel, Dmp> implemen
|
|||
protected uiNotificationService: UiNotificationService,
|
||||
protected httpErrorHandlingService: HttpErrorHandlingService,
|
||||
protected filterService: FilterService,
|
||||
protected datePipe: DatePipe,
|
||||
protected route: ActivatedRoute,
|
||||
protected queryParamsService: QueryParamsService,
|
||||
protected lockService: LockService,
|
||||
|
@ -163,6 +162,7 @@ export class DmpEditorComponent extends BaseEditor<DmpEditorModel, Dmp> implemen
|
|||
public dmpBlueprintService: DmpBlueprintService,
|
||||
// public visibilityRulesService: VisibilityRulesService,
|
||||
private languageInfoService: LanguageInfoService,
|
||||
public routerUtils: RouterUtilsService,
|
||||
public enumUtils: EnumUtils,
|
||||
public descriptionTemplateService: DescriptionTemplateService,
|
||||
public userService: UserService,
|
||||
|
@ -171,13 +171,13 @@ export class DmpEditorComponent extends BaseEditor<DmpEditorModel, Dmp> implemen
|
|||
private analyticsService: AnalyticsService,
|
||||
private breadcrumbService: BreadcrumbService
|
||||
) {
|
||||
const descriptionLabel:string = route.snapshot.data['entity']?.label;
|
||||
const descriptionLabel: string = route.snapshot.data['entity']?.label;
|
||||
if (descriptionLabel) {
|
||||
titleService.setTitle(descriptionLabel);
|
||||
} else {
|
||||
titleService.setTitle('DMP-EDITOR.TITLE-EDIT');
|
||||
}
|
||||
super(dialog, language, formService, router, uiNotificationService, httpErrorHandlingService, filterService, datePipe, route, queryParamsService, lockService, authService, configurationService);
|
||||
super(dialog, language, formService, router, uiNotificationService, httpErrorHandlingService, filterService, route, queryParamsService, lockService, authService, configurationService);
|
||||
}
|
||||
|
||||
ngOnInit(): void {
|
||||
|
@ -200,9 +200,9 @@ export class DmpEditorComponent extends BaseEditor<DmpEditorModel, Dmp> implemen
|
|||
prepareForm(data: Dmp) {
|
||||
try {
|
||||
if (data?.blueprint?.definition?.sections != null) {
|
||||
data.blueprint.definition.sections = data.blueprint.definition.sections.sort((s1,s2) => s1.ordinal-s2.ordinal);
|
||||
for (let i=0; i<data.blueprint.definition.sections.length; i++){
|
||||
data.blueprint.definition.sections[i].fields = data.blueprint.definition.sections[i]?.fields?.sort((f1,f2) => f1.ordinal-f2.ordinal);
|
||||
data.blueprint.definition.sections = data.blueprint.definition.sections.sort((s1, s2) => s1.ordinal - s2.ordinal);
|
||||
for (let i = 0; i < data.blueprint.definition.sections.length; i++) {
|
||||
data.blueprint.definition.sections[i].fields = data.blueprint.definition.sections[i]?.fields?.sort((f1, f2) => f1.ordinal - f2.ordinal);
|
||||
}
|
||||
}
|
||||
this.editorModel = data ? new DmpEditorModel().fromModel(data) : new DmpEditorModel();
|
||||
|
@ -235,7 +235,7 @@ export class DmpEditorComponent extends BaseEditor<DmpEditorModel, Dmp> implemen
|
|||
.pipe(takeUntil(this._destroyed)).subscribe(
|
||||
complete => {
|
||||
this.permissionPerSection = complete,
|
||||
this.buildForm();
|
||||
this.buildForm();
|
||||
},
|
||||
error => this.onCallbackError(error)
|
||||
);
|
||||
|
@ -278,7 +278,7 @@ export class DmpEditorComponent extends BaseEditor<DmpEditorModel, Dmp> implemen
|
|||
this.getItem(this.editorModel.id, (data: Dmp) => {
|
||||
this.breadcrumbService.addIdResolvedValue(data.id.toString(), data.label);
|
||||
this.prepareForm(data)
|
||||
if (this.isNew === false && this.step===0) this.nextStep();
|
||||
if (this.isNew === false && this.step === 0) this.nextStep();
|
||||
});
|
||||
}
|
||||
|
||||
|
@ -301,7 +301,7 @@ export class DmpEditorComponent extends BaseEditor<DmpEditorModel, Dmp> implemen
|
|||
//Transform descriptionTemplates
|
||||
formData.descriptionTemplates = [];
|
||||
for (const sectionId in (this.formGroup.get('descriptionTemplates') as UntypedFormGroup).controls) {
|
||||
if (this.formGroup.get('descriptionTemplates').get(sectionId).value != undefined){
|
||||
if (this.formGroup.get('descriptionTemplates').get(sectionId).value != undefined) {
|
||||
formData.descriptionTemplates.push(
|
||||
...(this.formGroup.get('descriptionTemplates').get(sectionId).value as Guid[]).map(x => { return { sectionId: Guid.parse(sectionId), descriptionTemplateGroupId: x } })
|
||||
);
|
||||
|
@ -353,7 +353,7 @@ export class DmpEditorComponent extends BaseEditor<DmpEditorModel, Dmp> implemen
|
|||
dialogRef.afterClosed().pipe(takeUntil(this._destroyed)).subscribe(result => {
|
||||
if (result) {
|
||||
setTimeout(x => {
|
||||
if (this.isNew) this.step = 0;
|
||||
if (this.isNew) this.step = 0;
|
||||
else this.step = this.step > 0 ? this.step - 1 : 0;
|
||||
this.ngOnInit();
|
||||
});
|
||||
|
@ -446,27 +446,27 @@ export class DmpEditorComponent extends BaseEditor<DmpEditorModel, Dmp> implemen
|
|||
//
|
||||
selectBlueprint() {
|
||||
this.dmpBlueprintService.getSingle(this.formGroup.get('blueprint').value, DmpEditorResolver.blueprintLookupFields()).pipe(takeUntil(this._destroyed))
|
||||
.subscribe(data => {
|
||||
this.selectedBlueprint = data;
|
||||
this.buildFormAfterBlueprintSelection();
|
||||
this.nextStep();
|
||||
},
|
||||
error => this.httpErrorHandlingService.handleBackedRequestError(error));
|
||||
.subscribe(data => {
|
||||
this.selectedBlueprint = data;
|
||||
this.buildFormAfterBlueprintSelection();
|
||||
this.nextStep();
|
||||
},
|
||||
error => this.httpErrorHandlingService.handleBackedRequestError(error));
|
||||
}
|
||||
|
||||
selectDefaultBlueprint(): void {
|
||||
this.dmpBlueprintService.getSingle(this.configurationService.defaultBlueprintId, DmpEditorResolver.blueprintLookupFields()).pipe(takeUntil(this._destroyed))
|
||||
.subscribe(data => {
|
||||
this.selectedBlueprint = data;
|
||||
this.formGroup.get('blueprint').setValue(this.selectedBlueprint.id);
|
||||
.subscribe(data => {
|
||||
this.selectedBlueprint = data;
|
||||
this.formGroup.get('blueprint').setValue(this.selectedBlueprint.id);
|
||||
|
||||
const goToNextStep: boolean = this.formGroup.get('label').valid && this.formGroup.get('description').valid;
|
||||
if (goToNextStep) {
|
||||
this.buildFormAfterBlueprintSelection();
|
||||
this.nextStep();
|
||||
}
|
||||
},
|
||||
error => this.httpErrorHandlingService.handleBackedRequestError(error));
|
||||
const goToNextStep: boolean = this.formGroup.get('label').valid && this.formGroup.get('description').valid;
|
||||
if (goToNextStep) {
|
||||
this.buildFormAfterBlueprintSelection();
|
||||
this.nextStep();
|
||||
}
|
||||
},
|
||||
error => this.httpErrorHandlingService.handleBackedRequestError(error));
|
||||
}
|
||||
|
||||
private buildFormAfterBlueprintSelection() {
|
||||
|
@ -532,13 +532,13 @@ export class DmpEditorComponent extends BaseEditor<DmpEditorModel, Dmp> implemen
|
|||
this.formGroup.get('properties').get('contacts').markAsDirty();
|
||||
}
|
||||
|
||||
searchContact(contactIndex: number, field: FieldInSection): void{
|
||||
searchContact(contactIndex: number, field: FieldInSection): void {
|
||||
const dialogRef = this.dialog.open(DmpContactPrefillDialogComponent, {
|
||||
maxWidth: '700px',
|
||||
maxHeight: '80vh',
|
||||
data: {
|
||||
contactFormGroup: (this.formGroup.get('properties').get('contacts') as FormArray).at(contactIndex),
|
||||
label: field.label
|
||||
label: field.label
|
||||
}
|
||||
});
|
||||
dialogRef.afterClosed().pipe(takeUntil(this._destroyed)).subscribe((result: Dmp) => {
|
||||
|
|
|
@ -125,7 +125,7 @@ export class DmpEditorResolver extends BaseEditorResolver {
|
|||
];
|
||||
const id = route.paramMap.get('id');
|
||||
if (id != null) {
|
||||
return this.descriptionService.getSingle(Guid.parse(id), fields).pipe(tap(x => this.breadcrumbService.addIdResolvedValue(x.id?.toString(), x.label)), takeUntil(this._destroyed));
|
||||
return this.descriptionService.getSingle(Guid.parse(id), fields).pipe(tap(x => this.breadcrumbService.addIdResolvedValue(id, x.label)), takeUntil(this._destroyed));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
<div class="dmp-card">
|
||||
<a [routerLink]="isPublic ? ['/explore-plans/overview/public/' + dmp.id] : ['/plans/overview/' + dmp.id]" class="pointer">
|
||||
<a [routerLink]="isPublic ? this.routerUtils.generateUrl(['/explore-plans/overview/public/', dmp.id]) : this.routerUtils.generateUrl(['/plans/overview/', dmp.id])" class="pointer">
|
||||
<div class="d-flex flex-direction-row">
|
||||
<div class="col-auto dmp-label">{{ 'DMP-LISTING.DMP' | translate }}</div>
|
||||
<div *ngIf="!isPublic" class="col-auto ml-auto edited-date">{{ 'DMP-LISTING.EDITED' | translate }}: {{ dmp.updatedAt | dateTimeCultureFormatter: "d MMMM y" }}</div>
|
||||
<div *ngIf="isPublic" class="col-auto ml-auto edited-date">{{ 'DMP-LISTING.PUBLISHED' | translate }}: {{ dmp.finalizedAt | dateTimeCultureFormatter: "d MMMM y" }}</div>
|
||||
<div *ngIf="!isPublic" class="col-auto ml-auto edited-date">{{ 'DMP-LISTING.EDITED' | translate }}: {{ dmp.updatedAt | dateTimeFormatter: "d MMMM y" }}</div>
|
||||
<div *ngIf="isPublic" class="col-auto ml-auto edited-date">{{ 'DMP-LISTING.PUBLISHED' | translate }}: {{ dmp.finalizedAt | dateTimeFormatter: "d MMMM y" }}</div>
|
||||
</div>
|
||||
<div class="col-auto" [ngClass]="{'dmp-title': !isDraft, 'dmp-title-draft': isDraft}">{{dmp.label}}</div>
|
||||
<div class="dmp-subtitle">
|
||||
|
@ -25,11 +25,11 @@
|
|||
<div class="col-auto dmp-dataset-descriptions-name" *ngIf="last || i == 2">{{description.label}}</div>
|
||||
</div>
|
||||
</div>
|
||||
<a class="d-flex justify-content-center pb-3 show-more" *ngIf="dmp.descriptions?.length > 3" [routerLink]="isPublic ? ['/explore-plans/overview/public/' + dmp.id] : ['/plans/overview/' + dmp.id]"><u>{{'GENERAL.ACTIONS.SHOW-MORE' | translate}}</u></a>
|
||||
<a class="d-flex justify-content-center pb-3 show-more" *ngIf="dmp.descriptions?.length > 3" [routerLink]="isPublic ? this.routerUtils.generateUrl(['/explore-plans/overview/public/', dmp.id]) : this.routerUtils.generateUrl(['/plans/overview/', dmp.id])"><u>{{'GENERAL.ACTIONS.SHOW-MORE' | translate}}</u></a>
|
||||
</a>
|
||||
<div class="dmp-card-actions">
|
||||
<a class="col-auto border-right pointer" *ngIf="canExportDmp(dmp) && fileTransformerService.availableFormatsFor(fileTransformerEntityTypeEnum.Dmp).length > 0" [matMenuTriggerFor]="exportMenu"><span class="material-icons icon-align pr-2">open_in_new</span>{{'DMP-LISTING.ACTIONS.EXPORT' | translate}}</a>
|
||||
<a class="col-auto border-right pointer" *ngIf="isDraftDmp(dmp) && canEditDmp(dmp)" [routerLink]="['/plans/edit/' + dmp.id]" target="_blank"><span class="material-icons icon-align">add</span>{{'DMP-LISTING.ACTIONS.ADD-DESCRIPTION-SHORT' | translate}}</a>
|
||||
<a class="col-auto border-right pointer" *ngIf="isDraftDmp(dmp) && canEditDmp(dmp)" [routerLink]="this.routerUtils.generateUrl(['/plans/edit/', dmp.id])" target="_blank"><span class="material-icons icon-align">add</span>{{'DMP-LISTING.ACTIONS.ADD-DESCRIPTION-SHORT' | translate}}</a>
|
||||
<a class="col-auto border-right pointer" *ngIf="canInviteDmpUsers(dmp)" (click)="inviteToDmp()"><span class="material-icons icon-align pr-2">group_add</span>{{'DMP-LISTING.ACTIONS.INVITE-SHORT' | translate}}</a>
|
||||
<a class="col-auto border-right pointer" *ngIf="canCloneDmp(dmp)" (click)="cloneClicked()"><span class="material-icons icon-align pr-2">filter_none</span>{{'DMP-LISTING.ACTIONS.CLONE' | translate}}</a>
|
||||
<a class="col-auto border-right pointer" *ngIf="!isAuthenticated()" (click)="viewVersions(dmp)"><span class="material-icons icon-align pr-2">library_books</span>{{'DMP-LISTING.ACTIONS.VIEW-VERSION' | translate}}</a>
|
||||
|
|
|
@ -30,6 +30,7 @@ import { DmpVersionStatus } from '@app/core/common/enum/dmp-version-status';
|
|||
import { DmpDeleteDialogComponent } from '../../dmp-delete-dialog/dmp-delete-dialog.component';
|
||||
import { AnalyticsService } from '@app/core/services/matomo/analytics-service';
|
||||
import { HttpErrorHandlingService } from '@common/modules/errors/error-handling/http-error-handling.service';
|
||||
import { RouterUtilsService } from '@app/core/services/router/router-utils.service';
|
||||
|
||||
@Component({
|
||||
selector: 'app-dmp-listing-item-component',
|
||||
|
@ -50,6 +51,7 @@ export class DmpListingItemComponent extends BaseComponent implements OnInit {
|
|||
fileTransformerEntityTypeEnum = FileTransformerEntityType;
|
||||
|
||||
constructor(
|
||||
public routerUtils: RouterUtilsService,
|
||||
private router: Router,
|
||||
private dialog: MatDialog,
|
||||
private authentication: AuthService,
|
||||
|
|
|
@ -41,7 +41,7 @@
|
|||
</mat-form-field>
|
||||
</div>
|
||||
<div class="col-auto d-flex">{{'DMP-OVERVIEW.EDITED' | translate}} :
|
||||
{{dmp.updatedAt | dateTimeCultureFormatter: "d MMMM y"}}
|
||||
{{dmp.updatedAt | dateTimeFormatter: "d MMMM y"}}
|
||||
</div>
|
||||
<div class="col-auto d-flex">
|
||||
<div *ngIf="dmp.status== dmpStatusEnum.Finalized" class="d-flex flex-row uppercase">
|
||||
|
@ -117,7 +117,7 @@
|
|||
<div class="row mb-4">
|
||||
<ng-container *ngFor="let description of dmp.descriptions">
|
||||
<div class="col-12 col-lg-7 mt-1">
|
||||
<a class="w-100 description" [routerLink]="isPublicView ? ['/descriptions/overview/public/' + description.id] : ['/descriptions/overview/' + description.id]" target="_blank">
|
||||
<a class="w-100 description" [routerLink]="isPublicView ? this.routerUtils.generateUrl(['/descriptions/overview/public/', description.id]) : this.routerUtils.generateUrl(['/descriptions/overview/' + description.id])" target="_blank">
|
||||
<button class="w-100" [ngClass]="{'dmp-btn': description.status === descriptionStatusEnum.Draft, 'dmp-finalized-btn': description.status === descriptionStatusEnum.Finalized}">
|
||||
<div matTooltip="{{ description.label }}" class="d-flex align-items-center justify-content-between">
|
||||
<div class="description-btn-label">{{ description.label }}</div>
|
||||
|
@ -131,12 +131,6 @@
|
|||
<span class="material-icons">horizontal_rule</span>
|
||||
</div>
|
||||
</div>
|
||||
<!-- <div class="row mt-2 add-description-txt" *ngIf="!isLocked">
|
||||
<a class="add-description-btn" *ngIf="canEditDmp()" [routerLink]="['/plans/edit/' + dmp.id]" target="_blank">
|
||||
<mat-icon>add</mat-icon>
|
||||
{{'DMP-OVERVIEW.ACTIONS.ADD-DESCRIPTION' | translate}}
|
||||
</a>
|
||||
</div> -->
|
||||
</div>
|
||||
<div class="col-12 col-lg-4">
|
||||
<ng-container *ngIf="!hasDoi(dmp)">
|
||||
|
|
|
@ -52,6 +52,7 @@ import { DmpEditorResolver } from '../dmp-editor-blueprint/dmp-editor.resolver';
|
|||
import { DmpFinalizeDialogComponent, DmpFinalizeDialogOutput } from '../dmp-finalize-dialog/dmp-finalize-dialog.component';
|
||||
import { DmpInvitationDialogComponent } from '../invitation/dialog/dmp-invitation-dialog.component';
|
||||
import { NewVersionDmpDialogComponent } from '../new-version-dialog/dmp-new-version-dialog.component';
|
||||
import { RouterUtilsService } from '@app/core/services/router/router-utils.service';
|
||||
|
||||
@Component({
|
||||
selector: 'app-dmp-overview',
|
||||
|
@ -87,6 +88,7 @@ export class DmpOverviewComponent extends BaseComponent implements OnInit {
|
|||
userName: string;
|
||||
|
||||
constructor(
|
||||
public routerUtils: RouterUtilsService,
|
||||
private route: ActivatedRoute,
|
||||
private router: Router,
|
||||
private dmpService: DmpService,
|
||||
|
@ -170,6 +172,7 @@ export class DmpOverviewComponent extends BaseComponent implements OnInit {
|
|||
this.dmpService.getPublicSingle(publicId, this.lookupFields())
|
||||
.pipe(takeUntil(this._destroyed))
|
||||
.subscribe(data => {
|
||||
this.breadcrumbService.addExcludedParam('public', true);
|
||||
this.breadcrumbService.addIdResolvedValue(data.id?.toString(), data.label);
|
||||
|
||||
this.dmp = data;
|
||||
|
|
|
@ -7,9 +7,11 @@ import { BehaviorSubject, Observable } from 'rxjs';
|
|||
export class BreadcrumbService { //todo maybe some memory management
|
||||
|
||||
private paramToStringDictionary: Record<string, string> = {};
|
||||
private excludedParamsDictionary: Record<string, boolean> = {};
|
||||
private pathOverrideMap = new Map<string, string>();
|
||||
|
||||
private resolvedValues$ = new BehaviorSubject<Record<string, string>>({ ...this.paramToStringDictionary })
|
||||
private excludedValues$ = new BehaviorSubject<Record<string, boolean>>({ ...this.excludedParamsDictionary })
|
||||
|
||||
|
||||
public addIdResolvedValue(param: string, value: string) {
|
||||
|
@ -21,14 +23,42 @@ export class BreadcrumbService { //todo maybe some memory management
|
|||
}
|
||||
|
||||
this.paramToStringDictionary[param] = value;
|
||||
// sync excludedParamsDictionary if needed
|
||||
if (this.excludedParamsDictionary[param])
|
||||
{
|
||||
delete this.excludedParamsDictionary[param];
|
||||
this.excludedValues$.next({ ...this.excludedParamsDictionary })
|
||||
}
|
||||
|
||||
this.resolvedValues$.next({ ...this.paramToStringDictionary })
|
||||
}
|
||||
|
||||
public addExcludedParam(param: string, value: boolean) {
|
||||
if (!param) {
|
||||
return;
|
||||
}
|
||||
if (this.excludedParamsDictionary[param] === value) { // value already in dictionary
|
||||
return;
|
||||
}
|
||||
|
||||
this.excludedParamsDictionary[param] = value;
|
||||
// sync paramToStringDictionary if needed
|
||||
if (this.paramToStringDictionary[param])
|
||||
{
|
||||
delete this.paramToStringDictionary[param];
|
||||
this.resolvedValues$.next({ ...this.paramToStringDictionary });
|
||||
}
|
||||
|
||||
this.excludedValues$.next({ ...this.excludedParamsDictionary })
|
||||
}
|
||||
|
||||
public resolvedValues(): Observable<Record<string, string>> {
|
||||
return this.resolvedValues$.asObservable();
|
||||
}
|
||||
|
||||
public excludedValues(): Observable<Record<string, boolean>> {
|
||||
return this.excludedValues$.asObservable();
|
||||
}
|
||||
|
||||
public addPathOverride(pathOverride: PathOverride): void {
|
||||
if (!pathOverride) {
|
||||
|
|
|
@ -1,33 +1,40 @@
|
|||
<nav class="list-inline list-unstyled">
|
||||
<li *ngFor="let item of breadCrumbs; let first = first; let index = index;let last = last" class="list-inline-item m-0">
|
||||
<div style="display: flex; justify-content: center; align-items:center" *ngIf="!item?.hideItem">
|
||||
<mat-icon [class.hidden]="first">chevron_right</mat-icon>
|
||||
|
||||
<a *ngIf="(!item?.skipNavigation && !last) else regularText" [routerLink]="computePath(index)" class=" text-black" disabled>
|
||||
<ng-container *ngIf="item.title !== HOME_SYMBOL else homeIcon">
|
||||
<span class="breadcrumb-item p-2">
|
||||
{{ item.title | translate:item.translateParams }}
|
||||
</span>
|
||||
</ng-container>
|
||||
</a>
|
||||
<ng-template #regularText>
|
||||
<ng-container *ngIf="item.title !== HOME_SYMBOL else homeIcon">
|
||||
<span class="p-2">
|
||||
<ng-container *ngFor="let titleItem of titleReferences; let i=index;">
|
||||
<span class="mr-1">
|
||||
{{ titleItem | translate:item.translateParams }}
|
||||
<div class="container-fluid">
|
||||
<div class="row align-items-center">
|
||||
<ng-container *ngFor="let item of breadCrumbs; let index = index; first as isFirst; last as isLast">
|
||||
<ng-container *ngIf="!item?.hideItem">
|
||||
<div class="col-auto mt-1 pl-0 pr-0" *ngIf="!isFirst">
|
||||
<mat-icon>chevron_right</mat-icon>
|
||||
</div>
|
||||
|
||||
<div class="col-auto p-0" [ngClass]="{'mb-1': item.title == HOME_SYMBOL}">
|
||||
<a *ngIf="(!item?.skipNavigation && !isLast) else skipNavigation" [routerLink]="computePath(index)" class=" text-black" disabled>
|
||||
<ng-container *ngIf="item.title !== HOME_SYMBOL else homeIcon">
|
||||
<span class="breadcrumb-item p-2">
|
||||
{{ item.title | translate:item.translateParams }}
|
||||
</span>
|
||||
<ng-container *ngIf="i != titleReferences.length-1">
|
||||
<span style="font-weight: 500;font-size: 1.3rem;" class="mr-1">/</span>
|
||||
</ng-container>
|
||||
</a>
|
||||
<ng-template #skipNavigation>
|
||||
<ng-container *ngIf="item?.skipNavigation && !isLast else last">
|
||||
<ng-container *ngIf="item.title !== HOME_SYMBOL else homeIcon">
|
||||
<span class="p-2">
|
||||
{{ item.title | translate:item.translateParams }}
|
||||
</span>
|
||||
</ng-container>
|
||||
</ng-container>
|
||||
<!-- {{ item.title | translate:item.translateParams }} -->
|
||||
</span>
|
||||
</ng-container>
|
||||
</ng-template>
|
||||
</div>
|
||||
</li>
|
||||
</nav>
|
||||
</ng-template>
|
||||
<ng-template #last>
|
||||
<ng-container *ngIf="item.title !== HOME_SYMBOL else homeIcon">
|
||||
<span class="pl-2 pt-2">
|
||||
{{ item.title | translate:item.translateParams }}
|
||||
</span>
|
||||
</ng-container>
|
||||
</ng-template>
|
||||
</div>
|
||||
</ng-container>
|
||||
</ng-container>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<ng-template #homeIcon>
|
||||
<mat-icon style="width: auto; height: auto; font-size: 1.2rem; color: #949597" class="text-muted breadcrumb-item p-2">home</mat-icon>
|
||||
|
|
|
@ -17,9 +17,9 @@ import { BreadCrumbRouteData, BreadcrumbService } from "./breadcrumb.service";
|
|||
export class NavigationBreadcrumbComponent extends BaseComponent {
|
||||
|
||||
breadCrumbs: BreadCrumbItem[] = [];
|
||||
titleReferences: string[] = [];
|
||||
|
||||
paramToStringDictionary: Record<string, string> = {};
|
||||
excludedParamsDictionary: Record<string, boolean> = {};
|
||||
|
||||
|
||||
protected readonly HOME_SYMBOL = Symbol('home')
|
||||
|
@ -31,6 +31,9 @@ export class NavigationBreadcrumbComponent extends BaseComponent {
|
|||
this.breadcrumbService.resolvedValues().pipe(
|
||||
tap(x => this.paramToStringDictionary = x),
|
||||
),
|
||||
this.breadcrumbService.excludedValues().pipe(
|
||||
tap(x => this.excludedParamsDictionary = x),
|
||||
),
|
||||
router.events.pipe(
|
||||
filter(event => event instanceof NavigationEnd),
|
||||
map((x: NavigationEnd) => x.url?.split('?')?.[0]),
|
||||
|
@ -42,14 +45,13 @@ export class NavigationBreadcrumbComponent extends BaseComponent {
|
|||
.pipe(
|
||||
map(() => {
|
||||
const routeSnapshot = this.router.routerState.snapshot.root;
|
||||
const breadcrumbs = this._buildBreadCrumbs(routeSnapshot).filter(x => !!x.title && !x.hideItem);
|
||||
const breadcrumbs = this._buildBreadCrumbs(routeSnapshot).filter(x => !!x.title);
|
||||
return breadcrumbs;
|
||||
}),
|
||||
takeUntil(this._destroyed),
|
||||
)
|
||||
.subscribe(breadCrumbs => {
|
||||
this.breadCrumbs = breadCrumbs;
|
||||
this.titleReferences = this.getTitleReferences();
|
||||
this.cdr.markForCheck();
|
||||
});
|
||||
}
|
||||
|
@ -86,29 +88,35 @@ export class NavigationBreadcrumbComponent extends BaseComponent {
|
|||
|
||||
let path = activatedRoute.routeConfig?.path ?? '/'; // undefined path is the root path
|
||||
|
||||
|
||||
const breadcrumbData: BreadCrumbRouteData | undefined = activatedRoute.routeConfig?.data?.[BreadcrumbService.ROUTE_DATA_KEY];
|
||||
|
||||
const [title, translateParams] = this._composeBreadCrumbTitle({
|
||||
path,
|
||||
breadcrumbData,
|
||||
pathParams: activatedRoute.params
|
||||
});
|
||||
const pathItems = path == '/' ? ['/'] : path.split('/');
|
||||
const currentItems: BreadCrumbItem[] = [];
|
||||
|
||||
path = this._enrichPathParamNames(path, activatedRoute.params); // somepath/:id => somepath/1239dfg123-123-123...etc
|
||||
for (let pathItem of pathItems) {
|
||||
|
||||
const skipNavigation = activatedRoute.routeConfig?.data?.breadcrumb?.skipNavigation ?? false;
|
||||
const hideItem = breadcrumbData?.hideNavigationItem ?? false
|
||||
const [title, translateParams] = this._composeBreadCrumbTitle({
|
||||
path: pathItem,
|
||||
breadcrumbData,
|
||||
pathParams: activatedRoute.params
|
||||
});
|
||||
|
||||
let pathName = this._enrichPathParamNames(pathItem, activatedRoute.params); // somepath/:id => somepath/1239dfg123-123-123...etc
|
||||
|
||||
const skipNavigation = activatedRoute.routeConfig?.data?.breadcrumb?.skipNavigation ?? false;
|
||||
const hideItem = (breadcrumbData?.hideNavigationItem || this.excludedParamsDictionary[pathName]) ?? false;
|
||||
|
||||
|
||||
const currentItem: BreadCrumbItem = {
|
||||
title,
|
||||
path,
|
||||
translateParams,
|
||||
skipNavigation,
|
||||
hideItem
|
||||
const currentItem: BreadCrumbItem = {
|
||||
title,
|
||||
path: pathName,
|
||||
translateParams,
|
||||
skipNavigation,
|
||||
hideItem
|
||||
}
|
||||
currentItems.push(currentItem);
|
||||
}
|
||||
|
||||
return [currentItem, ...this._buildBreadCrumbs(activatedRoute.firstChild)];
|
||||
return [...currentItems, ...this._buildBreadCrumbs(activatedRoute.firstChild)];
|
||||
}
|
||||
|
||||
|
||||
|
@ -144,14 +152,7 @@ export class NavigationBreadcrumbComponent extends BaseComponent {
|
|||
}
|
||||
|
||||
|
||||
// replace whole pathParams
|
||||
const paramText = Object.keys(pathParams)
|
||||
.map(key => pathParams[key])
|
||||
.join('/');
|
||||
|
||||
if (this.paramToStringDictionary[paramText]) {
|
||||
return [this.paramToStringDictionary[paramText], null];
|
||||
}
|
||||
|
||||
// replace path params segments
|
||||
const title = Object.keys(pathParams)
|
||||
|
@ -179,10 +180,6 @@ export class NavigationBreadcrumbComponent extends BaseComponent {
|
|||
|
||||
return path;
|
||||
}
|
||||
|
||||
getTitleReferences(): string[] {
|
||||
return this.breadCrumbs[this.breadCrumbs.length-1].title.split('/');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -4,12 +4,12 @@
|
|||
<div *ngIf="showItem(groupMenuItem);">
|
||||
<hr *ngIf="!firstGroup">
|
||||
<mat-list-item routerLinkActive="active" [isActiveMatchOptions]="{ paths: 'exact', queryParams: 'ignored' }" *ngFor="let groupMenuRoute of groupMenuItem.routes; let first = first" class="nav-item" [ngClass]="{'mt-4': first && firstGroup}">
|
||||
<a class="new-dmp nav-link nav-row" *ngIf="groupMenuRoute.path !== '/contact-support' && groupMenuRoute.path !== '/co-branding' && groupMenuRoute.path !== '/feedback' && groupMenuRoute.path !== '/descriptions'" [routerLink]="[groupMenuRoute.path]" [ngClass]="{'dmp-tour': groupMenuRoute.path == '/plans'}">
|
||||
<a class="new-dmp nav-link nav-row" *ngIf="groupMenuRoute.path !== '/contact-support' && groupMenuRoute.path !== '/co-branding' && groupMenuRoute.path !== '/feedback' && groupMenuRoute.path !== '/descriptions'" [routerLink]="[routerUtils.generateUrl(groupMenuRoute.path)]" [ngClass]="{'dmp-tour': groupMenuRoute.path == '/plans'}">
|
||||
<i class="material-symbols-outlined icon">{{ groupMenuRoute.icon }}</i>
|
||||
<i *ngIf="groupMenuRoute.path == '/plans'" class="material-symbols-outlined icon-mask">person</i>
|
||||
<span [ngClass]="{'pl-0': groupMenuRoute.path == '/plans'}" style="text-wrap: wrap;">{{groupMenuRoute.title | translate}}</span>
|
||||
</a>
|
||||
<a class="nav-link nav-row" *ngIf="groupMenuRoute.path === '/descriptions'" [routerLink]="[groupMenuRoute.path]">
|
||||
<a class="nav-link nav-row" *ngIf="groupMenuRoute.path === '/descriptions'" [routerLink]="[routerUtils.generateUrl(groupMenuRoute.path)]">
|
||||
<span class="mb-3 inner-line"></span>
|
||||
<div class="pl-0 pt-1 pb-1 container-fluid nav-subrow dataset-tour">
|
||||
<i class="mb-1 material-symbols-outlined icon">{{ groupMenuRoute.icon }}</i>
|
||||
|
@ -21,7 +21,7 @@
|
|||
<i class="material-symbols-outlined icon">{{ groupMenuRoute.icon }}</i>
|
||||
<span>{{groupMenuRoute.title | translate}} <span class="material-symbols-outlined icon-external">open_in_new</span></span>
|
||||
</a>
|
||||
<a class="nav-link nav-row" *ngIf="groupMenuRoute.path === '/contact-support' && this.isAuthenticated()" [routerLink]="[groupMenuRoute.path]">
|
||||
<a class="nav-link nav-row" *ngIf="groupMenuRoute.path === '/contact-support' && this.isAuthenticated()" [routerLink]="[routerUtils.generateUrl(groupMenuRoute.path)]">
|
||||
<i class="material-symbols-outlined icon">{{ groupMenuRoute.icon }}</i>
|
||||
<span>{{groupMenuRoute.title | translate}}</span>
|
||||
</a>
|
||||
|
|
|
@ -9,6 +9,7 @@ import { TranslateService } from '@ngx-translate/core';
|
|||
import { AuthService } from '../../core/services/auth/auth.service';
|
||||
import { LanguageDialogComponent } from '../language/dialog/language-dialog.component';
|
||||
import { UserDialogComponent } from '../navbar/user-dialog/user-dialog.component';
|
||||
import { RouterUtilsService } from '@app/core/services/router/router-utils.service';
|
||||
|
||||
declare interface RouteInfo {
|
||||
path: string;
|
||||
|
@ -46,8 +47,8 @@ export class SidebarComponent implements OnInit {
|
|||
private dialog: MatDialog,
|
||||
public router: Router,
|
||||
private location: Location,
|
||||
private httpClient: HttpClient,
|
||||
private analyticsService: AnalyticsService,
|
||||
public routerUtils: RouterUtilsService,
|
||||
) { }
|
||||
|
||||
ngOnInit() {
|
||||
|
|
|
@ -1,44 +1,40 @@
|
|||
import { Component, OnInit } from '@angular/core';
|
||||
import { UntypedFormGroup, UntypedFormBuilder } from '@angular/forms';
|
||||
import { map, takeUntil } from 'rxjs/operators';
|
||||
import { UiNotificationService, SnackBarNotificationLevel } from '@app/core/services/notification/ui-notification-service';
|
||||
import { TranslateService } from '@ngx-translate/core';
|
||||
import { ActivatedRoute, Router } from '@angular/router';
|
||||
import { ConfigurationService } from '@app/core/services/configuration/configuration.service';
|
||||
import { AuthService } from '@app/core/services/auth/auth.service';
|
||||
import { SupportiveMaterialService } from '@app/core/services/supportive-material/supportive-material.service';
|
||||
import { SupportiveMaterialFieldType } from '@app/core/common/enum/supportive-material-field-type';
|
||||
import { SupportiveMaterial, SupportiveMaterialPersist } from '@app/core/model/supportive-material/supportive-material';
|
||||
import { Guid } from '@common/types/guid';
|
||||
import { BaseEditor } from '@common/base/base-editor';
|
||||
import { SupportiveMaterialEditorModel } from './supportive-material-editor.model';
|
||||
import { UntypedFormGroup } from '@angular/forms';
|
||||
import { MatDialog } from '@angular/material/dialog';
|
||||
import { FormService } from '@common/forms/form-service';
|
||||
import { HttpErrorHandlingService } from '@common/modules/errors/error-handling/http-error-handling.service';
|
||||
import { FilterService } from '@common/modules/text-filter/filter-service';
|
||||
import { DatePipe } from '@angular/common';
|
||||
import { QueryParamsService } from '@app/core/services/utilities/query-params.service';
|
||||
import { EnumUtils } from '@app/core/services/utilities/enum-utils.service';
|
||||
import { LoggingService } from '@app/core/services/logging/logging-service';
|
||||
import { FileUtils } from '@app/core/services/utilities/file-utils.service';
|
||||
import { LanguageService } from '@app/core/services/language/language.service';
|
||||
import { SupportiveMaterialEditorService } from './supportive-material-editor.service';
|
||||
import { SupportiveMaterialEditorResolver } from './supportive-material-editor.resolver';
|
||||
import { ActivatedRoute, Router } from '@angular/router';
|
||||
import { IsActive } from '@app/core/common/enum/is-active.enum';
|
||||
import { AppPermission } from '@app/core/common/enum/permission.enum';
|
||||
import { ConfirmationDialogComponent } from '@common/modules/confirmation-dialog/confirmation-dialog.component';
|
||||
import { SupportiveMaterialFieldType } from '@app/core/common/enum/supportive-material-field-type';
|
||||
import { SupportiveMaterial, SupportiveMaterialPersist } from '@app/core/model/supportive-material/supportive-material';
|
||||
import { AuthService } from '@app/core/services/auth/auth.service';
|
||||
import { ConfigurationService } from '@app/core/services/configuration/configuration.service';
|
||||
import { LanguageHttpService } from '@app/core/services/language/language.http.service';
|
||||
import { nameof } from 'ts-simple-nameof';
|
||||
import { Language } from '@app/core/model/language/language';
|
||||
import { LanguageLookup } from '@app/core/query/language.lookup';
|
||||
import { LanguageService } from '@app/core/services/language/language.service';
|
||||
import { LockService } from '@app/core/services/lock/lock.service';
|
||||
import { LoggingService } from '@app/core/services/logging/logging-service';
|
||||
import { SnackBarNotificationLevel, UiNotificationService } from '@app/core/services/notification/ui-notification-service';
|
||||
import { SupportiveMaterialService } from '@app/core/services/supportive-material/supportive-material.service';
|
||||
import { EnumUtils } from '@app/core/services/utilities/enum-utils.service';
|
||||
import { FileUtils } from '@app/core/services/utilities/file-utils.service';
|
||||
import { QueryParamsService } from '@app/core/services/utilities/query-params.service';
|
||||
import { BaseEditor } from '@common/base/base-editor';
|
||||
import { FormService } from '@common/forms/form-service';
|
||||
import { ConfirmationDialogComponent } from '@common/modules/confirmation-dialog/confirmation-dialog.component';
|
||||
import { HttpErrorHandlingService } from '@common/modules/errors/error-handling/http-error-handling.service';
|
||||
import { FilterService } from '@common/modules/text-filter/filter-service';
|
||||
import { Guid } from '@common/types/guid';
|
||||
import { TranslateService } from '@ngx-translate/core';
|
||||
import { map, takeUntil } from 'rxjs/operators';
|
||||
import { SupportiveMaterialEditorModel } from './supportive-material-editor.model';
|
||||
import { SupportiveMaterialEditorResolver } from './supportive-material-editor.resolver';
|
||||
import { SupportiveMaterialEditorService } from './supportive-material-editor.service';
|
||||
|
||||
|
||||
@Component({
|
||||
selector: 'app-supportive-material-editor',
|
||||
templateUrl: './supportive-material-editor.component.html',
|
||||
styleUrls: ['./supportive-material-editor.component.scss'],
|
||||
providers: [SupportiveMaterialEditorService]
|
||||
selector: 'app-supportive-material-editor',
|
||||
templateUrl: './supportive-material-editor.component.html',
|
||||
styleUrls: ['./supportive-material-editor.component.scss'],
|
||||
providers: [SupportiveMaterialEditorService]
|
||||
})
|
||||
export class SupportiveMaterialEditorComponent extends BaseEditor<SupportiveMaterialEditorModel, SupportiveMaterial> implements OnInit {
|
||||
isNew = true;
|
||||
|
@ -59,7 +55,6 @@ export class SupportiveMaterialEditorComponent extends BaseEditor<SupportiveMate
|
|||
protected uiNotificationService: UiNotificationService,
|
||||
protected httpErrorHandlingService: HttpErrorHandlingService,
|
||||
protected filterService: FilterService,
|
||||
protected datePipe: DatePipe,
|
||||
protected route: ActivatedRoute,
|
||||
protected queryParamsService: QueryParamsService,
|
||||
protected lockService: LockService,
|
||||
|
@ -74,7 +69,7 @@ export class SupportiveMaterialEditorComponent extends BaseEditor<SupportiveMate
|
|||
private supportiveMaterialEditorService: SupportiveMaterialEditorService,
|
||||
private fileUtils: FileUtils,
|
||||
) {
|
||||
super(dialog, language, formService, router, uiNotificationService, httpErrorHandlingService, filterService, datePipe, route, queryParamsService, lockService, authService, configurationService);
|
||||
super(dialog, language, formService, router, uiNotificationService, httpErrorHandlingService, filterService, route, queryParamsService, lockService, authService, configurationService);
|
||||
}
|
||||
|
||||
ngOnInit(): void {
|
||||
|
@ -172,25 +167,25 @@ export class SupportiveMaterialEditorComponent extends BaseEditor<SupportiveMate
|
|||
}
|
||||
}
|
||||
|
||||
public selectedMaterialChanged(){
|
||||
public selectedMaterialChanged() {
|
||||
this.getSupportiveMaterialData();
|
||||
}
|
||||
|
||||
public selectedLangChanged(){
|
||||
public selectedLangChanged() {
|
||||
this.getSupportiveMaterialData();
|
||||
}
|
||||
|
||||
private getSupportiveMaterialData(){
|
||||
private getSupportiveMaterialData() {
|
||||
|
||||
if(this.formGroup.get('type').value >= 0 && this.formGroup.get('languageCode').value){
|
||||
if (this.formGroup.get('type').value >= 0 && this.formGroup.get('languageCode').value) {
|
||||
const lookup = SupportiveMaterialService.DefaultSupportiveMaterialLookup();
|
||||
lookup.types = [this.formGroup.get('type').value];
|
||||
lookup.languageCodes = [this.formGroup.get('languageCode').value];
|
||||
this.supportiveMaterialService.query(lookup).pipe(takeUntil(this._destroyed)).subscribe(data => { //TODO HANDLE-ERRORS
|
||||
if(data.count == 1){
|
||||
if (data.count == 1) {
|
||||
this.formGroup.get('id').patchValue(data.items[0].id);
|
||||
this.formGroup.get('payload').patchValue(data.items[0].payload);
|
||||
}else{
|
||||
} else {
|
||||
this.formGroup.get('id').patchValue(null);
|
||||
this.formGroup.get('payload').patchValue('');
|
||||
}
|
||||
|
|
|
@ -1,24 +1,22 @@
|
|||
import { NgModule } from '@angular/core';
|
||||
import { EditorModule } from '@tinymce/tinymce-angular';
|
||||
import { SupportiveMaterialEditorRoutingModule } from './supportive-material-editor.routing';
|
||||
import { SupportiveMaterialEditorComponent } from './supportive-material-editor.component';
|
||||
import { CommonUiModule } from '@common/ui/common-ui.module';
|
||||
import { CommonFormsModule } from '@common/forms/common-forms.module';
|
||||
import { DatePipe } from '@angular/common';
|
||||
import { EnumUtils } from '@app/core/services/utilities/enum-utils.service';
|
||||
import { CommonFormsModule } from '@common/forms/common-forms.module';
|
||||
import { CommonUiModule } from '@common/ui/common-ui.module';
|
||||
import { EditorModule } from '@tinymce/tinymce-angular';
|
||||
import { SupportiveMaterialEditorComponent } from './supportive-material-editor.component';
|
||||
import { SupportiveMaterialEditorRoutingModule } from './supportive-material-editor.routing';
|
||||
|
||||
|
||||
@NgModule({
|
||||
declarations: [SupportiveMaterialEditorComponent],
|
||||
imports: [
|
||||
CommonUiModule,
|
||||
CommonFormsModule,
|
||||
SupportiveMaterialEditorRoutingModule,
|
||||
EditorModule
|
||||
],
|
||||
providers: [
|
||||
DatePipe,
|
||||
EnumUtils
|
||||
],
|
||||
declarations: [SupportiveMaterialEditorComponent],
|
||||
imports: [
|
||||
CommonUiModule,
|
||||
CommonFormsModule,
|
||||
SupportiveMaterialEditorRoutingModule,
|
||||
EditorModule
|
||||
],
|
||||
providers: [
|
||||
EnumUtils
|
||||
],
|
||||
})
|
||||
export class SupportiveMaterialEditorModule { }
|
||||
|
|
|
@ -72,11 +72,7 @@
|
|||
<span [ngClass]="providerIcon"></span>
|
||||
</ng-container>
|
||||
<div *ngIf="i != 0" class="col-auto d-flex align-items-center unlink-mail" (click)="userCredential.data.email !== firstEmail && removeAccount(userCredential)">
|
||||
<mat-icon
|
||||
[matTooltip]="(userCredential.data?.email !== firstEmail ) ? ('USER-PROFILE.ACTIONS.UNLINK-ACCOUNT' | translate) : ('USER-PROFILE.ACTIONS.UNLINK-ACCOUNT-DISABLED' | translate)"
|
||||
matTooltipPosition="right"
|
||||
[ngClass]="{'disable-unlink':userCredential.data.email === firstEmail}"
|
||||
>link_off</mat-icon>
|
||||
<mat-icon [matTooltip]="(userCredential.data?.email !== firstEmail ) ? ('USER-PROFILE.ACTIONS.UNLINK-ACCOUNT' | translate) : ('USER-PROFILE.ACTIONS.UNLINK-ACCOUNT-DISABLED' | translate)" matTooltipPosition="right" [ngClass]="{'disable-unlink':userCredential.data.email === firstEmail}">link_off</mat-icon>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -143,18 +139,17 @@
|
|||
<div class="row">
|
||||
<div class="col timezone-form">
|
||||
<mat-form-field class="w-100">
|
||||
<input type="text" placeholder="{{'USER-PROFILE.SETTINGS.TIMEZONE' | translate}}" [formControl]="this.formGroup.get('additionalInfo').get('timezone')" matInput [matAutocomplete]="timezone" required>
|
||||
<mat-autocomplete #timezone="matAutocomplete">
|
||||
<mat-option *ngFor="let timezone of timezones | async" [value]="timezone">
|
||||
{{ timezone | timezoneInfoDisplay }}
|
||||
</mat-option>
|
||||
<input matInput autocomplete="off" placeholder="{{'USER-PROFILE.SETTINGS.TIMEZONE' | translate}}" [matAutocomplete]="timezoneAuto" type="text" name="timezone" [formControl]="formGroup.get('additionalInfo').get('timezone')">
|
||||
<mat-error *ngIf="formGroup.get('additionalInfo').get('timezone').hasError('backendError')">{{formGroup.get('additionalInfo').get('timezone').getError('backendError').message}}</mat-error>
|
||||
<mat-error *ngIf="formGroup.get('additionalInfo').get('timezone').hasError('required')">{{'COMMONS.VALIDATION.REQUIRED' | translate}}</mat-error>
|
||||
<mat-autocomplete autoActiveFirstOption #timezoneAuto="matAutocomplete">
|
||||
<mat-option *ngFor="let timezone of filteredTimezones" [value]="timezone">{{timezone | timezoneInfoDisplay}}</mat-option>
|
||||
</mat-autocomplete>
|
||||
<mat-error *ngIf="this.formGroup.get('additionalInfo').get('timezone').hasError('required')">{{'GENERAL.VALIDATION.REQUIRED' | translate}}</mat-error>
|
||||
</mat-form-field>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- Culture -->
|
||||
<!-- Culture -->
|
||||
<div class="col-12 col-lg-4">
|
||||
<div class="row">
|
||||
<div class="col-auto mb-1 field-title">{{'USER-PROFILE.SETTINGS.CULTURE' | translate}} *</div>
|
||||
|
@ -162,18 +157,17 @@
|
|||
<div class="row">
|
||||
<div class="col culture-form">
|
||||
<mat-form-field class="w-100">
|
||||
<input type="text" placeholder="{{'USER-PROFILE.SETTINGS.CULTURE' | translate}}" [formControl]="this.formGroup.get('additionalInfo').get('culture')" matInput [matAutocomplete]="culture" required>
|
||||
<mat-autocomplete #culture="matAutocomplete" [displayWith]="displayFn(culture)">
|
||||
<mat-option *ngFor="let culture of cultures | async" [value]="displayFn(culture)">
|
||||
{{ culture.displayName }} - {{ culture.nativeName }}
|
||||
</mat-option>
|
||||
<input matInput autocomplete="off" placeholder="{{'USER-PROFILE.SETTINGS.CULTURE' | translate}}" [matAutocomplete]="cultureAuto" type="text" name="culture" [formControl]="formGroup.get('additionalInfo').get('culture')">
|
||||
<mat-error *ngIf="formGroup.get('additionalInfo').get('culture').hasError('backendError')">{{formGroup.get('additionalInfo').get('culture').getError('backendError').message}}</mat-error>
|
||||
<mat-error *ngIf="formGroup.get('additionalInfo').get('culture').hasError('required')">{{'COMMONS.VALIDATION.REQUIRED' | translate}}</mat-error>
|
||||
<mat-autocomplete autoActiveFirstOption #cultureAuto="matAutocomplete" [displayWith]="displayCultureFn.bind(this)">
|
||||
<mat-option *ngFor="let culture of filteredCultures" [value]="culture.name">{{culture | cultureInfoDisplay}}</mat-option>
|
||||
</mat-autocomplete>
|
||||
<mat-error *ngIf="this.formGroup.get('additionalInfo').get('culture').hasError('required')">{{'GENERAL.VALIDATION.REQUIRED' | translate}}</mat-error>
|
||||
</mat-form-field>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- Language -->
|
||||
<!-- Language -->
|
||||
<div class="col-12 col-lg-4">
|
||||
<div class="row">
|
||||
<div class="col-auto mb-1 field-title">{{'USER-PROFILE.SETTINGS.LANGUAGE' | translate}} *</div>
|
||||
|
@ -183,7 +177,7 @@
|
|||
|
||||
<mat-form-field class="w-100">
|
||||
<!-- <mat-label>{{'USER-PROFILE.SETTINGS.LANGUAGE' | translate}}</mat-label> -->
|
||||
<mat-select [formControl]="this.formGroup.get('additionalInfo').get('language')" name="language">
|
||||
<mat-select [formControl]="this.formGroup.get('additionalInfo').get('language')" name="language">
|
||||
<mat-option *ngFor="let language of languages" [value]="language">
|
||||
{{ "GENERAL.LANGUAGES."+ language | translate }}
|
||||
</mat-option>
|
||||
|
@ -223,4 +217,4 @@
|
|||
<ng-template #loading>
|
||||
</ng-template>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
|
@ -3,14 +3,13 @@ import { UntypedFormArray, UntypedFormBuilder, UntypedFormGroup, Validators } fr
|
|||
import { MatDialog } from '@angular/material/dialog';
|
||||
import { ActivatedRoute, Params } from '@angular/router';
|
||||
import { RoleOrganizationType } from '@app/core/common/enum/role-organization-type';
|
||||
import { CultureInfo } from '@app/core/model/culture-info';
|
||||
import { ReferenceType } from '@app/core/model/reference-type/reference-type';
|
||||
import { Reference } from '@app/core/model/reference/reference';
|
||||
import { Tenant } from '@app/core/model/tenant/tenant';
|
||||
import { User, UserAdditionalInfo, UserCredential, UserPersist } from '@app/core/model/user/user';
|
||||
import { AuthService } from '@app/core/services/auth/auth.service';
|
||||
import { ConfigurationService } from '@app/core/services/configuration/configuration.service';
|
||||
import { CultureService } from '@app/core/services/culture/culture-service';
|
||||
import { CultureInfo, CultureService } from '@app/core/services/culture/culture-service';
|
||||
import { PrincipalService } from '@app/core/services/http/principal.service';
|
||||
import { LanguageService } from '@app/core/services/language/language.service';
|
||||
import { AnalyticsService } from '@app/core/services/matomo/analytics-service';
|
||||
|
@ -18,6 +17,7 @@ import { SnackBarNotificationLevel, UiNotificationService } from '@app/core/serv
|
|||
import { ReferenceTypeService } from '@app/core/services/reference-type/reference-type.service';
|
||||
import { ReferenceService } from '@app/core/services/reference/reference.service';
|
||||
import { TenantHandlingService } from '@app/core/services/tenant/tenant-handling.service';
|
||||
import { TimezoneService } from '@app/core/services/timezone/timezone-service';
|
||||
import { UserService } from '@app/core/services/user/user.service';
|
||||
import { EnumUtils } from '@app/core/services/utilities/enum-utils.service';
|
||||
import { SingleAutoCompleteConfiguration } from '@app/library/auto-complete/single/single-auto-complete-configuration';
|
||||
|
@ -31,7 +31,6 @@ import { ConfirmationDialogComponent } from '@common/modules/confirmation-dialog
|
|||
import { HttpErrorHandlingService } from '@common/modules/errors/error-handling/http-error-handling.service';
|
||||
import { Guid } from '@common/types/guid';
|
||||
import { TranslateService } from '@ngx-translate/core';
|
||||
import * as moment from 'moment-timezone';
|
||||
import { Observable, of } from 'rxjs';
|
||||
import { map, takeUntil } from 'rxjs/operators';
|
||||
import { nameof } from 'ts-simple-nameof';
|
||||
|
@ -52,7 +51,10 @@ export class UserProfileComponent extends BaseComponent implements OnInit, OnDes
|
|||
firstEmail: String;
|
||||
userLanguage: String;
|
||||
currentUserId: string;
|
||||
cultures: Observable<CultureInfo[]>;
|
||||
cultureValues = new Array<CultureInfo>();
|
||||
timezoneValues = new Array<string>();
|
||||
filteredCultures = new Array<CultureInfo>();
|
||||
filteredTimezones = new Array<string>();
|
||||
timezones: Observable<any[]>;
|
||||
editMode = false;
|
||||
languages = [];
|
||||
|
@ -74,6 +76,7 @@ export class UserProfileComponent extends BaseComponent implements OnInit, OnDes
|
|||
private authService: AuthService,
|
||||
private language: TranslateService,
|
||||
private cultureService: CultureService,
|
||||
private timezoneService: TimezoneService,
|
||||
private languageService: LanguageService,
|
||||
private configurationService: ConfigurationService,
|
||||
private uiNotificationService: UiNotificationService,
|
||||
|
@ -111,6 +114,9 @@ export class UserProfileComponent extends BaseComponent implements OnInit, OnDes
|
|||
}
|
||||
|
||||
ngOnInit() {
|
||||
this.cultureValues = this.cultureService.getCultureValues();
|
||||
this.timezoneValues = this.timezoneService.getTimezoneValues();
|
||||
|
||||
this.tenantFormGroup = this.formBuilder.group({
|
||||
tenantCode: [this.authService.selectedTenant(), [Validators.required]]
|
||||
});
|
||||
|
@ -159,12 +165,7 @@ export class UserProfileComponent extends BaseComponent implements OnInit, OnDes
|
|||
this.userProfileEditorModel = new UserProfileEditorModel().fromModel(result);
|
||||
this.formGroup = this.userProfileEditorModel.buildForm(this.languageService.getAvailableLanguagesCodes());
|
||||
|
||||
this.formGroup.get('additionalInfo').get('timezone').valueChanges
|
||||
.pipe(takeUntil(this._destroyed))
|
||||
.subscribe(x => { if (x) { this.timezones = this._filterTimezone(x); } });
|
||||
this.formGroup.get('additionalInfo').get('culture').valueChanges
|
||||
.pipe(takeUntil(this._destroyed))
|
||||
.subscribe(x => { if (x) { this.cultures = this._filterCulture(x); } });
|
||||
this.registerChangeListeners();
|
||||
|
||||
this.tenants = this.loadUserTenants();
|
||||
this.unlock();
|
||||
|
@ -172,42 +173,29 @@ export class UserProfileComponent extends BaseComponent implements OnInit, OnDes
|
|||
}));
|
||||
}
|
||||
|
||||
ngOnDestroy(): void {
|
||||
registerChangeListeners() {
|
||||
|
||||
this.filteredCultures = this.cultureValues.filter((culture) => culture.name === this.userProfileEditorModel.additionalInfo.culture);
|
||||
this.filteredTimezones = this.timezoneValues.filter((zone) => zone === this.userProfileEditorModel.additionalInfo.timezone);
|
||||
// set change listeners
|
||||
this.formGroup.get('additionalInfo').get('timezone').valueChanges
|
||||
.pipe(takeUntil(this._destroyed))
|
||||
.subscribe((text) => {
|
||||
const searchText = text.toLowerCase();
|
||||
const result = this.timezoneValues.filter((zone) => zone.toLowerCase().indexOf(searchText) >= 0);
|
||||
this.filteredTimezones = result;
|
||||
});
|
||||
|
||||
this.formGroup.get('additionalInfo').get('culture').valueChanges
|
||||
.pipe(takeUntil(this._destroyed))
|
||||
.subscribe((text) => {
|
||||
const searchText = text.toLowerCase();
|
||||
const result = this.cultureValues.filter((culture) => culture.name.toLowerCase().indexOf(searchText) >= 0);
|
||||
this.filteredCultures = result;
|
||||
});
|
||||
}
|
||||
|
||||
public hasProvider(userCredential: UserCredential, provider: string): boolean {
|
||||
const result = userCredential.data.externalProviderNames?.find(x => x == provider);
|
||||
|
||||
return result != null;
|
||||
}
|
||||
|
||||
private _filterTimezone(value: string): Observable<any[]> {
|
||||
if (value && typeof value === 'string') {
|
||||
const filterValue = value.toLowerCase();
|
||||
return of(moment.tz.names().filter(option => option.toLowerCase().includes(filterValue)));
|
||||
} else {
|
||||
return of(moment.tz.names());
|
||||
}
|
||||
}
|
||||
|
||||
private _filterCulture(value: string): Observable<any[]> {
|
||||
if (value && typeof value === 'string') {
|
||||
const filterValue = value.toLowerCase();
|
||||
return of(this.cultureService.getCultureValues().filter(option => option.displayName.toLowerCase().includes(filterValue)));
|
||||
} else {
|
||||
return of(this.cultureService.getCultureValues());
|
||||
}
|
||||
}
|
||||
|
||||
displayFn(culture?: CultureInfo): string | undefined {
|
||||
|
||||
if (culture == null
|
||||
|| culture.displayName == null
|
||||
|| culture.nativeName == null)
|
||||
return undefined;
|
||||
|
||||
return culture.displayName + '-' + culture.nativeName;
|
||||
}
|
||||
|
||||
save() {
|
||||
this.formService.removeAllBackEndErrors(this.formGroup);
|
||||
|
@ -375,4 +363,15 @@ export class UserProfileComponent extends BaseComponent implements OnInit, OnDes
|
|||
expandPreferences(): void {
|
||||
this.expandedPreferences = true;
|
||||
}
|
||||
|
||||
displayCultureFn(cultureName?: string): string | undefined {
|
||||
|
||||
const culture: CultureInfo = this.cultureValues?.find(x => x.name == cultureName);
|
||||
if (culture == null
|
||||
|| culture.displayName == null)
|
||||
return undefined;
|
||||
|
||||
return culture.displayName + ' [' + culture.name + ']';
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
"Enabled": false,
|
||||
"Url": "localhost:5000/"
|
||||
},
|
||||
"defaultCulture": "en-US",
|
||||
"defaultCulture": "en",
|
||||
"defaultBlueprintId": "86635178-36a6-484f-9057-a934e4eeecd5",
|
||||
"keycloak": {
|
||||
"enabled": true,
|
||||
|
|
|
@ -2249,5 +2249,9 @@
|
|||
"ACTIONS": {
|
||||
"CONFIRM": "Confirm"
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
"copy": "Copy",
|
||||
"clone": "Clone",
|
||||
"new-version": "New Version"
|
||||
}
|
||||
|
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
|
@ -1,4 +1,3 @@
|
|||
import { DatePipe } from '@angular/common';
|
||||
import { HttpErrorResponse } from '@angular/common/http';
|
||||
import { Component, OnInit } from '@angular/core';
|
||||
import { UntypedFormGroup } from '@angular/forms';
|
||||
|
@ -62,7 +61,6 @@ export abstract class BaseEditor<EditorModelType extends BaseEditorModel, Entity
|
|||
protected uiNotificationService: UiNotificationService,
|
||||
protected httpErrorHandlingService: HttpErrorHandlingService,
|
||||
protected filterService: FilterService,
|
||||
protected datePipe: DatePipe,
|
||||
protected route: ActivatedRoute,
|
||||
protected queryParamsService: QueryParamsService,
|
||||
protected lockService: LockService,
|
||||
|
|
|
@ -1,8 +1,7 @@
|
|||
import { Inject, Injectable, Optional } from '@angular/core';
|
||||
import { MAT_DATE_LOCALE } from '@angular/material/core';
|
||||
import { MomentDateAdapter } from '@angular/material-moment-adapter';
|
||||
import moment from 'moment';
|
||||
import { Moment } from 'moment';
|
||||
import { MAT_DATE_LOCALE } from '@angular/material/core';
|
||||
import moment, { Moment } from 'moment';
|
||||
|
||||
@Injectable()
|
||||
export class MomentUtcDateAdapter extends MomentDateAdapter {
|
||||
|
@ -36,10 +35,19 @@ export class MomentUtcDateAdapter extends MomentDateAdapter {
|
|||
// manually writing on the textbox
|
||||
parse(value: any, parseFormat: string | string[]): Moment | null {
|
||||
const initialParse = super.parse(value, parseFormat);
|
||||
if (initialParse == null) { return null };
|
||||
if (!initialParse) {
|
||||
return null
|
||||
}
|
||||
|
||||
if (!initialParse.isValid()) { return initialParse; }
|
||||
|
||||
const result = moment.utc({ year: initialParse.year(), month: initialParse.month(), date: initialParse.date() }).locale(this.locale);
|
||||
const result = moment.utc({
|
||||
year: initialParse.year(),
|
||||
month: initialParse.month(),
|
||||
date: initialParse.date(),
|
||||
hour: initialParse.hour(),
|
||||
minute: initialParse.minute()
|
||||
}).locale(this.locale);
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -0,0 +1,73 @@
|
|||
import { Injectable, inject } from "@angular/core";
|
||||
import { TimezoneService } from "@app/core/services/timezone/timezone-service";
|
||||
import { MomentDatetimeAdapter } from "@mat-datetimepicker/moment";
|
||||
import moment, { Moment } from "moment";
|
||||
|
||||
@Injectable()
|
||||
export class MomentUtcDateTimeAdapter extends MomentDatetimeAdapter {
|
||||
|
||||
private timezoneService = inject(TimezoneService);
|
||||
|
||||
// selected from datepicker
|
||||
createDatetime(year: number, month: number, date: number, hour: number, minute: number): Moment {
|
||||
// Moment.js will create an invalid date if any of the components are out of bounds, but we
|
||||
// explicitly check each case so we can throw more descriptive errors.
|
||||
if (month < 0 || month > 11) {
|
||||
throw Error(`Invalid month index "${month}". Month index has to be between 0 and 11.`);
|
||||
}
|
||||
|
||||
if (date < 1) {
|
||||
throw Error(`Invalid date "${date}". Date has to be greater than 0.`);
|
||||
}
|
||||
|
||||
if (hour < 0 || hour > 23) {
|
||||
throw Error(`Invalid hours "${hour}". Hours has to be between 0 and 23.`);
|
||||
}
|
||||
|
||||
if (minute < 0 || minute > 59) {
|
||||
throw Error(`Invalid minutes "${minute}". Minutes has to between 0 and 59.`);
|
||||
}
|
||||
|
||||
|
||||
const result = moment.utc({ year, month, date, hour, minute }).locale(this.locale);
|
||||
|
||||
|
||||
if (this.timezoneService) {// !!GOTCHA! super() calls createDate . At that moment it has no timezoneService
|
||||
result.tz(this.timezoneService.getCurrentTimezone(), true)
|
||||
}
|
||||
|
||||
// If the result isn't valid, the date must have been out of bounds for this month.
|
||||
if (!result.isValid()) {
|
||||
throw Error(`Invalid date "${date}" for month with index "${month}".`);
|
||||
}
|
||||
|
||||
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
// manually writing on the textbox
|
||||
parse(value: any, parseFormat: string | string[]): Moment | null {
|
||||
const initialParse = super.parse(value, parseFormat);
|
||||
if (!initialParse) {
|
||||
return null
|
||||
}
|
||||
|
||||
if (!initialParse.isValid()) { return initialParse; }
|
||||
|
||||
const result = moment.utc({
|
||||
year: initialParse.year(),
|
||||
month: initialParse.month(),
|
||||
date: initialParse.date(),
|
||||
hour: initialParse.hour(),
|
||||
minute: initialParse.minute()
|
||||
}).locale(this.locale)
|
||||
.tz(this.timezoneService.getCurrentTimezone(), true)
|
||||
return result;
|
||||
}
|
||||
|
||||
format(date: Moment, displayFormat: string): string {
|
||||
date.tz(this.timezoneService.getCurrentTimezone());
|
||||
return super.format(date, displayFormat);
|
||||
}
|
||||
}
|
|
@ -1,8 +1,6 @@
|
|||
import { NgModule } from '@angular/core';
|
||||
import { ArrayToStringPipe } from '@common/formatting/pipes/array-to-string.pipe';
|
||||
import { DataTableDateFormatPipe, DateFormatPipe } from '@common/formatting/pipes/date-format.pipe';
|
||||
import { DataTableDateOnlyFormatPipe, DateOnlyPipe } from '@common/formatting/pipes/date-only-format.pipe';
|
||||
import { DataTableDateTimeFormatPipe, DateTimeFormatPipe } from '@common/formatting/pipes/date-time-format.pipe';
|
||||
import { LowercaseFirstLetterPipe } from '@common/formatting/pipes/lowercase-first-letter.pipe';
|
||||
import { IsActiveTypePipe } from './pipes/is-active-type.pipe';
|
||||
import { NotificationContactTypePipe } from './pipes/notification-contact-type.pipe';
|
||||
|
@ -22,10 +20,6 @@ import { LockTargetTypePipe } from './pipes/lock-target-type.pipe';
|
|||
//
|
||||
@NgModule({
|
||||
declarations: [
|
||||
DateFormatPipe,
|
||||
DateTimeFormatPipe,
|
||||
DataTableDateFormatPipe,
|
||||
DataTableDateTimeFormatPipe,
|
||||
LowercaseFirstLetterPipe,
|
||||
ArrayToStringPipe,
|
||||
DateOnlyPipe,
|
||||
|
@ -42,10 +36,6 @@ import { LockTargetTypePipe } from './pipes/lock-target-type.pipe';
|
|||
LockTargetTypePipe
|
||||
],
|
||||
exports: [
|
||||
DateFormatPipe,
|
||||
DateTimeFormatPipe,
|
||||
DataTableDateFormatPipe,
|
||||
DataTableDateTimeFormatPipe,
|
||||
LowercaseFirstLetterPipe,
|
||||
ArrayToStringPipe,
|
||||
DateOnlyPipe,
|
||||
|
@ -62,10 +52,6 @@ import { LockTargetTypePipe } from './pipes/lock-target-type.pipe';
|
|||
LockTargetTypePipe
|
||||
],
|
||||
providers: [
|
||||
DateFormatPipe,
|
||||
DateTimeFormatPipe,
|
||||
DataTableDateFormatPipe,
|
||||
DataTableDateTimeFormatPipe,
|
||||
LowercaseFirstLetterPipe,
|
||||
ArrayToStringPipe,
|
||||
DateOnlyPipe,
|
||||
|
|
|
@ -1,49 +0,0 @@
|
|||
import { DatePipe } from '@angular/common';
|
||||
import { Pipe, PipeTransform } from '@angular/core';
|
||||
import moment from 'moment';
|
||||
import 'moment-timezone';
|
||||
|
||||
|
||||
/**
|
||||
* @deprecated
|
||||
*/
|
||||
@Pipe({
|
||||
name: 'dateFormatter'
|
||||
})
|
||||
export class DateFormatPipe implements PipeTransform {
|
||||
|
||||
constructor(private datePipe: DatePipe) {
|
||||
|
||||
}
|
||||
|
||||
transform(value: any, format?: string, locale?: string): string | null {
|
||||
// using timezone set in timezoneService by default. can be overwritten with pipe arguments
|
||||
const timezoneToUse = moment(value).tz('UTC').format('Z');
|
||||
return this.datePipe.transform(value, format, timezoneToUse, locale);
|
||||
}
|
||||
}
|
||||
/**
|
||||
* @deprecated
|
||||
*/
|
||||
@Pipe({
|
||||
name: 'dataTableDateFormatter'
|
||||
})
|
||||
// This is only used for the DataTable Column definition.
|
||||
// It's a hacky way to apply format to the pipe because it only supports passing a pipe instance and calls transform in it without params.
|
||||
export class DataTableDateFormatPipe extends DateFormatPipe implements PipeTransform {
|
||||
|
||||
format: string;
|
||||
|
||||
constructor(_datePipe: DatePipe) {
|
||||
super(_datePipe);
|
||||
}
|
||||
|
||||
public withFormat(format: string): DataTableDateFormatPipe {
|
||||
this.format = format;
|
||||
return this;
|
||||
}
|
||||
|
||||
transform(value: any): string | null {
|
||||
return super.transform(value, this.format);
|
||||
}
|
||||
}
|
|
@ -1,47 +0,0 @@
|
|||
import { DatePipe } from '@angular/common';
|
||||
import { Pipe, PipeTransform } from '@angular/core';
|
||||
import { CultureService } from '@app/core/services/culture/culture-service';
|
||||
import { TimezoneService } from '@app/core/services/timezone/timezone-service';
|
||||
import moment from 'moment';
|
||||
import 'moment-timezone';
|
||||
|
||||
@Pipe({
|
||||
name: 'dateTimeFormatter'
|
||||
})
|
||||
export class DateTimeFormatPipe implements PipeTransform {
|
||||
|
||||
constructor(private datePipe: DatePipe, private timezoneService: TimezoneService, private cultureService: CultureService) {
|
||||
|
||||
}
|
||||
|
||||
transform(value: any, format?: string, timezone?: string, locale?: string): string | null {
|
||||
// using timezone set in timezoneService by default. can be overwritten with pipe arguments
|
||||
const timezoneToUse = timezone ? timezone : moment(value).tz(this.timezoneService.getCurrentTimezone()).format('Z');
|
||||
const localeToUse = locale ? locale : this.cultureService.getCurrentCulture().name;
|
||||
return this.datePipe.transform(value, format, timezoneToUse, localeToUse);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@Pipe({
|
||||
name: 'dataTableDateTimeFormatter'
|
||||
})
|
||||
// This is only used for the DataTable Column definition.
|
||||
// It's a hacky way to apply format to the pipe because it only supports passing a pipe instance and calls transform in it without params.
|
||||
export class DataTableDateTimeFormatPipe extends DateTimeFormatPipe implements PipeTransform {
|
||||
|
||||
format: string;
|
||||
|
||||
constructor(private _datePipe: DatePipe, private _timezoneService: TimezoneService, private _cultureService: CultureService) {
|
||||
super(_datePipe, _timezoneService, _cultureService);
|
||||
}
|
||||
|
||||
public withFormat(format: string): DataTableDateTimeFormatPipe {
|
||||
this.format = format;
|
||||
return this;
|
||||
}
|
||||
|
||||
transform(value: any): string | null {
|
||||
return super.transform(value, this.format);
|
||||
}
|
||||
}
|
|
@ -31,4 +31,4 @@ import { ServerErrorsInterceptor } from '@common/modules/errors/server-errors-in
|
|||
},
|
||||
]
|
||||
})
|
||||
export class ErrorsModule { }
|
||||
export class ErrorsModule { } //not used
|
||||
|
|
|
@ -1,42 +1,40 @@
|
|||
import { Component, OnInit } from '@angular/core';
|
||||
import { FormArray, UntypedFormGroup } from '@angular/forms';
|
||||
import { UntypedFormGroup } from '@angular/forms';
|
||||
import { MatCheckboxChange } from '@angular/material/checkbox';
|
||||
import { MatChipEditedEvent, MatChipInputEvent } from '@angular/material/chips';
|
||||
import { MatDialog } from '@angular/material/dialog';
|
||||
import { Title } from '@angular/platform-browser';
|
||||
import { ActivatedRoute, Router } from '@angular/router';
|
||||
import { AppPermission } from '@app/core/common/enum/permission.enum';
|
||||
import { Language } from '@app/core/model/language/language';
|
||||
import { AuthService } from '@app/core/services/auth/auth.service';
|
||||
import { ConfigurationService } from '@app/core/services/configuration/configuration.service';
|
||||
import { LanguageHttpService } from '@app/core/services/language/language.http.service';
|
||||
import { LockService } from '@app/core/services/lock/lock.service';
|
||||
import { LoggingService } from '@app/core/services/logging/logging-service';
|
||||
import { AnalyticsService } from '@app/core/services/matomo/analytics-service';
|
||||
import { SnackBarNotificationLevel, UiNotificationService } from '@app/core/services/notification/ui-notification-service';
|
||||
import { QueryParamsService } from '@app/core/services/utilities/query-params.service';
|
||||
import { BaseEditor } from '@common/base/base-editor';
|
||||
import { FormService } from '@common/forms/form-service';
|
||||
import { ConfirmationDialogComponent } from '@common/modules/confirmation-dialog/confirmation-dialog.component';
|
||||
import { HttpErrorHandlingService } from '@common/modules/errors/error-handling/http-error-handling.service';
|
||||
import { SnackBarNotificationLevel, UiNotificationService } from '@app/core/services/notification/ui-notification-service';
|
||||
import { TranslateService } from '@ngx-translate/core';
|
||||
import { AppPermission } from '@app/core/common/enum/permission.enum';
|
||||
import { NotificationTemplate, NotificationTemplatePersist } from '@notification-service/core/model/notification-template.model';
|
||||
import { NotificationTemplateService } from '@notification-service/services/http/notification-template.service';
|
||||
import { NotificationFieldInfoEditorModel, NotificationFieldOptionsEditorModel, NotificationTemplateEditorModel } from './notification-template-editor.model';
|
||||
import { map, takeUntil } from 'rxjs/operators';
|
||||
import { BaseEditor } from '@common/base/base-editor';
|
||||
import { ActivatedRoute, Router } from '@angular/router';
|
||||
import { FilterService } from '@common/modules/text-filter/filter-service';
|
||||
import { DatePipe } from '@angular/common';
|
||||
import { QueryParamsService } from '@app/core/services/utilities/query-params.service';
|
||||
import { NotificationServiceEnumUtils } from '@notification-service/core/formatting/enum-utils.service';
|
||||
import { NotificationTemplateEditorService } from './notification-template-editor.service';
|
||||
import { Guid } from '@common/types/guid';
|
||||
import { NotificationTemplateEditorResolver } from './notification-template-editor.resolver';
|
||||
import { LoggingService } from '@app/core/services/logging/logging-service';
|
||||
import { LanguageHttpService } from '@app/core/services/language/language.http.service';
|
||||
import { Language } from '@app/core/model/language/language';
|
||||
import { nameof } from 'ts-simple-nameof';
|
||||
import { MatChipEditedEvent, MatChipInputEvent } from '@angular/material/chips';
|
||||
import { MatCheckboxChange } from '@angular/material/checkbox';
|
||||
import { ConfigurationService } from '@app/core/services/configuration/configuration.service';
|
||||
import { LockService } from '@app/core/services/lock/lock.service';
|
||||
import { TranslateService } from '@ngx-translate/core';
|
||||
import { EmailOverrideMode } from '@notification-service/core/enum/email-override-mode';
|
||||
import { IsActive } from '@notification-service/core/enum/is-active.enum';
|
||||
import { NotificationDataType } from '@notification-service/core/enum/notification-data-type';
|
||||
import { NotificationTemplateChannel } from '@notification-service/core/enum/notification-template-channel.enum';
|
||||
import { NotificationTemplateKind } from '@notification-service/core/enum/notification-template-kind.enum';
|
||||
import { NotificationType } from '@notification-service/core/enum/notification-type.enum';
|
||||
import { EmailOverrideMode } from '@notification-service/core/enum/email-override-mode';
|
||||
import { NotificationDataType } from '@notification-service/core/enum/notification-data-type';
|
||||
import { Title } from '@angular/platform-browser';
|
||||
import { AnalyticsService } from '@app/core/services/matomo/analytics-service';
|
||||
import { NotificationServiceEnumUtils } from '@notification-service/core/formatting/enum-utils.service';
|
||||
import { NotificationTemplate, NotificationTemplatePersist } from '@notification-service/core/model/notification-template.model';
|
||||
import { NotificationTemplateService } from '@notification-service/services/http/notification-template.service';
|
||||
import { map, takeUntil } from 'rxjs/operators';
|
||||
import { NotificationTemplateEditorModel } from './notification-template-editor.model';
|
||||
import { NotificationTemplateEditorResolver } from './notification-template-editor.resolver';
|
||||
import { NotificationTemplateEditorService } from './notification-template-editor.service';
|
||||
|
||||
@Component({
|
||||
selector: 'app-notification-template-editor',
|
||||
|
@ -87,7 +85,6 @@ export class NotificationTemplateEditorComponent extends BaseEditor<Notification
|
|||
protected uiNotificationService: UiNotificationService,
|
||||
protected httpErrorHandlingService: HttpErrorHandlingService,
|
||||
protected filterService: FilterService,
|
||||
protected datePipe: DatePipe,
|
||||
protected route: ActivatedRoute,
|
||||
protected queryParamsService: QueryParamsService,
|
||||
protected lockService: LockService,
|
||||
|
@ -102,13 +99,13 @@ export class NotificationTemplateEditorComponent extends BaseEditor<Notification
|
|||
private titleService: Title,
|
||||
private analyticsService: AnalyticsService,
|
||||
) {
|
||||
const descriptionLabel:string = route.snapshot.data['entity']?.notificationType;
|
||||
const descriptionLabel: string = route.snapshot.data['entity']?.notificationType;
|
||||
if (descriptionLabel) {
|
||||
titleService.setTitle(descriptionLabel);
|
||||
} else {
|
||||
titleService.setTitle('NOTIFICATION-SERVICE.NOTIFICATION-TEMPLATE-EDITOR.TITLE-EDIT-NOTIFICATION-TEMPLATE');
|
||||
}
|
||||
super(dialog, language, formService, router, uiNotificationService, httpErrorHandlingService, filterService, datePipe, route, queryParamsService, lockService, authService, configurationService);
|
||||
super(dialog, language, formService, router, uiNotificationService, httpErrorHandlingService, filterService, route, queryParamsService, lockService, authService, configurationService);
|
||||
}
|
||||
|
||||
ngOnInit(): void {
|
||||
|
@ -135,19 +132,19 @@ export class NotificationTemplateEditorComponent extends BaseEditor<Notification
|
|||
try {
|
||||
this.editorModel = data ? new NotificationTemplateEditorModel().fromModel(data) : new NotificationTemplateEditorModel();
|
||||
|
||||
if(data){
|
||||
if(data.value && data.value.subjectFieldOptions){
|
||||
if (data) {
|
||||
if (data.value && data.value.subjectFieldOptions) {
|
||||
this.subjectFieldOptionsEnabled = true;
|
||||
this.subjectMandatoryFields = data.value.subjectFieldOptions.mandatory;
|
||||
}
|
||||
if(data.value && data.value.bodyFieldOptions){
|
||||
if (data.value && data.value.bodyFieldOptions) {
|
||||
this.bodyFieldOptionsEnabled = true;
|
||||
this.bodyMandatoryFields = data.value.bodyFieldOptions.mandatory;
|
||||
}
|
||||
if(data.value && data.value.subjectFieldOptions && data.value.subjectFieldOptions.formatting){
|
||||
if (data.value && data.value.subjectFieldOptions && data.value.subjectFieldOptions.formatting) {
|
||||
this.subjectFormatting = data.value.subjectFieldOptions.formatting;
|
||||
}
|
||||
if(data.value && data.value.bodyFieldOptions && data.value.bodyFieldOptions.formatting){
|
||||
if (data.value && data.value.bodyFieldOptions && data.value.bodyFieldOptions.formatting) {
|
||||
this.bodyFormatting = data.value.bodyFieldOptions.formatting;
|
||||
}
|
||||
this.ccValues = this.editorModel.value.cc;
|
||||
|
@ -166,9 +163,9 @@ export class NotificationTemplateEditorComponent extends BaseEditor<Notification
|
|||
this.formGroup = this.editorModel.buildForm(null, this.isDeleted || !this.authService.hasPermission(AppPermission.EditNotificationTemplate));
|
||||
this.notificationTemplateEditorService.setValidationErrorModel(this.editorModel.validationErrorModel);
|
||||
NotificationTemplateEditorModel.reApplyValueValidators({
|
||||
formGroup: this.formGroup,
|
||||
validationErrorModel: this.editorModel.validationErrorModel
|
||||
}
|
||||
formGroup: this.formGroup,
|
||||
validationErrorModel: this.editorModel.validationErrorModel
|
||||
}
|
||||
)
|
||||
}
|
||||
|
||||
|
@ -240,50 +237,50 @@ export class NotificationTemplateEditorComponent extends BaseEditor<Notification
|
|||
}
|
||||
|
||||
|
||||
subjectFieldOptionsSelectionChanged(matCheckBox: MatCheckboxChange){
|
||||
if(matCheckBox.checked == true){
|
||||
subjectFieldOptionsSelectionChanged(matCheckBox: MatCheckboxChange) {
|
||||
if (matCheckBox.checked == true) {
|
||||
this.subjectFieldOptionsEnabled = true;
|
||||
}else{
|
||||
} else {
|
||||
this.subjectFieldOptionsEnabled = false;
|
||||
}
|
||||
}
|
||||
|
||||
bodyFieldOptionsSelectionChanged(matCheckBox: MatCheckboxChange){
|
||||
if(matCheckBox.checked == true){
|
||||
bodyFieldOptionsSelectionChanged(matCheckBox: MatCheckboxChange) {
|
||||
if (matCheckBox.checked == true) {
|
||||
this.bodyFieldOptionsEnabled = true;
|
||||
}else{
|
||||
} else {
|
||||
this.bodyFieldOptionsEnabled = false;
|
||||
}
|
||||
}
|
||||
|
||||
// chip lists
|
||||
|
||||
addChipListValues(type: string, event: MatChipInputEvent){
|
||||
if(type == "cc"){
|
||||
addChipListValues(type: string, event: MatChipInputEvent) {
|
||||
if (type == "cc") {
|
||||
this.ccValues = this.add(event, this.ccValues);
|
||||
}else if(type == "bcc"){
|
||||
} else if (type == "bcc") {
|
||||
this.bccValues = this.add(event, this.bccValues);
|
||||
}else if(type == "extraDataKeys"){
|
||||
} else if (type == "extraDataKeys") {
|
||||
this.extraDataKeys = this.add(event, this.extraDataKeys);
|
||||
}
|
||||
}
|
||||
|
||||
editChipListValues(type: string, event: MatChipEditedEvent, field: string){
|
||||
if(type == "cc"){
|
||||
editChipListValues(type: string, event: MatChipEditedEvent, field: string) {
|
||||
if (type == "cc") {
|
||||
this.ccValues = this.edit(field, this.ccValues, event);
|
||||
}else if(type == "bcc"){
|
||||
} else if (type == "bcc") {
|
||||
this.bccValues = this.edit(field, this.bccValues, event);
|
||||
}else if(type == "extraDataKeys"){
|
||||
} else if (type == "extraDataKeys") {
|
||||
this.extraDataKeys = this.edit(field, this.extraDataKeys, event);
|
||||
}
|
||||
}
|
||||
|
||||
removeChipListValues(type: string, field: string){
|
||||
if(type == "cc"){
|
||||
removeChipListValues(type: string, field: string) {
|
||||
if (type == "cc") {
|
||||
this.ccValues = this.remove(field, this.ccValues);
|
||||
}else if(type == "bcc"){
|
||||
} else if (type == "bcc") {
|
||||
this.bccValues = this.remove(field, this.bccValues);
|
||||
}else if(type == "extraDataKeys"){
|
||||
} else if (type == "extraDataKeys") {
|
||||
this.extraDataKeys = this.remove(field, this.extraDataKeys);
|
||||
}
|
||||
}
|
||||
|
@ -308,8 +305,8 @@ export class NotificationTemplateEditorComponent extends BaseEditor<Notification
|
|||
const value = event.value.trim();
|
||||
|
||||
if (!value) {
|
||||
values = this.remove(field, values);
|
||||
return values;
|
||||
values = this.remove(field, values);
|
||||
return values;
|
||||
}
|
||||
|
||||
const index = values.indexOf(field);
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
<div class="col-auto">
|
||||
<button mat-raised-button class="create-btn"
|
||||
*ngIf="authService.hasPermission(authService.permissionEnum.EditNotificationTemplate)"
|
||||
[routerLink]="['/notification-templates/new']">
|
||||
[routerLink]="routerUtils.generateUrl(['/notification-templates/new'])">
|
||||
<mat-icon>add</mat-icon>
|
||||
{{'NOTIFICATION-SERVICE.NOTIFICATION-TEMPLATE-LISTING.CREATE' | translate}}
|
||||
</button>
|
||||
|
@ -40,7 +40,7 @@
|
|||
<div class="d-flex align-items-center p-3 gap-1-rem">
|
||||
<div class="row">
|
||||
<ng-container *ngIf="isColumnSelected('name')">
|
||||
<a class="buttonLinkClass" [routerLink]="'./' + item?.id" class="col-12"
|
||||
<a class="buttonLinkClass" [routerLink]="routerUtils.generateUrl('./' + item?.id)" class="col-12"
|
||||
(click)="$event.stopPropagation()">{{item?.name | nullifyValue}}</a>
|
||||
<br />
|
||||
</ng-container>
|
||||
|
@ -98,7 +98,7 @@
|
|||
<mat-icon>more_horiz</mat-icon>
|
||||
</button>
|
||||
<mat-menu #actionsMenu="matMenu">
|
||||
<button mat-menu-item [routerLink]="['/notification-templates/' + row.id]">
|
||||
<button mat-menu-item [routerLink]="routerUtils.generateUrl(['/notification-templates/' + row.id])">
|
||||
<mat-icon>edit</mat-icon>{{'NOTIFICATION-SERVICE.NOTIFICATION-TEMPLATE-LISTING.ACTIONS.EDIT' | translate}}
|
||||
</button>
|
||||
<button mat-menu-item (click)="deleteType(row.id)">
|
||||
|
|
|
@ -7,7 +7,7 @@ import { NotificationServiceEnumUtils } from '@notification-service/core/formatt
|
|||
import { QueryParamsService } from '@app/core/services/utilities/query-params.service';
|
||||
import { BaseListingComponent } from '@common/base/base-listing-component';
|
||||
import { PipeService } from '@common/formatting/pipe.service';
|
||||
import { DataTableDateTimeFormatPipe } from '@common/formatting/pipes/date-time-format.pipe';
|
||||
import { DataTableDateTimeFormatPipe } from '@app/core/pipes/date-time-format.pipe';
|
||||
import { QueryResult } from '@common/model/query-result';
|
||||
import { ConfirmationDialogComponent } from '@common/modules/confirmation-dialog/confirmation-dialog.component';
|
||||
import { HttpErrorHandlingService } from '@common/modules/errors/error-handling/http-error-handling.service';
|
||||
|
@ -26,6 +26,7 @@ import { NotificationTemplateKindPipe } from '@common/formatting/pipes/notificat
|
|||
import { Language } from '@app/core/model/language/language';
|
||||
import { NotificationTypePipe } from '@common/formatting/pipes/notification-type.pipe';
|
||||
import { IsActive } from '@notification-service/core/enum/is-active.enum';
|
||||
import { RouterUtilsService } from '@app/core/services/router/router-utils.service';
|
||||
|
||||
@Component({
|
||||
templateUrl: './notification-template-listing.component.html',
|
||||
|
@ -53,6 +54,7 @@ export class NotificationTemplateListingComponent extends BaseListingComponent<N
|
|||
rowIdentity = x => x.id;
|
||||
|
||||
constructor(
|
||||
public routerUtils: RouterUtilsService,
|
||||
protected router: Router,
|
||||
protected route: ActivatedRoute,
|
||||
protected uiNotificationService: UiNotificationService,
|
||||
|
|
|
@ -7,7 +7,6 @@ import { EnumUtils } from '@app/core/services/utilities/enum-utils.service';
|
|||
import { QueryParamsService } from '@app/core/services/utilities/query-params.service';
|
||||
import { BaseListingComponent } from '@common/base/base-listing-component';
|
||||
import { PipeService } from '@common/formatting/pipe.service';
|
||||
import { DataTableDateTimeFormatPipe } from '@common/formatting/pipes/date-time-format.pipe';
|
||||
import { QueryResult } from '@common/model/query-result';
|
||||
import { ConfirmationDialogComponent } from '@common/modules/confirmation-dialog/confirmation-dialog.component';
|
||||
import { HttpErrorHandlingService } from '@common/modules/errors/error-handling/http-error-handling.service';
|
||||
|
@ -27,6 +26,7 @@ import { NotificationNotifyStatePipe } from '@common/formatting/pipes/notificati
|
|||
import { NotificationTrackingStatePipe } from '@common/formatting/pipes/notification-tracking-state.pipe';
|
||||
import { NotificationTrackingProcessPipe } from '@common/formatting/pipes/notification-tracking-process.pipe';
|
||||
import { IsActive } from '@notification-service/core/enum/is-active.enum';
|
||||
import { DataTableDateTimeFormatPipe } from '@app/core/pipes/date-time-format.pipe';
|
||||
|
||||
@Component({
|
||||
templateUrl: './notification-listing.component.html',
|
||||
|
|
|
@ -4,7 +4,6 @@ import { AuthService } from '@app/core/services/auth/auth.service';
|
|||
import { QueryParamsService } from '@app/core/services/utilities/query-params.service';
|
||||
import { BaseListingComponent } from '@common/base/base-listing-component';
|
||||
import { PipeService } from '@common/formatting/pipe.service';
|
||||
import { DataTableDateTimeFormatPipe } from '@common/formatting/pipes/date-time-format.pipe';
|
||||
import { HttpErrorHandlingService } from '@common/modules/errors/error-handling/http-error-handling.service';
|
||||
import { ColumnDefinition, ColumnsChangedEvent, HybridListingComponent, PageLoadEvent } from '@common/modules/hybrid-listing/hybrid-listing.component';
|
||||
import { SnackBarNotificationLevel, UiNotificationService } from '@app/core/services/notification/ui-notification-service';
|
||||
|
@ -23,6 +22,7 @@ import { takeUntil } from 'rxjs/operators';
|
|||
import { NotificationTypePipe } from '@common/formatting/pipes/notification-type.pipe';
|
||||
import { NotificationInAppTracking } from '@notification-service/core/enum/notification-inapp-tracking.enum';
|
||||
import { InAppNotification } from '@notification-service/core/model/inapp-notification.model';
|
||||
import { DataTableDateTimeFormatPipe } from '@app/core/pipes/date-time-format.pipe';
|
||||
|
||||
@Component({
|
||||
selector: 'app-mine-inapp-notification-listing',
|
||||
|
|
Loading…
Reference in New Issue