= {
- 0: _('months.jan'),
- 1: _('months.feb'),
- 2: _('months.mar'),
- 3: _('months.apr'),
- 4: _('months.may'),
- 5: _('months.jun'),
- 6: _('months.jul'),
- 7: _('months.aug'),
- 8: _('months.sep'),
- 9: _('months.oct'),
- 10: _('months.nov'),
- 11: _('months.dec'),
-};
+import dayjs from 'dayjs';
@Pipe({
name: 'date',
@@ -42,7 +26,7 @@ export class DatePipe extends BaseDatePipe implements PipeTransform {
return this._getExactDate(value);
}
}
- return super.transform(value, format, timezone, locale);
+ return super.transform(value, format, timezone, locale || this._translateService.currentLang);
}
private _getTimeFromNow(value: string) {
@@ -71,12 +55,12 @@ export class DatePipe extends BaseDatePipe implements PipeTransform {
}
private _getSophisticatedDate(item: string) {
- const date = moment(item);
+ const date = dayjs(item);
const day = date.date();
const month = date.month();
const year = date.year();
- const now = moment(Date.now());
+ const now = dayjs(Date.now());
const yesterday = now.clone().subtract(1, 'days').startOf('day');
const thisDay = now.date();
const thisMonth = now.month();
@@ -84,10 +68,10 @@ export class DatePipe extends BaseDatePipe implements PipeTransform {
const isTodayFormat = date.isSame(new Date(), 'day');
if (isTodayFormat) {
- return moment(date, ['h:mm A']).format('HH:mm');
+ return dayjs(date, ['h:mm A']).format('HH:mm');
}
- const isYesterdayFormat = date.isSame(yesterday, 'd');
+ const isYesterdayFormat = date.isSame(yesterday, 'day');
if (isYesterdayFormat) {
return this._translateService.instant('yesterday');
}
@@ -96,13 +80,13 @@ export class DatePipe extends BaseDatePipe implements PipeTransform {
year === thisYear &&
((month === thisMonth && day !== thisDay && day !== thisDay - 1) || (month !== thisMonth && month >= thisMonth - 2));
if (isShortMonthFormat) {
- const translatedMonth = this._translateService.instant(MONTH_NAMES[month]);
+ const translatedMonth = dayjs.monthsShort()[month];
return `${day} ${translatedMonth}`;
}
const isShortMonthYearFormat = (year === thisYear && month <= thisMonth - 3) || year === thisYear - 1;
if (isShortMonthYearFormat) {
- const translatedMonth = this._translateService.instant(MONTH_NAMES[month]);
+ const translatedMonth = dayjs.monthsShort()[month];
return `${translatedMonth} ${year}`;
}
@@ -110,9 +94,9 @@ export class DatePipe extends BaseDatePipe implements PipeTransform {
}
private _getExactDate(item: string) {
- const date = moment(item);
+ const date = dayjs(item);
const day = date.date();
- const month = this._translateService.instant(MONTH_NAMES[date.month()]);
+ const month = dayjs.monthsShort()[date.month()];
const year = date.year();
const hour = date.hour().toString(10).padStart(2, '0');
const minute = date.minute().toString(10).padStart(2, '0');
diff --git a/apps/red-ui/src/app/modules/shared/shared.module.ts b/apps/red-ui/src/app/modules/shared/shared.module.ts
index addd82cf7..4e59742ed 100644
--- a/apps/red-ui/src/app/modules/shared/shared.module.ts
+++ b/apps/red-ui/src/app/modules/shared/shared.module.ts
@@ -12,8 +12,6 @@ import { AnnotationIconComponent } from './components/annotation-icon/annotation
import { SimpleDoughnutChartComponent } from './components/simple-doughnut-chart/simple-doughnut-chart.component';
import { DictionaryAnnotationIconComponent } from './components/dictionary-annotation-icon/dictionary-annotation-icon.component';
import { CommonUiModule } from '@iqser/common-ui';
-import { DateAdapter, MAT_DATE_FORMATS, MAT_DATE_LOCALE } from '@angular/material/core';
-import { MomentDateAdapter } from '@angular/material-moment-adapter';
import { SelectComponent } from './components/select/select.component';
import { NavigateLastDossiersScreenDirective } from './directives/navigate-last-dossiers-screen.directive';
import { DictionaryManagerComponent } from './components/dictionary-manager/dictionary-manager.component';
@@ -31,6 +29,7 @@ import { DossierStateComponent } from '@shared/components/dossier-state/dossier-
import { FileStatsComponent } from './components/file-stats/file-stats.component';
import { FileNameColumnComponent } from '@shared/components/file-name-column/file-name-column.component';
import { DossierNameColumnComponent } from '@shared/components/dossier-name-column/dossier-name-column.component';
+import { MAT_DATE_FORMATS } from '@angular/material/core';
const buttons = [FileDownloadBtnComponent, UserButtonComponent];
@@ -64,7 +63,6 @@ const modules = [MatConfigModule, ScrollingModule, IconsModule, FormsModule, Rea
imports: [CommonModule, ...modules, MonacoEditorModule],
exports: [...modules, ...components, ...utils],
providers: [
- { provide: DateAdapter, useClass: MomentDateAdapter, deps: [MAT_DATE_LOCALE] },
{
provide: MAT_DATE_FORMATS,
useValue: {
diff --git a/apps/red-ui/src/app/services/notifications.service.ts b/apps/red-ui/src/app/services/notifications.service.ts
index e81677afb..f25f49a88 100644
--- a/apps/red-ui/src/app/services/notifications.service.ts
+++ b/apps/red-ui/src/app/services/notifications.service.ts
@@ -1,6 +1,5 @@
import { Injectable, Injector } from '@angular/core';
import { GenericService, List, mapEach, QueryParam, RequiredParam, Validate } from '@iqser/common-ui';
-import * as moment from 'moment';
import { TranslateService } from '@ngx-translate/core';
import { EMPTY, iif, Observable } from 'rxjs';
import { INotification, Notification, NotificationTypes } from '@red/domain';
@@ -10,6 +9,7 @@ import { marker as _ } from '@biesbjerg/ngx-translate-extract-marker';
import { ActiveDossiersService } from './dossiers/active-dossiers.service';
import { UserService } from '@services/user.service';
import { FilesMapService } from '@services/entity-services/files-map.service';
+import dayjs from 'dayjs';
@Injectable({
providedIn: 'root',
@@ -60,8 +60,7 @@ export class NotificationsService extends GenericService {
}
private _getTime(date: string): string {
- moment.locale(this._translateService.currentLang);
- return moment(date).format('hh:mm A');
+ return dayjs(date).format('hh:mm A');
}
private _translate(notification: INotification, translation: string): string {
diff --git a/apps/red-ui/src/app/utils/configuration.initializer.ts b/apps/red-ui/src/app/utils/configuration.initializer.ts
index d2533f2fd..bbd074151 100644
--- a/apps/red-ui/src/app/utils/configuration.initializer.ts
+++ b/apps/red-ui/src/app/utils/configuration.initializer.ts
@@ -36,7 +36,7 @@ export function configurationInitializer(
title.setTitle('RedactManager');
return of({});
}),
- tap(() => languageService.chooseAndSetInitialLanguage()),
+ switchMap(() => languageService.chooseAndSetInitialLanguage()),
tap(() => userService.initialize()),
take(1),
),
diff --git a/apps/red-ui/src/app/utils/date-inputs-utils.ts b/apps/red-ui/src/app/utils/date-inputs-utils.ts
index f75518ab1..b21f5145f 100644
--- a/apps/red-ui/src/app/utils/date-inputs-utils.ts
+++ b/apps/red-ui/src/app/utils/date-inputs-utils.ts
@@ -1,10 +1,10 @@
import { FormGroup } from '@angular/forms';
-import { Moment } from 'moment';
+import { Dayjs } from 'dayjs';
export function applyIntervalConstraints(
value,
- previousFrom: Moment,
- previousTo: Moment,
+ previousFrom: Dayjs,
+ previousTo: Dayjs,
form: FormGroup,
fromKey: string,
toKey: string,
diff --git a/apps/red-ui/src/assets/config/config.json b/apps/red-ui/src/assets/config/config.json
index 78d1498b2..684210fa7 100644
--- a/apps/red-ui/src/assets/config/config.json
+++ b/apps/red-ui/src/assets/config/config.json
@@ -1,7 +1,7 @@
{
"ADMIN_CONTACT_NAME": null,
"ADMIN_CONTACT_URL": null,
- "API_URL": "https://dev-04.iqser.cloud/redaction-gateway-v1",
+ "API_URL": "https://dev-08.iqser.cloud/redaction-gateway-v1",
"APP_NAME": "RedactManager",
"AUTO_READ_TIME": 3,
"BACKEND_APP_VERSION": "4.4.40",
@@ -10,14 +10,14 @@
"FRONTEND_APP_VERSION": "1.1",
"LICENSE_CUSTOMER": "Development License",
"LICENSE_EMAIL": "todo-license@email.com",
- "LICENSE_END": "31-12-2021",
- "LICENSE_PAGE_COUNT": 1000000,
+ "LICENSE_END": "31-12-2022",
+ "LICENSE_PAGE_COUNT": 1000,
"LICENSE_START": "01-01-2021",
"MAX_FILE_SIZE_MB": 100,
"MAX_RETRIES_ON_SERVER_ERROR": 3,
"OAUTH_CLIENT_ID": "redaction",
"OAUTH_IDP_HINT": null,
- "OAUTH_URL": "https://dev-04.iqser.cloud/auth/realms/redaction",
+ "OAUTH_URL": "https://dev-08.iqser.cloud/auth/realms/redaction",
"RECENT_PERIOD_IN_HOURS": 24,
"SELECTION_MODE": "structural",
"MANUAL_BASE_URL": "https://docs.redactmanager.com/preview"
diff --git a/apps/red-ui/src/assets/i18n/de.json b/apps/red-ui/src/assets/i18n/de.json
index f5e14b6b7..3127d1417 100644
--- a/apps/red-ui/src/assets/i18n/de.json
+++ b/apps/red-ui/src/assets/i18n/de.json
@@ -27,7 +27,10 @@
"label": "Dossier-Name",
"placeholder": "Geben Sie einen Namen ein."
},
- "template": "Dossier-Vorlage",
+ "template": {
+ "label": "Dossier-Vorlage",
+ "placeholder": ""
+ },
"watermark": "Geschwärzte Dokumente mit Wasserzeichen versehen",
"watermark-preview": "Vorschau Dokumente mit Wasserzeichen versehen"
},
diff --git a/apps/red-ui/src/assets/i18n/en.json b/apps/red-ui/src/assets/i18n/en.json
index d193fa05c..202091afb 100644
--- a/apps/red-ui/src/assets/i18n/en.json
+++ b/apps/red-ui/src/assets/i18n/en.json
@@ -27,7 +27,10 @@
"label": "Dossier Name",
"placeholder": "Enter Name"
},
- "template": "Dossier Template",
+ "template": {
+ "label": "Dossier Template",
+ "placeholder": "Choose Dossier Template"
+ },
"watermark": "Watermark application on redacted documents",
"watermark-preview": "Watermark application on preview documents"
},
diff --git a/libs/red-domain/src/lib/trash/trash.item.ts b/libs/red-domain/src/lib/trash/trash.item.ts
index 3676937f1..7f2b5cd0a 100644
--- a/libs/red-domain/src/lib/trash/trash.item.ts
+++ b/libs/red-domain/src/lib/trash/trash.item.ts
@@ -1,5 +1,5 @@
import { getLeftDateTime } from '@iqser/common-ui';
-import * as moment from 'moment';
+import * as dayjs from 'dayjs';
export abstract class TrashItem {
abstract readonly type: 'dossier' | 'file';
@@ -38,6 +38,6 @@ export abstract class TrashItem {
}
get #restoreDate(): string {
- return moment(this.softDeletedTime).add(this._retentionHours, 'hours').toISOString();
+ return dayjs(this.softDeletedTime).add(this._retentionHours, 'hours').toISOString();
}
}
diff --git a/package.json b/package.json
index cf1c4af7d..8ea7f6c0a 100644
--- a/package.json
+++ b/package.json
@@ -28,10 +28,11 @@
"@angular/cdk": "13.2.6",
"@angular/common": "13.2.6",
"@angular/compiler": "13.2.6",
+ "@tabuckner/material-dayjs-adapter": "2.0.0",
+ "dayjs": "^1.11.0",
"@angular/core": "13.2.6",
"@angular/forms": "13.2.6",
"@angular/material": "13.2.6",
- "@angular/material-moment-adapter": "^13.2.0",
"@angular/platform-browser": "13.2.6",
"@angular/platform-browser-dynamic": "13.2.6",
"@angular/router": "13.2.6",
@@ -49,7 +50,6 @@
"keycloak-js": "^16.1.1",
"lodash-es": "^4.17.21",
"messageformat": "^2.3.0",
- "moment": "^2.29.1",
"monaco-editor": "^0.33.0",
"ngx-color-picker": "^12.0.1",
"ngx-logger": "^5.0.9",
diff --git a/yarn.lock b/yarn.lock
index 20d8b00f6..dee309cfc 100644
--- a/yarn.lock
+++ b/yarn.lock
@@ -257,13 +257,6 @@
resolved "https://registry.yarnpkg.com/@angular/language-service/-/language-service-13.2.6.tgz#ee417af8a814b531be54e82e73254c3f18793a3a"
integrity sha512-nhF8GvEyUKIaDFTIQ4RSPQwRng7XjEWQl2zz0B8ShvQsgF/zMLo7mAci9MXxkYBIejU1I07w32r2J90rkjsARA==
-"@angular/material-moment-adapter@^13.2.0":
- version "13.2.6"
- resolved "https://registry.yarnpkg.com/@angular/material-moment-adapter/-/material-moment-adapter-13.2.6.tgz#62461ae77ac3bcc61aec068151e726f8e4d4ce21"
- integrity sha512-mlp+890uL8nr/ufiAw9axEkr4z5Xv4rvyq1bBDUBjrLhODS4gOyo3XC5vO57Ycf4zhSpHPjmDAU/BTFtmNLw4A==
- dependencies:
- tslib "^2.3.0"
-
"@angular/material@13.2.6":
version "13.2.6"
resolved "https://registry.yarnpkg.com/@angular/material/-/material-13.2.6.tgz#615ad63453cd4122ab1775b077e8122c932cab06"
@@ -2149,6 +2142,11 @@
d3-transition "^2.0.0"
tslib "^2.0.0"
+"@tabuckner/material-dayjs-adapter@2.0.0":
+ version "2.0.0"
+ resolved "https://registry.yarnpkg.com/@tabuckner/material-dayjs-adapter/-/material-dayjs-adapter-2.0.0.tgz#e79207232363fca391820c7992f7ed97576d7199"
+ integrity sha512-U2h76Gid/9sWXo+CxxQFnkMpOxfGiSH2xnHDHUmI9ZHZjTzOQ3/T7bZl9jIh43eBEwM3E4mba5W8NYvKExtzaA==
+
"@tootallnate/once@1":
version "1.1.2"
resolved "https://registry.yarnpkg.com/@tootallnate/once/-/once-1.1.2.tgz#ccb91445360179a04e7fe6aff78c00ffc1eeaf82"
@@ -4649,6 +4647,11 @@ data-urls@^2.0.0:
whatwg-mimetype "^2.3.0"
whatwg-url "^8.0.0"
+dayjs@^1.11.0:
+ version "1.11.0"
+ resolved "https://registry.yarnpkg.com/dayjs/-/dayjs-1.11.0.tgz#009bf7ef2e2ea2d5db2e6583d2d39a4b5061e805"
+ integrity sha512-JLC809s6Y948/FuCZPm5IX8rRhQwOiyMb2TfVVQEixG7P8Lm/gt5S7yoQZmC8x1UehI9Pb7sksEt4xx14m+7Ug==
+
debug@2.6.9, debug@^2.2.0, debug@^2.3.3, debug@^2.6.9:
version "2.6.9"
resolved "https://registry.yarnpkg.com/debug/-/debug-2.6.9.tgz#5d128515df134ff327e90a4c93f4e077a536341f"
@@ -8807,11 +8810,6 @@ mkdirp@^1.0.3, mkdirp@^1.0.4:
resolved "https://registry.yarnpkg.com/mkdirp/-/mkdirp-1.0.4.tgz#3eb5ed62622756d79a5f0e2a221dfebad75c2f7e"
integrity sha512-vVqVZQyf3WLx2Shd0qJ9xuvqgAyKPLAiqITEtqW0oIUjzo3PePDd6fW9iFz30ef7Ysp/oiWqbhszeGWW2T6Gzw==
-moment@^2.29.1:
- version "2.29.1"
- resolved "https://registry.yarnpkg.com/moment/-/moment-2.29.1.tgz#b2be769fa31940be9eeea6469c075e35006fa3d3"
- integrity sha512-kHmoybcPV8Sqy59DwNDY3Jefr64lK/by/da0ViFcuA4DH0vQg5Q6Ze5VimxkfQNSC+Mls/Kx53s7TjP1RhFEDQ==
-
monaco-editor@^0.33.0:
version "0.33.0"
resolved "https://registry.yarnpkg.com/monaco-editor/-/monaco-editor-0.33.0.tgz#842e244f3750a2482f8a29c676b5684e75ff34af"