@tilde-nlp/ngx-translate 2.0.3 → 2.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/esm2020/lib/factories/file-api-service.factory.mjs +1 -1
- package/esm2020/lib/factories/mt-term-term-api.factory.mjs +12 -0
- package/esm2020/lib/factories/text-api-service.factory.mjs +3 -3
- package/esm2020/lib/i18n/de.mjs +2 -7
- package/esm2020/lib/i18n/en.mjs +2 -6
- package/esm2020/lib/i18n/et.mjs +1 -6
- package/esm2020/lib/i18n/fi.mjs +1 -6
- package/esm2020/lib/i18n/lt.mjs +1 -6
- package/esm2020/lib/i18n/lv.mjs +2 -7
- package/esm2020/lib/i18n/pl.mjs +1 -6
- package/esm2020/lib/i18n/sv.mjs +1 -4
- package/esm2020/lib/injection-tokens/index.mjs +2 -1
- package/esm2020/lib/injection-tokens/mt-term-api.token.mjs +2 -0
- package/esm2020/lib/modules/tld-common/models/configs/tld-term-config.model.mjs +1 -1
- package/esm2020/lib/modules/tld-common/services/tld-translate-config.service.mjs +2 -1
- package/esm2020/lib/modules/tld-document/services/api/file-api.service.mjs +7 -7
- package/esm2020/lib/modules/tld-term/create-collection/create-collection.component.mjs +51 -0
- package/esm2020/lib/modules/tld-term/index.mjs +2 -1
- package/esm2020/lib/modules/tld-term/services/api-v1/models/mt-term-collection-v1-status.enum.mjs +7 -0
- package/esm2020/lib/modules/tld-term/services/api-v1/models/mt-term-collection-v1.model.mjs +2 -0
- package/esm2020/lib/modules/tld-term/services/api-v1/mt-term-v1.service.mjs +53 -0
- package/esm2020/lib/modules/tld-term/services/api-v2/mt-term-v2.service.mjs +67 -0
- package/esm2020/lib/modules/tld-term/services/engine-term/eninge-term-api.service.mjs +32 -0
- package/esm2020/lib/modules/tld-term/services/engine-term/models/add-engine-terms-request-params.model.mjs +2 -0
- package/esm2020/lib/modules/tld-term/services/engine-term/models/engine-term-collection-list.model.mjs +2 -0
- package/esm2020/lib/modules/tld-term/services/engine-term/models/engine-term-collection-scope.enum.mjs +6 -0
- package/esm2020/lib/modules/tld-term/services/engine-term/models/engine-term-collection-source.enum.mjs +6 -0
- package/esm2020/lib/modules/tld-term/services/engine-term/models/engine-term-collection-status.enum.mjs +11 -0
- package/esm2020/lib/modules/tld-term/services/engine-term/models/engine-term-collection.model.mjs +2 -0
- package/esm2020/lib/modules/tld-term/services/engine-term/models/index.mjs +8 -0
- package/esm2020/lib/modules/tld-term/services/engine-term/models/update-engine-terms-request-params.model.mjs +2 -0
- package/esm2020/lib/modules/tld-term/services/index.mjs +4 -4
- package/esm2020/lib/modules/tld-term/services/models/combined-collection-tooltip-key.enum.mjs +6 -0
- package/esm2020/lib/modules/tld-term/services/models/combined-collection.model.mjs +190 -0
- package/esm2020/lib/modules/tld-term/services/models/index.mjs +6 -0
- package/esm2020/lib/modules/tld-term/services/models/mt-collection-status.enum.mjs +14 -0
- package/esm2020/lib/modules/tld-term/services/models/mt-collection.model.mjs +2 -0
- package/esm2020/lib/modules/tld-term/services/models/mt-term-service.model.mjs +2 -0
- package/esm2020/lib/modules/tld-term/services/term-api/index.mjs +3 -0
- package/esm2020/lib/modules/tld-term/services/term-api/models/index.mjs +3 -0
- package/esm2020/lib/modules/tld-term/services/term-api/models/tld-term-collection-languages.model.mjs +2 -0
- package/esm2020/lib/modules/tld-term/services/term-api/models/tld-term-collection.model.mjs +2 -0
- package/esm2020/lib/modules/tld-term/services/term-api/term-api.service.mjs +58 -0
- package/esm2020/lib/modules/tld-term/services/terminology.service.mjs +292 -0
- package/esm2020/lib/modules/tld-term/tld-term-collection/tld-term-collection.component.mjs +27 -12
- package/esm2020/lib/modules/tld-term/tld-term-collection-list/tld-term-collection-list.component.mjs +24 -51
- package/esm2020/lib/modules/tld-term/tld-term-menu/tld-term-menu.component.mjs +19 -12
- package/esm2020/lib/modules/tld-term/tld-term.module.mjs +6 -5
- package/esm2020/lib/modules/tld-text/services/api/tld-translate-text-api.service.mjs +7 -7
- package/esm2020/lib/modules/tld-tooltip/services/api-v2/tld-system-api-v2.service.mjs +4 -2
- package/esm2020/lib/modules/tld-web/tld-translate-web/tld-translate-web.component.mjs +8 -8
- package/esm2020/lib/tld-translate.module.mjs +17 -4
- package/esm2020/public-api.mjs +4 -2
- package/fesm2015/tilde-nlp-ngx-translate.mjs +749 -435
- package/fesm2015/tilde-nlp-ngx-translate.mjs.map +1 -1
- package/fesm2020/tilde-nlp-ngx-translate.mjs +724 -431
- package/fesm2020/tilde-nlp-ngx-translate.mjs.map +1 -1
- package/lib/factories/file-api-service.factory.d.ts +2 -2
- package/lib/factories/mt-term-term-api.factory.d.ts +7 -0
- package/lib/factories/text-api-service.factory.d.ts +3 -3
- package/lib/i18n/de.d.ts +0 -5
- package/lib/i18n/en.d.ts +1 -5
- package/lib/i18n/et.d.ts +0 -5
- package/lib/i18n/fi.d.ts +0 -5
- package/lib/i18n/lt.d.ts +0 -5
- package/lib/i18n/lv.d.ts +0 -5
- package/lib/i18n/pl.d.ts +0 -5
- package/lib/i18n/sv.d.ts +0 -3
- package/lib/injection-tokens/index.d.ts +1 -0
- package/lib/injection-tokens/mt-term-api.token.d.ts +1 -0
- package/lib/modules/tld-common/models/configs/tld-term-config.model.d.ts +1 -0
- package/lib/modules/tld-document/services/api/file-api.service.d.ts +3 -3
- package/lib/modules/tld-term/create-collection/create-collection.component.d.ts +17 -0
- package/lib/modules/tld-term/index.d.ts +1 -0
- package/lib/modules/tld-term/{models/mt-collection-status.model.d.ts → services/api-v1/models/mt-term-collection-v1-status.enum.d.ts} +1 -1
- package/lib/modules/tld-term/services/api-v1/models/mt-term-collection-v1.model.d.ts +12 -0
- package/lib/modules/tld-term/services/api-v1/mt-term-v1.service.d.ts +17 -0
- package/lib/modules/tld-term/services/api-v2/mt-term-v2.service.d.ts +18 -0
- package/lib/modules/tld-term/services/engine-term/eninge-term-api.service.d.ts +17 -0
- package/lib/modules/tld-term/services/engine-term/models/add-engine-terms-request-params.model.d.ts +8 -0
- package/lib/modules/tld-term/services/engine-term/models/engine-term-collection-list.model.d.ts +4 -0
- package/lib/modules/tld-term/services/engine-term/models/engine-term-collection-scope.enum.d.ts +4 -0
- package/lib/modules/tld-term/services/engine-term/models/engine-term-collection-source.enum.d.ts +4 -0
- package/lib/modules/tld-term/services/engine-term/models/engine-term-collection-status.enum.d.ts +9 -0
- package/lib/modules/tld-term/services/engine-term/models/engine-term-collection.model.d.ts +14 -0
- package/lib/modules/tld-term/services/engine-term/models/index.d.ts +7 -0
- package/lib/modules/tld-term/services/engine-term/models/update-engine-terms-request-params.model.d.ts +5 -0
- package/lib/modules/tld-term/services/index.d.ts +3 -3
- package/lib/modules/tld-term/services/models/combined-collection-tooltip-key.enum.d.ts +4 -0
- package/lib/modules/tld-term/services/models/combined-collection.model.d.ts +87 -0
- package/lib/modules/tld-term/services/models/index.d.ts +5 -0
- package/lib/modules/tld-term/services/models/mt-collection-status.enum.d.ts +11 -0
- package/lib/modules/tld-term/services/models/mt-collection.model.d.ts +14 -0
- package/lib/modules/tld-term/services/models/mt-term-service.model.d.ts +7 -0
- package/lib/modules/tld-term/services/term-api/index.d.ts +2 -0
- package/lib/modules/tld-term/services/term-api/models/index.d.ts +2 -0
- package/lib/modules/tld-term/{models/term-api → services/term-api/models}/tld-term-collection.model.d.ts +2 -2
- package/lib/modules/tld-term/services/term-api/term-api.service.d.ts +17 -0
- package/lib/modules/tld-term/services/terminology.service.d.ts +63 -0
- package/lib/modules/tld-term/tld-term-collection/tld-term-collection.component.d.ts +13 -4
- package/lib/modules/tld-term/tld-term-collection-list/tld-term-collection-list.component.d.ts +13 -17
- package/lib/modules/tld-term/tld-term-menu/tld-term-menu.component.d.ts +11 -7
- package/lib/modules/tld-term/tld-term.module.d.ts +13 -12
- package/lib/modules/tld-text/services/api/tld-translate-text-api.service.d.ts +3 -3
- package/lib/modules/tld-web/tld-translate-web/tld-translate-web.component.d.ts +3 -3
- package/package.json +1 -1
- package/public-api.d.ts +3 -1
- package/src/assets/webcomponent/tld-translate.js +1 -1
- package/tilde-nlp-ngx-translate-2.1.0.tgz +0 -0
- package/esm2020/lib/modules/tld-term/models/converted-collection-tooltip-key.model.mjs +0 -7
- package/esm2020/lib/modules/tld-term/models/converted-collection-type.model.mjs +0 -9
- package/esm2020/lib/modules/tld-term/models/index.mjs +0 -7
- package/esm2020/lib/modules/tld-term/models/mt-api/tld-mt-term-collection.model.mjs +0 -2
- package/esm2020/lib/modules/tld-term/models/mt-collection-status.model.mjs +0 -7
- package/esm2020/lib/modules/tld-term/models/term-api/tld-term-collection-languages.model.mjs +0 -2
- package/esm2020/lib/modules/tld-term/models/term-api/tld-term-collection.model.mjs +0 -2
- package/esm2020/lib/modules/tld-term/models/tld-converted-collection.model.mjs +0 -114
- package/esm2020/lib/modules/tld-term/services/mt-collections-api.service.mjs +0 -33
- package/esm2020/lib/modules/tld-term/services/term-api.service.mjs +0 -34
- package/esm2020/lib/modules/tld-term/services/tld-term-collections.service.mjs +0 -253
- package/lib/modules/tld-term/models/converted-collection-tooltip-key.model.d.ts +0 -5
- package/lib/modules/tld-term/models/converted-collection-type.model.d.ts +0 -7
- package/lib/modules/tld-term/models/index.d.ts +0 -6
- package/lib/modules/tld-term/models/mt-api/tld-mt-term-collection.model.d.ts +0 -15
- package/lib/modules/tld-term/models/tld-converted-collection.model.d.ts +0 -43
- package/lib/modules/tld-term/services/mt-collections-api.service.d.ts +0 -13
- package/lib/modules/tld-term/services/term-api.service.d.ts +0 -15
- package/lib/modules/tld-term/services/tld-term-collections.service.d.ts +0 -57
- package/tilde-nlp-ngx-translate-2.0.3.tgz +0 -0
- /package/lib/modules/tld-term/{models/term-api → services/term-api/models}/tld-term-collection-languages.model.d.ts +0 -0
|
@@ -8,13 +8,13 @@ import * as i1$3 from '@angular/common/http';
|
|
|
8
8
|
import { HttpErrorResponse, HttpHeaders, HttpEventType, HttpClient, HttpClientModule } from '@angular/common/http';
|
|
9
9
|
import * as i12 from '@tilde-nlp/ngx-common';
|
|
10
10
|
import { NotificationMessageType, CloseButtonModule, SortTranslationsModule, InlineMessageType, InlineMessageIconPosition, InlineMessageModule, FileUploadModule, FilterWithHighlightPipe, FilterWithHighlightModule, ClickOutsideModule, NotificationMessageModule, CompanyProductModule } from '@tilde-nlp/ngx-common';
|
|
11
|
-
import { Subject, ReplaySubject, BehaviorSubject, of, timer, throwError, forkJoin } from 'rxjs';
|
|
11
|
+
import { Subject, ReplaySubject, BehaviorSubject, of, timer, throwError, map, tap, forkJoin } from 'rxjs';
|
|
12
12
|
import * as i1$1 from '@ngx-translate/core';
|
|
13
13
|
import { TranslateModule, TranslateService } from '@ngx-translate/core';
|
|
14
14
|
import * as i4 from '@angular/flex-layout/flex';
|
|
15
15
|
import * as i3$1 from '@angular/material/menu';
|
|
16
16
|
import { MatMenu, MatMenuModule } from '@angular/material/menu';
|
|
17
|
-
import { takeUntil, catchError, retryWhen, mergeMap, take, map
|
|
17
|
+
import { takeUntil, catchError, retryWhen, mergeMap, take, map as map$1, distinctUntilChanged, debounce, tap as tap$1 } from 'rxjs/operators';
|
|
18
18
|
import * as i5 from '@angular/material/button';
|
|
19
19
|
import { MatButton, MatButtonModule } from '@angular/material/button';
|
|
20
20
|
import * as i3 from '@angular/common';
|
|
@@ -352,12 +352,9 @@ const i18n_de = {
|
|
|
352
352
|
"SELECTED_NONE": "Keines",
|
|
353
353
|
"EDIT": "Bearbeiten",
|
|
354
354
|
"CREATE": "Neues Glossar",
|
|
355
|
-
"ENTRY_COUNT": "Einträge: {{count}}",
|
|
356
|
-
"ENTRY_COUNT_WITH_LANGUGAES": "Einträge: {{count}} [{{languages}}]",
|
|
357
355
|
"DEFAULT_COLLECTION_NAME": "Meine Begriffssammlung",
|
|
358
356
|
"SYNC": "Synchronisieren",
|
|
359
357
|
"SYNC_ERROR": "Erneut versuchen",
|
|
360
|
-
"MT_ENTRY_COUNT": "Importiert: {{count}}",
|
|
361
358
|
"TITLE": "Glossare auswählen, bearbeiten und verwalten",
|
|
362
359
|
"TITLE_EMPTY": "Ein erstes Glossar erstellen",
|
|
363
360
|
"TITLE_MOBILE": "Glossare auswählen",
|
|
@@ -374,8 +371,7 @@ const i18n_de = {
|
|
|
374
371
|
},
|
|
375
372
|
"ARIA_LABELS": {
|
|
376
373
|
"RADIO_GROUP": "Begriffssammlung auswählen",
|
|
377
|
-
"OTHER_COLLECTIONS": "Sammlungsmenü öffnen"
|
|
378
|
-
"MT_ENTRY_COUNT": "Anzahl der für die maschinelle Übersetzung verwendeten Einträge"
|
|
374
|
+
"OTHER_COLLECTIONS": "Sammlungsmenü öffnen"
|
|
379
375
|
},
|
|
380
376
|
"CREATE_DIALOG": {
|
|
381
377
|
"CANCEL": "Abbrechen",
|
|
@@ -388,7 +384,6 @@ const i18n_de = {
|
|
|
388
384
|
},
|
|
389
385
|
"TOOLTIPS": {
|
|
390
386
|
"EDIT": "Sie werden zum Terminologieportal weitergeleitet, das in einem neuen Tab geöffnet wird",
|
|
391
|
-
"ENTRY_COUNT": "Anzahl der hinzugefügten Einträge in der Begriffssammlung",
|
|
392
387
|
"IMPORTING": "Die Begriffssammlung wird gerade importiert und kann nicht verwendet werden, solange der Import nicht abgeschlossen ist.",
|
|
393
388
|
"NO_ENTRIES": "Begriffssammlung kann nicht verwendet werden, da es keine Begriffe für die Ausgangssprache gibt.",
|
|
394
389
|
"SYNC": "Begriffssammlung aktualisieren",
|
|
@@ -747,9 +742,7 @@ const i18n_en = {
|
|
|
747
742
|
"CREATE": "New glossary",
|
|
748
743
|
"DESCRIPTION_EMPTY": "You can set up exactly how you want {{appName}} to translate words and phrases specific to your company or industry by adding them to your unique term collections.",
|
|
749
744
|
"DESCRIPTION_EMPTY_MOBILE": "Use the desktop version to set up exactly how you want Tilde MT to translate words and phrases specific to your company or industry by adding them to your unique term collections.",
|
|
750
|
-
"
|
|
751
|
-
"ENTRY_COUNT_WITH_LANGUGAES": "Entries: {{count}} [{{languages}}]",
|
|
752
|
-
"MT_ENTRY_COUNT": "Imported: {{count}}",
|
|
745
|
+
"LAST_UPDATED": "Last updated: {{date}}",
|
|
753
746
|
"DEFAULT_COLLECTION_NAME": "My term collection",
|
|
754
747
|
"SYNC": "Sync",
|
|
755
748
|
"SYNC_ERROR": "Retry",
|
|
@@ -768,8 +761,6 @@ const i18n_en = {
|
|
|
768
761
|
},
|
|
769
762
|
"TOOLTIPS": {
|
|
770
763
|
"EDIT": "You will be redirected to terminology portal that will be opened in a new tab",
|
|
771
|
-
"ENTRY_COUNT": "Number of entries added to the term collection",
|
|
772
|
-
"MT_ENTRY_COUNT": "Number of entries used for machine translation",
|
|
773
764
|
"IMPORTING": "Import of the term collection in progress, the collection will not be available until it is completed.",
|
|
774
765
|
"NO_ENTRIES": "Term collection cannot be used: no terms in source language",
|
|
775
766
|
"SYNC": "Update the term collection",
|
|
@@ -1124,7 +1115,6 @@ const i18n_et = {
|
|
|
1124
1115
|
"CANCEL": "Loobu"
|
|
1125
1116
|
},
|
|
1126
1117
|
"TERM_COLLECTIONS": {
|
|
1127
|
-
"MT_ENTRY_COUNT": "Imporditud: {{count}}",
|
|
1128
1118
|
"TITLE": "Sõnastike valimine, redigeerimine ja haldamine",
|
|
1129
1119
|
"TITLE_EMPTY": "Looge oma esimene sõnastik",
|
|
1130
1120
|
"TITLE_MOBILE": "Valige sõnastikud",
|
|
@@ -1137,8 +1127,6 @@ const i18n_et = {
|
|
|
1137
1127
|
"SELECTED_NONE": "Puudub",
|
|
1138
1128
|
"EDIT": "Redigeeri",
|
|
1139
1129
|
"CREATE": "Uus sõnastik",
|
|
1140
|
-
"ENTRY_COUNT": "Kirjeid: {{count}}",
|
|
1141
|
-
"ENTRY_COUNT_WITH_LANGUGAES": "Kirjeid: {{count}} [{{languages}}]",
|
|
1142
1130
|
"DEFAULT_COLLECTION_NAME": "Minu terminikogu",
|
|
1143
1131
|
"SYNC": "Sünkrooni",
|
|
1144
1132
|
"SYNC_ERROR": "Proovi uuesti",
|
|
@@ -1162,9 +1150,7 @@ const i18n_et = {
|
|
|
1162
1150
|
"COLLECTION_NAME_ERROR": "Pealkiri peaks olema vähemalt {{minLength}} sümbolit pikk ja mitte pikem kui {{maxLength}} sümbolit"
|
|
1163
1151
|
},
|
|
1164
1152
|
"TOOLTIPS": {
|
|
1165
|
-
"MT_ENTRY_COUNT": "Masintõlkes kasutatavate kirjete arv",
|
|
1166
1153
|
"EDIT": "Teid suunatakse ümber terminoloogiaportaali, mis avatakse uuel vahekaardil",
|
|
1167
|
-
"ENTRY_COUNT": "Terminikogusse lisatud kirjete arv",
|
|
1168
1154
|
"IMPORTING": "Terminikogu imporditakse ja seda ei kasutata, kui importimine veel kestab.",
|
|
1169
1155
|
"NO_ENTRIES": "Terminikogu ei saa kasutada. Lähtekeeles pole termineid.",
|
|
1170
1156
|
"SYNC": "Värskenda terminikogu",
|
|
@@ -1507,7 +1493,6 @@ const i18n_fi = {
|
|
|
1507
1493
|
"CLOSE": "Sulje"
|
|
1508
1494
|
},
|
|
1509
1495
|
"TERM_COLLECTIONS": {
|
|
1510
|
-
"MT_ENTRY_COUNT": "Tuotu: {{count}}",
|
|
1511
1496
|
"TITLE": "Valitse, muokkaa ja hallinnoi sanastoja",
|
|
1512
1497
|
"TITLE_EMPTY": "Luo ensimmäinen sanasto",
|
|
1513
1498
|
"TITLE_MOBILE": "Valitse sanastot",
|
|
@@ -1526,8 +1511,6 @@ const i18n_fi = {
|
|
|
1526
1511
|
"SELECTED_NONE": "Ei mitään",
|
|
1527
1512
|
"EDIT": "Muokkaa",
|
|
1528
1513
|
"CREATE": "Uusi sanasto",
|
|
1529
|
-
"ENTRY_COUNT": "Merkinnät: {{count}}",
|
|
1530
|
-
"ENTRY_COUNT_WITH_LANGUGAES": "Merkinnät: {{count}} [{{languages}}]",
|
|
1531
1514
|
"DEFAULT_COLLECTION_NAME": "Termikokoelmani",
|
|
1532
1515
|
"SYNC": "Synkronoi",
|
|
1533
1516
|
"SYNC_ERROR": "Yritä uudelleen",
|
|
@@ -1545,9 +1528,7 @@ const i18n_fi = {
|
|
|
1545
1528
|
"COLLECTION_NAME_ERROR": "Otsikon tulee olla vähintään {{minLength}} ja enintään {{maxLength}} merkkiä pitkä"
|
|
1546
1529
|
},
|
|
1547
1530
|
"TOOLTIPS": {
|
|
1548
|
-
"MT_ENTRY_COUNT": "Konekäännökseen käytettyjen merkintöjen määrä",
|
|
1549
1531
|
"EDIT": "Sinut ohjataan uudelleen termiportaaliin, joka avautuu uudessa välilehdessä",
|
|
1550
|
-
"ENTRY_COUNT": "Termikokoelmaan lisättyjen merkintöjen määrä",
|
|
1551
1532
|
"IMPORTING": "Termikokoelmaa tuodaan. Sitä ei voida käyttää, ennen kuin tuonti on valmis.",
|
|
1552
1533
|
"NO_ENTRIES": "Termikokoelmaa ei voida käyttää, koska lähdekielellä ei ole termejä",
|
|
1553
1534
|
"SYNC": "Päivitä termikokoelma",
|
|
@@ -1913,7 +1894,6 @@ const i18n_lt = {
|
|
|
1913
1894
|
"CANCEL": "Atšaukti"
|
|
1914
1895
|
},
|
|
1915
1896
|
"TERM_COLLECTIONS": {
|
|
1916
|
-
"MT_ENTRY_COUNT": "Importuota: {{count}}",
|
|
1917
1897
|
"TITLE": "Pasirinkite, redaguokite ir tvarkykite žodynus",
|
|
1918
1898
|
"TITLE_EMPTY": "Sukurkite pirmąjį savo žodyną",
|
|
1919
1899
|
"TITLE_MOBILE": "Pasirinkite žodynus",
|
|
@@ -1932,8 +1912,6 @@ const i18n_lt = {
|
|
|
1932
1912
|
"SELECTED_NONE": "Nėra",
|
|
1933
1913
|
"EDIT": "Redaguoti",
|
|
1934
1914
|
"CREATE": "Naujas žodynas",
|
|
1935
|
-
"ENTRY_COUNT": "Įrašų: {{count}}",
|
|
1936
|
-
"ENTRY_COUNT_WITH_LANGUGAES": "Įrašų: {{count}} [{{languages}}]",
|
|
1937
1915
|
"DEFAULT_COLLECTION_NAME": "Mano terminų rinkinys",
|
|
1938
1916
|
"SYNC": "Sinchronizuoti",
|
|
1939
1917
|
"SYNC_ERROR": "Kartoti",
|
|
@@ -1951,9 +1929,7 @@ const i18n_lt = {
|
|
|
1951
1929
|
"COLLECTION_NAME_ERROR": "Pavadinimas turėtų būti bent tiek simbolių ilgio: {{minLength}} ir ne ilgesnis nei tiek simbolių: {{maxLength}}"
|
|
1952
1930
|
},
|
|
1953
1931
|
"TOOLTIPS": {
|
|
1954
|
-
"MT_ENTRY_COUNT": "Mašininio vertimo įrašų skaičius",
|
|
1955
1932
|
"EDIT": "Būsite nukreipti į terminologijos portalą, kuris bus atidarytas naujame skirtuke",
|
|
1956
|
-
"ENTRY_COUNT": "Į terminų rinkinį įtrauktų įrašų skaičius",
|
|
1957
1933
|
"IMPORTING": "Terminų rinkinys importuojamas ir nebus naudojamas, kol nebaigta importuoti.",
|
|
1958
1934
|
"NO_ENTRIES": "Terminų rinkinio naudoti negalima, nes nėra šaltinio kalbos terminų",
|
|
1959
1935
|
"SYNC": "Atnaujinti terminų rinkinį",
|
|
@@ -2304,7 +2280,6 @@ const i18n_lv = {
|
|
|
2304
2280
|
"CANCEL": "Atcelt"
|
|
2305
2281
|
},
|
|
2306
2282
|
"TERM_COLLECTIONS": {
|
|
2307
|
-
"MT_ENTRY_COUNT": "Importēts: {{count}}",
|
|
2308
2283
|
"TITLE": "Glosāriju atlase, rediģēšana un pārvaldība",
|
|
2309
2284
|
"TITLE_EMPTY": "Sava pirmā glosārija izveide",
|
|
2310
2285
|
"TITLE_MOBILE": "Glosāriju atlase",
|
|
@@ -2323,8 +2298,6 @@ const i18n_lv = {
|
|
|
2323
2298
|
"SELECTED_NONE": "Neviens",
|
|
2324
2299
|
"EDIT": "Rediģēt",
|
|
2325
2300
|
"CREATE": "Jauns glosārijs",
|
|
2326
|
-
"ENTRY_COUNT": "Ieraksti: {{count}}",
|
|
2327
|
-
"ENTRY_COUNT_WITH_LANGUGAES": "Ieraksti: {{count}} [{{languages}}]",
|
|
2328
2301
|
"DEFAULT_COLLECTION_NAME": "Mana terminu kolekcija",
|
|
2329
2302
|
"SYNC": "Sinhronizēt",
|
|
2330
2303
|
"SYNC_ERROR": "Mēģināt vēlreiz",
|
|
@@ -2342,9 +2315,7 @@ const i18n_lv = {
|
|
|
2342
2315
|
"COLLECTION_NAME_ERROR": "Rakstzīmju skaits virsrakstā nedrīkst būt mazāks par {{minLength}} vai lielāks par {{maxLength}}"
|
|
2343
2316
|
},
|
|
2344
2317
|
"TOOLTIPS": {
|
|
2345
|
-
"
|
|
2346
|
-
"EDIT": "Jūs tiksit novirzīts uz terminoloģijas portālu, kas tiks atvērts jaunā cilnē",
|
|
2347
|
-
"ENTRY_COUNT": "Terminu kolekcijā pievienoto ierakstu skaits",
|
|
2318
|
+
"EDIT": "Jūs tiksiet novirzīts uz terminoloģijas portālu, kas tiks atvērts jaunā cilnē",
|
|
2348
2319
|
"IMPORTING": "Terminu kolekcija tiek importēta un netiks izmantota līdz importēšanas beigām.",
|
|
2349
2320
|
"NO_ENTRIES": "Terminu kolekciju nevar izmantot, jo avotvalodā nav terminu",
|
|
2350
2321
|
"SYNC": "Atjaunināt terminu kolekciju",
|
|
@@ -2682,7 +2653,6 @@ const i18n_pl = {
|
|
|
2682
2653
|
"CANCEL": "Anuluj"
|
|
2683
2654
|
},
|
|
2684
2655
|
"TERM_COLLECTIONS": {
|
|
2685
|
-
"MT_ENTRY_COUNT": "Zaimportowano: {{count}}",
|
|
2686
2656
|
"TITLE": "Wybieranie, edytowanie i zarządzanie słownikami",
|
|
2687
2657
|
"TITLE_EMPTY": "Utwórz swój pierwszy słownik",
|
|
2688
2658
|
"TITLE_MOBILE": "Wybierz słowniki",
|
|
@@ -2701,8 +2671,6 @@ const i18n_pl = {
|
|
|
2701
2671
|
"SELECTED_NONE": "Brak",
|
|
2702
2672
|
"EDIT": "Edytuj",
|
|
2703
2673
|
"CREATE": "Nowy glosariusz",
|
|
2704
|
-
"ENTRY_COUNT": "Wpisy: {{count}}",
|
|
2705
|
-
"ENTRY_COUNT_WITH_LANGUGAES": "Wpisy: {{count}} [{{languages}}]",
|
|
2706
2674
|
"DEFAULT_COLLECTION_NAME": "Mój zbiór terminów",
|
|
2707
2675
|
"SYNC": "Synchronizuj",
|
|
2708
2676
|
"SYNC_ERROR": "Spróbuj ponownie",
|
|
@@ -2720,9 +2688,7 @@ const i18n_pl = {
|
|
|
2720
2688
|
"COLLECTION_NAME_ERROR": "Tytuł powinien mieć minimalną liczbę symboli wynoszącą {{minLength}} oraz nie większą niż {{maxLength}}"
|
|
2721
2689
|
},
|
|
2722
2690
|
"TOOLTIPS": {
|
|
2723
|
-
"MT_ENTRY_COUNT": "Liczba wpisów używanych do tłumaczenia maszynowego",
|
|
2724
2691
|
"EDIT": "Nastąpi przekierowanie do portalu z terminologią, który otworzy się w nowej zakładce",
|
|
2725
|
-
"ENTRY_COUNT": "Liczba wpisów dodana w zbiorze terminów",
|
|
2726
2692
|
"IMPORTING": "Zbiór terminów jest importowany i do momentu zakończenia importu nie można z niego korzystać.",
|
|
2727
2693
|
"NO_ENTRIES": "Nie można korzystać ze zbioru terminów, ponieważ dla języka źródłowego nie ma terminów",
|
|
2728
2694
|
"SYNC": "Zaktualizuj zbiór terminów",
|
|
@@ -2980,8 +2946,6 @@ const i18n_sv = {
|
|
|
2980
2946
|
"CREATE": "Ny ordlista",
|
|
2981
2947
|
"DESCRIPTION_EMPTY": "Du kan skapa unika termbanker för varje domän och projekt för att definiera hur specifika ord och fraser översätts.",
|
|
2982
2948
|
"DESCRIPTION_EMPTY_MOBILE": "Använd skrivbordsversionen för att skapa unika termbanker för varje domän och projekt för att definiera hur specifika ord och fraser översätts. När du är klar kommer du att kunna använda dem i dina översättningsprojekt.",
|
|
2983
|
-
"ENTRY_COUNT": "Poster: {{count}}",
|
|
2984
|
-
"ENTRY_COUNT_WITH_LANGUGAES": "Poster: {{count}} [{{languages}}]",
|
|
2985
2949
|
"DEFAULT_COLLECTION_NAME": "Min termbank",
|
|
2986
2950
|
"SYNC": "Synkronisera",
|
|
2987
2951
|
"SYNC_ERROR": "Försök igen",
|
|
@@ -3000,7 +2964,6 @@ const i18n_sv = {
|
|
|
3000
2964
|
},
|
|
3001
2965
|
"TOOLTIPS": {
|
|
3002
2966
|
"EDIT": "Du kommer att omdirigeras till terminologiportalen som kommer att öppnas i en ny flik",
|
|
3003
|
-
"ENTRY_COUNT": "Antal poster som lagts till i termbanken",
|
|
3004
2967
|
"IMPORTING": "Termbanken importeras och kommer inte att användas förrän importen är klar.",
|
|
3005
2968
|
"NO_ENTRIES": "Termbanken kan inte användas eftersom det inte finns några termer för källspråket",
|
|
3006
2969
|
"SYNC": "Uppdatera termbank",
|
|
@@ -3215,6 +3178,8 @@ const TLD_TRANSLATE_CONFIG_TOKEN = "TldTranslateConfig";
|
|
|
3215
3178
|
|
|
3216
3179
|
const OPEN_CLOSE_BTN_ICONS_TOKEN = 'OPEN_CLOSE_BTN_ICONS_TOKEN';
|
|
3217
3180
|
|
|
3181
|
+
const MT_TERM_API_TOKEN = "MtTermApiToken";
|
|
3182
|
+
|
|
3218
3183
|
/**
|
|
3219
3184
|
* Class for storing some common methods or global app constants.
|
|
3220
3185
|
*/
|
|
@@ -3559,6 +3524,7 @@ class TldTranslateConfigService {
|
|
|
3559
3524
|
this._termConfig.collectionNameMaxLength = termConfig?.collectionNameMaxLength ?? 300;
|
|
3560
3525
|
this._termConfig.refreshTimeoutMs = termConfig?.refreshTimeoutMs ?? 10000;
|
|
3561
3526
|
this._termConfig.refreshTimeoutMsWhenImporting = termConfig?.refreshTimeoutMsWhenImporting ?? 5000;
|
|
3527
|
+
this._termConfig.engineTermUrl = termConfig?.engineTermUrl;
|
|
3562
3528
|
this._termConfig.freeTrialUrl = termConfig?.freeTrialUrl ?? "https://tilde.com/products-and-services/machine-translation/pricing/Tilde-MT";
|
|
3563
3529
|
this._termConfig.learnMoreUrl = termConfig?.learnMoreUrl ?? "https://www.tilde.com/products-and-services/machine-translation/Tilde-MT-features-glossary";
|
|
3564
3530
|
// seperated because following urls have method names added
|
|
@@ -5683,139 +5649,235 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImpor
|
|
|
5683
5649
|
}]
|
|
5684
5650
|
}] });
|
|
5685
5651
|
|
|
5686
|
-
|
|
5687
|
-
|
|
5688
|
-
|
|
5689
|
-
|
|
5690
|
-
(
|
|
5691
|
-
|
|
5692
|
-
|
|
5693
|
-
|
|
5652
|
+
var EngineTermCollectionScope;
|
|
5653
|
+
(function (EngineTermCollectionScope) {
|
|
5654
|
+
EngineTermCollectionScope["GLOBAL"] = "Global";
|
|
5655
|
+
EngineTermCollectionScope["GROUP"] = "Group";
|
|
5656
|
+
})(EngineTermCollectionScope || (EngineTermCollectionScope = {}));
|
|
5657
|
+
|
|
5658
|
+
var EngineTermCollectionSource;
|
|
5659
|
+
(function (EngineTermCollectionSource) {
|
|
5660
|
+
EngineTermCollectionSource["TILDE_TERM"] = "TildeTerm";
|
|
5661
|
+
EngineTermCollectionSource["FILE"] = "File";
|
|
5662
|
+
})(EngineTermCollectionSource || (EngineTermCollectionSource = {}));
|
|
5663
|
+
|
|
5664
|
+
var EngineTermCollectionStatus;
|
|
5665
|
+
(function (EngineTermCollectionStatus) {
|
|
5666
|
+
EngineTermCollectionStatus["QUEUING"] = "Queuing";
|
|
5667
|
+
EngineTermCollectionStatus["FETCHING"] = "Fetching";
|
|
5668
|
+
EngineTermCollectionStatus["PREPROCESSING"] = "Preprocessing";
|
|
5669
|
+
EngineTermCollectionStatus["DELETING"] = "Deleting";
|
|
5670
|
+
EngineTermCollectionStatus["READY"] = "Ready";
|
|
5671
|
+
EngineTermCollectionStatus["ERROR"] = "Error";
|
|
5672
|
+
EngineTermCollectionStatus["DELETED"] = "Deleted";
|
|
5673
|
+
})(EngineTermCollectionStatus || (EngineTermCollectionStatus = {}));
|
|
5674
|
+
|
|
5675
|
+
var CombinedCollectionTooltipKey;
|
|
5676
|
+
(function (CombinedCollectionTooltipKey) {
|
|
5677
|
+
CombinedCollectionTooltipKey["NO_ENTRIES"] = "NO_ENTRIES";
|
|
5678
|
+
CombinedCollectionTooltipKey["IMPORTING"] = "IMPORTING";
|
|
5679
|
+
})(CombinedCollectionTooltipKey || (CombinedCollectionTooltipKey = {}));
|
|
5694
5680
|
|
|
5695
5681
|
var MtCollectionStatus;
|
|
5696
5682
|
(function (MtCollectionStatus) {
|
|
5683
|
+
MtCollectionStatus["QUEUING"] = "Queuing";
|
|
5684
|
+
MtCollectionStatus["FETCHING"] = "Fetching";
|
|
5685
|
+
MtCollectionStatus["PREPROCESSING"] = "Preprocessing";
|
|
5686
|
+
MtCollectionStatus["DELETING"] = "Deleting";
|
|
5697
5687
|
MtCollectionStatus["READY"] = "Ready";
|
|
5688
|
+
MtCollectionStatus["DELETED"] = "Deleted";
|
|
5698
5689
|
MtCollectionStatus["PROCESSING"] = "Processing";
|
|
5699
5690
|
MtCollectionStatus["ERROR"] = "Error";
|
|
5691
|
+
// basic status created in frontend
|
|
5692
|
+
MtCollectionStatus["NOT_IN_USE"] = "NotInUse";
|
|
5700
5693
|
})(MtCollectionStatus || (MtCollectionStatus = {}));
|
|
5701
5694
|
|
|
5702
|
-
var ConvertedCollectionTooltipKey;
|
|
5703
|
-
(function (ConvertedCollectionTooltipKey) {
|
|
5704
|
-
ConvertedCollectionTooltipKey["NO_ENTRIES"] = "NO_ENTRIES";
|
|
5705
|
-
ConvertedCollectionTooltipKey["IMPORTING"] = "IMPORTING";
|
|
5706
|
-
ConvertedCollectionTooltipKey["SYNCING"] = "SYNCING";
|
|
5707
|
-
})(ConvertedCollectionTooltipKey || (ConvertedCollectionTooltipKey = {}));
|
|
5708
|
-
|
|
5709
5695
|
/**
|
|
5710
|
-
*
|
|
5696
|
+
* Class that joins collection from term api and its imported collection from MT api.
|
|
5711
5697
|
*/
|
|
5712
|
-
class
|
|
5713
|
-
|
|
5714
|
-
|
|
5715
|
-
|
|
5716
|
-
|
|
5717
|
-
|
|
5718
|
-
|
|
5698
|
+
class CombinedCollection {
|
|
5699
|
+
//#endregion
|
|
5700
|
+
constructor(termApiCollection, mtCollection) {
|
|
5701
|
+
//#endregion
|
|
5702
|
+
//#region Editable MT (api v2) fields
|
|
5703
|
+
this.editables = {};
|
|
5704
|
+
//#endregion
|
|
5705
|
+
//#region Getters for common fields
|
|
5706
|
+
// It is possible to optimize getters, by setting some of the values in update method, but it is left this way, so that data is more consistent.
|
|
5707
|
+
// Otherwise it might be easy to miss some property updating and get wrong data in future.
|
|
5708
|
+
this._isSynchronized = true;
|
|
5709
|
+
this.mtCollection = mtCollection;
|
|
5710
|
+
this.termCollection = termApiCollection;
|
|
5711
|
+
this.update(null);
|
|
5712
|
+
}
|
|
5713
|
+
static findExistingCollectionFromList(collections, collection) {
|
|
5714
|
+
for (const col of collections) {
|
|
5715
|
+
if ((col.termId && col.termId == collection.termId) ||
|
|
5716
|
+
(col.mtCollection?.id && col.mtCollection.id == collection.mtCollection?.id)) {
|
|
5717
|
+
return col;
|
|
5718
|
+
}
|
|
5719
5719
|
}
|
|
5720
|
-
|
|
5721
|
-
|
|
5720
|
+
return null;
|
|
5721
|
+
}
|
|
5722
|
+
static findExistingIndexFromList(collections, collection) {
|
|
5723
|
+
let i = 0;
|
|
5724
|
+
for (const col of collections) {
|
|
5725
|
+
if ((col.termId && col.termId == collection.termId) ||
|
|
5726
|
+
(col.mtCollection?.id && col.mtCollection.id == collection.mtCollection?.id)) {
|
|
5727
|
+
return i;
|
|
5728
|
+
}
|
|
5729
|
+
i += 1;
|
|
5722
5730
|
}
|
|
5731
|
+
return null;
|
|
5732
|
+
}
|
|
5733
|
+
/**
|
|
5734
|
+
* Weather collection is synchronized with term portal collection. If no term collection, value is set to true.
|
|
5735
|
+
*/
|
|
5736
|
+
get isSynchronized() {
|
|
5737
|
+
return this._isSynchronized;
|
|
5723
5738
|
}
|
|
5739
|
+
/**
|
|
5740
|
+
* Determines if collections is 'syncable'. Returns true if it is not synced or if synchronization has failed and status is error.
|
|
5741
|
+
*/
|
|
5724
5742
|
get syncButtonVissible() {
|
|
5725
|
-
return !this.isSynchronized || (this.
|
|
5743
|
+
return !this.isSynchronized || (this.termCollection?.modifyDate && this.mtStatus === MtCollectionStatus.ERROR);
|
|
5726
5744
|
}
|
|
5745
|
+
/**
|
|
5746
|
+
* If not ready or error, then collection is importing.
|
|
5747
|
+
*/
|
|
5727
5748
|
get isImporting() {
|
|
5728
|
-
return this.
|
|
5749
|
+
return this.mtCollection && CombinedCollection.importingStatuses.includes(this.mtCollection?.status);
|
|
5729
5750
|
}
|
|
5730
5751
|
;
|
|
5731
|
-
|
|
5732
|
-
|
|
5733
|
-
|
|
5734
|
-
|
|
5735
|
-
|
|
5736
|
-
}
|
|
5737
|
-
}
|
|
5738
|
-
return null;
|
|
5752
|
+
/**
|
|
5753
|
+
* Term collection id. Returns value from term collection or from mt, if term collection not existing.
|
|
5754
|
+
*/
|
|
5755
|
+
get termId() {
|
|
5756
|
+
return this.termCollection?.id ?? this.mtCollection?.termId;
|
|
5739
5757
|
}
|
|
5740
|
-
|
|
5741
|
-
|
|
5742
|
-
|
|
5743
|
-
|
|
5744
|
-
|
|
5745
|
-
|
|
5746
|
-
|
|
5747
|
-
|
|
5748
|
-
|
|
5749
|
-
|
|
5750
|
-
|
|
5751
|
-
|
|
5752
|
-
|
|
5753
|
-
|
|
5754
|
-
|
|
5755
|
-
|
|
5758
|
+
get mtStatus() {
|
|
5759
|
+
return this.mtCollection?.status;
|
|
5760
|
+
}
|
|
5761
|
+
/**
|
|
5762
|
+
* Last updated date from mt api.
|
|
5763
|
+
*/
|
|
5764
|
+
get lastUpdated() {
|
|
5765
|
+
return this.mtCollection?.lastUpdated;
|
|
5766
|
+
}
|
|
5767
|
+
/**
|
|
5768
|
+
* Collection name. If has term collection, takes from there. If not, then returns mt collection name.
|
|
5769
|
+
*/
|
|
5770
|
+
get name() {
|
|
5771
|
+
return this.termCollection?.name ?? this.mtCollection?.name;
|
|
5772
|
+
}
|
|
5773
|
+
/**
|
|
5774
|
+
* Entry count from term api.
|
|
5775
|
+
*/
|
|
5776
|
+
get termEntries() {
|
|
5777
|
+
return this.termCollection?.entryCount;
|
|
5778
|
+
}
|
|
5779
|
+
get default() {
|
|
5780
|
+
return this.mtCollection?.default;
|
|
5781
|
+
}
|
|
5782
|
+
/**
|
|
5783
|
+
* Status from mt api or custom "NOT_IN_USE" status if not imported in mt.s
|
|
5784
|
+
*/
|
|
5785
|
+
get status() {
|
|
5786
|
+
return this.mtStatus ?? MtCollectionStatus.NOT_IN_USE;
|
|
5787
|
+
}
|
|
5788
|
+
/**
|
|
5789
|
+
* Scope can be edited only if has mt collcetion or term collection is being prepared for import.
|
|
5790
|
+
*/
|
|
5791
|
+
get canEditScope() {
|
|
5792
|
+
return this.mtCollection || this.editables.default;
|
|
5793
|
+
}
|
|
5794
|
+
/**
|
|
5795
|
+
* Updates collection with values from new collection.
|
|
5796
|
+
* @param collection collection from which should be updated.
|
|
5797
|
+
* @param initialRefresh if set to true, editable fields will also be updated.
|
|
5798
|
+
*/
|
|
5799
|
+
update(collection, initialRefresh = true) {
|
|
5800
|
+
if (collection?.termCollection) {
|
|
5801
|
+
this.termCollection = collection.termCollection;
|
|
5756
5802
|
}
|
|
5757
|
-
|
|
5758
|
-
|
|
5759
|
-
this.tooltipKey = ConvertedCollectionTooltipKey.NO_ENTRIES;
|
|
5803
|
+
if (collection?.mtCollection) {
|
|
5804
|
+
this.mtCollection = collection.mtCollection;
|
|
5760
5805
|
}
|
|
5761
|
-
|
|
5762
|
-
this.
|
|
5806
|
+
if (initialRefresh) {
|
|
5807
|
+
this.updateEditables();
|
|
5763
5808
|
}
|
|
5764
|
-
|
|
5765
|
-
|
|
5809
|
+
this.updateIsSynchronized();
|
|
5810
|
+
this.updateTooltipKey();
|
|
5811
|
+
this.updateSource();
|
|
5812
|
+
}
|
|
5813
|
+
/**
|
|
5814
|
+
* If some of editables are edited.
|
|
5815
|
+
*
|
|
5816
|
+
* if collection not imported and enabled not set, method will return true, because you cannot update collection if it is not imported or is not meant to be imported.
|
|
5817
|
+
*
|
|
5818
|
+
* @returns true if collection is edited, false if not.
|
|
5819
|
+
*/
|
|
5820
|
+
isEdited() {
|
|
5821
|
+
// if collection not imported and enabled not set, should not update collection.
|
|
5822
|
+
if (!this.mtCollection && !this.editables.default) {
|
|
5823
|
+
return false;
|
|
5766
5824
|
}
|
|
5767
|
-
else
|
|
5768
|
-
this.
|
|
5825
|
+
else if ((this.mtCollection?.default !== this.editables.default)
|
|
5826
|
+
|| (this.mtCollection && this.editables.scope !== this.mtCollection.scope)) {
|
|
5827
|
+
return true;
|
|
5769
5828
|
}
|
|
5829
|
+
return false;
|
|
5770
5830
|
}
|
|
5771
|
-
|
|
5772
|
-
|
|
5773
|
-
|
|
5774
|
-
|
|
5775
|
-
this.
|
|
5776
|
-
|
|
5777
|
-
static convertCollections(collections, sourceLanguage, targetLanguage) {
|
|
5778
|
-
const converted = [];
|
|
5779
|
-
collections.forEach((collection) => {
|
|
5780
|
-
converted.push(new TldConvertedCollection(collection, sourceLanguage, targetLanguage));
|
|
5781
|
-
});
|
|
5782
|
-
return converted;
|
|
5783
|
-
}
|
|
5784
|
-
fromTermApi(obj) {
|
|
5785
|
-
this.termId = obj.id.toString();
|
|
5786
|
-
this.title = obj.name;
|
|
5787
|
-
this.importedFrom = ConvertedCollectionType.Term;
|
|
5788
|
-
this.termModifiedDate = new Date(obj.modifyDate);
|
|
5789
|
-
const language = obj.languages?.find(lang => lang.id.toLowerCase() === this.sourceLanguageCode.toLowerCase());
|
|
5790
|
-
this.entryCount = language?.count ?? 0;
|
|
5791
|
-
this.languagesString = obj.languages.filter(lang => lang.id !== this.sourceLanguageCode && lang.count > 0)
|
|
5792
|
-
.map(lang => lang.id.toUpperCase()).join(", ");
|
|
5793
|
-
}
|
|
5794
|
-
fromTldMTCollection(obj) {
|
|
5795
|
-
this.id = obj.CorpusId;
|
|
5796
|
-
this.title = obj.Title;
|
|
5797
|
-
this.importedFrom = ConvertedCollectionType.MT;
|
|
5798
|
-
this.mtAttachmentDateTime = new Date(obj.AttachmentDateTime);
|
|
5799
|
-
this.termId = obj.TildeTermId;
|
|
5800
|
-
this.mtStatus = obj.Status;
|
|
5801
|
-
this.mtPreparedDateTime = obj.PreparedDateTime;
|
|
5802
|
-
this.mtEntryCount = obj.Count;
|
|
5803
|
-
}
|
|
5804
|
-
isTldCorpus(obj) {
|
|
5805
|
-
return obj.TildeTermId !== undefined;
|
|
5831
|
+
/**
|
|
5832
|
+
* Deletes term collection and its properties.
|
|
5833
|
+
*/
|
|
5834
|
+
deleteTerms() {
|
|
5835
|
+
this.termCollection = null;
|
|
5836
|
+
this.update(null);
|
|
5806
5837
|
}
|
|
5807
5838
|
/**
|
|
5808
|
-
*
|
|
5809
|
-
|
|
5810
|
-
|
|
5811
|
-
|
|
5839
|
+
* Deletes mt collection and its properties.
|
|
5840
|
+
*/
|
|
5841
|
+
deleteMT() {
|
|
5842
|
+
this.mtCollection = null;
|
|
5843
|
+
this.update(null);
|
|
5844
|
+
}
|
|
5845
|
+
//#region Private methods
|
|
5846
|
+
updateIsSynchronized() {
|
|
5812
5847
|
let isSynchronized = true;
|
|
5813
|
-
|
|
5814
|
-
|
|
5848
|
+
const termModified = this.termCollection?.modifyDate;
|
|
5849
|
+
const lastMtUpdated = this.mtCollection?.lastUpdated;
|
|
5850
|
+
if (termModified && lastMtUpdated) {
|
|
5851
|
+
isSynchronized = termModified < lastMtUpdated;
|
|
5815
5852
|
}
|
|
5816
|
-
|
|
5853
|
+
this._isSynchronized = isSynchronized;
|
|
5817
5854
|
}
|
|
5818
|
-
|
|
5855
|
+
updateSource() {
|
|
5856
|
+
if (this.termCollection) {
|
|
5857
|
+
this.source = EngineTermCollectionSource.TILDE_TERM;
|
|
5858
|
+
}
|
|
5859
|
+
else if (this.mtCollection) {
|
|
5860
|
+
this.source = EngineTermCollectionSource.FILE;
|
|
5861
|
+
}
|
|
5862
|
+
}
|
|
5863
|
+
updateTooltipKey() {
|
|
5864
|
+
if (this.termCollection?.entryCount === 0) {
|
|
5865
|
+
this.termTooltipKey = CombinedCollectionTooltipKey.NO_ENTRIES;
|
|
5866
|
+
}
|
|
5867
|
+
else if (this.isImporting) {
|
|
5868
|
+
this.termTooltipKey = CombinedCollectionTooltipKey.IMPORTING;
|
|
5869
|
+
}
|
|
5870
|
+
else {
|
|
5871
|
+
this.termTooltipKey = null;
|
|
5872
|
+
}
|
|
5873
|
+
}
|
|
5874
|
+
updateEditables() {
|
|
5875
|
+
this.editables.default = this.mtCollection?.default;
|
|
5876
|
+
this.editables.scope = this.mtCollection?.scope ?? EngineTermCollectionScope.GLOBAL;
|
|
5877
|
+
}
|
|
5878
|
+
}
|
|
5879
|
+
//#region Static properties
|
|
5880
|
+
CombinedCollection.importingStatuses = [MtCollectionStatus.FETCHING, MtCollectionStatus.PREPROCESSING, MtCollectionStatus.PROCESSING, MtCollectionStatus.QUEUING];
|
|
5819
5881
|
|
|
5820
5882
|
class TermApiService {
|
|
5821
5883
|
constructor(config, http) {
|
|
@@ -5830,10 +5892,34 @@ class TermApiService {
|
|
|
5830
5892
|
name: collectionName,
|
|
5831
5893
|
defaultLanguages
|
|
5832
5894
|
};
|
|
5833
|
-
return this.http.post(this.url, params)
|
|
5895
|
+
return this.http.post(this.url, params)
|
|
5896
|
+
.pipe(map((collection) => {
|
|
5897
|
+
return this.convertToCombinedCollection(collection);
|
|
5898
|
+
}));
|
|
5899
|
+
}
|
|
5900
|
+
getCollectionList(languages) {
|
|
5901
|
+
return this.http.get(this.url)
|
|
5902
|
+
.pipe(map((collections) => {
|
|
5903
|
+
const converted = [];
|
|
5904
|
+
collections.forEach((collection) => {
|
|
5905
|
+
converted.push(this.convertToCombinedCollection(collection));
|
|
5906
|
+
});
|
|
5907
|
+
return converted;
|
|
5908
|
+
}));
|
|
5909
|
+
}
|
|
5910
|
+
getEditLink(termId, sourceLanguage, targetLanguage) {
|
|
5911
|
+
let link = `${this.config.termConfig.apiUrl}/collections/${termId}/mt`;
|
|
5912
|
+
if (sourceLanguage) {
|
|
5913
|
+
link = `${link}/${sourceLanguage}`;
|
|
5914
|
+
}
|
|
5915
|
+
if (targetLanguage) {
|
|
5916
|
+
link = `${link}/${targetLanguage}`;
|
|
5917
|
+
}
|
|
5918
|
+
return link;
|
|
5834
5919
|
}
|
|
5835
|
-
|
|
5836
|
-
|
|
5920
|
+
convertToCombinedCollection(collection) {
|
|
5921
|
+
collection.modifyDate = new Date(collection.modifyDate);
|
|
5922
|
+
return new CombinedCollection(collection, null);
|
|
5837
5923
|
}
|
|
5838
5924
|
}
|
|
5839
5925
|
TermApiService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: TermApiService, deps: [{ token: TldTranslateConfigService }, { token: i1$3.HttpClient }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
@@ -5845,52 +5931,14 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImpor
|
|
|
5845
5931
|
}]
|
|
5846
5932
|
}], ctorParameters: function () { return [{ type: TldTranslateConfigService }, { type: i1$3.HttpClient }]; } });
|
|
5847
5933
|
|
|
5848
|
-
class
|
|
5849
|
-
constructor(
|
|
5850
|
-
this.http = http;
|
|
5851
|
-
this.config = config;
|
|
5852
|
-
}
|
|
5853
|
-
attachTermsFromTildeTerm(systemId, tildeTermCollectionId) {
|
|
5854
|
-
const params = { systemID: systemId, tildeTermColectionID: tildeTermCollectionId };
|
|
5855
|
-
const url = `${this.config.coreConfig.translationServiceUrl}AttachTermsFromTildeTerm`;
|
|
5856
|
-
return this.http.get(url, { params });
|
|
5857
|
-
}
|
|
5858
|
-
loadMTCollections(systemId, sourceLanguage, targetLanguage) {
|
|
5859
|
-
const headers = Common.getAuthHeaders(this.config);
|
|
5860
|
-
const url = `${this.config.coreConfig.translationServiceUrl}GetDetailedSystemTermCorpora`;
|
|
5861
|
-
const params = { systemID: systemId };
|
|
5862
|
-
return this.http.get(url, { headers, params }).pipe(map((collections) => { return TldConvertedCollection.convertCollections(collections, sourceLanguage, targetLanguage); }));
|
|
5863
|
-
}
|
|
5864
|
-
}
|
|
5865
|
-
MtCollectionsApiService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: MtCollectionsApiService, deps: [{ token: i1$3.HttpClient }, { token: TldTranslateConfigService }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
5866
|
-
MtCollectionsApiService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: MtCollectionsApiService, providedIn: 'root' });
|
|
5867
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: MtCollectionsApiService, decorators: [{
|
|
5868
|
-
type: Injectable,
|
|
5869
|
-
args: [{
|
|
5870
|
-
providedIn: 'root'
|
|
5871
|
-
}]
|
|
5872
|
-
}], ctorParameters: function () { return [{ type: i1$3.HttpClient }, { type: TldTranslateConfigService }]; } });
|
|
5873
|
-
|
|
5874
|
-
class TldTermCollectionsService {
|
|
5875
|
-
constructor(config, tldSystem, termApi, mtApi) {
|
|
5934
|
+
class TerminologyService {
|
|
5935
|
+
constructor(config, termApi, mtApi) {
|
|
5876
5936
|
this.config = config;
|
|
5877
|
-
this.tldSystem = tldSystem;
|
|
5878
5937
|
this.termApi = termApi;
|
|
5879
5938
|
this.mtApi = mtApi;
|
|
5880
5939
|
this._selected = null;
|
|
5940
|
+
this.onDataUpdate = new Subject();
|
|
5881
5941
|
this.LOCAL_STORAGE_KEY = "systemLastCollections";
|
|
5882
|
-
this.tldSystem.getActiveData()
|
|
5883
|
-
.subscribe((active) => {
|
|
5884
|
-
this.sourceLanguageCode = active?.sourceLang.lang;
|
|
5885
|
-
this.targetLanguageCode = active?.targetLang.lang;
|
|
5886
|
-
this.activeSystemId = active?.systemId || null;
|
|
5887
|
-
this._collections = new Set();
|
|
5888
|
-
// avoiding setter, so the null value is not storeed in location since it is not by user action
|
|
5889
|
-
this._selected = null;
|
|
5890
|
-
if (active && this.tldSystem.isTerminologySupported(active?.system)) {
|
|
5891
|
-
this.refreshCollections(true);
|
|
5892
|
-
}
|
|
5893
|
-
});
|
|
5894
5942
|
}
|
|
5895
5943
|
get selected() { return this._selected; }
|
|
5896
5944
|
set selected(val) {
|
|
@@ -5899,15 +5947,15 @@ class TldTermCollectionsService {
|
|
|
5899
5947
|
if (!this._selected) {
|
|
5900
5948
|
return;
|
|
5901
5949
|
}
|
|
5902
|
-
if (!this._selected.
|
|
5903
|
-
this.
|
|
5950
|
+
if (!this._selected.mtCollection) {
|
|
5951
|
+
this.addToEngine(this._selected);
|
|
5904
5952
|
}
|
|
5905
5953
|
}
|
|
5906
|
-
get
|
|
5907
|
-
return this.
|
|
5954
|
+
get hasAnyCollections() {
|
|
5955
|
+
return this._hasAnyCollections;
|
|
5908
5956
|
}
|
|
5909
|
-
get
|
|
5910
|
-
return this.
|
|
5957
|
+
get shouldShowPromotion() {
|
|
5958
|
+
return !this.hasAnyCollections && !this.hasEditPermissions;
|
|
5911
5959
|
}
|
|
5912
5960
|
get canCreateCollections() {
|
|
5913
5961
|
return this.config.termConfig.canCreateCollection;
|
|
@@ -5915,99 +5963,127 @@ class TldTermCollectionsService {
|
|
|
5915
5963
|
get hasEditPermissions() {
|
|
5916
5964
|
return this.config?.coreConfig.isAuth && this.canCreateCollections && this.config.termConfig.isTermPortalSupported;
|
|
5917
5965
|
}
|
|
5918
|
-
get
|
|
5919
|
-
return this.
|
|
5966
|
+
get isRefreshingCollections() {
|
|
5967
|
+
return this._isRefreshingCollections;
|
|
5920
5968
|
}
|
|
5921
|
-
get
|
|
5922
|
-
return
|
|
5969
|
+
get collections() {
|
|
5970
|
+
return this._collections;
|
|
5923
5971
|
}
|
|
5924
|
-
|
|
5925
|
-
|
|
5926
|
-
if (
|
|
5927
|
-
this.
|
|
5972
|
+
setEngine(engineId, languages = null, setSelectedFromLocalStorage = false) {
|
|
5973
|
+
// engine is already set with that ID and no need to refresh it.
|
|
5974
|
+
if (engineId !== this.engineId || JSON.stringify(languages) !== JSON.stringify(this.engineLanguages)) {
|
|
5975
|
+
this.engineLanguages = languages;
|
|
5976
|
+
this.engineId = engineId;
|
|
5977
|
+
this._collections = new Set();
|
|
5978
|
+
this.emitDataUpdateEvent();
|
|
5979
|
+
// avoiding setter, so the null value is not storeed in location since it is not by user action
|
|
5980
|
+
this._selected = null;
|
|
5981
|
+
}
|
|
5982
|
+
if (this.engineId) {
|
|
5983
|
+
this.refreshCollections(setSelectedFromLocalStorage, true);
|
|
5928
5984
|
}
|
|
5985
|
+
return this.onDataUpdate.asObservable();
|
|
5929
5986
|
}
|
|
5930
|
-
|
|
5931
|
-
this.
|
|
5932
|
-
|
|
5933
|
-
if (this.selected?.mtStatus !== MtCollectionStatus.PROCESSING) {
|
|
5934
|
-
this.stopAutoRefresh();
|
|
5987
|
+
refreshCollections(setSelectedFromLocalStorage = false, initialRefresh = false) {
|
|
5988
|
+
if (!this.engineId || !this.config.termConfig.isCollectionsActivated || this.isRefreshingCollections) {
|
|
5989
|
+
return;
|
|
5935
5990
|
}
|
|
5991
|
+
// clear timeout since this refresh replaces scheduled
|
|
5992
|
+
this.clearTimeout();
|
|
5993
|
+
this._isRefreshingCollections = true;
|
|
5994
|
+
let termResponse;
|
|
5995
|
+
let mtApiResponse;
|
|
5996
|
+
const observables = [
|
|
5997
|
+
this.termApi.getCollectionList(this.engineLanguages)
|
|
5998
|
+
.pipe(tap((response) => termResponse = response)),
|
|
5999
|
+
this.mtApi.getList(this.engineId)
|
|
6000
|
+
.pipe(tap((response) => mtApiResponse = response)),
|
|
6001
|
+
];
|
|
6002
|
+
forkJoin(observables).subscribe({
|
|
6003
|
+
// do not need response becaue responses are saved in pipe methods
|
|
6004
|
+
next: () => {
|
|
6005
|
+
this.isAnyImporting = false;
|
|
6006
|
+
// note that termResponse and mtapiresponse gets changed during remove method
|
|
6007
|
+
this.removeDeleted(termResponse, mtApiResponse, initialRefresh);
|
|
6008
|
+
this.addCollections([...mtApiResponse, ...termResponse], initialRefresh);
|
|
6009
|
+
if (setSelectedFromLocalStorage) {
|
|
6010
|
+
this.setSelectedFromLocalStorage();
|
|
6011
|
+
}
|
|
6012
|
+
this._isRefreshingCollections = false;
|
|
6013
|
+
this.scheduleRefresh();
|
|
6014
|
+
},
|
|
6015
|
+
error: (error) => {
|
|
6016
|
+
this._isRefreshingCollections = false;
|
|
6017
|
+
// it is enough to show error only in console. No special thing is necessary.
|
|
6018
|
+
console.error(error);
|
|
6019
|
+
},
|
|
6020
|
+
});
|
|
5936
6021
|
}
|
|
5937
|
-
|
|
5938
|
-
if (!collection || !collection.
|
|
6022
|
+
addToEngine(collection) {
|
|
6023
|
+
if (!collection || !collection.termCollection) {
|
|
5939
6024
|
console.error("Trying to attach collection that has no tilde term id.");
|
|
5940
6025
|
return;
|
|
5941
6026
|
}
|
|
5942
|
-
collection.mtStatus = MtCollectionStatus.PROCESSING;
|
|
5943
|
-
collection.isSynchronized = true;
|
|
5944
|
-
this.mtApi.
|
|
5945
|
-
.subscribe(
|
|
5946
|
-
|
|
5947
|
-
|
|
6027
|
+
// collection.mtStatus = MtCollectionStatus.PROCESSING;
|
|
6028
|
+
// collection.isSynchronized = true;
|
|
6029
|
+
this.mtApi.add(this.engineId, collection)
|
|
6030
|
+
.subscribe({
|
|
6031
|
+
error: () => {
|
|
6032
|
+
// collection.mtStatus = MtCollectionStatus.ERROR;
|
|
6033
|
+
// collection.errorKey = ErrorCode.COLLECTION_IMPORT;
|
|
6034
|
+
}
|
|
5948
6035
|
});
|
|
5949
6036
|
}
|
|
5950
|
-
create(
|
|
5951
|
-
return this.termApi.createCollection(
|
|
6037
|
+
create(sourceLanguage, targetLanguage, collectionName, redirectToEdit = true) {
|
|
6038
|
+
return this.termApi.createCollection([sourceLanguage, targetLanguage], collectionName).pipe(tap((collection) => {
|
|
6039
|
+
if (redirectToEdit) {
|
|
6040
|
+
window.open(this.termApi.getEditLink(collection.termCollection.id, sourceLanguage, targetLanguage), "_blank");
|
|
6041
|
+
}
|
|
5952
6042
|
this._collections.add(collection);
|
|
6043
|
+
this.emitDataUpdateEvent();
|
|
5953
6044
|
this._hasAnyCollections = true;
|
|
5954
6045
|
}));
|
|
5955
6046
|
}
|
|
5956
|
-
|
|
5957
|
-
|
|
5958
|
-
|
|
5959
|
-
|
|
6047
|
+
updateIfNecessary(collection) {
|
|
6048
|
+
// collection is not imported and should be attached to engine
|
|
6049
|
+
if (collection.isEdited()) {
|
|
6050
|
+
this.mtApi.add(this.engineId, collection).subscribe((updatedCollection) => {
|
|
6051
|
+
collection.update(updatedCollection);
|
|
6052
|
+
});
|
|
5960
6053
|
}
|
|
5961
|
-
this._isRefreshingCollections = true;
|
|
5962
|
-
const observables = [
|
|
5963
|
-
this.termApi.getCollectionList(this.sourceLanguageCode, this.targetLanguageCode),
|
|
5964
|
-
this.mtApi.loadMTCollections(this.activeSystemId, this.sourceLanguageCode, this.targetLanguageCode)
|
|
5965
|
-
];
|
|
5966
|
-
forkJoin(observables).subscribe((response) => {
|
|
5967
|
-
this.isAnyImporting = false;
|
|
5968
|
-
// TO DO. Doesn't seem to be clean approach with syncing collections. Maybe some cleaner solution possible?
|
|
5969
|
-
this.removeDeletedFromTerms(response[0]);
|
|
5970
|
-
this.updateCollections([...response[0], ...response[1]]);
|
|
5971
|
-
if (setSelectedFromLocalStorage) {
|
|
5972
|
-
this.setSelectedFromLocalStorage();
|
|
5973
|
-
}
|
|
5974
|
-
this._isRefreshingCollections = false;
|
|
5975
|
-
this.scheduleRefresh();
|
|
5976
|
-
}, (error) => {
|
|
5977
|
-
this._isRefreshingCollections = false;
|
|
5978
|
-
// it is enough to show error only in console. No special thing is necessary.
|
|
5979
|
-
console.error(error);
|
|
5980
|
-
});
|
|
5981
6054
|
}
|
|
5982
6055
|
/**
|
|
5983
|
-
|
|
5984
|
-
|
|
5985
|
-
|
|
6056
|
+
*
|
|
6057
|
+
* @returns selected collection id if it is allowed to use collection for translations
|
|
6058
|
+
*/
|
|
5986
6059
|
selectedIdForTranslation() {
|
|
5987
|
-
if (this.selected && (this.selected.
|
|
5988
|
-
return this.selected.id;
|
|
6060
|
+
if (this.selected?.mtCollection && (this.selected.mtCollection.lastUpdated || this.selected.mtCollection?.status === MtCollectionStatus.READY)) {
|
|
6061
|
+
return this.selected.mtCollection?.id;
|
|
5989
6062
|
}
|
|
5990
6063
|
return null;
|
|
5991
6064
|
}
|
|
5992
|
-
startAutoRefresh() {
|
|
5993
|
-
this.
|
|
5994
|
-
this.
|
|
6065
|
+
startAutoRefresh(engineId, languages = null, setSelectedFromLocalStorage = false) {
|
|
6066
|
+
this.hardAutoRefresh = true;
|
|
6067
|
+
return this.setEngine(engineId ?? this.engineId, languages ?? this.engineLanguages, setSelectedFromLocalStorage);
|
|
5995
6068
|
}
|
|
5996
6069
|
stopAutoRefresh() {
|
|
5997
|
-
|
|
5998
|
-
|
|
5999
|
-
|
|
6000
|
-
|
|
6001
|
-
|
|
6070
|
+
this.clearTimeout();
|
|
6071
|
+
this.isSoftAutoRefreshOn = false;
|
|
6072
|
+
this.hardAutoRefresh = false;
|
|
6073
|
+
}
|
|
6074
|
+
removeMtCollection(collection, engineId = this.engineId) {
|
|
6075
|
+
return this.mtApi.remove(engineId, collection).pipe(tap((response) => {
|
|
6076
|
+
collection.update(response);
|
|
6077
|
+
}));
|
|
6002
6078
|
}
|
|
6003
6079
|
scheduleRefresh(timeout) {
|
|
6004
6080
|
// if menu is closed and selected collection is not importing anymore - auto refreshing should be cancelled.
|
|
6005
|
-
if (!this.
|
|
6081
|
+
if (!this.hardAutoRefresh && !this.selected?.isImporting && this.isSoftAutoRefreshOn) {
|
|
6006
6082
|
this.stopAutoRefresh();
|
|
6007
6083
|
return;
|
|
6008
6084
|
}
|
|
6009
|
-
// if
|
|
6010
|
-
if (!this.refreshTimeout && (this.
|
|
6085
|
+
// if hard auto refresho on, auto refresh should be on. If hard autoreferesh is off , refresh needs to be done only if selected is importing.
|
|
6086
|
+
if (this.hardAutoRefresh || (!this.refreshTimeout && (this.isSoftAutoRefreshOn || this.selected?.isImporting))) {
|
|
6011
6087
|
const timeoutMs = timeout ?? (this.isAnyImporting ? this.config.termConfig.refreshTimeoutMsWhenImporting : this.config.termConfig.refreshTimeoutMs);
|
|
6012
6088
|
this.refreshTimeout = setTimeout(() => {
|
|
6013
6089
|
this.refreshTimeout = null;
|
|
@@ -6016,72 +6092,92 @@ class TldTermCollectionsService {
|
|
|
6016
6092
|
}
|
|
6017
6093
|
}
|
|
6018
6094
|
/**
|
|
6019
|
-
*
|
|
6095
|
+
*
|
|
6096
|
+
* @param newCollections
|
|
6097
|
+
* @param initialRefresh Whether also editable collection fields should be updated. If not initial refresh, editable fields will not be updated.
|
|
6020
6098
|
*/
|
|
6021
|
-
|
|
6022
|
-
for (const collection of this.collections) {
|
|
6023
|
-
if (!collection.termId) {
|
|
6024
|
-
continue;
|
|
6025
|
-
}
|
|
6026
|
-
const exists = refreshedList.find(refreshedCollection => refreshedCollection.importedFrom === ConvertedCollectionType.Term && refreshedCollection.termId === collection.termId);
|
|
6027
|
-
if (!exists) {
|
|
6028
|
-
// Removes collection if it hasn't been imported.
|
|
6029
|
-
if (!collection.id) {
|
|
6030
|
-
this.collections.delete(collection);
|
|
6031
|
-
}
|
|
6032
|
-
else {
|
|
6033
|
-
collection.deletedFromTermApi();
|
|
6034
|
-
}
|
|
6035
|
-
}
|
|
6036
|
-
}
|
|
6037
|
-
}
|
|
6038
|
-
updateCollections(refreshedCollections) {
|
|
6099
|
+
addCollections(newCollections, initialRefresh) {
|
|
6039
6100
|
// sets collection list to this value at the end, so deleted collections are not in the list.
|
|
6040
|
-
|
|
6041
|
-
for (let collection of refreshedCollections) {
|
|
6101
|
+
for (let collection of newCollections) {
|
|
6042
6102
|
// User shouldn't see failed collections if he can't retry to import them.
|
|
6043
6103
|
if (!this.hasEditPermissions
|
|
6044
|
-
&& collection.importedFrom === ConvertedCollectionType.MT
|
|
6045
6104
|
&& collection.mtStatus === MtCollectionStatus.ERROR) {
|
|
6046
6105
|
continue;
|
|
6047
6106
|
}
|
|
6048
6107
|
if (collection.isImporting) {
|
|
6049
6108
|
this.isAnyImporting = true;
|
|
6050
6109
|
}
|
|
6051
|
-
let existing =
|
|
6052
|
-
//
|
|
6053
|
-
|
|
6054
|
-
|
|
6055
|
-
|
|
6056
|
-
|
|
6057
|
-
|
|
6058
|
-
|
|
6110
|
+
let existing = CombinedCollection.findExistingCollectionFromList(this.collections, collection);
|
|
6111
|
+
// If term api doesn't have engine languages, collection should not be shown (if it is not already imported somehow);
|
|
6112
|
+
if (!existing && collection.source === EngineTermCollectionSource.TILDE_TERM) {
|
|
6113
|
+
let hasLanguages = true;
|
|
6114
|
+
for (let i = 0; i < this.engineLanguages?.length; i++) {
|
|
6115
|
+
if (!collection.termCollection.languages?.find(lang => lang.id === this.engineLanguages[i])) {
|
|
6116
|
+
hasLanguages = false;
|
|
6117
|
+
break;
|
|
6118
|
+
}
|
|
6119
|
+
}
|
|
6120
|
+
if (!hasLanguages) {
|
|
6059
6121
|
continue;
|
|
6060
6122
|
}
|
|
6061
|
-
collection.termId = null;
|
|
6062
6123
|
}
|
|
6063
|
-
if (existing) {
|
|
6064
|
-
|
|
6124
|
+
if (!existing) {
|
|
6125
|
+
this._collections.add(collection);
|
|
6065
6126
|
}
|
|
6066
6127
|
else {
|
|
6067
|
-
|
|
6128
|
+
existing.update(collection, initialRefresh);
|
|
6068
6129
|
}
|
|
6069
|
-
const editedCollection = existing ?? collection;
|
|
6070
|
-
updatedCollections.add(editedCollection);
|
|
6071
6130
|
}
|
|
6072
|
-
this._collections = updatedCollections;
|
|
6073
|
-
this.
|
|
6131
|
+
// this._collections = updatedCollections;
|
|
6132
|
+
this.emitDataUpdateEvent();
|
|
6133
|
+
this._hasAnyCollections = this._collections.size > 0;
|
|
6134
|
+
}
|
|
6135
|
+
/**
|
|
6136
|
+
* Should be called after refresh to check if there is any collections from api that are deleted.
|
|
6137
|
+
*/
|
|
6138
|
+
removeDeleted(termResponse, mtResponse, initialRefresh) {
|
|
6139
|
+
for (const collection of this.collections) {
|
|
6140
|
+
const termExistingIx = CombinedCollection.findExistingIndexFromList(termResponse, collection);
|
|
6141
|
+
const mtExistingIx = CombinedCollection.findExistingIndexFromList(mtResponse, collection);
|
|
6142
|
+
if (termExistingIx === null && mtExistingIx === null) {
|
|
6143
|
+
this.collections.delete(collection);
|
|
6144
|
+
}
|
|
6145
|
+
else {
|
|
6146
|
+
if (termExistingIx !== null) {
|
|
6147
|
+
const existing = termResponse[termExistingIx];
|
|
6148
|
+
collection.update(existing, initialRefresh);
|
|
6149
|
+
termResponse.splice(termExistingIx, 1);
|
|
6150
|
+
}
|
|
6151
|
+
else {
|
|
6152
|
+
collection.deleteTerms();
|
|
6153
|
+
}
|
|
6154
|
+
if (mtExistingIx !== null) {
|
|
6155
|
+
const existing = mtResponse[mtExistingIx];
|
|
6156
|
+
collection.update(existing, initialRefresh);
|
|
6157
|
+
mtResponse.splice(mtExistingIx, 1);
|
|
6158
|
+
}
|
|
6159
|
+
else {
|
|
6160
|
+
collection.deleteMT();
|
|
6161
|
+
}
|
|
6162
|
+
}
|
|
6163
|
+
}
|
|
6164
|
+
}
|
|
6165
|
+
clearTimeout() {
|
|
6166
|
+
if (this.refreshTimeout) {
|
|
6167
|
+
clearTimeout(this.refreshTimeout);
|
|
6168
|
+
this.refreshTimeout = null;
|
|
6169
|
+
}
|
|
6074
6170
|
}
|
|
6075
6171
|
setSelectedFromLocalStorage() {
|
|
6076
6172
|
// If no collections or selected is already set, it should not be changed from localstorage value. (Usually, localstorage should have the same value).
|
|
6077
6173
|
if (this.collections?.size === 0 || this.selected) {
|
|
6078
6174
|
return;
|
|
6079
6175
|
}
|
|
6080
|
-
const storedId = this.readLocalStorage()?.[this.
|
|
6176
|
+
const storedId = this.readLocalStorage()?.[this.engineId];
|
|
6081
6177
|
if (!storedId) {
|
|
6082
6178
|
return;
|
|
6083
6179
|
}
|
|
6084
|
-
const existing = Array.from(this.collections).find(item => item.id === storedId || item.
|
|
6180
|
+
const existing = Array.from(this.collections).find(item => item.termCollection?.id === storedId || item.mtCollection?.id === storedId);
|
|
6085
6181
|
this.selected = existing;
|
|
6086
6182
|
}
|
|
6087
6183
|
storeSelectedInLocalStorage() {
|
|
@@ -6089,7 +6185,7 @@ class TldTermCollectionsService {
|
|
|
6089
6185
|
if (!localStorageObject) {
|
|
6090
6186
|
localStorageObject = {};
|
|
6091
6187
|
}
|
|
6092
|
-
localStorageObject[this.
|
|
6188
|
+
localStorageObject[this.engineId] = this.selected ? (this.selected.termCollection?.id ?? this.selected.mtCollection?.id) : null;
|
|
6093
6189
|
// store term id if it exists
|
|
6094
6190
|
localStorage.setItem(this.LOCAL_STORAGE_KEY, JSON.stringify(localStorageObject));
|
|
6095
6191
|
}
|
|
@@ -6102,21 +6198,27 @@ class TldTermCollectionsService {
|
|
|
6102
6198
|
return null;
|
|
6103
6199
|
}
|
|
6104
6200
|
}
|
|
6201
|
+
emitDataUpdateEvent() {
|
|
6202
|
+
this.onDataUpdate.next(this.collections);
|
|
6203
|
+
}
|
|
6105
6204
|
}
|
|
6106
|
-
|
|
6107
|
-
|
|
6108
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type:
|
|
6205
|
+
TerminologyService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: TerminologyService, deps: [{ token: TldTranslateConfigService }, { token: TermApiService }, { token: MT_TERM_API_TOKEN }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
6206
|
+
TerminologyService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: TerminologyService, providedIn: 'root' });
|
|
6207
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: TerminologyService, decorators: [{
|
|
6109
6208
|
type: Injectable,
|
|
6110
6209
|
args: [{
|
|
6111
6210
|
providedIn: 'root'
|
|
6112
6211
|
}]
|
|
6113
|
-
}], ctorParameters: function () { return [{ type: TldTranslateConfigService }, { type:
|
|
6212
|
+
}], ctorParameters: function () { return [{ type: TldTranslateConfigService }, { type: TermApiService }, { type: undefined, decorators: [{
|
|
6213
|
+
type: Inject,
|
|
6214
|
+
args: [MT_TERM_API_TOKEN]
|
|
6215
|
+
}] }]; } });
|
|
6114
6216
|
|
|
6115
6217
|
class TldTranslateFileApiService {
|
|
6116
|
-
constructor(http, config,
|
|
6218
|
+
constructor(http, config, terminologyService, alerts) {
|
|
6117
6219
|
this.http = http;
|
|
6118
6220
|
this.config = config;
|
|
6119
|
-
this.
|
|
6221
|
+
this.terminologyService = terminologyService;
|
|
6120
6222
|
this.alerts = alerts;
|
|
6121
6223
|
this._segmentLimit = -1;
|
|
6122
6224
|
this._sourceDownloadStatusses = [TranslationStatuss.WAITING, TranslationStatuss.SAVING, TranslationStatuss.COMPLETED, TranslationStatuss.TRANSLATING];
|
|
@@ -6150,11 +6252,11 @@ class TldTranslateFileApiService {
|
|
|
6150
6252
|
segmentLimit: this._segmentLimit,
|
|
6151
6253
|
ocrPageLimit: this.config.fileConfig.ocrPageLimit
|
|
6152
6254
|
};
|
|
6153
|
-
const selectedCollectionId = this.
|
|
6255
|
+
const selectedCollectionId = this.terminologyService.selectedIdForTranslation();
|
|
6154
6256
|
if (selectedCollectionId) {
|
|
6155
6257
|
params.termCorpusId = selectedCollectionId;
|
|
6156
6258
|
}
|
|
6157
|
-
return this.http.post(url, params, { headers }).pipe(map((response) => {
|
|
6259
|
+
return this.http.post(url, params, { headers }).pipe(map$1((response) => {
|
|
6158
6260
|
if (response.success) {
|
|
6159
6261
|
const error = { ErrorCode: ErrorCode.CANT_START_FILE_TRANSLATION };
|
|
6160
6262
|
this.alerts.unhandeledError(error);
|
|
@@ -6181,7 +6283,7 @@ class TldTranslateFileApiService {
|
|
|
6181
6283
|
const formData = new FormData();
|
|
6182
6284
|
formData.append("file", file.file);
|
|
6183
6285
|
return this.http.post(url, formData, { headers: new HttpHeaders(headers), reportProgress: true, observe: "events" })
|
|
6184
|
-
.pipe(map((response) => {
|
|
6286
|
+
.pipe(map$1((response) => {
|
|
6185
6287
|
const returnvalue = {};
|
|
6186
6288
|
if (response.type === HttpEventType.Response) {
|
|
6187
6289
|
const body = response.body;
|
|
@@ -6204,7 +6306,7 @@ class TldTranslateFileApiService {
|
|
|
6204
6306
|
getStatus(properties) {
|
|
6205
6307
|
const methodName = "GetStatus";
|
|
6206
6308
|
const url = this.config.fileConfig.fileApiUrl + methodName;
|
|
6207
|
-
return this.http.post(url, { docId: properties.file.id }, { headers: this.getAuthHeaders() }).pipe(map((response) => {
|
|
6309
|
+
return this.http.post(url, { docId: properties.file.id }, { headers: this.getAuthHeaders() }).pipe(map$1((response) => {
|
|
6208
6310
|
if (typeof (response) == 'string') {
|
|
6209
6311
|
const error = { ErrorCode: response };
|
|
6210
6312
|
this.alerts.unhandeledError(error);
|
|
@@ -6259,78 +6361,43 @@ class TldTranslateFileApiService {
|
|
|
6259
6361
|
return Common.getAuthHeaders(this.config);
|
|
6260
6362
|
}
|
|
6261
6363
|
}
|
|
6262
|
-
TldTranslateFileApiService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: TldTranslateFileApiService, deps: [{ token: i1$3.HttpClient }, { token: TldTranslateConfigService }, { token:
|
|
6364
|
+
TldTranslateFileApiService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: TldTranslateFileApiService, deps: [{ token: i1$3.HttpClient }, { token: TldTranslateConfigService }, { token: TerminologyService }, { token: TldAlertService }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
6263
6365
|
TldTranslateFileApiService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: TldTranslateFileApiService, providedIn: 'root' });
|
|
6264
6366
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: TldTranslateFileApiService, decorators: [{
|
|
6265
6367
|
type: Injectable,
|
|
6266
6368
|
args: [{
|
|
6267
6369
|
providedIn: 'root'
|
|
6268
6370
|
}]
|
|
6269
|
-
}], ctorParameters: function () { return [{ type: i1$3.HttpClient }, { type: TldTranslateConfigService }, { type:
|
|
6270
|
-
|
|
6271
|
-
class TldTermCreateCollectionDialogComponent {
|
|
6272
|
-
constructor(dialogRef, data, config) {
|
|
6273
|
-
this.dialogRef = dialogRef;
|
|
6274
|
-
this.data = data;
|
|
6275
|
-
this.config = config;
|
|
6276
|
-
}
|
|
6277
|
-
ngOnInit() {
|
|
6278
|
-
this.minLength = this.config.termConfig.collectionNameMinLength;
|
|
6279
|
-
this.maxLength = this.config.termConfig.collectionNameMaxLength;
|
|
6280
|
-
this.collectionName = new UntypedFormControl(this.data.collectionName, [
|
|
6281
|
-
Validators.minLength(this.minLength),
|
|
6282
|
-
Validators.maxLength(this.maxLength),
|
|
6283
|
-
Validators.required
|
|
6284
|
-
]);
|
|
6285
|
-
this.collectionName.markAsTouched();
|
|
6286
|
-
this.formGroup = new UntypedFormGroup({ collectionName: this.collectionName });
|
|
6287
|
-
}
|
|
6288
|
-
submit() {
|
|
6289
|
-
if (this.formGroup.valid) {
|
|
6290
|
-
this.dialogRef.close(this.collectionName.value);
|
|
6291
|
-
}
|
|
6292
|
-
}
|
|
6293
|
-
}
|
|
6294
|
-
TldTermCreateCollectionDialogComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: TldTermCreateCollectionDialogComponent, deps: [{ token: i1$2.MatDialogRef }, { token: MAT_DIALOG_DATA }, { token: TldTranslateConfigService }], target: i0.ɵɵFactoryTarget.Component });
|
|
6295
|
-
TldTermCreateCollectionDialogComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.3.0", type: TldTermCreateCollectionDialogComponent, selector: "tld-term-create-collection-dialog", ngImport: i0, template: "<tld-close-button class=\"close-button\" mat-dialog-close>\r\n</tld-close-button>\r\n<h1 mat-dialog-title>{{'TERM_COLLECTIONS.CREATE_DIALOG.TITLE' | translate}}</h1>\r\n<div mat-dialog-content>\r\n <p [innerHtml]=\"'TERM_COLLECTIONS.CREATE_DIALOG.DESCRIPTION_1' | translate\"></p>\r\n <p [innerHtml]=\"'TERM_COLLECTIONS.CREATE_DIALOG.DESCRIPTION_2' | translate\"></p>\r\n <div [formGroup]=\"formGroup\">\r\n <mat-form-field appearance=\"outline\" class=\"collection-name-form-field\">\r\n <mat-label>{{'TERM_COLLECTIONS.CREATE_DIALOG.COLLECTION_NAME_LABEL' | translate}}</mat-label>\r\n <input matInput formControlName=\"collectionName\" (keyup.enter)=\"submit()\">\r\n <mat-error *ngIf=\"collectionName.errors\">{{'TERM_COLLECTIONS.CREATE_DIALOG.COLLECTION_NAME_ERROR' |\r\n translate: {minLength: minLength, maxLength: maxLength} }}</mat-error>\r\n </mat-form-field>\r\n </div>\r\n</div>\r\n<div mat-dialog-actions fxLayout=\"row\" fxLayoutAlign=\"center center\">\r\n <button mat-flat-button (click)=\"submit()\" cdkFocusInitial color=\"accent\"\r\n [disabled]=\"formGroup.invalid\">{{'TERM_COLLECTIONS.CREATE_DIALOG.CREATE' | translate}}</button>\r\n <button mat-button mat-dialog-close color=\"accent\">{{\"TERM_COLLECTIONS.CREATE_DIALOG.CANCEL\" | translate}}</button>\r\n</div>\r\n", styles: ["input{outline:none!important}:host ::ng-deep .mat-form-field-appearance-outline:hover .mat-form-field-outline,:host ::ng-deep .mat-form-field-appearance-outline.mat-focused .mat-form-field-outline-thick,:host ::ng-deep .mat-form-field.mat-focused .mat-form-field-label{color:#ad234a}.create-dialog-wrapper{position:relative}.close-button{position:absolute;right:1em;top:1em}\n"], dependencies: [{ kind: "directive", type: i3$2.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i3$2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i3$2.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i3.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i5.MatButton, selector: "button[mat-button], button[mat-raised-button], button[mat-icon-button], button[mat-fab], button[mat-mini-fab], button[mat-stroked-button], button[mat-flat-button]", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }, { kind: "directive", type: i6.MatError, selector: "mat-error", inputs: ["id"] }, { kind: "component", type: i6.MatFormField, selector: "mat-form-field", inputs: ["color", "appearance", "hideRequiredMarker", "hintLabel", "floatLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i6.MatLabel, selector: "mat-label" }, { kind: "directive", type: i7.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly"], exportAs: ["matInput"] }, { kind: "directive", type: i1$2.MatDialogClose, selector: "[mat-dialog-close], [matDialogClose]", inputs: ["aria-label", "type", "mat-dialog-close", "matDialogClose"], exportAs: ["matDialogClose"] }, { kind: "directive", type: i1$2.MatDialogTitle, selector: "[mat-dialog-title], [matDialogTitle]", inputs: ["id"], exportAs: ["matDialogTitle"] }, { kind: "directive", type: i1$2.MatDialogContent, selector: "[mat-dialog-content], mat-dialog-content, [matDialogContent]" }, { kind: "directive", type: i1$2.MatDialogActions, selector: "[mat-dialog-actions], mat-dialog-actions, [matDialogActions]", inputs: ["align"] }, { kind: "directive", type: i4.DefaultLayoutDirective, selector: " [fxLayout], [fxLayout.xs], [fxLayout.sm], [fxLayout.md], [fxLayout.lg], [fxLayout.xl], [fxLayout.lt-sm], [fxLayout.lt-md], [fxLayout.lt-lg], [fxLayout.lt-xl], [fxLayout.gt-xs], [fxLayout.gt-sm], [fxLayout.gt-md], [fxLayout.gt-lg]", inputs: ["fxLayout", "fxLayout.xs", "fxLayout.sm", "fxLayout.md", "fxLayout.lg", "fxLayout.xl", "fxLayout.lt-sm", "fxLayout.lt-md", "fxLayout.lt-lg", "fxLayout.lt-xl", "fxLayout.gt-xs", "fxLayout.gt-sm", "fxLayout.gt-md", "fxLayout.gt-lg"] }, { kind: "directive", type: i4.DefaultLayoutAlignDirective, selector: " [fxLayoutAlign], [fxLayoutAlign.xs], [fxLayoutAlign.sm], [fxLayoutAlign.md], [fxLayoutAlign.lg], [fxLayoutAlign.xl], [fxLayoutAlign.lt-sm], [fxLayoutAlign.lt-md], [fxLayoutAlign.lt-lg], [fxLayoutAlign.lt-xl], [fxLayoutAlign.gt-xs], [fxLayoutAlign.gt-sm], [fxLayoutAlign.gt-md], [fxLayoutAlign.gt-lg]", inputs: ["fxLayoutAlign", "fxLayoutAlign.xs", "fxLayoutAlign.sm", "fxLayoutAlign.md", "fxLayoutAlign.lg", "fxLayoutAlign.xl", "fxLayoutAlign.lt-sm", "fxLayoutAlign.lt-md", "fxLayoutAlign.lt-lg", "fxLayoutAlign.lt-xl", "fxLayoutAlign.gt-xs", "fxLayoutAlign.gt-sm", "fxLayoutAlign.gt-md", "fxLayoutAlign.gt-lg"] }, { kind: "directive", type: i3$2.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i3$2.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "component", type: i12.CloseButtonComponent, selector: "tld-close-button", inputs: ["ariaCode", "disabled", "tooltip"], outputs: ["tldClick"] }, { kind: "pipe", type: i1$1.TranslatePipe, name: "translate" }] });
|
|
6296
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: TldTermCreateCollectionDialogComponent, decorators: [{
|
|
6297
|
-
type: Component,
|
|
6298
|
-
args: [{ selector: 'tld-term-create-collection-dialog', template: "<tld-close-button class=\"close-button\" mat-dialog-close>\r\n</tld-close-button>\r\n<h1 mat-dialog-title>{{'TERM_COLLECTIONS.CREATE_DIALOG.TITLE' | translate}}</h1>\r\n<div mat-dialog-content>\r\n <p [innerHtml]=\"'TERM_COLLECTIONS.CREATE_DIALOG.DESCRIPTION_1' | translate\"></p>\r\n <p [innerHtml]=\"'TERM_COLLECTIONS.CREATE_DIALOG.DESCRIPTION_2' | translate\"></p>\r\n <div [formGroup]=\"formGroup\">\r\n <mat-form-field appearance=\"outline\" class=\"collection-name-form-field\">\r\n <mat-label>{{'TERM_COLLECTIONS.CREATE_DIALOG.COLLECTION_NAME_LABEL' | translate}}</mat-label>\r\n <input matInput formControlName=\"collectionName\" (keyup.enter)=\"submit()\">\r\n <mat-error *ngIf=\"collectionName.errors\">{{'TERM_COLLECTIONS.CREATE_DIALOG.COLLECTION_NAME_ERROR' |\r\n translate: {minLength: minLength, maxLength: maxLength} }}</mat-error>\r\n </mat-form-field>\r\n </div>\r\n</div>\r\n<div mat-dialog-actions fxLayout=\"row\" fxLayoutAlign=\"center center\">\r\n <button mat-flat-button (click)=\"submit()\" cdkFocusInitial color=\"accent\"\r\n [disabled]=\"formGroup.invalid\">{{'TERM_COLLECTIONS.CREATE_DIALOG.CREATE' | translate}}</button>\r\n <button mat-button mat-dialog-close color=\"accent\">{{\"TERM_COLLECTIONS.CREATE_DIALOG.CANCEL\" | translate}}</button>\r\n</div>\r\n", styles: ["input{outline:none!important}:host ::ng-deep .mat-form-field-appearance-outline:hover .mat-form-field-outline,:host ::ng-deep .mat-form-field-appearance-outline.mat-focused .mat-form-field-outline-thick,:host ::ng-deep .mat-form-field.mat-focused .mat-form-field-label{color:#ad234a}.create-dialog-wrapper{position:relative}.close-button{position:absolute;right:1em;top:1em}\n"] }]
|
|
6299
|
-
}], ctorParameters: function () { return [{ type: i1$2.MatDialogRef }, { type: undefined, decorators: [{
|
|
6300
|
-
type: Inject,
|
|
6301
|
-
args: [MAT_DIALOG_DATA]
|
|
6302
|
-
}] }, { type: TldTranslateConfigService }]; } });
|
|
6371
|
+
}], ctorParameters: function () { return [{ type: i1$3.HttpClient }, { type: TldTranslateConfigService }, { type: TerminologyService }, { type: TldAlertService }]; } });
|
|
6303
6372
|
|
|
6304
6373
|
class TldTermCollectionListComponent {
|
|
6305
|
-
constructor(
|
|
6306
|
-
this.
|
|
6374
|
+
constructor(terminologyService, config, tldSystem, termApiService) {
|
|
6375
|
+
this.terminologyService = terminologyService;
|
|
6307
6376
|
this.config = config;
|
|
6308
6377
|
this.tldSystem = tldSystem;
|
|
6309
|
-
this.
|
|
6310
|
-
this.translate = translate;
|
|
6311
|
-
this.alerts = alerts;
|
|
6378
|
+
this.termApiService = termApiService;
|
|
6312
6379
|
this.localizationKey = "TERM_COLLECTIONS.";
|
|
6313
6380
|
this.tooltipLocalizationKey = "TERM_COLLECTIONS.TOOLTIPS.";
|
|
6314
6381
|
this.readyStatus = "Ready";
|
|
6315
6382
|
this.collectionErrorStatus = MtCollectionStatus.ERROR;
|
|
6316
6383
|
}
|
|
6317
6384
|
get selected() {
|
|
6318
|
-
return this.
|
|
6385
|
+
return this.terminologyService.selected;
|
|
6319
6386
|
}
|
|
6320
6387
|
set selected(val) {
|
|
6321
|
-
this.
|
|
6388
|
+
this.terminologyService.selected = val;
|
|
6322
6389
|
}
|
|
6323
6390
|
get collections() {
|
|
6324
|
-
return this.
|
|
6391
|
+
return this.terminologyService?.collections;
|
|
6325
6392
|
}
|
|
6326
6393
|
get hasAnyCollections() {
|
|
6327
|
-
return this.
|
|
6394
|
+
return this.terminologyService.hasAnyCollections;
|
|
6328
6395
|
}
|
|
6329
6396
|
get isRefreshingCollections() {
|
|
6330
|
-
return this.
|
|
6397
|
+
return this.terminologyService?.isRefreshingCollections;
|
|
6331
6398
|
}
|
|
6332
6399
|
get hasEditPermissions() {
|
|
6333
|
-
return this.
|
|
6400
|
+
return this.terminologyService.hasEditPermissions;
|
|
6334
6401
|
}
|
|
6335
6402
|
get appName() {
|
|
6336
6403
|
return this.config.coreConfig.appName;
|
|
@@ -6345,42 +6412,18 @@ class TldTermCollectionListComponent {
|
|
|
6345
6412
|
this.subscription.unsubscribe();
|
|
6346
6413
|
}
|
|
6347
6414
|
getEditLink(collection) {
|
|
6348
|
-
return
|
|
6349
|
-
}
|
|
6350
|
-
createNew() {
|
|
6351
|
-
const localizationKey = "TERM_COLLECTIONS.DEFAULT_COLLECTION_NAME";
|
|
6352
|
-
this.translate.get(localizationKey).subscribe((collectionName) => {
|
|
6353
|
-
const dialogRef = this.dialog.open(TldTermCreateCollectionDialogComponent, {
|
|
6354
|
-
minWidth: '300px',
|
|
6355
|
-
maxWidth: '700px',
|
|
6356
|
-
data: { collectionName: collectionName }
|
|
6357
|
-
});
|
|
6358
|
-
dialogRef.afterClosed().subscribe(collectionName => {
|
|
6359
|
-
if (!collectionName) {
|
|
6360
|
-
return;
|
|
6361
|
-
}
|
|
6362
|
-
const languages = [this.sourceLanguageCode, this.targetLanguageCode];
|
|
6363
|
-
this.collectionService.create(languages, collectionName).subscribe((collection) => {
|
|
6364
|
-
window.open(this.getEditLink(collection), "_blank");
|
|
6365
|
-
}, (err) => {
|
|
6366
|
-
console.error(err);
|
|
6367
|
-
const error = { ErrorCode: ErrorCode.COLLECTION_CREATE };
|
|
6368
|
-
this.alerts.unhandeledError(error);
|
|
6369
|
-
throw error;
|
|
6370
|
-
});
|
|
6371
|
-
});
|
|
6372
|
-
});
|
|
6415
|
+
return this.termApiService.getEditLink(collection.termCollection?.id, this.sourceLanguageCode, this.targetLanguageCode);
|
|
6373
6416
|
}
|
|
6374
6417
|
attach(collection) {
|
|
6375
|
-
this.
|
|
6418
|
+
this.terminologyService.addToEngine(collection);
|
|
6376
6419
|
}
|
|
6377
6420
|
}
|
|
6378
|
-
TldTermCollectionListComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: TldTermCollectionListComponent, deps: [{ token:
|
|
6379
|
-
TldTermCollectionListComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.3.0", type: TldTermCollectionListComponent, selector: "tld-term-collection-list", ngImport: i0, template: "<header class=\"tld-collection-list-header\">\r\n <ng-container *ngIf=\"hasAnyCollections\">\r\n <h1 class=\"term-window-title\">\r\n <span fxHide.lt-sm>{{localizationKey + 'TITLE' | translate}}</span>\r\n <span fxHide.gt-xs>{{localizationKey + 'TITLE_MOBILE' | translate}}</span>\r\n </h1>\r\n <p class=\"term-window-description\">\r\n <span>{{localizationKey + 'DESCRIPTION_1' | translate}}</span>\r\n <span fxHide.lt-sm *ngIf=\"hasEditPermissions\">{{localizationKey + 'DESCRIPTION_2' | translate}}</span>\r\n <span fxHide.gt-xs *ngIf=\"hasEditPermissions\">{{localizationKey + 'DESCRIPTION_2_MOBILE' | translate}}</span>\r\n </p>\r\n </ng-container>\r\n <ng-container *ngIf=\"!hasAnyCollections\">\r\n <h1 class=\"term-window-title\">{{localizationKey + 'TITLE_EMPTY' | translate}}</h1>\r\n <p class=\"term-window-description\" fxHide.lt-sm>{{localizationKey + 'DESCRIPTION_EMPTY' | translate: {appName
|
|
6421
|
+
TldTermCollectionListComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: TldTermCollectionListComponent, deps: [{ token: TerminologyService }, { token: TldTranslateConfigService }, { token: TldSystemService }, { token: TermApiService }], target: i0.ɵɵFactoryTarget.Component });
|
|
6422
|
+
TldTermCollectionListComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.3.0", type: TldTermCollectionListComponent, selector: "tld-term-collection-list", ngImport: i0, template: "<header class=\"tld-collection-list-header\">\r\n <ng-container *ngIf=\"hasAnyCollections\">\r\n <h1 class=\"term-window-title\">\r\n <span fxHide.lt-sm>{{localizationKey + 'TITLE' | translate}}</span>\r\n <span fxHide.gt-xs>{{localizationKey + 'TITLE_MOBILE' | translate}}</span>\r\n </h1>\r\n <p class=\"term-window-description\">\r\n <span>{{localizationKey + 'DESCRIPTION_1' | translate}}</span>\r\n <span fxHide.lt-sm *ngIf=\"hasEditPermissions\">{{localizationKey + 'DESCRIPTION_2' | translate}}</span>\r\n <span fxHide.gt-xs *ngIf=\"hasEditPermissions\">{{localizationKey + 'DESCRIPTION_2_MOBILE' | translate}}</span>\r\n </p>\r\n </ng-container>\r\n <ng-container *ngIf=\"!hasAnyCollections\">\r\n <h1 class=\"term-window-title\">{{localizationKey + 'TITLE_EMPTY' | translate}}</h1>\r\n <p class=\"term-window-description\" fxHide.lt-sm>{{localizationKey + 'DESCRIPTION_EMPTY' | translate: {appName:\r\n appName} }}</p>\r\n <p class=\"term-window-description\" fxHide.gt-xs>{{localizationKey + 'DESCRIPTION_EMPTY_MOBILE' | translate:\r\n {appName: appName} }}</p>\r\n </ng-container>\r\n</header>\r\n<div *ngIf=\"hasAnyCollections\" class=\"tld-collection-list-body\">\r\n <mat-radio-group [attr.aria-label]=\"localizationKey + 'ARIA_LABELS.RADIO_GROUP' | translate\" [(ngModel)]=\"selected\">\r\n <div fxLayout=\"row\" fxLayoutAlign=\"start center\">\r\n <mat-radio-button [value]=\"null\">\r\n <span class=\"text-m-semi-bold\">\r\n {{localizationKey + 'SELECTED_NONE' | translate}}\r\n </span>\r\n </mat-radio-button>\r\n </div>\r\n <div class=\"collection\" fxLayout=\"row\" fxLayoutAlign=\"start center\" *ngFor=\"let collection of collections\"\r\n [matTooltip]=\"collection.termTooltipKey? (tooltipLocalizationKey + collection.termTooltipKey | translate) : ''\">\r\n <mat-radio-button [value]=\"collection\" fxFlex [disabled]=\"collection.termId !== null && collection.termEntries<=0\"\r\n fxLayoutAlign=\"center center\">\r\n <span class=\"collection-label text-m-semi-bold\" [matTooltip]=\"collection.termTooltipKey? '' : collection.name\">\r\n {{collection.name}}\r\n </span>\r\n\r\n <span *ngIf=\"collection.lastUpdated\" class=\"collection-label last-updated-label\">\r\n {{ localizationKey + ('LAST_UPDATED') | translate: { date: collection.lastUpdated | date: 'dd.MM.yy\r\n HH:mm' } }}\r\n </span>\r\n </mat-radio-button>\r\n\r\n <span *ngIf=\" collection.mtStatus === collectionErrorStatus\" color=\"accent\" class=\"material-icons\">\r\n error\r\n </span>\r\n\r\n <mat-spinner color=\"accent\" diameter=\"20\" *ngIf=\"collection.isImporting\"></mat-spinner>\r\n <ng-container *ngIf=\"hasEditPermissions\">\r\n <button mat-button *ngIf=\"collection.syncButtonVissible\" (click)=\"attach(collection)\" color=\"primary\"\r\n [matTooltip]=\"tooltipLocalizationKey + 'SYNC' | translate\" [disabled]=\"collection.isImporting\">\r\n {{localizationKey + (collectionErrorStatus === collection.mtStatus? 'SYNC_ERROR': 'SYNC') | translate}}\r\n </button>\r\n <a mat-icon-button target=\"_blank\"\r\n [matTooltip]=\"collection.termTooltipKey? '' : (tooltipLocalizationKey + 'EDIT' | translate)\"\r\n [attr.href]=\"getEditLink(collection)\" *ngIf=\"collection.termCollection\" fxHide.lt-sm>\r\n <mat-icon class=\"material-icons\">edit</mat-icon>\r\n </a>\r\n </ng-container>\r\n </div>\r\n </mat-radio-group>\r\n</div>\r\n", styles: [".tld-collection-list-body,.tld-collection-list-header{padding:1em .75em}.collection-label{display:block;max-width:215px;overflow:hidden;text-overflow:ellipsis}.collection-label.last-updated-label{font-size:small;color:#5a6672}:host ::ng-deep .mat-radio-button{overflow:hidden;padding:5px 0}:host ::ng-deep .mat-radio-button .mat-radio-ripple{display:none}:host ::ng-deep .mat-radio-button .mat-radio-label-content{overflow:hidden}.collection{min-height:70px;border-top:1px solid #cbd2d9}\n"], dependencies: [{ kind: "directive", type: i3$2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i3$2.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "directive", type: i3.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i3.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i5.MatButton, selector: "button[mat-button], button[mat-raised-button], button[mat-icon-button], button[mat-fab], button[mat-mini-fab], button[mat-stroked-button], button[mat-flat-button]", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }, { kind: "component", type: i5.MatAnchor, selector: "a[mat-button], a[mat-raised-button], a[mat-icon-button], a[mat-fab], a[mat-mini-fab], a[mat-stroked-button], a[mat-flat-button]", inputs: ["disabled", "disableRipple", "color", "tabIndex"], exportAs: ["matButton", "matAnchor"] }, { kind: "component", type: i1.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "directive", type: i2$1.MatTooltip, selector: "[matTooltip]", exportAs: ["matTooltip"] }, { kind: "directive", type: i10.MatRadioGroup, selector: "mat-radio-group", exportAs: ["matRadioGroup"] }, { kind: "component", type: i10.MatRadioButton, selector: "mat-radio-button", inputs: ["disableRipple", "tabIndex"], exportAs: ["matRadioButton"] }, { kind: "directive", type: i4.DefaultLayoutDirective, selector: " [fxLayout], [fxLayout.xs], [fxLayout.sm], [fxLayout.md], [fxLayout.lg], [fxLayout.xl], [fxLayout.lt-sm], [fxLayout.lt-md], [fxLayout.lt-lg], [fxLayout.lt-xl], [fxLayout.gt-xs], [fxLayout.gt-sm], [fxLayout.gt-md], [fxLayout.gt-lg]", inputs: ["fxLayout", "fxLayout.xs", "fxLayout.sm", "fxLayout.md", "fxLayout.lg", "fxLayout.xl", "fxLayout.lt-sm", "fxLayout.lt-md", "fxLayout.lt-lg", "fxLayout.lt-xl", "fxLayout.gt-xs", "fxLayout.gt-sm", "fxLayout.gt-md", "fxLayout.gt-lg"] }, { kind: "directive", type: i4.DefaultLayoutAlignDirective, selector: " [fxLayoutAlign], [fxLayoutAlign.xs], [fxLayoutAlign.sm], [fxLayoutAlign.md], [fxLayoutAlign.lg], [fxLayoutAlign.xl], [fxLayoutAlign.lt-sm], [fxLayoutAlign.lt-md], [fxLayoutAlign.lt-lg], [fxLayoutAlign.lt-xl], [fxLayoutAlign.gt-xs], [fxLayoutAlign.gt-sm], [fxLayoutAlign.gt-md], [fxLayoutAlign.gt-lg]", inputs: ["fxLayoutAlign", "fxLayoutAlign.xs", "fxLayoutAlign.sm", "fxLayoutAlign.md", "fxLayoutAlign.lg", "fxLayoutAlign.xl", "fxLayoutAlign.lt-sm", "fxLayoutAlign.lt-md", "fxLayoutAlign.lt-lg", "fxLayoutAlign.lt-xl", "fxLayoutAlign.gt-xs", "fxLayoutAlign.gt-sm", "fxLayoutAlign.gt-md", "fxLayoutAlign.gt-lg"] }, { kind: "directive", type: i4.DefaultFlexDirective, selector: " [fxFlex], [fxFlex.xs], [fxFlex.sm], [fxFlex.md], [fxFlex.lg], [fxFlex.xl], [fxFlex.lt-sm], [fxFlex.lt-md], [fxFlex.lt-lg], [fxFlex.lt-xl], [fxFlex.gt-xs], [fxFlex.gt-sm], [fxFlex.gt-md], [fxFlex.gt-lg]", inputs: ["fxFlex", "fxFlex.xs", "fxFlex.sm", "fxFlex.md", "fxFlex.lg", "fxFlex.xl", "fxFlex.lt-sm", "fxFlex.lt-md", "fxFlex.lt-lg", "fxFlex.lt-xl", "fxFlex.gt-xs", "fxFlex.gt-sm", "fxFlex.gt-md", "fxFlex.gt-lg"] }, { kind: "directive", type: i5$1.DefaultShowHideDirective, selector: " [fxShow], [fxShow.print], [fxShow.xs], [fxShow.sm], [fxShow.md], [fxShow.lg], [fxShow.xl], [fxShow.lt-sm], [fxShow.lt-md], [fxShow.lt-lg], [fxShow.lt-xl], [fxShow.gt-xs], [fxShow.gt-sm], [fxShow.gt-md], [fxShow.gt-lg], [fxHide], [fxHide.print], [fxHide.xs], [fxHide.sm], [fxHide.md], [fxHide.lg], [fxHide.xl], [fxHide.lt-sm], [fxHide.lt-md], [fxHide.lt-lg], [fxHide.lt-xl], [fxHide.gt-xs], [fxHide.gt-sm], [fxHide.gt-md], [fxHide.gt-lg]", inputs: ["fxShow", "fxShow.print", "fxShow.xs", "fxShow.sm", "fxShow.md", "fxShow.lg", "fxShow.xl", "fxShow.lt-sm", "fxShow.lt-md", "fxShow.lt-lg", "fxShow.lt-xl", "fxShow.gt-xs", "fxShow.gt-sm", "fxShow.gt-md", "fxShow.gt-lg", "fxHide", "fxHide.print", "fxHide.xs", "fxHide.sm", "fxHide.md", "fxHide.lg", "fxHide.xl", "fxHide.lt-sm", "fxHide.lt-md", "fxHide.lt-lg", "fxHide.lt-xl", "fxHide.gt-xs", "fxHide.gt-sm", "fxHide.gt-md", "fxHide.gt-lg"] }, { kind: "component", type: i13.MatProgressSpinner, selector: "mat-progress-spinner, mat-spinner", inputs: ["color", "diameter", "strokeWidth", "mode", "value"], exportAs: ["matProgressSpinner"] }, { kind: "pipe", type: i3.DatePipe, name: "date" }, { kind: "pipe", type: i1$1.TranslatePipe, name: "translate" }] });
|
|
6380
6423
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: TldTermCollectionListComponent, decorators: [{
|
|
6381
6424
|
type: Component,
|
|
6382
|
-
args: [{ selector: 'tld-term-collection-list', template: "<header class=\"tld-collection-list-header\">\r\n <ng-container *ngIf=\"hasAnyCollections\">\r\n <h1 class=\"term-window-title\">\r\n <span fxHide.lt-sm>{{localizationKey + 'TITLE' | translate}}</span>\r\n <span fxHide.gt-xs>{{localizationKey + 'TITLE_MOBILE' | translate}}</span>\r\n </h1>\r\n <p class=\"term-window-description\">\r\n <span>{{localizationKey + 'DESCRIPTION_1' | translate}}</span>\r\n <span fxHide.lt-sm *ngIf=\"hasEditPermissions\">{{localizationKey + 'DESCRIPTION_2' | translate}}</span>\r\n <span fxHide.gt-xs *ngIf=\"hasEditPermissions\">{{localizationKey + 'DESCRIPTION_2_MOBILE' | translate}}</span>\r\n </p>\r\n </ng-container>\r\n <ng-container *ngIf=\"!hasAnyCollections\">\r\n <h1 class=\"term-window-title\">{{localizationKey + 'TITLE_EMPTY' | translate}}</h1>\r\n <p class=\"term-window-description\" fxHide.lt-sm>{{localizationKey + 'DESCRIPTION_EMPTY' | translate: {appName
|
|
6383
|
-
}], ctorParameters: function () { return [{ type:
|
|
6425
|
+
args: [{ selector: 'tld-term-collection-list', template: "<header class=\"tld-collection-list-header\">\r\n <ng-container *ngIf=\"hasAnyCollections\">\r\n <h1 class=\"term-window-title\">\r\n <span fxHide.lt-sm>{{localizationKey + 'TITLE' | translate}}</span>\r\n <span fxHide.gt-xs>{{localizationKey + 'TITLE_MOBILE' | translate}}</span>\r\n </h1>\r\n <p class=\"term-window-description\">\r\n <span>{{localizationKey + 'DESCRIPTION_1' | translate}}</span>\r\n <span fxHide.lt-sm *ngIf=\"hasEditPermissions\">{{localizationKey + 'DESCRIPTION_2' | translate}}</span>\r\n <span fxHide.gt-xs *ngIf=\"hasEditPermissions\">{{localizationKey + 'DESCRIPTION_2_MOBILE' | translate}}</span>\r\n </p>\r\n </ng-container>\r\n <ng-container *ngIf=\"!hasAnyCollections\">\r\n <h1 class=\"term-window-title\">{{localizationKey + 'TITLE_EMPTY' | translate}}</h1>\r\n <p class=\"term-window-description\" fxHide.lt-sm>{{localizationKey + 'DESCRIPTION_EMPTY' | translate: {appName:\r\n appName} }}</p>\r\n <p class=\"term-window-description\" fxHide.gt-xs>{{localizationKey + 'DESCRIPTION_EMPTY_MOBILE' | translate:\r\n {appName: appName} }}</p>\r\n </ng-container>\r\n</header>\r\n<div *ngIf=\"hasAnyCollections\" class=\"tld-collection-list-body\">\r\n <mat-radio-group [attr.aria-label]=\"localizationKey + 'ARIA_LABELS.RADIO_GROUP' | translate\" [(ngModel)]=\"selected\">\r\n <div fxLayout=\"row\" fxLayoutAlign=\"start center\">\r\n <mat-radio-button [value]=\"null\">\r\n <span class=\"text-m-semi-bold\">\r\n {{localizationKey + 'SELECTED_NONE' | translate}}\r\n </span>\r\n </mat-radio-button>\r\n </div>\r\n <div class=\"collection\" fxLayout=\"row\" fxLayoutAlign=\"start center\" *ngFor=\"let collection of collections\"\r\n [matTooltip]=\"collection.termTooltipKey? (tooltipLocalizationKey + collection.termTooltipKey | translate) : ''\">\r\n <mat-radio-button [value]=\"collection\" fxFlex [disabled]=\"collection.termId !== null && collection.termEntries<=0\"\r\n fxLayoutAlign=\"center center\">\r\n <span class=\"collection-label text-m-semi-bold\" [matTooltip]=\"collection.termTooltipKey? '' : collection.name\">\r\n {{collection.name}}\r\n </span>\r\n\r\n <span *ngIf=\"collection.lastUpdated\" class=\"collection-label last-updated-label\">\r\n {{ localizationKey + ('LAST_UPDATED') | translate: { date: collection.lastUpdated | date: 'dd.MM.yy\r\n HH:mm' } }}\r\n </span>\r\n </mat-radio-button>\r\n\r\n <span *ngIf=\" collection.mtStatus === collectionErrorStatus\" color=\"accent\" class=\"material-icons\">\r\n error\r\n </span>\r\n\r\n <mat-spinner color=\"accent\" diameter=\"20\" *ngIf=\"collection.isImporting\"></mat-spinner>\r\n <ng-container *ngIf=\"hasEditPermissions\">\r\n <button mat-button *ngIf=\"collection.syncButtonVissible\" (click)=\"attach(collection)\" color=\"primary\"\r\n [matTooltip]=\"tooltipLocalizationKey + 'SYNC' | translate\" [disabled]=\"collection.isImporting\">\r\n {{localizationKey + (collectionErrorStatus === collection.mtStatus? 'SYNC_ERROR': 'SYNC') | translate}}\r\n </button>\r\n <a mat-icon-button target=\"_blank\"\r\n [matTooltip]=\"collection.termTooltipKey? '' : (tooltipLocalizationKey + 'EDIT' | translate)\"\r\n [attr.href]=\"getEditLink(collection)\" *ngIf=\"collection.termCollection\" fxHide.lt-sm>\r\n <mat-icon class=\"material-icons\">edit</mat-icon>\r\n </a>\r\n </ng-container>\r\n </div>\r\n </mat-radio-group>\r\n</div>\r\n", styles: [".tld-collection-list-body,.tld-collection-list-header{padding:1em .75em}.collection-label{display:block;max-width:215px;overflow:hidden;text-overflow:ellipsis}.collection-label.last-updated-label{font-size:small;color:#5a6672}:host ::ng-deep .mat-radio-button{overflow:hidden;padding:5px 0}:host ::ng-deep .mat-radio-button .mat-radio-ripple{display:none}:host ::ng-deep .mat-radio-button .mat-radio-label-content{overflow:hidden}.collection{min-height:70px;border-top:1px solid #cbd2d9}\n"] }]
|
|
6426
|
+
}], ctorParameters: function () { return [{ type: TerminologyService }, { type: TldTranslateConfigService }, { type: TldSystemService }, { type: TermApiService }]; } });
|
|
6384
6427
|
|
|
6385
6428
|
class WtwLinkParamsService {
|
|
6386
6429
|
constructor(translate) {
|
|
@@ -6437,44 +6480,138 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImpor
|
|
|
6437
6480
|
args: [{ selector: 'tld-term-promotion', template: "<section class=\"term-promotion-wrapper\" fxLayout=\"column\" fxLayoutGap=\"16px\">\r\n <div>\r\n <h1 class=\"term-window-title\">{{ localizationKey + \"TITLE\" | translate}}</h1>\r\n <p>{{ localizationKey + \"DESCRIPTION\" | translate}}</p>\r\n </div>\r\n <div fxLayoutGap=\"0.75em\" fxLayout.lt-sm=\"column\">\r\n <a [attr.href]=\"trialUrl\" target=\"_blank\" mat-flat-button color=\"primary\">\r\n {{ localizationKey + \"START_TRIAL\" | translate}}\r\n </a>\r\n <a [attr.href]=\"learnMoreUrl\" target=\"_blank\">{{ localizationKey + \"LEARN_MORE\" | translate}}</a>\r\n </div>\r\n</section>", styles: [".term-promotion-wrapper{margin:1em}.term-promotion-wrapper button{width:100%}.term-promotion-wrapper p{margin:0}.term-promotion-wrapper a.mat-flat-button:hover{color:#fff!important}\n"] }]
|
|
6438
6481
|
}], ctorParameters: function () { return [{ type: TldTranslateConfigService }, { type: WtwLinkParamsService }]; } });
|
|
6439
6482
|
|
|
6483
|
+
class TldTermCreateCollectionDialogComponent {
|
|
6484
|
+
constructor(dialogRef, data, config) {
|
|
6485
|
+
this.dialogRef = dialogRef;
|
|
6486
|
+
this.data = data;
|
|
6487
|
+
this.config = config;
|
|
6488
|
+
}
|
|
6489
|
+
ngOnInit() {
|
|
6490
|
+
this.minLength = this.config.termConfig.collectionNameMinLength;
|
|
6491
|
+
this.maxLength = this.config.termConfig.collectionNameMaxLength;
|
|
6492
|
+
this.collectionName = new UntypedFormControl(this.data.collectionName, [
|
|
6493
|
+
Validators.minLength(this.minLength),
|
|
6494
|
+
Validators.maxLength(this.maxLength),
|
|
6495
|
+
Validators.required
|
|
6496
|
+
]);
|
|
6497
|
+
this.collectionName.markAsTouched();
|
|
6498
|
+
this.formGroup = new UntypedFormGroup({ collectionName: this.collectionName });
|
|
6499
|
+
}
|
|
6500
|
+
submit() {
|
|
6501
|
+
if (this.formGroup.valid) {
|
|
6502
|
+
this.dialogRef.close(this.collectionName.value);
|
|
6503
|
+
}
|
|
6504
|
+
}
|
|
6505
|
+
}
|
|
6506
|
+
TldTermCreateCollectionDialogComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: TldTermCreateCollectionDialogComponent, deps: [{ token: i1$2.MatDialogRef }, { token: MAT_DIALOG_DATA }, { token: TldTranslateConfigService }], target: i0.ɵɵFactoryTarget.Component });
|
|
6507
|
+
TldTermCreateCollectionDialogComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.3.0", type: TldTermCreateCollectionDialogComponent, selector: "tld-term-create-collection-dialog", ngImport: i0, template: "<tld-close-button class=\"close-button\" mat-dialog-close>\r\n</tld-close-button>\r\n<h1 mat-dialog-title>{{'TERM_COLLECTIONS.CREATE_DIALOG.TITLE' | translate}}</h1>\r\n<div mat-dialog-content>\r\n <p [innerHtml]=\"'TERM_COLLECTIONS.CREATE_DIALOG.DESCRIPTION_1' | translate\"></p>\r\n <p [innerHtml]=\"'TERM_COLLECTIONS.CREATE_DIALOG.DESCRIPTION_2' | translate\"></p>\r\n <div [formGroup]=\"formGroup\">\r\n <mat-form-field appearance=\"outline\" class=\"collection-name-form-field\">\r\n <mat-label>{{'TERM_COLLECTIONS.CREATE_DIALOG.COLLECTION_NAME_LABEL' | translate}}</mat-label>\r\n <input matInput formControlName=\"collectionName\" (keyup.enter)=\"submit()\">\r\n <mat-error *ngIf=\"collectionName.errors\">{{'TERM_COLLECTIONS.CREATE_DIALOG.COLLECTION_NAME_ERROR' |\r\n translate: {minLength: minLength, maxLength: maxLength} }}</mat-error>\r\n </mat-form-field>\r\n </div>\r\n</div>\r\n<div mat-dialog-actions fxLayout=\"row\" fxLayoutAlign=\"center center\">\r\n <button mat-flat-button (click)=\"submit()\" cdkFocusInitial color=\"accent\"\r\n [disabled]=\"formGroup.invalid\">{{'TERM_COLLECTIONS.CREATE_DIALOG.CREATE' | translate}}</button>\r\n <button mat-button mat-dialog-close color=\"accent\">{{\"TERM_COLLECTIONS.CREATE_DIALOG.CANCEL\" | translate}}</button>\r\n</div>\r\n", styles: ["input{outline:none!important}:host ::ng-deep .mat-form-field-appearance-outline:hover .mat-form-field-outline,:host ::ng-deep .mat-form-field-appearance-outline.mat-focused .mat-form-field-outline-thick,:host ::ng-deep .mat-form-field.mat-focused .mat-form-field-label{color:#ad234a}.create-dialog-wrapper{position:relative}.close-button{position:absolute;right:1em;top:1em}\n"], dependencies: [{ kind: "directive", type: i3$2.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i3$2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i3$2.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i3.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i5.MatButton, selector: "button[mat-button], button[mat-raised-button], button[mat-icon-button], button[mat-fab], button[mat-mini-fab], button[mat-stroked-button], button[mat-flat-button]", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }, { kind: "directive", type: i6.MatError, selector: "mat-error", inputs: ["id"] }, { kind: "component", type: i6.MatFormField, selector: "mat-form-field", inputs: ["color", "appearance", "hideRequiredMarker", "hintLabel", "floatLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i6.MatLabel, selector: "mat-label" }, { kind: "directive", type: i7.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly"], exportAs: ["matInput"] }, { kind: "directive", type: i1$2.MatDialogClose, selector: "[mat-dialog-close], [matDialogClose]", inputs: ["aria-label", "type", "mat-dialog-close", "matDialogClose"], exportAs: ["matDialogClose"] }, { kind: "directive", type: i1$2.MatDialogTitle, selector: "[mat-dialog-title], [matDialogTitle]", inputs: ["id"], exportAs: ["matDialogTitle"] }, { kind: "directive", type: i1$2.MatDialogContent, selector: "[mat-dialog-content], mat-dialog-content, [matDialogContent]" }, { kind: "directive", type: i1$2.MatDialogActions, selector: "[mat-dialog-actions], mat-dialog-actions, [matDialogActions]", inputs: ["align"] }, { kind: "directive", type: i4.DefaultLayoutDirective, selector: " [fxLayout], [fxLayout.xs], [fxLayout.sm], [fxLayout.md], [fxLayout.lg], [fxLayout.xl], [fxLayout.lt-sm], [fxLayout.lt-md], [fxLayout.lt-lg], [fxLayout.lt-xl], [fxLayout.gt-xs], [fxLayout.gt-sm], [fxLayout.gt-md], [fxLayout.gt-lg]", inputs: ["fxLayout", "fxLayout.xs", "fxLayout.sm", "fxLayout.md", "fxLayout.lg", "fxLayout.xl", "fxLayout.lt-sm", "fxLayout.lt-md", "fxLayout.lt-lg", "fxLayout.lt-xl", "fxLayout.gt-xs", "fxLayout.gt-sm", "fxLayout.gt-md", "fxLayout.gt-lg"] }, { kind: "directive", type: i4.DefaultLayoutAlignDirective, selector: " [fxLayoutAlign], [fxLayoutAlign.xs], [fxLayoutAlign.sm], [fxLayoutAlign.md], [fxLayoutAlign.lg], [fxLayoutAlign.xl], [fxLayoutAlign.lt-sm], [fxLayoutAlign.lt-md], [fxLayoutAlign.lt-lg], [fxLayoutAlign.lt-xl], [fxLayoutAlign.gt-xs], [fxLayoutAlign.gt-sm], [fxLayoutAlign.gt-md], [fxLayoutAlign.gt-lg]", inputs: ["fxLayoutAlign", "fxLayoutAlign.xs", "fxLayoutAlign.sm", "fxLayoutAlign.md", "fxLayoutAlign.lg", "fxLayoutAlign.xl", "fxLayoutAlign.lt-sm", "fxLayoutAlign.lt-md", "fxLayoutAlign.lt-lg", "fxLayoutAlign.lt-xl", "fxLayoutAlign.gt-xs", "fxLayoutAlign.gt-sm", "fxLayoutAlign.gt-md", "fxLayoutAlign.gt-lg"] }, { kind: "directive", type: i3$2.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i3$2.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "component", type: i12.CloseButtonComponent, selector: "tld-close-button", inputs: ["ariaCode", "disabled", "tooltip"], outputs: ["tldClick"] }, { kind: "pipe", type: i1$1.TranslatePipe, name: "translate" }] });
|
|
6508
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: TldTermCreateCollectionDialogComponent, decorators: [{
|
|
6509
|
+
type: Component,
|
|
6510
|
+
args: [{ selector: 'tld-term-create-collection-dialog', template: "<tld-close-button class=\"close-button\" mat-dialog-close>\r\n</tld-close-button>\r\n<h1 mat-dialog-title>{{'TERM_COLLECTIONS.CREATE_DIALOG.TITLE' | translate}}</h1>\r\n<div mat-dialog-content>\r\n <p [innerHtml]=\"'TERM_COLLECTIONS.CREATE_DIALOG.DESCRIPTION_1' | translate\"></p>\r\n <p [innerHtml]=\"'TERM_COLLECTIONS.CREATE_DIALOG.DESCRIPTION_2' | translate\"></p>\r\n <div [formGroup]=\"formGroup\">\r\n <mat-form-field appearance=\"outline\" class=\"collection-name-form-field\">\r\n <mat-label>{{'TERM_COLLECTIONS.CREATE_DIALOG.COLLECTION_NAME_LABEL' | translate}}</mat-label>\r\n <input matInput formControlName=\"collectionName\" (keyup.enter)=\"submit()\">\r\n <mat-error *ngIf=\"collectionName.errors\">{{'TERM_COLLECTIONS.CREATE_DIALOG.COLLECTION_NAME_ERROR' |\r\n translate: {minLength: minLength, maxLength: maxLength} }}</mat-error>\r\n </mat-form-field>\r\n </div>\r\n</div>\r\n<div mat-dialog-actions fxLayout=\"row\" fxLayoutAlign=\"center center\">\r\n <button mat-flat-button (click)=\"submit()\" cdkFocusInitial color=\"accent\"\r\n [disabled]=\"formGroup.invalid\">{{'TERM_COLLECTIONS.CREATE_DIALOG.CREATE' | translate}}</button>\r\n <button mat-button mat-dialog-close color=\"accent\">{{\"TERM_COLLECTIONS.CREATE_DIALOG.CANCEL\" | translate}}</button>\r\n</div>\r\n", styles: ["input{outline:none!important}:host ::ng-deep .mat-form-field-appearance-outline:hover .mat-form-field-outline,:host ::ng-deep .mat-form-field-appearance-outline.mat-focused .mat-form-field-outline-thick,:host ::ng-deep .mat-form-field.mat-focused .mat-form-field-label{color:#ad234a}.create-dialog-wrapper{position:relative}.close-button{position:absolute;right:1em;top:1em}\n"] }]
|
|
6511
|
+
}], ctorParameters: function () { return [{ type: i1$2.MatDialogRef }, { type: undefined, decorators: [{
|
|
6512
|
+
type: Inject,
|
|
6513
|
+
args: [MAT_DIALOG_DATA]
|
|
6514
|
+
}] }, { type: TldTranslateConfigService }]; } });
|
|
6515
|
+
|
|
6516
|
+
class CreateCollectionComponent {
|
|
6517
|
+
constructor(translate, dialog, terminologyService) {
|
|
6518
|
+
this.translate = translate;
|
|
6519
|
+
this.dialog = dialog;
|
|
6520
|
+
this.terminologyService = terminologyService;
|
|
6521
|
+
}
|
|
6522
|
+
ngOnInit() {
|
|
6523
|
+
}
|
|
6524
|
+
create() {
|
|
6525
|
+
const localizationKey = "TERM_COLLECTIONS.DEFAULT_COLLECTION_NAME";
|
|
6526
|
+
this.translate.get(localizationKey).subscribe((collectionName) => {
|
|
6527
|
+
const dialogRef = this.dialog.open(TldTermCreateCollectionDialogComponent, {
|
|
6528
|
+
minWidth: '300px',
|
|
6529
|
+
maxWidth: '700px',
|
|
6530
|
+
data: { collectionName: collectionName }
|
|
6531
|
+
});
|
|
6532
|
+
dialogRef.afterClosed().subscribe(collectionName => {
|
|
6533
|
+
if (!collectionName) {
|
|
6534
|
+
return;
|
|
6535
|
+
}
|
|
6536
|
+
this.terminologyService.create(this.sourceLanguageCode, this.targetLanguageCode, collectionName).subscribe({
|
|
6537
|
+
error: (err) => {
|
|
6538
|
+
console.error(err);
|
|
6539
|
+
const error = { ErrorCode: ErrorCode.COLLECTION_CREATE };
|
|
6540
|
+
throw error;
|
|
6541
|
+
}
|
|
6542
|
+
});
|
|
6543
|
+
});
|
|
6544
|
+
});
|
|
6545
|
+
}
|
|
6546
|
+
}
|
|
6547
|
+
CreateCollectionComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: CreateCollectionComponent, deps: [{ token: i1$1.TranslateService }, { token: i1$2.MatDialog }, { token: TerminologyService }], target: i0.ɵɵFactoryTarget.Component });
|
|
6548
|
+
CreateCollectionComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.3.0", type: CreateCollectionComponent, selector: "tld-create-collection", inputs: { sourceLanguageCode: "sourceLanguageCode", targetLanguageCode: "targetLanguageCode" }, ngImport: i0, template: "<button mat-flat-button color=\"accent\" (click)=\"create()\" fxHide.lt-sm>\r\n {{'TERM_COLLECTIONS.CREATE' | translate}}\r\n</button>\r\n", styles: [""], dependencies: [{ kind: "component", type: i5.MatButton, selector: "button[mat-button], button[mat-raised-button], button[mat-icon-button], button[mat-fab], button[mat-mini-fab], button[mat-stroked-button], button[mat-flat-button]", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }, { kind: "directive", type: i5$1.DefaultShowHideDirective, selector: " [fxShow], [fxShow.print], [fxShow.xs], [fxShow.sm], [fxShow.md], [fxShow.lg], [fxShow.xl], [fxShow.lt-sm], [fxShow.lt-md], [fxShow.lt-lg], [fxShow.lt-xl], [fxShow.gt-xs], [fxShow.gt-sm], [fxShow.gt-md], [fxShow.gt-lg], [fxHide], [fxHide.print], [fxHide.xs], [fxHide.sm], [fxHide.md], [fxHide.lg], [fxHide.xl], [fxHide.lt-sm], [fxHide.lt-md], [fxHide.lt-lg], [fxHide.lt-xl], [fxHide.gt-xs], [fxHide.gt-sm], [fxHide.gt-md], [fxHide.gt-lg]", inputs: ["fxShow", "fxShow.print", "fxShow.xs", "fxShow.sm", "fxShow.md", "fxShow.lg", "fxShow.xl", "fxShow.lt-sm", "fxShow.lt-md", "fxShow.lt-lg", "fxShow.lt-xl", "fxShow.gt-xs", "fxShow.gt-sm", "fxShow.gt-md", "fxShow.gt-lg", "fxHide", "fxHide.print", "fxHide.xs", "fxHide.sm", "fxHide.md", "fxHide.lg", "fxHide.xl", "fxHide.lt-sm", "fxHide.lt-md", "fxHide.lt-lg", "fxHide.lt-xl", "fxHide.gt-xs", "fxHide.gt-sm", "fxHide.gt-md", "fxHide.gt-lg"] }, { kind: "pipe", type: i1$1.TranslatePipe, name: "translate" }] });
|
|
6549
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: CreateCollectionComponent, decorators: [{
|
|
6550
|
+
type: Component,
|
|
6551
|
+
args: [{ selector: 'tld-create-collection', template: "<button mat-flat-button color=\"accent\" (click)=\"create()\" fxHide.lt-sm>\r\n {{'TERM_COLLECTIONS.CREATE' | translate}}\r\n</button>\r\n" }]
|
|
6552
|
+
}], ctorParameters: function () { return [{ type: i1$1.TranslateService }, { type: i1$2.MatDialog }, { type: TerminologyService }]; }, propDecorators: { sourceLanguageCode: [{
|
|
6553
|
+
type: Input
|
|
6554
|
+
}], targetLanguageCode: [{
|
|
6555
|
+
type: Input
|
|
6556
|
+
}] } });
|
|
6557
|
+
|
|
6440
6558
|
class TldTermCollectionComponent {
|
|
6441
|
-
constructor(
|
|
6442
|
-
this.
|
|
6559
|
+
constructor(terminologyService, systemService) {
|
|
6560
|
+
this.terminologyService = terminologyService;
|
|
6561
|
+
this.systemService = systemService;
|
|
6562
|
+
}
|
|
6563
|
+
get promotion() { return this.terminologyService.shouldShowPromotion; }
|
|
6564
|
+
get hasEditPermissions() { return this.terminologyService.hasEditPermissions; }
|
|
6565
|
+
ngOnInit() {
|
|
6566
|
+
this.subscription = this.systemService.getActiveData().subscribe((data) => {
|
|
6567
|
+
this.sourceLanguageCode = data.sourceLang.lang;
|
|
6568
|
+
this.targetLanguageCode = data.targetLang.lang;
|
|
6569
|
+
this.terminologyService.setEngine(data.systemId, [this.sourceLanguageCode, this.targetLanguageCode]);
|
|
6570
|
+
});
|
|
6571
|
+
}
|
|
6572
|
+
ngOnDestroy() {
|
|
6573
|
+
this.subscription.unsubscribe();
|
|
6443
6574
|
}
|
|
6444
|
-
get promotion() { return this.terms.shouldShowPromotion; }
|
|
6445
6575
|
}
|
|
6446
|
-
TldTermCollectionComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: TldTermCollectionComponent, deps: [{ token:
|
|
6447
|
-
TldTermCollectionComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.3.0", type: TldTermCollectionComponent, selector: "tld-term-collection", ngImport: i0, template: "<section class=\"tld-collection-list-wrapper\">\r\n <ng-container *ngIf=\"!promotion\">\r\n <tld-term-collection-list></tld-term-collection-list>\r\n </ng-container>\r\n <ng-container *ngIf=\"promotion\">\r\n <tld-term-promotion></tld-term-promotion>\r\n </ng-container>\r\n</section
|
|
6576
|
+
TldTermCollectionComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: TldTermCollectionComponent, deps: [{ token: TerminologyService }, { token: TldSystemService }], target: i0.ɵɵFactoryTarget.Component });
|
|
6577
|
+
TldTermCollectionComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.3.0", type: TldTermCollectionComponent, selector: "tld-term-collection", ngImport: i0, template: "<section class=\"tld-collection-list-wrapper\">\r\n <ng-container *ngIf=\"!promotion\">\r\n <tld-term-collection-list></tld-term-collection-list>\r\n <footer class=\"tld-collection-list-footer\" fxLayout=\"row\" *ngIf=\"hasEditPermissions\">\r\n <tld-create-collection [sourceLanguageCode]=\"sourceLanguageCode\" [targetLanguageCode]=\"targetLanguageCode\">\r\n </tld-create-collection>\r\n </footer>\r\n </ng-container>\r\n <ng-container *ngIf=\"promotion\">\r\n <tld-term-promotion></tld-term-promotion>\r\n </ng-container>\r\n</section>\r\n", styles: [".tld-collection-list-footer{padding:1em .75em}\n"], dependencies: [{ kind: "directive", type: i3.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i4.DefaultLayoutDirective, selector: " [fxLayout], [fxLayout.xs], [fxLayout.sm], [fxLayout.md], [fxLayout.lg], [fxLayout.xl], [fxLayout.lt-sm], [fxLayout.lt-md], [fxLayout.lt-lg], [fxLayout.lt-xl], [fxLayout.gt-xs], [fxLayout.gt-sm], [fxLayout.gt-md], [fxLayout.gt-lg]", inputs: ["fxLayout", "fxLayout.xs", "fxLayout.sm", "fxLayout.md", "fxLayout.lg", "fxLayout.xl", "fxLayout.lt-sm", "fxLayout.lt-md", "fxLayout.lt-lg", "fxLayout.lt-xl", "fxLayout.gt-xs", "fxLayout.gt-sm", "fxLayout.gt-md", "fxLayout.gt-lg"] }, { kind: "component", type: TldTermCollectionListComponent, selector: "tld-term-collection-list" }, { kind: "component", type: TldTermPromotionComponent, selector: "tld-term-promotion" }, { kind: "component", type: CreateCollectionComponent, selector: "tld-create-collection", inputs: ["sourceLanguageCode", "targetLanguageCode"] }] });
|
|
6448
6578
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: TldTermCollectionComponent, decorators: [{
|
|
6449
6579
|
type: Component,
|
|
6450
|
-
args: [{ selector: 'tld-term-collection', template: "<section class=\"tld-collection-list-wrapper\">\r\n <ng-container *ngIf=\"!promotion\">\r\n <tld-term-collection-list></tld-term-collection-list>\r\n </ng-container>\r\n <ng-container *ngIf=\"promotion\">\r\n <tld-term-promotion></tld-term-promotion>\r\n </ng-container>\r\n</section
|
|
6451
|
-
}], ctorParameters: function () { return [{ type:
|
|
6580
|
+
args: [{ selector: 'tld-term-collection', template: "<section class=\"tld-collection-list-wrapper\">\r\n <ng-container *ngIf=\"!promotion\">\r\n <tld-term-collection-list></tld-term-collection-list>\r\n <footer class=\"tld-collection-list-footer\" fxLayout=\"row\" *ngIf=\"hasEditPermissions\">\r\n <tld-create-collection [sourceLanguageCode]=\"sourceLanguageCode\" [targetLanguageCode]=\"targetLanguageCode\">\r\n </tld-create-collection>\r\n </footer>\r\n </ng-container>\r\n <ng-container *ngIf=\"promotion\">\r\n <tld-term-promotion></tld-term-promotion>\r\n </ng-container>\r\n</section>\r\n", styles: [".tld-collection-list-footer{padding:1em .75em}\n"] }]
|
|
6581
|
+
}], ctorParameters: function () { return [{ type: TerminologyService }, { type: TldSystemService }]; } });
|
|
6452
6582
|
|
|
6453
6583
|
class TldTermMenuComponent {
|
|
6454
|
-
constructor(
|
|
6455
|
-
this.
|
|
6584
|
+
constructor(terminologyService) {
|
|
6585
|
+
this.terminologyService = terminologyService;
|
|
6456
6586
|
}
|
|
6457
|
-
get selected() { return this.
|
|
6587
|
+
get selected() { return this.terminologyService.selected; }
|
|
6458
6588
|
;
|
|
6459
|
-
set selected(val) { this.
|
|
6589
|
+
set selected(val) { this.terminologyService.selected = val; }
|
|
6590
|
+
get title() {
|
|
6591
|
+
return this.selected?.termCollection?.name ?? this.selected.mtCollection?.name;
|
|
6592
|
+
}
|
|
6593
|
+
ngOnDestroy() {
|
|
6594
|
+
this.menuClosed();
|
|
6595
|
+
}
|
|
6460
6596
|
menuOpened() {
|
|
6461
|
-
this.
|
|
6597
|
+
this.subscription = this.terminologyService.startAutoRefresh().subscribe();
|
|
6462
6598
|
}
|
|
6463
6599
|
menuClosed() {
|
|
6464
|
-
this.
|
|
6600
|
+
this.terminologyService.stopAutoRefresh();
|
|
6601
|
+
this.subscription?.unsubscribe();
|
|
6465
6602
|
}
|
|
6466
6603
|
}
|
|
6467
|
-
TldTermMenuComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: TldTermMenuComponent, deps: [{ token:
|
|
6468
|
-
TldTermMenuComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.3.0", type: TldTermMenuComponent, selector: "tld-term-menu", ngImport: i0, template: "<div fxLayoutAlign=\"center center\" [ngClass.lt-sm]=\"'tld-term-collection-wrapper-mobile'\" fxLayoutGap=\"8px\">\r\n <span fxHide.lt-md>\r\n {{'TERM_COLLECTIONS.GLOSSARY' | translate}}\r\n </span>\r\n <tld-open-close-button fxHide.lt-sm #state=\"matMenuTrigger\" [matMenuTriggerFor]=\"menu\"
|
|
6604
|
+
TldTermMenuComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: TldTermMenuComponent, deps: [{ token: TerminologyService }], target: i0.ɵɵFactoryTarget.Component });
|
|
6605
|
+
TldTermMenuComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.3.0", type: TldTermMenuComponent, selector: "tld-term-menu", ngImport: i0, template: "<div fxLayoutAlign=\"center center\" [ngClass.lt-sm]=\"'tld-term-collection-wrapper-mobile'\" fxLayoutGap=\"8px\">\r\n <span fxHide.lt-md>\r\n {{'TERM_COLLECTIONS.GLOSSARY' | translate}}\r\n </span>\r\n <tld-open-close-button fxHide.lt-sm #state=\"matMenuTrigger\" [matMenuTriggerFor]=\"menu\" (menuOpened)=\"menuOpened()\"\r\n (menuClosed)=\"menuClosed()\" [matTooltip]=\"selected? title:''\" [isOpened]=\"state.menuOpen\"\r\n class=\"tld-collection-menu-button\" [attr.aria-label]=\"'TERM_COLLECTIONS.ARIA_LABELS.OTHER_COLLECTIONS' | translate\">\r\n <span class=\"selected-collection\">\r\n {{selected? title : ('TERM_COLLECTIONS.SELECTED_NONE' | translate)}}\r\n </span>\r\n <mat-spinner class=\"selected-col-spinner\" color=\"accent\" diameter=\"16\" *ngIf=\"selected?.isImporting\"></mat-spinner>\r\n </tld-open-close-button>\r\n <button mat-icon-button fxHide.gt-xs [matMenuTriggerFor]=\"menu\">\r\n <mat-icon svgIcon=\"collections_menu\" [attr.color]=\"selected?'accent':''\"></mat-icon>\r\n </button>\r\n\r\n</div>\r\n\r\n<mat-menu #menu=\"matMenu\" class=\"tld-collection-menu\">\r\n <tld-close-button fxHide.gt-xs></tld-close-button>\r\n <div class=\"tld-term-collection\" (click)=\"$event.stopPropagation()\" (keydown)=\"$event.stopPropagation()\">\r\n <tld-term-collection></tld-term-collection>\r\n </div>\r\n</mat-menu>\r\n", styles: [".tld-collection-menu-button .selected-collection{overflow:hidden;text-overflow:ellipsis;max-width:140px;display:inline-block}.selected-col-spinner{margin-left:5px}\n"], dependencies: [{ kind: "directive", type: i3.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i5.MatButton, selector: "button[mat-button], button[mat-raised-button], button[mat-icon-button], button[mat-fab], button[mat-mini-fab], button[mat-stroked-button], button[mat-flat-button]", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }, { kind: "component", type: i1.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "component", type: i3$1.MatMenu, selector: "mat-menu", exportAs: ["matMenu"] }, { kind: "directive", type: i3$1.MatMenuTrigger, selector: "[mat-menu-trigger-for], [matMenuTriggerFor]", exportAs: ["matMenuTrigger"] }, { kind: "directive", type: i2$1.MatTooltip, selector: "[matTooltip]", exportAs: ["matTooltip"] }, { kind: "directive", type: i4.DefaultLayoutGapDirective, selector: " [fxLayoutGap], [fxLayoutGap.xs], [fxLayoutGap.sm], [fxLayoutGap.md], [fxLayoutGap.lg], [fxLayoutGap.xl], [fxLayoutGap.lt-sm], [fxLayoutGap.lt-md], [fxLayoutGap.lt-lg], [fxLayoutGap.lt-xl], [fxLayoutGap.gt-xs], [fxLayoutGap.gt-sm], [fxLayoutGap.gt-md], [fxLayoutGap.gt-lg]", inputs: ["fxLayoutGap", "fxLayoutGap.xs", "fxLayoutGap.sm", "fxLayoutGap.md", "fxLayoutGap.lg", "fxLayoutGap.xl", "fxLayoutGap.lt-sm", "fxLayoutGap.lt-md", "fxLayoutGap.lt-lg", "fxLayoutGap.lt-xl", "fxLayoutGap.gt-xs", "fxLayoutGap.gt-sm", "fxLayoutGap.gt-md", "fxLayoutGap.gt-lg"] }, { kind: "directive", type: i4.DefaultLayoutAlignDirective, selector: " [fxLayoutAlign], [fxLayoutAlign.xs], [fxLayoutAlign.sm], [fxLayoutAlign.md], [fxLayoutAlign.lg], [fxLayoutAlign.xl], [fxLayoutAlign.lt-sm], [fxLayoutAlign.lt-md], [fxLayoutAlign.lt-lg], [fxLayoutAlign.lt-xl], [fxLayoutAlign.gt-xs], [fxLayoutAlign.gt-sm], [fxLayoutAlign.gt-md], [fxLayoutAlign.gt-lg]", inputs: ["fxLayoutAlign", "fxLayoutAlign.xs", "fxLayoutAlign.sm", "fxLayoutAlign.md", "fxLayoutAlign.lg", "fxLayoutAlign.xl", "fxLayoutAlign.lt-sm", "fxLayoutAlign.lt-md", "fxLayoutAlign.lt-lg", "fxLayoutAlign.lt-xl", "fxLayoutAlign.gt-xs", "fxLayoutAlign.gt-sm", "fxLayoutAlign.gt-md", "fxLayoutAlign.gt-lg"] }, { kind: "directive", type: i5$1.DefaultShowHideDirective, selector: " [fxShow], [fxShow.print], [fxShow.xs], [fxShow.sm], [fxShow.md], [fxShow.lg], [fxShow.xl], [fxShow.lt-sm], [fxShow.lt-md], [fxShow.lt-lg], [fxShow.lt-xl], [fxShow.gt-xs], [fxShow.gt-sm], [fxShow.gt-md], [fxShow.gt-lg], [fxHide], [fxHide.print], [fxHide.xs], [fxHide.sm], [fxHide.md], [fxHide.lg], [fxHide.xl], [fxHide.lt-sm], [fxHide.lt-md], [fxHide.lt-lg], [fxHide.lt-xl], [fxHide.gt-xs], [fxHide.gt-sm], [fxHide.gt-md], [fxHide.gt-lg]", inputs: ["fxShow", "fxShow.print", "fxShow.xs", "fxShow.sm", "fxShow.md", "fxShow.lg", "fxShow.xl", "fxShow.lt-sm", "fxShow.lt-md", "fxShow.lt-lg", "fxShow.lt-xl", "fxShow.gt-xs", "fxShow.gt-sm", "fxShow.gt-md", "fxShow.gt-lg", "fxHide", "fxHide.print", "fxHide.xs", "fxHide.sm", "fxHide.md", "fxHide.lg", "fxHide.xl", "fxHide.lt-sm", "fxHide.lt-md", "fxHide.lt-lg", "fxHide.lt-xl", "fxHide.gt-xs", "fxHide.gt-sm", "fxHide.gt-md", "fxHide.gt-lg"] }, { kind: "directive", type: i5$1.DefaultClassDirective, selector: " [ngClass], [ngClass.xs], [ngClass.sm], [ngClass.md], [ngClass.lg], [ngClass.xl], [ngClass.lt-sm], [ngClass.lt-md], [ngClass.lt-lg], [ngClass.lt-xl], [ngClass.gt-xs], [ngClass.gt-sm], [ngClass.gt-md], [ngClass.gt-lg]", inputs: ["ngClass", "ngClass.xs", "ngClass.sm", "ngClass.md", "ngClass.lg", "ngClass.xl", "ngClass.lt-sm", "ngClass.lt-md", "ngClass.lt-lg", "ngClass.lt-xl", "ngClass.gt-xs", "ngClass.gt-sm", "ngClass.gt-md", "ngClass.gt-lg"] }, { kind: "component", type: i13.MatProgressSpinner, selector: "mat-progress-spinner, mat-spinner", inputs: ["color", "diameter", "strokeWidth", "mode", "value"], exportAs: ["matProgressSpinner"] }, { kind: "component", type: TldOpenCloseButtonComponent, selector: "tld-open-close-button", inputs: ["disableFocusOnAction", "isOpened", "disabled", "isIcon", "ariaLabelCode"] }, { kind: "component", type: i12.CloseButtonComponent, selector: "tld-close-button", inputs: ["ariaCode", "disabled", "tooltip"], outputs: ["tldClick"] }, { kind: "component", type: TldTermCollectionComponent, selector: "tld-term-collection" }, { kind: "pipe", type: i1$1.TranslatePipe, name: "translate" }] });
|
|
6469
6606
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: TldTermMenuComponent, decorators: [{
|
|
6470
6607
|
type: Component,
|
|
6471
|
-
args: [{ selector: 'tld-term-menu', template: "<div fxLayoutAlign=\"center center\" [ngClass.lt-sm]=\"'tld-term-collection-wrapper-mobile'\" fxLayoutGap=\"8px\">\r\n <span fxHide.lt-md>\r\n {{'TERM_COLLECTIONS.GLOSSARY' | translate}}\r\n </span>\r\n <tld-open-close-button fxHide.lt-sm #state=\"matMenuTrigger\" [matMenuTriggerFor]=\"menu\"
|
|
6472
|
-
}], ctorParameters: function () { return [{ type:
|
|
6608
|
+
args: [{ selector: 'tld-term-menu', template: "<div fxLayoutAlign=\"center center\" [ngClass.lt-sm]=\"'tld-term-collection-wrapper-mobile'\" fxLayoutGap=\"8px\">\r\n <span fxHide.lt-md>\r\n {{'TERM_COLLECTIONS.GLOSSARY' | translate}}\r\n </span>\r\n <tld-open-close-button fxHide.lt-sm #state=\"matMenuTrigger\" [matMenuTriggerFor]=\"menu\" (menuOpened)=\"menuOpened()\"\r\n (menuClosed)=\"menuClosed()\" [matTooltip]=\"selected? title:''\" [isOpened]=\"state.menuOpen\"\r\n class=\"tld-collection-menu-button\" [attr.aria-label]=\"'TERM_COLLECTIONS.ARIA_LABELS.OTHER_COLLECTIONS' | translate\">\r\n <span class=\"selected-collection\">\r\n {{selected? title : ('TERM_COLLECTIONS.SELECTED_NONE' | translate)}}\r\n </span>\r\n <mat-spinner class=\"selected-col-spinner\" color=\"accent\" diameter=\"16\" *ngIf=\"selected?.isImporting\"></mat-spinner>\r\n </tld-open-close-button>\r\n <button mat-icon-button fxHide.gt-xs [matMenuTriggerFor]=\"menu\">\r\n <mat-icon svgIcon=\"collections_menu\" [attr.color]=\"selected?'accent':''\"></mat-icon>\r\n </button>\r\n\r\n</div>\r\n\r\n<mat-menu #menu=\"matMenu\" class=\"tld-collection-menu\">\r\n <tld-close-button fxHide.gt-xs></tld-close-button>\r\n <div class=\"tld-term-collection\" (click)=\"$event.stopPropagation()\" (keydown)=\"$event.stopPropagation()\">\r\n <tld-term-collection></tld-term-collection>\r\n </div>\r\n</mat-menu>\r\n", styles: [".tld-collection-menu-button .selected-collection{overflow:hidden;text-overflow:ellipsis;max-width:140px;display:inline-block}.selected-col-spinner{margin-left:5px}\n"] }]
|
|
6609
|
+
}], ctorParameters: function () { return [{ type: TerminologyService }]; } });
|
|
6473
6610
|
|
|
6474
6611
|
class TldTermModule {
|
|
6475
6612
|
}
|
|
6476
6613
|
TldTermModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: TldTermModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
6477
|
-
TldTermModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "14.3.0", ngImport: i0, type: TldTermModule, declarations: [TldTermCollectionComponent, TldTermCollectionListComponent, TldTermCreateCollectionDialogComponent, TldTermMenuComponent, TldTermPromotionComponent], imports: [FormsModule,
|
|
6614
|
+
TldTermModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "14.3.0", ngImport: i0, type: TldTermModule, declarations: [TldTermCollectionComponent, TldTermCollectionListComponent, TldTermCreateCollectionDialogComponent, TldTermMenuComponent, TldTermPromotionComponent, CreateCollectionComponent], imports: [FormsModule,
|
|
6478
6615
|
CommonModule,
|
|
6479
6616
|
MaterialModule,
|
|
6480
6617
|
TranslateModule,
|
|
@@ -6485,7 +6622,7 @@ TldTermModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version:
|
|
|
6485
6622
|
MatTooltipModule,
|
|
6486
6623
|
TldCommonModule,
|
|
6487
6624
|
ReactiveFormsModule,
|
|
6488
|
-
CloseButtonModule], exports: [TldTermMenuComponent] });
|
|
6625
|
+
CloseButtonModule], exports: [TldTermMenuComponent, CreateCollectionComponent] });
|
|
6489
6626
|
TldTermModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: TldTermModule, imports: [FormsModule,
|
|
6490
6627
|
CommonModule,
|
|
6491
6628
|
MaterialModule,
|
|
@@ -6501,7 +6638,7 @@ TldTermModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version:
|
|
|
6501
6638
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: TldTermModule, decorators: [{
|
|
6502
6639
|
type: NgModule,
|
|
6503
6640
|
args: [{
|
|
6504
|
-
declarations: [TldTermCollectionComponent, TldTermCollectionListComponent, TldTermCreateCollectionDialogComponent, TldTermMenuComponent, TldTermPromotionComponent],
|
|
6641
|
+
declarations: [TldTermCollectionComponent, TldTermCollectionListComponent, TldTermCreateCollectionDialogComponent, TldTermMenuComponent, TldTermPromotionComponent, CreateCollectionComponent],
|
|
6505
6642
|
imports: [
|
|
6506
6643
|
FormsModule,
|
|
6507
6644
|
CommonModule,
|
|
@@ -6516,10 +6653,38 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImpor
|
|
|
6516
6653
|
ReactiveFormsModule,
|
|
6517
6654
|
CloseButtonModule
|
|
6518
6655
|
],
|
|
6519
|
-
exports: [TldTermMenuComponent]
|
|
6656
|
+
exports: [TldTermMenuComponent, CreateCollectionComponent]
|
|
6520
6657
|
}]
|
|
6521
6658
|
}] });
|
|
6522
6659
|
|
|
6660
|
+
class EningeTermApiService {
|
|
6661
|
+
constructor(http, config) {
|
|
6662
|
+
this.http = http;
|
|
6663
|
+
this.config = config;
|
|
6664
|
+
this.baseUrl = this.config.termConfig.engineTermUrl;
|
|
6665
|
+
}
|
|
6666
|
+
add(engineId, params) {
|
|
6667
|
+
return this.http.post(`${this.baseUrl}/${engineId}/terms`, params);
|
|
6668
|
+
}
|
|
6669
|
+
update(engineId, collectionId, params) {
|
|
6670
|
+
return this.http.put(`${this.baseUrl}/${engineId}/terms/${collectionId}`, params);
|
|
6671
|
+
}
|
|
6672
|
+
getList(engineId) {
|
|
6673
|
+
return this.http.get(`${this.baseUrl}/${engineId}/terms`, { params: { engineId } });
|
|
6674
|
+
}
|
|
6675
|
+
remove(engineId, collectionId) {
|
|
6676
|
+
return this.http.delete(`${this.baseUrl}/${engineId}/terms/${collectionId}`);
|
|
6677
|
+
}
|
|
6678
|
+
}
|
|
6679
|
+
EningeTermApiService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: EningeTermApiService, deps: [{ token: i1$3.HttpClient }, { token: TldTranslateConfigService }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
6680
|
+
EningeTermApiService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: EningeTermApiService, providedIn: 'root' });
|
|
6681
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: EningeTermApiService, decorators: [{
|
|
6682
|
+
type: Injectable,
|
|
6683
|
+
args: [{
|
|
6684
|
+
providedIn: 'root'
|
|
6685
|
+
}]
|
|
6686
|
+
}], ctorParameters: function () { return [{ type: i1$3.HttpClient }, { type: TldTranslateConfigService }]; } });
|
|
6687
|
+
|
|
6523
6688
|
class ExtensionDialogComponent {
|
|
6524
6689
|
constructor(data) {
|
|
6525
6690
|
this.data = data;
|
|
@@ -7001,10 +7166,10 @@ class TldVoiceInputApiService {
|
|
|
7001
7166
|
const formData = new FormData();
|
|
7002
7167
|
formData.append("file", params.file);
|
|
7003
7168
|
formData.append("langauge", params.language);
|
|
7004
|
-
return this.http.post(this.audioConfig.audioApiUrl, formData).pipe(map(response => this.mapJob(response)));
|
|
7169
|
+
return this.http.post(this.audioConfig.audioApiUrl, formData).pipe(map$1(response => this.mapJob(response)));
|
|
7005
7170
|
}
|
|
7006
7171
|
getJobInfo(jobId) {
|
|
7007
|
-
return this.http.get(`${this.audioConfig.audioApiUrl}/${jobId}`).pipe(map(response => this.mapJob(response)));
|
|
7172
|
+
return this.http.get(`${this.audioConfig.audioApiUrl}/${jobId}`).pipe(map$1(response => this.mapJob(response)));
|
|
7008
7173
|
}
|
|
7009
7174
|
mapJob(response) {
|
|
7010
7175
|
// converts to VoiceToTextState, so it suits enum conventions.
|
|
@@ -7619,7 +7784,7 @@ class TldTranslateTextService {
|
|
|
7619
7784
|
this.untranslatedParagraphCount = 0;
|
|
7620
7785
|
this.paragraphTranslationSubscription = this.paragraphTranslationsSubject.asObservable().pipe(mergeMap((untranslatedParagraph) => {
|
|
7621
7786
|
this.untranslatedParagraphCount += 1;
|
|
7622
|
-
return this.translateParagraph(untranslatedParagraph).pipe(tap((response) => {
|
|
7787
|
+
return this.translateParagraph(untranslatedParagraph).pipe(tap$1((response) => {
|
|
7623
7788
|
// No need to handle response if source text has changed.
|
|
7624
7789
|
if (source != this.sourceText) {
|
|
7625
7790
|
return;
|
|
@@ -9412,7 +9577,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImpor
|
|
|
9412
9577
|
|
|
9413
9578
|
window.$ = window.jQuery = $;
|
|
9414
9579
|
class TldTranslateWebsiteComponent {
|
|
9415
|
-
constructor(translate, configService, translateButtonService, alerts, router, activatedRoute, tldSystem,
|
|
9580
|
+
constructor(translate, configService, translateButtonService, alerts, router, activatedRoute, tldSystem, terminologyService, tldTranslateWebService, iconService, apiVersion) {
|
|
9416
9581
|
this.translate = translate;
|
|
9417
9582
|
this.configService = configService;
|
|
9418
9583
|
this.translateButtonService = translateButtonService;
|
|
@@ -9420,7 +9585,7 @@ class TldTranslateWebsiteComponent {
|
|
|
9420
9585
|
this.router = router;
|
|
9421
9586
|
this.activatedRoute = activatedRoute;
|
|
9422
9587
|
this.tldSystem = tldSystem;
|
|
9423
|
-
this.
|
|
9588
|
+
this.terminologyService = terminologyService;
|
|
9424
9589
|
this.tldTranslateWebService = tldTranslateWebService;
|
|
9425
9590
|
this.apiVersion = apiVersion;
|
|
9426
9591
|
this.product = '';
|
|
@@ -9687,7 +9852,7 @@ class TldTranslateWebsiteComponent {
|
|
|
9687
9852
|
this.sendMessage({ message: 'changeSystem', systemId: sys.id });
|
|
9688
9853
|
}
|
|
9689
9854
|
translateButtonClick() {
|
|
9690
|
-
const selectedCollectionId = this.
|
|
9855
|
+
const selectedCollectionId = this.terminologyService.selectedIdForTranslation();
|
|
9691
9856
|
if (this.urlToTranslate != '') {
|
|
9692
9857
|
this.sendMessage({
|
|
9693
9858
|
message: 'loadUrl',
|
|
@@ -9846,7 +10011,7 @@ class TldTranslateWebsiteComponent {
|
|
|
9846
10011
|
body.appendChild(script);
|
|
9847
10012
|
}
|
|
9848
10013
|
}
|
|
9849
|
-
TldTranslateWebsiteComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: TldTranslateWebsiteComponent, deps: [{ token: i1$1.TranslateService }, { token: TldTranslateConfigService }, { token: TldTranslateButtonService }, { token: TldAlertService }, { token: i4$1.Router }, { token: i4$1.ActivatedRoute }, { token: TldSystemService }, { token:
|
|
10014
|
+
TldTranslateWebsiteComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: TldTranslateWebsiteComponent, deps: [{ token: i1$1.TranslateService }, { token: TldTranslateConfigService }, { token: TldTranslateButtonService }, { token: TldAlertService }, { token: i4$1.Router }, { token: i4$1.ActivatedRoute }, { token: TldSystemService }, { token: TerminologyService }, { token: TldTranslateWebService }, { token: IconService }, { token: TRANSLATION_API_VERSION_TOKEN }], target: i0.ɵɵFactoryTarget.Component });
|
|
9850
10015
|
TldTranslateWebsiteComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.3.0", type: TldTranslateWebsiteComponent, selector: "tld-translate-website", inputs: { product: "product", company: "company" }, outputs: { onError: "onError" }, viewQueries: [{ propertyName: "urlInputField", first: true, predicate: ["url"], descendants: true }], ngImport: i0, template: "<div id=\"widget\" class=\"tld-translate-web\">\r\n <div class=\"translate-container-header\">\r\n <a href=\"/\" id=\"home-link\" [attr.title]=\"'WEBTRANSLATE.BACK' | translate\">\r\n <img [src]=\"logoLocation\" alt=\"logo\">\r\n <lib-company-product *ngIf=\"company && product\" [company]=\"company\" [product]=\"product\"></lib-company-product>\r\n </a>\r\n <div [ngClass.lt-sm]=\"'tld-translate-mobile'\">\r\n\r\n <div fxLayout=\"row\" fxLayoutAlign=\"center center\" class=\"address-wrapper\">\r\n <div fxFlex class=\"back-btn\">\r\n\r\n <button (click)=\"goToHome()\" color=\"accent\" mat-flat-button [attr.title]=\"'WEBTRANSLATE.BACK' | translate\">\r\n <mat-icon inline=true>chevron_left</mat-icon>\r\n </button>\r\n\r\n </div>\r\n <div fxFlex class=\"\">\r\n <div data-text=\"address\" class=\"\">{{'WEBTRANSLATE.ADDRESS' | translate}}</div>\r\n </div>\r\n <div fxFlex=\"100%\" class=\"address-input\">\r\n <input type=\"url\" #url class=\"url w-100\" autofocus=\"autofocus\" [(ngModel)]=\"urlToTranslate\"\r\n (keyup.enter)=\"loadButtonClicked()\" />\r\n </div>\r\n <div fxFlex class=\"load-btn\">\r\n <button (click)=\"loadButtonClicked()\" color=\"accent\" mat-flat-button\r\n [attr.title]=\"'WEBTRANSLATE.LOAD_PAGE' | translate\" [disabled]=\"!urlToTranslate\">\r\n <mat-icon inline=true>search</mat-icon>\r\n </button>\r\n </div>\r\n\r\n </div>\r\n\r\n <div fxLayout=\"row\" fxLayoutAlign=\"center\" class=\"tld-translate-switcher-wrapper\">\r\n <div fxLayout=\"row\" fxLayoutAlign=\"center center\" fxFlex>\r\n <tld-translate-switcher\r\n *ngIf=\"switcherOptions\"\r\n [isCollectionsActivated]=\"isCollectionsActivated\"\r\n [useParentWidth]=\"useParentWidth\"\r\n [disabled]=\"actionButtonDisabled\"\r\n [settings]=\"switcherOptions\"\r\n [showTranslateButton]=\"false\"\r\n [hideOnSmallScreens]=\"false\"\r\n [hideLangMenuLabels]=\"hideLangMenuLabels\"\r\n [maxDisplayedLanguages]=\"maxDisplayedLanguages\"\r\n [showDomainsWithLanguageName]=\"showDomainsWithLanguageName\"\r\n (onDomainChange)=\"systemChange($event)\"\r\n (onActionClick)=\"translateButtonClick()\"\r\n (onLanguageSwap)=\"swapLanguages()\"\r\n (onSourceLanguageChange)=\"sourceLanguageChange($event)\"\r\n (onTargetLanguageChange)=\"targetLanguageChange($event)\">\r\n </tld-translate-switcher>\r\n <div fxFlexAlign=\"center\" class=\"action-btn-wrapper\">\r\n <tld-translate-button\r\n *ngIf=\"showTranslateBtn\"\r\n class=\"switcher-translate-button\"\r\n [disabled]=\"actionButtonDisabled || !urlToTranslate\">\r\n </tld-translate-button>\r\n <button *ngIf=\"showCancel\" mat-flat-button color=\"accent\" (click)=\"cancel()\"\r\n class=\"cancel-button\">{{'WEBTRANSLATE.CANCEL' | translate}}</button>\r\n <button *ngIf=\"showRestore\" mat-flat-button color=\"accent\" (click)=\"restore()\"\r\n class=\"restore-button\">{{'WEBTRANSLATE.RESTORE' | translate}}</button>\r\n </div>\r\n </div>\r\n </div>\r\n\r\n </div>\r\n\r\n <div id=\"website-frame-container\">\r\n <mat-progress-bar *ngIf=\"showProgress\" color=\"accent\" [mode]=\"mode\" [value]=\"progressValue\">\r\n </mat-progress-bar>\r\n <lib-tld-notification-message [@openCloseAnimation] *ngFor=\"let message of messages; let ix = index\" [message]=\"message\"\r\n (closeClicked)=\"removeMessage(ix)\"></lib-tld-notification-message>\r\n <iframe id=\"letsmt-translate-page-iframe\" name=\"letsmtTranslatePageIframe\" src=\"about:blank\"\r\n [attr.sandbox]=\"sandbox\"></iframe>\r\n </div>\r\n </div>\r\n</div>\r\n", styles: [".tld-translate-switcher-wrapper{padding:0 .5em;margin-left:auto;margin-right:auto}.translate-container-header{padding:.6em 1em 0;box-sizing:border-box}#widget .translate-container-header{width:100%;height:100%;margin-left:auto;margin-right:auto}#letsmt-translate-page-iframe{width:100%;height:100%;border:0}#website-frame-container{inset:5.92em 0 0;border-top:solid 1px #d4d4d4;position:fixed}#home-link{position:absolute;left:.75em;top:.2em;display:flex;flex-direction:row;text-decoration:none}#home-link img{margin-right:.75em;max-height:5.5em}@media screen and (max-width: 73em){#home-link{display:none}}.back-btn .mat-flat-button,.load-btn .mat-flat-button{width:27px;height:27px;line-height:27px;min-width:27px;padding:0}.back-btn .mat-flat-button .mat-icon,.load-btn .mat-flat-button .mat-icon{vertical-align:top;font-size:1.25em}.address-wrapper{max-width:60em;margin-bottom:.38em;margin-left:auto;margin-right:auto}.load-btn{padding-left:.8em}.back-btn{padding-right:.8em}.cancel-button,.restore-button{min-width:100px;height:36px;align-self:center}.w-100{width:100%}.address-input{padding-left:.9em;padding-right:.65em}\n"], dependencies: [{ kind: "directive", type: i3.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i3.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: TldTranslateSwitcherComponent, selector: "tld-translate-switcher", inputs: ["buttonDisabled", "showTranslateButton", "hideOnSmallScreens", "disabled", "hideLangMenuLabels", "maxDisplayedLanguages", "collections", "showDomainsWithLanguageName", "isCollectionsActivated", "useParentWidth", "loader", "settings"], outputs: ["onDomainChange", "onActionClick", "onSourceLanguageChange", "onTargetLanguageChange", "onLanguageSwap", "onVendorChange"] }, { kind: "component", type: TldTranslateButtonComponent, selector: "tld-translate-button", inputs: ["disabled", "enablePulseAnimation"], outputs: ["clicked"] }, { kind: "component", type: i5.MatButton, selector: "button[mat-button], button[mat-raised-button], button[mat-icon-button], button[mat-fab], button[mat-mini-fab], button[mat-stroked-button], button[mat-flat-button]", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }, { kind: "component", type: i1.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "component", type: i11.MatProgressBar, selector: "mat-progress-bar", inputs: ["color", "value", "bufferValue", "mode"], outputs: ["animationEnd"], exportAs: ["matProgressBar"] }, { kind: "directive", type: i4.DefaultLayoutDirective, selector: " [fxLayout], [fxLayout.xs], [fxLayout.sm], [fxLayout.md], [fxLayout.lg], [fxLayout.xl], [fxLayout.lt-sm], [fxLayout.lt-md], [fxLayout.lt-lg], [fxLayout.lt-xl], [fxLayout.gt-xs], [fxLayout.gt-sm], [fxLayout.gt-md], [fxLayout.gt-lg]", inputs: ["fxLayout", "fxLayout.xs", "fxLayout.sm", "fxLayout.md", "fxLayout.lg", "fxLayout.xl", "fxLayout.lt-sm", "fxLayout.lt-md", "fxLayout.lt-lg", "fxLayout.lt-xl", "fxLayout.gt-xs", "fxLayout.gt-sm", "fxLayout.gt-md", "fxLayout.gt-lg"] }, { kind: "directive", type: i4.DefaultLayoutAlignDirective, selector: " [fxLayoutAlign], [fxLayoutAlign.xs], [fxLayoutAlign.sm], [fxLayoutAlign.md], [fxLayoutAlign.lg], [fxLayoutAlign.xl], [fxLayoutAlign.lt-sm], [fxLayoutAlign.lt-md], [fxLayoutAlign.lt-lg], [fxLayoutAlign.lt-xl], [fxLayoutAlign.gt-xs], [fxLayoutAlign.gt-sm], [fxLayoutAlign.gt-md], [fxLayoutAlign.gt-lg]", inputs: ["fxLayoutAlign", "fxLayoutAlign.xs", "fxLayoutAlign.sm", "fxLayoutAlign.md", "fxLayoutAlign.lg", "fxLayoutAlign.xl", "fxLayoutAlign.lt-sm", "fxLayoutAlign.lt-md", "fxLayoutAlign.lt-lg", "fxLayoutAlign.lt-xl", "fxLayoutAlign.gt-xs", "fxLayoutAlign.gt-sm", "fxLayoutAlign.gt-md", "fxLayoutAlign.gt-lg"] }, { kind: "directive", type: i4.DefaultFlexAlignDirective, selector: " [fxFlexAlign], [fxFlexAlign.xs], [fxFlexAlign.sm], [fxFlexAlign.md], [fxFlexAlign.lg], [fxFlexAlign.xl], [fxFlexAlign.lt-sm], [fxFlexAlign.lt-md], [fxFlexAlign.lt-lg], [fxFlexAlign.lt-xl], [fxFlexAlign.gt-xs], [fxFlexAlign.gt-sm], [fxFlexAlign.gt-md], [fxFlexAlign.gt-lg]", inputs: ["fxFlexAlign", "fxFlexAlign.xs", "fxFlexAlign.sm", "fxFlexAlign.md", "fxFlexAlign.lg", "fxFlexAlign.xl", "fxFlexAlign.lt-sm", "fxFlexAlign.lt-md", "fxFlexAlign.lt-lg", "fxFlexAlign.lt-xl", "fxFlexAlign.gt-xs", "fxFlexAlign.gt-sm", "fxFlexAlign.gt-md", "fxFlexAlign.gt-lg"] }, { kind: "directive", type: i4.DefaultFlexDirective, selector: " [fxFlex], [fxFlex.xs], [fxFlex.sm], [fxFlex.md], [fxFlex.lg], [fxFlex.xl], [fxFlex.lt-sm], [fxFlex.lt-md], [fxFlex.lt-lg], [fxFlex.lt-xl], [fxFlex.gt-xs], [fxFlex.gt-sm], [fxFlex.gt-md], [fxFlex.gt-lg]", inputs: ["fxFlex", "fxFlex.xs", "fxFlex.sm", "fxFlex.md", "fxFlex.lg", "fxFlex.xl", "fxFlex.lt-sm", "fxFlex.lt-md", "fxFlex.lt-lg", "fxFlex.lt-xl", "fxFlex.gt-xs", "fxFlex.gt-sm", "fxFlex.gt-md", "fxFlex.gt-lg"] }, { kind: "directive", type: i5$1.DefaultClassDirective, selector: " [ngClass], [ngClass.xs], [ngClass.sm], [ngClass.md], [ngClass.lg], [ngClass.xl], [ngClass.lt-sm], [ngClass.lt-md], [ngClass.lt-lg], [ngClass.lt-xl], [ngClass.gt-xs], [ngClass.gt-sm], [ngClass.gt-md], [ngClass.gt-lg]", inputs: ["ngClass", "ngClass.xs", "ngClass.sm", "ngClass.md", "ngClass.lg", "ngClass.xl", "ngClass.lt-sm", "ngClass.lt-md", "ngClass.lt-lg", "ngClass.lt-xl", "ngClass.gt-xs", "ngClass.gt-sm", "ngClass.gt-md", "ngClass.gt-lg"] }, { kind: "directive", type: i3$2.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i3$2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i3$2.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "component", type: i12.NotificationMessageComponent, selector: "lib-tld-notification-message", inputs: ["message", "inline"], outputs: ["buttonClicked", "closeClicked", "linkClicked"] }, { kind: "component", type: i12.CompanyProductComponent, selector: "lib-company-product", inputs: ["company", "product"] }, { kind: "pipe", type: i1$1.TranslatePipe, name: "translate" }], animations: [
|
|
9851
10016
|
trigger('openCloseAnimation', [
|
|
9852
10017
|
transition(':enter', [
|
|
@@ -9867,7 +10032,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImpor
|
|
|
9867
10032
|
transition(':leave', animate(500, style({ height: 0 })))
|
|
9868
10033
|
])
|
|
9869
10034
|
], template: "<div id=\"widget\" class=\"tld-translate-web\">\r\n <div class=\"translate-container-header\">\r\n <a href=\"/\" id=\"home-link\" [attr.title]=\"'WEBTRANSLATE.BACK' | translate\">\r\n <img [src]=\"logoLocation\" alt=\"logo\">\r\n <lib-company-product *ngIf=\"company && product\" [company]=\"company\" [product]=\"product\"></lib-company-product>\r\n </a>\r\n <div [ngClass.lt-sm]=\"'tld-translate-mobile'\">\r\n\r\n <div fxLayout=\"row\" fxLayoutAlign=\"center center\" class=\"address-wrapper\">\r\n <div fxFlex class=\"back-btn\">\r\n\r\n <button (click)=\"goToHome()\" color=\"accent\" mat-flat-button [attr.title]=\"'WEBTRANSLATE.BACK' | translate\">\r\n <mat-icon inline=true>chevron_left</mat-icon>\r\n </button>\r\n\r\n </div>\r\n <div fxFlex class=\"\">\r\n <div data-text=\"address\" class=\"\">{{'WEBTRANSLATE.ADDRESS' | translate}}</div>\r\n </div>\r\n <div fxFlex=\"100%\" class=\"address-input\">\r\n <input type=\"url\" #url class=\"url w-100\" autofocus=\"autofocus\" [(ngModel)]=\"urlToTranslate\"\r\n (keyup.enter)=\"loadButtonClicked()\" />\r\n </div>\r\n <div fxFlex class=\"load-btn\">\r\n <button (click)=\"loadButtonClicked()\" color=\"accent\" mat-flat-button\r\n [attr.title]=\"'WEBTRANSLATE.LOAD_PAGE' | translate\" [disabled]=\"!urlToTranslate\">\r\n <mat-icon inline=true>search</mat-icon>\r\n </button>\r\n </div>\r\n\r\n </div>\r\n\r\n <div fxLayout=\"row\" fxLayoutAlign=\"center\" class=\"tld-translate-switcher-wrapper\">\r\n <div fxLayout=\"row\" fxLayoutAlign=\"center center\" fxFlex>\r\n <tld-translate-switcher\r\n *ngIf=\"switcherOptions\"\r\n [isCollectionsActivated]=\"isCollectionsActivated\"\r\n [useParentWidth]=\"useParentWidth\"\r\n [disabled]=\"actionButtonDisabled\"\r\n [settings]=\"switcherOptions\"\r\n [showTranslateButton]=\"false\"\r\n [hideOnSmallScreens]=\"false\"\r\n [hideLangMenuLabels]=\"hideLangMenuLabels\"\r\n [maxDisplayedLanguages]=\"maxDisplayedLanguages\"\r\n [showDomainsWithLanguageName]=\"showDomainsWithLanguageName\"\r\n (onDomainChange)=\"systemChange($event)\"\r\n (onActionClick)=\"translateButtonClick()\"\r\n (onLanguageSwap)=\"swapLanguages()\"\r\n (onSourceLanguageChange)=\"sourceLanguageChange($event)\"\r\n (onTargetLanguageChange)=\"targetLanguageChange($event)\">\r\n </tld-translate-switcher>\r\n <div fxFlexAlign=\"center\" class=\"action-btn-wrapper\">\r\n <tld-translate-button\r\n *ngIf=\"showTranslateBtn\"\r\n class=\"switcher-translate-button\"\r\n [disabled]=\"actionButtonDisabled || !urlToTranslate\">\r\n </tld-translate-button>\r\n <button *ngIf=\"showCancel\" mat-flat-button color=\"accent\" (click)=\"cancel()\"\r\n class=\"cancel-button\">{{'WEBTRANSLATE.CANCEL' | translate}}</button>\r\n <button *ngIf=\"showRestore\" mat-flat-button color=\"accent\" (click)=\"restore()\"\r\n class=\"restore-button\">{{'WEBTRANSLATE.RESTORE' | translate}}</button>\r\n </div>\r\n </div>\r\n </div>\r\n\r\n </div>\r\n\r\n <div id=\"website-frame-container\">\r\n <mat-progress-bar *ngIf=\"showProgress\" color=\"accent\" [mode]=\"mode\" [value]=\"progressValue\">\r\n </mat-progress-bar>\r\n <lib-tld-notification-message [@openCloseAnimation] *ngFor=\"let message of messages; let ix = index\" [message]=\"message\"\r\n (closeClicked)=\"removeMessage(ix)\"></lib-tld-notification-message>\r\n <iframe id=\"letsmt-translate-page-iframe\" name=\"letsmtTranslatePageIframe\" src=\"about:blank\"\r\n [attr.sandbox]=\"sandbox\"></iframe>\r\n </div>\r\n </div>\r\n</div>\r\n", styles: [".tld-translate-switcher-wrapper{padding:0 .5em;margin-left:auto;margin-right:auto}.translate-container-header{padding:.6em 1em 0;box-sizing:border-box}#widget .translate-container-header{width:100%;height:100%;margin-left:auto;margin-right:auto}#letsmt-translate-page-iframe{width:100%;height:100%;border:0}#website-frame-container{inset:5.92em 0 0;border-top:solid 1px #d4d4d4;position:fixed}#home-link{position:absolute;left:.75em;top:.2em;display:flex;flex-direction:row;text-decoration:none}#home-link img{margin-right:.75em;max-height:5.5em}@media screen and (max-width: 73em){#home-link{display:none}}.back-btn .mat-flat-button,.load-btn .mat-flat-button{width:27px;height:27px;line-height:27px;min-width:27px;padding:0}.back-btn .mat-flat-button .mat-icon,.load-btn .mat-flat-button .mat-icon{vertical-align:top;font-size:1.25em}.address-wrapper{max-width:60em;margin-bottom:.38em;margin-left:auto;margin-right:auto}.load-btn{padding-left:.8em}.back-btn{padding-right:.8em}.cancel-button,.restore-button{min-width:100px;height:36px;align-self:center}.w-100{width:100%}.address-input{padding-left:.9em;padding-right:.65em}\n"] }]
|
|
9870
|
-
}], ctorParameters: function () { return [{ type: i1$1.TranslateService }, { type: TldTranslateConfigService }, { type: TldTranslateButtonService }, { type: TldAlertService }, { type: i4$1.Router }, { type: i4$1.ActivatedRoute }, { type: TldSystemService }, { type:
|
|
10035
|
+
}], ctorParameters: function () { return [{ type: i1$1.TranslateService }, { type: TldTranslateConfigService }, { type: TldTranslateButtonService }, { type: TldAlertService }, { type: i4$1.Router }, { type: i4$1.ActivatedRoute }, { type: TldSystemService }, { type: TerminologyService }, { type: TldTranslateWebService }, { type: IconService }, { type: TranslationApiVersion, decorators: [{
|
|
9871
10036
|
type: Inject,
|
|
9872
10037
|
args: [TRANSLATION_API_VERSION_TOKEN]
|
|
9873
10038
|
}] }]; }, propDecorators: { product: [{
|
|
@@ -10175,6 +10340,122 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImpor
|
|
|
10175
10340
|
args: [TldTranslateBodyComponent]
|
|
10176
10341
|
}] } });
|
|
10177
10342
|
|
|
10343
|
+
class MtTermV1Service {
|
|
10344
|
+
constructor(http, config) {
|
|
10345
|
+
this.http = http;
|
|
10346
|
+
this.config = config;
|
|
10347
|
+
}
|
|
10348
|
+
add(engineId, collection) {
|
|
10349
|
+
const url = `${this.config.coreConfig.translationServiceUrl}AttachTermsFromTildeTerm`;
|
|
10350
|
+
return this.http.get(url, { params: { systemID: engineId, tildeTermColectionID: collection.termId } })
|
|
10351
|
+
.pipe(map(data => this.convertToCombinedCollection(data)));
|
|
10352
|
+
}
|
|
10353
|
+
getList(engineId) {
|
|
10354
|
+
const headers = Common.getAuthHeaders(this.config);
|
|
10355
|
+
const url = `${this.config.coreConfig.translationServiceUrl}GetDetailedSystemTermCorpora`;
|
|
10356
|
+
const params = { systemID: engineId };
|
|
10357
|
+
return this.http.get(url, { headers, params }).pipe(map((data) => {
|
|
10358
|
+
const mtCollections = [];
|
|
10359
|
+
data.forEach((collection) => {
|
|
10360
|
+
mtCollections.push(this.convertToCombinedCollection(collection));
|
|
10361
|
+
});
|
|
10362
|
+
return mtCollections;
|
|
10363
|
+
}));
|
|
10364
|
+
}
|
|
10365
|
+
remove(engineId, collection) {
|
|
10366
|
+
throw new Error("not Implemented");
|
|
10367
|
+
}
|
|
10368
|
+
convertToCombinedCollection(collection) {
|
|
10369
|
+
const convertedMtCollection = {
|
|
10370
|
+
id: collection.CorpusId,
|
|
10371
|
+
termId: collection.TildeTermId,
|
|
10372
|
+
lastUpdated: new Date(collection.AttachmentDateTime),
|
|
10373
|
+
name: collection.Title,
|
|
10374
|
+
// any because enums should overlap
|
|
10375
|
+
status: collection.Status
|
|
10376
|
+
};
|
|
10377
|
+
return new CombinedCollection(null, convertedMtCollection);
|
|
10378
|
+
}
|
|
10379
|
+
}
|
|
10380
|
+
MtTermV1Service.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: MtTermV1Service, deps: [{ token: i1$3.HttpClient }, { token: TldTranslateConfigService }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
10381
|
+
MtTermV1Service.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: MtTermV1Service, providedIn: 'root' });
|
|
10382
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: MtTermV1Service, decorators: [{
|
|
10383
|
+
type: Injectable,
|
|
10384
|
+
args: [{
|
|
10385
|
+
providedIn: 'root'
|
|
10386
|
+
}]
|
|
10387
|
+
}], ctorParameters: function () { return [{ type: i1$3.HttpClient }, { type: TldTranslateConfigService }]; } });
|
|
10388
|
+
|
|
10389
|
+
class MtTermV2Service {
|
|
10390
|
+
constructor(config, engineTermApi) {
|
|
10391
|
+
this.config = config;
|
|
10392
|
+
this.engineTermApi = engineTermApi;
|
|
10393
|
+
this.baseUrl = this.config.termConfig.engineTermUrl;
|
|
10394
|
+
}
|
|
10395
|
+
add(engineId, collection) {
|
|
10396
|
+
if (!collection.mtCollection) {
|
|
10397
|
+
const params = {
|
|
10398
|
+
collectionId: collection.termId,
|
|
10399
|
+
default: collection.editables.default,
|
|
10400
|
+
collectionSource: collection.source,
|
|
10401
|
+
scope: collection.editables.scope
|
|
10402
|
+
};
|
|
10403
|
+
return this.engineTermApi.add(engineId, params)
|
|
10404
|
+
.pipe(map(collection => this.convertToCombinedCollection(collection)));
|
|
10405
|
+
}
|
|
10406
|
+
else {
|
|
10407
|
+
const params = {
|
|
10408
|
+
default: collection.editables.default,
|
|
10409
|
+
scope: collection.editables.scope
|
|
10410
|
+
};
|
|
10411
|
+
return this.engineTermApi.update(engineId, collection.termId, params)
|
|
10412
|
+
.pipe(map(collection => this.convertToCombinedCollection(collection)));
|
|
10413
|
+
}
|
|
10414
|
+
}
|
|
10415
|
+
getList(engineId) {
|
|
10416
|
+
return this.engineTermApi.getList(engineId)
|
|
10417
|
+
.pipe(map((collections) => {
|
|
10418
|
+
const converted = [];
|
|
10419
|
+
collections?.termCollections?.forEach((collection) => {
|
|
10420
|
+
converted.push(this.convertToCombinedCollection(collection));
|
|
10421
|
+
});
|
|
10422
|
+
return converted;
|
|
10423
|
+
}));
|
|
10424
|
+
}
|
|
10425
|
+
remove(engineId, collection) {
|
|
10426
|
+
return this.engineTermApi.remove(engineId, collection.mtCollection.id).pipe(map(collection => this.convertToCombinedCollection(collection)));
|
|
10427
|
+
}
|
|
10428
|
+
convertToCombinedCollection(collection) {
|
|
10429
|
+
const convertedMtCollection = {
|
|
10430
|
+
id: collection.id,
|
|
10431
|
+
lastUpdated: new Date(collection.collectionUpdatedAt),
|
|
10432
|
+
name: collection.name,
|
|
10433
|
+
status: collection.status,
|
|
10434
|
+
termId: collection.collectionId,
|
|
10435
|
+
default: collection.default,
|
|
10436
|
+
scope: collection.scope
|
|
10437
|
+
};
|
|
10438
|
+
return new CombinedCollection(null, convertedMtCollection);
|
|
10439
|
+
}
|
|
10440
|
+
}
|
|
10441
|
+
MtTermV2Service.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: MtTermV2Service, deps: [{ token: TldTranslateConfigService }, { token: EningeTermApiService }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
10442
|
+
MtTermV2Service.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: MtTermV2Service, providedIn: 'root' });
|
|
10443
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: MtTermV2Service, decorators: [{
|
|
10444
|
+
type: Injectable,
|
|
10445
|
+
args: [{
|
|
10446
|
+
providedIn: 'root'
|
|
10447
|
+
}]
|
|
10448
|
+
}], ctorParameters: function () { return [{ type: TldTranslateConfigService }, { type: EningeTermApiService }]; } });
|
|
10449
|
+
|
|
10450
|
+
function mtTermApiFactory(version, config, http, engineTermService) {
|
|
10451
|
+
if (version === TranslationApiVersion.V1) {
|
|
10452
|
+
return new MtTermV1Service(http, config);
|
|
10453
|
+
}
|
|
10454
|
+
else {
|
|
10455
|
+
return new MtTermV2Service(config, engineTermService);
|
|
10456
|
+
}
|
|
10457
|
+
}
|
|
10458
|
+
|
|
10178
10459
|
var FileV2Category;
|
|
10179
10460
|
(function (FileV2Category) {
|
|
10180
10461
|
FileV2Category["SOURCE"] = "SOURCE";
|
|
@@ -10207,7 +10488,7 @@ class FileApiV2Service {
|
|
|
10207
10488
|
formData.append("domain", properties.system.domain);
|
|
10208
10489
|
}
|
|
10209
10490
|
const headers = Common.GetApiV2AuthHeaders(this.config);
|
|
10210
|
-
return this.http.post(this.url, formData, { headers }).pipe(map(response => response.id));
|
|
10491
|
+
return this.http.post(this.url, formData, { headers }).pipe(map$1(response => response.id));
|
|
10211
10492
|
}
|
|
10212
10493
|
remove(properties) {
|
|
10213
10494
|
if (properties.file.translationStartedOnServer) {
|
|
@@ -10229,7 +10510,7 @@ class FileApiV2Service {
|
|
|
10229
10510
|
}
|
|
10230
10511
|
getStatus(properties) {
|
|
10231
10512
|
const headers = Common.GetApiV2AuthHeaders(this.config);
|
|
10232
|
-
return this.http.get(`${this.url}/${properties.file.id}`, { headers }).pipe(map((response) => {
|
|
10513
|
+
return this.http.get(`${this.url}/${properties.file.id}`, { headers }).pipe(map$1((response) => {
|
|
10233
10514
|
const extensions = [];
|
|
10234
10515
|
response.files.forEach((file) => {
|
|
10235
10516
|
if (file.category.toUpperCase() === FileV2Category.TRANSLATED) {
|
|
@@ -10276,7 +10557,7 @@ class TldSystemApiV2Service {
|
|
|
10276
10557
|
}
|
|
10277
10558
|
getSystemList() {
|
|
10278
10559
|
const headers = Common.GetApiV2AuthHeaders(this.config);
|
|
10279
|
-
return this.http.get(this.config?.apiV2Config?.systemListUrl, { headers }).pipe(map((response) => {
|
|
10560
|
+
return this.http.get(this.config?.apiV2Config?.systemListUrl, { headers }).pipe(map$1((response) => {
|
|
10280
10561
|
const systems = [];
|
|
10281
10562
|
const uniqueDirections = [];
|
|
10282
10563
|
const autoDomainSystems = [];
|
|
@@ -10288,7 +10569,9 @@ class TldSystemApiV2Service {
|
|
|
10288
10569
|
sourceLanguage: system.srcLang,
|
|
10289
10570
|
targetLanguage: system.trgLang,
|
|
10290
10571
|
translationApiVersion: TranslationApiVersion.V2,
|
|
10291
|
-
vendor: system.vendor
|
|
10572
|
+
vendor: system.vendor,
|
|
10573
|
+
// hardcoded since there is no param yet for determinig which systems support terms.
|
|
10574
|
+
includesTerminology: true
|
|
10292
10575
|
};
|
|
10293
10576
|
systems.push(newSystem);
|
|
10294
10577
|
if (this.config.apiV2Config?.autoDomainDetection && !uniqueDirections.includes(languageDirections)) {
|
|
@@ -10340,7 +10623,7 @@ class TldSystemApiService {
|
|
|
10340
10623
|
const params = {
|
|
10341
10624
|
appID: this.config.coreConfig.appId,
|
|
10342
10625
|
};
|
|
10343
|
-
return this.http.get(this.config?.coreConfig?.systemListUrl, { headers, params }).pipe(map((response) => {
|
|
10626
|
+
return this.http.get(this.config?.coreConfig?.systemListUrl, { headers, params }).pipe(map$1((response) => {
|
|
10344
10627
|
const systems = [];
|
|
10345
10628
|
response.System.forEach(element => {
|
|
10346
10629
|
const system = {
|
|
@@ -10412,7 +10695,7 @@ class TldTranslateTextApiV2Service {
|
|
|
10412
10695
|
if (this.config.textConfig.checkSourceGrammar && this.config.textConfig.grammarCheckLanguages.includes(params.system.sourceLanguage)) {
|
|
10413
10696
|
this.checkAndAttachGrammarToTree(params.text, params.system.sourceLanguage, sourceTree);
|
|
10414
10697
|
}
|
|
10415
|
-
return this.http.post(this.config.apiV2Config.translationUrl, requestParams, { headers }).pipe(map((translationResponse) => {
|
|
10698
|
+
return this.http.post(this.config.apiV2Config.translationUrl, requestParams, { headers }).pipe(map$1((translationResponse) => {
|
|
10416
10699
|
const systemId = `${requestParams.srcLang}-${requestParams.trgLang}-${translationResponse.domain}`;
|
|
10417
10700
|
const originalTranslation = translationResponse.translations[0].translation;
|
|
10418
10701
|
const targetTree = {
|
|
@@ -10490,8 +10773,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImpor
|
|
|
10490
10773
|
}], ctorParameters: function () { return [{ type: i1$3.HttpClient }, { type: TldTranslateConfigService }]; } });
|
|
10491
10774
|
|
|
10492
10775
|
class TldTranslateTextApiService {
|
|
10493
|
-
constructor(
|
|
10494
|
-
this.
|
|
10776
|
+
constructor(terminologyService, http, config, alerts) {
|
|
10777
|
+
this.terminologyService = terminologyService;
|
|
10495
10778
|
this.http = http;
|
|
10496
10779
|
this.config = config;
|
|
10497
10780
|
this.alerts = alerts;
|
|
@@ -10527,11 +10810,11 @@ class TldTranslateTextApiService {
|
|
|
10527
10810
|
systemID: requestParams.system.id,
|
|
10528
10811
|
text: requestParams.text,
|
|
10529
10812
|
};
|
|
10530
|
-
const selectedCollectionId = this.
|
|
10813
|
+
const selectedCollectionId = this.terminologyService.selectedIdForTranslation();
|
|
10531
10814
|
if (selectedCollectionId) {
|
|
10532
10815
|
params.options += `,termCorpusId=${selectedCollectionId}`;
|
|
10533
10816
|
}
|
|
10534
|
-
return this.http.get(this.config?.textConfig?.translationUrl, { headers: headers, params: params }).pipe(map((response) => {
|
|
10817
|
+
return this.http.get(this.config?.textConfig?.translationUrl, { headers: headers, params: params }).pipe(map$1((response) => {
|
|
10535
10818
|
if (response.ErrorMessage) {
|
|
10536
10819
|
this.alerts.unhandeledError(response.ErrorMessage);
|
|
10537
10820
|
throw response.ErrorMessage;
|
|
@@ -10658,21 +10941,21 @@ class TldTranslateTextApiService {
|
|
|
10658
10941
|
});
|
|
10659
10942
|
}
|
|
10660
10943
|
}
|
|
10661
|
-
TldTranslateTextApiService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: TldTranslateTextApiService, deps: [{ token:
|
|
10944
|
+
TldTranslateTextApiService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: TldTranslateTextApiService, deps: [{ token: TerminologyService }, { token: i1$3.HttpClient }, { token: TldTranslateConfigService }, { token: TldAlertService }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
10662
10945
|
TldTranslateTextApiService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: TldTranslateTextApiService, providedIn: 'root' });
|
|
10663
10946
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: TldTranslateTextApiService, decorators: [{
|
|
10664
10947
|
type: Injectable,
|
|
10665
10948
|
args: [{
|
|
10666
10949
|
providedIn: 'root'
|
|
10667
10950
|
}]
|
|
10668
|
-
}], ctorParameters: function () { return [{ type:
|
|
10951
|
+
}], ctorParameters: function () { return [{ type: TerminologyService }, { type: i1$3.HttpClient }, { type: TldTranslateConfigService }, { type: TldAlertService }]; } });
|
|
10669
10952
|
|
|
10670
|
-
function textApiServiceFactory(version, config, http,
|
|
10953
|
+
function textApiServiceFactory(version, config, http, terminologyService, alerts) {
|
|
10671
10954
|
if (version === TranslationApiVersion.V2) {
|
|
10672
10955
|
return new TldTranslateTextApiV2Service(http, config);
|
|
10673
10956
|
}
|
|
10674
10957
|
else {
|
|
10675
|
-
return new TldTranslateTextApiService(
|
|
10958
|
+
return new TldTranslateTextApiService(terminologyService, http, config, alerts);
|
|
10676
10959
|
}
|
|
10677
10960
|
}
|
|
10678
10961
|
|
|
@@ -10687,7 +10970,7 @@ class TldTranslateModule {
|
|
|
10687
10970
|
TRANSLATION_API_VERSION_TOKEN,
|
|
10688
10971
|
TldTranslateConfigService,
|
|
10689
10972
|
HttpClient,
|
|
10690
|
-
|
|
10973
|
+
TerminologyService,
|
|
10691
10974
|
TldAlertService
|
|
10692
10975
|
]
|
|
10693
10976
|
},
|
|
@@ -10698,10 +10981,20 @@ class TldTranslateModule {
|
|
|
10698
10981
|
TRANSLATION_API_VERSION_TOKEN,
|
|
10699
10982
|
TldTranslateConfigService,
|
|
10700
10983
|
HttpClient,
|
|
10701
|
-
|
|
10984
|
+
TerminologyService,
|
|
10702
10985
|
TldAlertService
|
|
10703
10986
|
]
|
|
10704
10987
|
},
|
|
10988
|
+
{
|
|
10989
|
+
provide: MT_TERM_API_TOKEN,
|
|
10990
|
+
useFactory: mtTermApiFactory,
|
|
10991
|
+
deps: [
|
|
10992
|
+
TRANSLATION_API_VERSION_TOKEN,
|
|
10993
|
+
TldTranslateConfigService,
|
|
10994
|
+
HttpClient,
|
|
10995
|
+
EningeTermApiService
|
|
10996
|
+
]
|
|
10997
|
+
},
|
|
10705
10998
|
];
|
|
10706
10999
|
if (translationApiVersion !== null) {
|
|
10707
11000
|
providers.push({
|
|
@@ -10780,5 +11073,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImpor
|
|
|
10780
11073
|
* Generated bundle index. Do not edit.
|
|
10781
11074
|
*/
|
|
10782
11075
|
|
|
10783
|
-
export { AudioRecordService, Common,
|
|
11076
|
+
export { AudioRecordService, CombinedCollection, CombinedCollectionTooltipKey, Common, CreateCollectionComponent, EngineTermCollectionScope, EngineTermCollectionSource, EngineTermCollectionStatus, EningeTermApiService, ErrorCode, ExtensionDialogComponent, ExtensionDialogModule, ExtensionDialogService, FILE_API_SERVICE_TOKEN, FileCategories, FileExtensions, FileTranslationSubstatus, FileTypeIcons, FileTypes, HighlightParams, HighlightTreeComponent, IconService, MT_TERM_API_TOKEN, MtCollectionStatus, OPEN_CLOSE_BTN_ICONS_TOKEN, OpenExtensionDialogComponent, OpenedMenu, SYSTEM_SERVICE_TOKEN, SourceAndTargetWrapperComponent, TEXT_API_SERVICE_TOKEN, TLD_TRANSLATE_CONFIG_TOKEN, TRANSLATION_API_VERSION_TOKEN, TermApiService, TerminologyService, TextToSpeechComponent, TextToSpeechModule, TextareaWithBackgroundComponent, TldAlertService, TldAudioModule, TldCommonModule, TldDictateComponent, TldDictionaryComponent, TldDocumentModule, TldDomainListComponent, TldFileTranslateBaseComponent, TldHighlightService, TldLangListComponent, TldListMenuComponent, TldLoaderComponent, TldMessageComponent, TldMessageType, TldOpenCloseButtonComponent, TldRecordComponent, TldSystemService, TldTermCollectionComponent, TldTermCollectionListComponent, TldTermCreateCollectionDialogComponent, TldTermMenuComponent, TldTermModule, TldTermPromotionComponent, TldTextModule, TldTooltipModule, TldTranslateAchievementComponent, TldTranslateButtonComponent, TldTranslateComponent, TldTranslateConfigService, TldTranslateFileApiService, TldTranslateFileComponent, TldTranslateFileDownloadButtonComponent, TldTranslateFileMultipleComponent, TldTranslateFileService, TldTranslateImageConversionHelpComponent, TldTranslateModule, TldTranslatePdfConversionHelpComponent, TldTranslateSourceComponent, TldTranslateSuggestComponent, TldTranslateSuggestDialogComponent, TldTranslateSwitcherComponent, TldTranslateTextComponent, TldTranslateTextService, TldTranslateWebsiteComponent, TldVoiceInputApiService, TldVoiceInputService, TldWebModule, TranslateDomainPipe, TranslationApiVersion, TranslationStatuss, TranslationSystemPickerButtonComponent, TranslationSystemPickerComponent, TranslationSystemPickerDropdownComponent, TranslationSystemPickerFilterComponent, TranslationSystemPickerLanguageListComponent, TranslationSystemPickerService, VoiceToTextState, availableLanguages, languageMenuVersion };
|
|
10784
11077
|
//# sourceMappingURL=tilde-nlp-ngx-translate.mjs.map
|