@opengeoweb/taf 9.21.0 → 9.22.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/index.esm.js +421 -137
- package/package.json +2 -2
- package/src/index.d.ts +1 -0
- package/src/lib/components/IssuesPane/utils.d.ts +2 -1
- package/src/lib/components/Providers/Providers.d.ts +0 -5
- package/src/lib/components/TafForm/TafForm.d.ts +0 -1
- package/src/lib/components/TafForm/utils.d.ts +6 -9
- package/src/lib/components/TafLayout/TacOverview/ExportButton.d.ts +0 -1
- package/src/lib/components/TafLayout/TacOverview/TacContainer.d.ts +0 -1
- package/src/lib/components/TafLayout/TafLayout.d.ts +6 -6
- package/src/lib/components/TafLayout/TafPanel/TafPanel.d.ts +1 -2
- package/src/lib/utils/i18n.d.ts +4 -0
package/index.esm.js
CHANGED
|
@@ -8,8 +8,10 @@ import { ReactSortable } from 'react-sortablejs';
|
|
|
8
8
|
import Sortable from 'sortablejs';
|
|
9
9
|
import { useAuthenticationContext } from '@opengeoweb/authentication';
|
|
10
10
|
import { HIDDEN_INPUT_HELPER_IS_DRAFT, getDeepProperty, useDraftFormHelpers, ReactHookFormHiddenInput, ReactHookFormProvider } from '@opengeoweb/form-fields';
|
|
11
|
-
import { dateUtils, useIsMounted, CustomIconButton, CustomTooltip, ToolContainerDraggable, Avatar, getInitials, ToggleMenu, useConfirmationDialog, usePreventBrowserClose, SwitchButton, ToolHeader, AlertBanner, getErrorMessage as getErrorMessage$1, getWarningMessage, LastUpdateTime, usePoller, ErrorBoundary } from '@opengeoweb/shared';
|
|
11
|
+
import { SHARED_NAMESPACE, dateUtils, useIsMounted, CustomIconButton, CustomTooltip, ToolContainerDraggable, Avatar, getInitials, ToggleMenu, useConfirmationDialog, usePreventBrowserClose, SwitchButton, ToolHeader, AlertBanner, getErrorMessage as getErrorMessage$1, getWarningMessage, LastUpdateTime, usePoller, ErrorBoundary } from '@opengeoweb/shared';
|
|
12
12
|
import { snackbarActions } from '@opengeoweb/snackbar';
|
|
13
|
+
import 'i18next';
|
|
14
|
+
import { useTranslation } from 'react-i18next';
|
|
13
15
|
import { isEqual } from 'lodash';
|
|
14
16
|
import { DragHandle as DragHandle$1, ThumbsUp, Add, Delete, Close, Clock, Cancel, Success, Edit, Export, ListItem } from '@opengeoweb/theme';
|
|
15
17
|
import ReactDOM from 'react-dom';
|
|
@@ -19,18 +21,242 @@ import LinearProgress from '@mui/material/LinearProgress';
|
|
|
19
21
|
import Box$1 from '@mui/material/Box';
|
|
20
22
|
|
|
21
23
|
var en = {
|
|
22
|
-
|
|
24
|
+
"issues-button-title": "View details",
|
|
25
|
+
"issues-pane-none": "Looks good",
|
|
26
|
+
"issues-pane-one": "There is an issue to address",
|
|
27
|
+
"issues-pane-multiple": "There are a few issues to address",
|
|
28
|
+
"status-new-amendment": "new amendment",
|
|
29
|
+
"status-new-correction": "new correction",
|
|
30
|
+
"status-draft-amendment": "draft amendment",
|
|
31
|
+
"status-draft-correction": "draft correction",
|
|
32
|
+
"status-published-amendment": "published amendment",
|
|
33
|
+
"status-published-correction": "published correction",
|
|
34
|
+
"status-new": "new",
|
|
35
|
+
"status-draft": "draft",
|
|
36
|
+
"status-published": "published",
|
|
37
|
+
"status-cancelled": "cancelled",
|
|
38
|
+
"status-expired": "expired",
|
|
39
|
+
"top-tabs-upcoming": "Upcoming",
|
|
40
|
+
"top-tabs-current": "Current",
|
|
41
|
+
"top-tabs-current-expired": "Current & Expired",
|
|
42
|
+
"confirm-dialog-title": "Whoops",
|
|
43
|
+
"confirm-dialog-description": "It's not possible to autosave this TAF due to the presence of issue(s). Are you sure you want to close this TAF? Any changes made will be lost.",
|
|
44
|
+
"confirm-dialog-confirm-label": "Exit without saving",
|
|
45
|
+
"error-auth": "This feature is protected by authentication.",
|
|
46
|
+
"error-auth-message": "Please log in to proceed.",
|
|
47
|
+
"error-list": "An error has occurred while retrieving the list",
|
|
48
|
+
"error-title-retry": "Try again",
|
|
49
|
+
"editor-on": "You are now the editor for TAF {{location}}",
|
|
50
|
+
"editor-off": "You are now no longer the editor for TAF {{location}}",
|
|
51
|
+
"taf-import-message": "TAF {{location}} {{locationLabel}} was imported successfully",
|
|
52
|
+
"taf-import-title": "Import TAC",
|
|
53
|
+
"tac-overview": "TAC Overview",
|
|
54
|
+
"button-cancel": "Cancel",
|
|
55
|
+
"button-correct": "Correct",
|
|
56
|
+
"button-amend": "Amend",
|
|
57
|
+
"button-clear": "Clear",
|
|
58
|
+
"button-save": "Save",
|
|
59
|
+
"button-publish": "Publish",
|
|
60
|
+
"error-cancel": "Cancelling this TAF failed, please try again",
|
|
61
|
+
"error-save": "An error has occurred while saving, please try again",
|
|
62
|
+
"options-insert-above": "Insert 1 row above",
|
|
63
|
+
"options-insert-below": "Insert 1 row below",
|
|
64
|
+
"options-delete": "Delete row",
|
|
65
|
+
"options-clear": "Clear row",
|
|
66
|
+
"confirm-clear-title": "Clear TAF",
|
|
67
|
+
"confirm-clear-content": "Are you sure you would like to clear this TAF? All content will be lost",
|
|
68
|
+
"confirm-publish-content": "Are you sure you want to publish this TAF?",
|
|
69
|
+
"confirm-correct-amend-content": "Do you want to publish it?",
|
|
70
|
+
"confirm-correct-amend-content-no-changes": "Are you sure you want to publish this TAF? You did not make any changes!",
|
|
71
|
+
"confirm-cancel-content": "Are you sure you want to cancel this TAF?",
|
|
72
|
+
"confirm-amend-title": "This TAF is an amendment",
|
|
73
|
+
"confirm-correct-title": "This TAF is a correction",
|
|
74
|
+
"confirm-cancel-title": "Cancel TAF",
|
|
75
|
+
"clear-message": "TAF has been cleared",
|
|
76
|
+
"TAC-missing-data": "Missing data: no TAC can be generated",
|
|
77
|
+
"TAC-not-available": "No TAC available",
|
|
78
|
+
"TAC-retrieving-data": "Retrieving TAC",
|
|
79
|
+
"TAC-failed": "Failed to retrieve TAC",
|
|
80
|
+
"snackbar-auto-save": "All changes have been saved automatically",
|
|
81
|
+
"snackbar-draft": "Saved as draft",
|
|
82
|
+
"snackbar-draft-amend": "Saved as draft amendment",
|
|
83
|
+
"snackbar-draft-correct": "Saved as draft correction",
|
|
84
|
+
"snackbar-publish": "TAF {{location}} {{formattedDate}} {{messageType}} was published successfully",
|
|
85
|
+
"snackbar-cancel": "TAF {{location}} {{formattedDate}} {{messageType}} was cancelled successfully",
|
|
86
|
+
"snackbar-correct": "TAF {{location}} {{formattedDate}} {{messageType}} was corrected successfully",
|
|
87
|
+
"snackbar-amend": "TAF {{location}} {{formattedDate}} {{messageType}} was amended successfully",
|
|
88
|
+
"snackbar-save": "TAF {{location}} {{formattedDate}} {{messageType}} was saved successfully",
|
|
89
|
+
"switch-title": "Switch to editor mode",
|
|
90
|
+
"switch-description": "This TAF is already in edit mode and important information could get lost in the switching process.",
|
|
91
|
+
"switch-confirm": "Edit mode",
|
|
92
|
+
"switch-description-viewer": "Are you sure you want to switch to viewer mode? Your unsaved changes will be lost.",
|
|
93
|
+
"switch-confirm-viewer": "Switch mode",
|
|
94
|
+
"confirm-delete-description": "Are you sure you want to delete this row?",
|
|
95
|
+
"confirm-yes": "Yes",
|
|
96
|
+
"confirm-clear-description": "Are you sure you want to clear this row?",
|
|
97
|
+
"issues-button-0": "0 issues",
|
|
98
|
+
"issues-button-1": "1 issue",
|
|
99
|
+
"issues-button-multiple": "{{amount}} issues"
|
|
23
100
|
};
|
|
24
101
|
var fi = {
|
|
25
|
-
taf: "Taf"
|
|
26
102
|
};
|
|
27
103
|
var no = {
|
|
28
|
-
|
|
104
|
+
"issues-button-title": "Vis detaljer",
|
|
105
|
+
"issues-pane-none": "Ser bra ut",
|
|
106
|
+
"issues-pane-one": "Det er et problem",
|
|
107
|
+
"issues-pane-multiple": "Det er et par problem",
|
|
108
|
+
"status-new-amendment": "ny amendment",
|
|
109
|
+
"status-new-correction": "ny korreksjon",
|
|
110
|
+
"status-draft-amendment": "utkast amendment",
|
|
111
|
+
"status-draft-correction": "utkast korreksjon",
|
|
112
|
+
"status-published-amendment": "publisert amendment",
|
|
113
|
+
"status-published-correction": "publisert korreksjon",
|
|
114
|
+
"status-new": "ny",
|
|
115
|
+
"status-draft": "utkast",
|
|
116
|
+
"status-published": "publisert",
|
|
117
|
+
"status-cancelled": "annulert",
|
|
118
|
+
"status-expired": "utgått",
|
|
119
|
+
"top-tabs-upcoming": "Kommende",
|
|
120
|
+
"top-tabs-current": "Gjeldende",
|
|
121
|
+
"top-tabs-current-expired": "Gjeldende & Utgått",
|
|
122
|
+
"confirm-dialog-title": "Oops",
|
|
123
|
+
"confirm-dialog-description": "Det er ikke mulig å autolagre denne TAFen fordi det oppsto et problem. Er du sikker på at du vil lukke TAFen? Alle endringer vil gå tapt.",
|
|
124
|
+
"confirm-dialog-confirm-label": "Avslutt uten å lagre",
|
|
125
|
+
"error-auth": "Denne delen er passordbeskyttet.",
|
|
126
|
+
"error-auth-message": "Vennligst logg inn.",
|
|
127
|
+
"error-list": "En feil har oppstått ved henting av liste",
|
|
128
|
+
"error-title-retry": "Prøv igjen",
|
|
129
|
+
"editor-on": "Du er no redaktøren for TAF {{location}}",
|
|
130
|
+
"editor-off": "Du er ikke lenger redaktøren for TAF {{location}}",
|
|
131
|
+
"taf-import-message": "TAF {{location}} {{locationLabel}} ble importert",
|
|
132
|
+
"taf-import-title": "Importer TAC",
|
|
133
|
+
"tac-overview": "TAC Oversikt",
|
|
134
|
+
"button-cancel": "Annuler",
|
|
135
|
+
"button-correct": "Korreksjon",
|
|
136
|
+
"button-amend": "Amend",
|
|
137
|
+
"button-clear": "Tøm",
|
|
138
|
+
"button-save": "Lagre",
|
|
139
|
+
"button-publish": "Publiser",
|
|
140
|
+
"error-cancel": "Annuluering av denne TAF feilet, prøv igjen",
|
|
141
|
+
"error-save": "Det oppstod ein feil ved lagring, prøv igjen",
|
|
142
|
+
"options-insert-above": "Legg til en rad over",
|
|
143
|
+
"options-insert-below": "Legg til en rad under",
|
|
144
|
+
"options-delete": "Fjern rad",
|
|
145
|
+
"options-clear": "Tøm rad",
|
|
146
|
+
"confirm-clear-title": "Tøm TAF",
|
|
147
|
+
"confirm-clear-content": "Er du sikker på at du vil tømme denne TAFen? Alt innhold vil bli tapt",
|
|
148
|
+
"confirm-publish-content": "Er du sikker på at du vil publisere denne TAFen?",
|
|
149
|
+
"confirm-correct-amend-content": "Vil du publisere den?",
|
|
150
|
+
"confirm-correct-amend-content-no-changes": "Er du sikker på at du vil publisere denne TAFen? Du har ikke gjort noen endringer!",
|
|
151
|
+
"confirm-cancel-content": "Er du sikker på at du vil annulere denne TAFen?",
|
|
152
|
+
"confirm-amend-title": "Denne TAFen er et amendment",
|
|
153
|
+
"confirm-correct-title": "Denne TAFen er en korreksjon",
|
|
154
|
+
"confirm-cancel-title": "Annuler TAF",
|
|
155
|
+
"clear-message": "TAF har blitt tømt",
|
|
156
|
+
"TAC-missing-data": "Manglende data: Ingen TAC kan bli generert",
|
|
157
|
+
"TAC-not-available": "Ingen TAC tilgjengelig",
|
|
158
|
+
"TAC-retrieving-data": "Henter TAC",
|
|
159
|
+
"TAC-failed": "Henting av TAC feilet",
|
|
160
|
+
"snackbar-auto-save": "Alle endringer har blitt automatisk lagret",
|
|
161
|
+
"snackbar-draft": "Lagret som utkast",
|
|
162
|
+
"snackbar-draft-amend": "Lagret som utkast amendment",
|
|
163
|
+
"snackbar-draft-correct": "Lagret som utkast korreksjon",
|
|
164
|
+
"snackbar-publish": "TAF {{location}} {{formattedDate}} {{messageType}} ble publisert",
|
|
165
|
+
"snackbar-cancel": "TAF {{location}} {{formattedDate}} {{messageType}} ble kansellert",
|
|
166
|
+
"snackbar-correct": "TAF {{location}} {{formattedDate}} {{messageType}} ble korrigert",
|
|
167
|
+
"snackbar-amend": "TAF {{location}} {{formattedDate}} {{messageType}} ble amendet",
|
|
168
|
+
"snackbar-save": "TAF {{location}} {{formattedDate}} {{messageType}} ble lagret",
|
|
169
|
+
"switch-title": "Skift til redigeringsmodus",
|
|
170
|
+
"switch-description": "Denne TAFen er alt i redigeringsmodus og viktig informasjon vil gå tapt dersom en endrer modus.",
|
|
171
|
+
"switch-confirm": "Redigeringsmodus",
|
|
172
|
+
"switch-description-viewer": "Er du sikkert på at du vil endre til visningsmodus? Dine ulagrede endringer vil gå tapt.",
|
|
173
|
+
"switch-confirm-viewer": "Skift modus",
|
|
174
|
+
"confirm-delete-description": "Er du sikker på at du slette denne raden?",
|
|
175
|
+
"confirm-yes": "Ja",
|
|
176
|
+
"confirm-clear-description": "Er du sikker på at du tømme denne raden?",
|
|
177
|
+
"issues-button-0": "Ingen problem",
|
|
178
|
+
"issues-button-1": "1 problem",
|
|
179
|
+
"issues-button-multiple": "{{amount}} problem"
|
|
29
180
|
};
|
|
30
181
|
var nl = {
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
182
|
+
"issues-button-title": "Bekijk details",
|
|
183
|
+
"issues-pane-none": "Helemaal goed",
|
|
184
|
+
"issues-pane-one": "Er is een probleem",
|
|
185
|
+
"issues-pane-multiple": "Er zijn enkele problemen",
|
|
186
|
+
"status-new-amendment": "nieuwe amendment",
|
|
187
|
+
"status-new-correction": "nieuwe correctie",
|
|
188
|
+
"status-draft-amendment": "concept amendment",
|
|
189
|
+
"status-draft-correction": "concept correctie",
|
|
190
|
+
"status-published-amendment": "gepubliceerde amendment",
|
|
191
|
+
"status-published-correction": "gepubliceerde correctie",
|
|
192
|
+
"status-new": "nieuw",
|
|
193
|
+
"status-draft": "concept",
|
|
194
|
+
"status-published": "gepubliceerd",
|
|
195
|
+
"status-cancelled": "gecancelled",
|
|
196
|
+
"status-expired": "verlopen",
|
|
197
|
+
"top-tabs-upcoming": "Aankomend",
|
|
198
|
+
"top-tabs-current": "Huidig",
|
|
199
|
+
"top-tabs-current-expired": "Huidig & Verlopen",
|
|
200
|
+
"confirm-dialog-title": "Oeps",
|
|
201
|
+
"confirm-dialog-description": "Het is niet mogelijk om deze TAF automatisch op te slaan vanwege de aanwezigheid van een of meerdere issues. Weet je zeker dat je deze TAF wilt sluiten? Niet-opgeslagen wijzigingen gaan verloren.",
|
|
202
|
+
"confirm-dialog-confirm-label": "Sluiten zonder opslaan",
|
|
203
|
+
"error-auth": "Deze functie wordt beschermd door authenticatie.",
|
|
204
|
+
"error-auth-message": "Log in om door te gaan.",
|
|
205
|
+
"error-list": "Er is een fout opgetreden bij het laden van de lijst",
|
|
206
|
+
"error-title-retry": "Probeer opnieuw",
|
|
207
|
+
"editor-on": "Je bent nu de editor van TAF {{location}}",
|
|
208
|
+
"editor-off": "Je bent nu niet langer de editor van TAF {{location}}",
|
|
209
|
+
"taf-import-message": "TAF {{location}} {{locationLabel}} is succesvol geïmporteerd",
|
|
210
|
+
"taf-import-title": "Importeer TAC",
|
|
211
|
+
"tac-overview": "TAC Overzicht",
|
|
212
|
+
"button-cancel": "Annuleren",
|
|
213
|
+
"button-correct": "Correct",
|
|
214
|
+
"button-amend": "Amend",
|
|
215
|
+
"button-clear": "Leegmaken",
|
|
216
|
+
"button-save": "Opslaan",
|
|
217
|
+
"button-publish": "Publiceren",
|
|
218
|
+
"error-cancel": "Het annuleren van deze TAF is mislukt, probeer het opnieuw",
|
|
219
|
+
"error-save": "Er is een probleem opgetreden tijdens het opslaan, probeer het opnieuw",
|
|
220
|
+
"options-insert-above": "Rij boven invoegen",
|
|
221
|
+
"options-insert-below": "Rij onder invoegen",
|
|
222
|
+
"options-delete": "Rij verwijderen",
|
|
223
|
+
"options-clear": "Rij leegmaken",
|
|
224
|
+
"confirm-clear-title": "TAF leegmaken",
|
|
225
|
+
"confirm-clear-content": "Weet je zeker dat je deze TAF leeg wilt maken? Alle inhoud gaat verloren",
|
|
226
|
+
"confirm-publish-content": "Weet je zeker dat je deze TAF wilt publiceren?",
|
|
227
|
+
"confirm-correct-amend-content": "Wil je deze TAF publiceren?",
|
|
228
|
+
"confirm-correct-amend-content-no-changes": "Weet je zeker dat je deze TAF wilt publiceren? Je hebt geen wijzigingen gedaan!",
|
|
229
|
+
"confirm-cancel-content": "Weet je zeker dat je deze TAF wilt annuleren?",
|
|
230
|
+
"confirm-amend-title": "Deze TAF is een amendment",
|
|
231
|
+
"confirm-correct-title": "Deze TAF is een correctie",
|
|
232
|
+
"confirm-cancel-title": "TAF annuleren",
|
|
233
|
+
"clear-message": "TAF is leeggemaakt",
|
|
234
|
+
"TAC-missing-data": "Ontbrekende data: er kan geen TAC worden gegenereerd",
|
|
235
|
+
"TAC-not-available": "Geen TAC beschikbaar",
|
|
236
|
+
"TAC-retrieving-data": "TAC aan het ophalen",
|
|
237
|
+
"TAC-failed": "TAC ophalen is mislukt",
|
|
238
|
+
"snackbar-auto-save": "Alle wijzigingen zijn automatisch opgeslagen",
|
|
239
|
+
"snackbar-draft": "Concept opgeslagen",
|
|
240
|
+
"snackbar-draft-amend": "Concept amendment opgeslagen",
|
|
241
|
+
"snackbar-draft-correct": "Concept correctie opgeslagen",
|
|
242
|
+
"snackbar-publish": "TAF {{location}} {{formattedDate}} {{messageType}} is succesvol gepubliceerd",
|
|
243
|
+
"snackbar-cancel": "TAF {{location}} {{formattedDate}} {{messageType}} is succesvol geannuleerd",
|
|
244
|
+
"snackbar-correct": "TAF {{location}} {{formattedDate}} {{messageType}} is succesvol gecorrigeerd",
|
|
245
|
+
"snackbar-amend": "TAF {{location}} {{formattedDate}} {{messageType}} is succesvol geamendeerd",
|
|
246
|
+
"snackbar-save": "TAF {{location}} {{formattedDate}} {{messageType}} is succesvol opgeslagen",
|
|
247
|
+
"switch-title": "Wissel naar bewerken",
|
|
248
|
+
"switch-description": "Deze TAF wordt al bewerkt door een andere gebruiker en belangrijke informatie kan verloren gaan.",
|
|
249
|
+
"switch-confirm": "Bewerken",
|
|
250
|
+
"switch-description-viewer": "Weet je zeker dat je wilt wisselen naar weergavemodus? Niet-opgeslagen wijzigingen gaan verloren.",
|
|
251
|
+
"switch-confirm-viewer": "Wisselen",
|
|
252
|
+
"confirm-delete-description": "Weet je zeker dat je deze rij wilt verwijderen?",
|
|
253
|
+
"confirm-yes": "Ja",
|
|
254
|
+
"confirm-clear-description": "Weet je zeker dat je deze rij leeg wilt maken?",
|
|
255
|
+
"issues-button-0": "0 problemen",
|
|
256
|
+
"issues-button-1": "1 probleem",
|
|
257
|
+
"issues-button-multiple": "{{amount}} problemen"
|
|
258
|
+
};
|
|
259
|
+
var tafTranslations = {
|
|
34
260
|
en: en,
|
|
35
261
|
fi: fi,
|
|
36
262
|
no: no,
|
|
@@ -3467,6 +3693,10 @@ $$5({ target: 'String', proto: true, forced: !correctIsRegExpLogic('includes') }
|
|
|
3467
3693
|
}
|
|
3468
3694
|
});
|
|
3469
3695
|
|
|
3696
|
+
const TAF_NAMESPACE = 'taf';
|
|
3697
|
+
const ns = [TAF_NAMESPACE, SHARED_NAMESPACE];
|
|
3698
|
+
const useTafTranslation = () => useTranslation(ns);
|
|
3699
|
+
|
|
3470
3700
|
const tafActionToDraftAction = tafAction => {
|
|
3471
3701
|
switch (tafAction) {
|
|
3472
3702
|
case 'AMEND':
|
|
@@ -3497,10 +3727,6 @@ const buttonsStyle = {
|
|
|
3497
3727
|
xs: '56px',
|
|
3498
3728
|
sm: '64px'
|
|
3499
3729
|
},
|
|
3500
|
-
width: {
|
|
3501
|
-
xs: '56px',
|
|
3502
|
-
sm: '64px'
|
|
3503
|
-
},
|
|
3504
3730
|
marginLeft: {
|
|
3505
3731
|
xs: 0.5,
|
|
3506
3732
|
sm: 1
|
|
@@ -3513,25 +3739,28 @@ const ViewModeButtons = ({
|
|
|
3513
3739
|
canBe,
|
|
3514
3740
|
onTafViewModeButtonPress
|
|
3515
3741
|
}) => {
|
|
3742
|
+
const {
|
|
3743
|
+
t
|
|
3744
|
+
} = useTafTranslation();
|
|
3516
3745
|
return !canBe.includes('CANCELLED') && !canBe.includes('CORRECTED') && !canBe.includes('AMENDED') ? null : jsxs(Fragment, {
|
|
3517
3746
|
children: [canBe.includes('CANCELLED') && jsx(Button, Object.assign({
|
|
3518
3747
|
"data-testid": "canceltaf",
|
|
3519
3748
|
variant: "tertiary",
|
|
3520
3749
|
onClick: () => onTafViewModeButtonPress('CANCEL')
|
|
3521
3750
|
}, {
|
|
3522
|
-
children:
|
|
3751
|
+
children: t('button-cancel')
|
|
3523
3752
|
})), canBe.includes('CORRECTED') && jsx(Button, Object.assign({
|
|
3524
3753
|
"data-testid": "correcttaf",
|
|
3525
3754
|
variant: "tertiary",
|
|
3526
3755
|
onClick: () => onTafViewModeButtonPress('CORRECT')
|
|
3527
3756
|
}, {
|
|
3528
|
-
children:
|
|
3757
|
+
children: t('button-correct')
|
|
3529
3758
|
})), canBe.includes('AMENDED') && jsx(Button, Object.assign({
|
|
3530
3759
|
"data-testid": "amendtaf",
|
|
3531
3760
|
variant: "tertiary",
|
|
3532
3761
|
onClick: () => onTafViewModeButtonPress('AMEND')
|
|
3533
3762
|
}, {
|
|
3534
|
-
children:
|
|
3763
|
+
children: t('button-amend')
|
|
3535
3764
|
}))]
|
|
3536
3765
|
});
|
|
3537
3766
|
};
|
|
@@ -3542,6 +3771,9 @@ const TafFormButtons = ({
|
|
|
3542
3771
|
onTafEditModeButtonPress,
|
|
3543
3772
|
onTafViewModeButtonPress
|
|
3544
3773
|
}) => {
|
|
3774
|
+
const {
|
|
3775
|
+
t
|
|
3776
|
+
} = useTafTranslation();
|
|
3545
3777
|
return jsxs(Grid, Object.assign({
|
|
3546
3778
|
container: true,
|
|
3547
3779
|
justifyContent: "flex-end",
|
|
@@ -3568,7 +3800,7 @@ const TafFormButtons = ({
|
|
|
3568
3800
|
onTafEditModeButtonPress('CLEAR');
|
|
3569
3801
|
}
|
|
3570
3802
|
}, {
|
|
3571
|
-
children:
|
|
3803
|
+
children: t('button-clear')
|
|
3572
3804
|
})), jsx(Button, Object.assign({
|
|
3573
3805
|
"data-testid": "savedrafttaf",
|
|
3574
3806
|
variant: "tertiary",
|
|
@@ -3583,7 +3815,7 @@ const TafFormButtons = ({
|
|
|
3583
3815
|
onTafEditModeButtonPress(tafActionToDraftAction(tafAction));
|
|
3584
3816
|
}
|
|
3585
3817
|
}, {
|
|
3586
|
-
children:
|
|
3818
|
+
children: t('button-save')
|
|
3587
3819
|
})), jsx(Button, Object.assign({
|
|
3588
3820
|
"data-testid": "publishtaf",
|
|
3589
3821
|
variant: "tertiary",
|
|
@@ -3598,7 +3830,7 @@ const TafFormButtons = ({
|
|
|
3598
3830
|
onTafEditModeButtonPress(tafActionToPublishAction(tafAction));
|
|
3599
3831
|
}
|
|
3600
3832
|
}, {
|
|
3601
|
-
children:
|
|
3833
|
+
children: t('button-publish')
|
|
3602
3834
|
}))]
|
|
3603
3835
|
})
|
|
3604
3836
|
})), jsx(Grid, {
|
|
@@ -5948,15 +6180,14 @@ const getFieldNames = (isChangeGroup, index) => {
|
|
|
5948
6180
|
cloud4: `${namePrefix}.cloud.cloud4`
|
|
5949
6181
|
});
|
|
5950
6182
|
};
|
|
5951
|
-
const
|
|
5952
|
-
|
|
5953
|
-
const TAC_RETRIEVING_DATA = 'Retrieving TAC';
|
|
5954
|
-
const TAC_FAILED = 'Failed to retrieve TAC';
|
|
5955
|
-
const tacHasError = tac => {
|
|
5956
|
-
return tac === TAC_MISSING_DATA || tac === TAC_NOT_AVAILABLE || tac === TAC_RETRIEVING_DATA || tac === TAC_FAILED;
|
|
6183
|
+
const tacHasError = (tac, t) => {
|
|
6184
|
+
return tac === t('TAC-missing-data') || tac === t('TAC-not-available') || tac === t('TAC-retrieving-data') || tac === t('TAC-failed');
|
|
5957
6185
|
};
|
|
5958
6186
|
const useTACGenerator = (taf, requestTAC, getJSON = false) => {
|
|
5959
|
-
const
|
|
6187
|
+
const {
|
|
6188
|
+
t
|
|
6189
|
+
} = useTafTranslation();
|
|
6190
|
+
const [TAC, setTAC] = React__default.useState(!taf || taf.status === 'NEW' ? t('TAC-not-available') : t('TAC-retrieving-data'));
|
|
5960
6191
|
const {
|
|
5961
6192
|
isMounted
|
|
5962
6193
|
} = useIsMounted();
|
|
@@ -5973,20 +6204,22 @@ const useTACGenerator = (taf, requestTAC, getJSON = false) => {
|
|
|
5973
6204
|
controller.current.abort();
|
|
5974
6205
|
}
|
|
5975
6206
|
controller.current = new AbortController();
|
|
5976
|
-
setTAC(
|
|
6207
|
+
setTAC(t('TAC-retrieving-data'));
|
|
5977
6208
|
requestTAC(tafToPost, getJSON, controller.current.signal).then(result => {
|
|
5978
6209
|
if (isMounted.current) {
|
|
5979
6210
|
setTAC(result.data);
|
|
5980
6211
|
}
|
|
5981
6212
|
}).catch(error => {
|
|
5982
6213
|
if (isMounted && error.message !== 'canceled') {
|
|
5983
|
-
setTAC(
|
|
6214
|
+
setTAC(t('TAC-failed'));
|
|
5984
6215
|
}
|
|
5985
6216
|
});
|
|
5986
6217
|
} else {
|
|
5987
|
-
setTAC(
|
|
6218
|
+
setTAC(t('TAC-missing-data'));
|
|
5988
6219
|
}
|
|
5989
|
-
},
|
|
6220
|
+
},
|
|
6221
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
6222
|
+
[isMounted, requestTAC, getJSON]);
|
|
5990
6223
|
React__default.useEffect(() => {
|
|
5991
6224
|
if (taf && taf.status !== 'NEW') {
|
|
5992
6225
|
retrieveTAC(taf);
|
|
@@ -6026,23 +6259,23 @@ const useDragOrder = (trigger, move) => {
|
|
|
6026
6259
|
};
|
|
6027
6260
|
};
|
|
6028
6261
|
// dialog utils
|
|
6029
|
-
const getConfirmationDialogTitle = action => {
|
|
6262
|
+
const getConfirmationDialogTitle = (action, t) => {
|
|
6030
6263
|
if (action === 'CLEAR') {
|
|
6031
|
-
return '
|
|
6264
|
+
return t('confirm-clear-title');
|
|
6032
6265
|
}
|
|
6033
6266
|
if (action === 'PUBLISH') {
|
|
6034
|
-
return '
|
|
6267
|
+
return t('button-publish');
|
|
6035
6268
|
}
|
|
6036
6269
|
if (action === 'AMEND') {
|
|
6037
|
-
return '
|
|
6270
|
+
return t('confirm-amend-title');
|
|
6038
6271
|
}
|
|
6039
6272
|
if (action === 'CORRECT') {
|
|
6040
|
-
return '
|
|
6273
|
+
return t('confirm-correct-title');
|
|
6041
6274
|
}
|
|
6042
6275
|
if (action === 'CANCEL') {
|
|
6043
|
-
return '
|
|
6276
|
+
return t('confirm-cancel-title');
|
|
6044
6277
|
}
|
|
6045
|
-
return '
|
|
6278
|
+
return t('confirm-cancel-title');
|
|
6046
6279
|
};
|
|
6047
6280
|
// Check if the amended/corrected TAF has been changed. Only compare the fields users are able to fill in
|
|
6048
6281
|
// (i.e. exclude baseforecast valid time as that gets updated when doing an amendment automatically outside of the users influence)
|
|
@@ -6062,30 +6295,31 @@ const isTafAmendedCorrectedChanged = (originalTaf, currentTaf) => {
|
|
|
6062
6295
|
const currentNoValid = __rest(currentBaseF, ["valid"]);
|
|
6063
6296
|
return !isEqual(originalNoValid, currentNoValid) || !isEqual(originalChG, currentChG);
|
|
6064
6297
|
};
|
|
6065
|
-
const getConfirmationDialogContent = (action, isFormDirty) => {
|
|
6298
|
+
const getConfirmationDialogContent = (action, isFormDirty, t) => {
|
|
6066
6299
|
switch (action) {
|
|
6067
6300
|
case 'CLEAR':
|
|
6068
|
-
return '
|
|
6301
|
+
return t('confirm-clear-content');
|
|
6069
6302
|
case 'PUBLISH':
|
|
6070
|
-
return '
|
|
6303
|
+
return t('confirm-publish-content');
|
|
6071
6304
|
case 'AMEND':
|
|
6072
6305
|
case 'CORRECT':
|
|
6073
|
-
return isFormDirty() ? '
|
|
6306
|
+
return isFormDirty() ? t('confirm-correct-amend-content') : t('confirm-correct-amend-content-no-changes');
|
|
6307
|
+
case 'CANCEL':
|
|
6074
6308
|
default:
|
|
6075
|
-
return '
|
|
6309
|
+
return t('confirm-cancel-content');
|
|
6076
6310
|
}
|
|
6077
6311
|
};
|
|
6078
|
-
const getConfirmationDialogButtonLabel = action => {
|
|
6312
|
+
const getConfirmationDialogButtonLabel = (action, t) => {
|
|
6079
6313
|
switch (action) {
|
|
6080
6314
|
case 'CLEAR':
|
|
6081
6315
|
{
|
|
6082
|
-
return '
|
|
6316
|
+
return t('button-clear');
|
|
6083
6317
|
}
|
|
6084
6318
|
case 'CANCEL':
|
|
6085
|
-
return '
|
|
6319
|
+
return t('button-cancel');
|
|
6086
6320
|
default:
|
|
6087
6321
|
{
|
|
6088
|
-
return '
|
|
6322
|
+
return t('button-publish');
|
|
6089
6323
|
}
|
|
6090
6324
|
}
|
|
6091
6325
|
};
|
|
@@ -6107,26 +6341,26 @@ const emptyChangegroup = {
|
|
|
6107
6341
|
change: '',
|
|
6108
6342
|
probability: ''
|
|
6109
6343
|
};
|
|
6110
|
-
const getTafStatusLabel = (status, action, isFormDisabled) => {
|
|
6344
|
+
const getTafStatusLabel = (t, status, action, isFormDisabled) => {
|
|
6111
6345
|
// See if we need to base status label on action if form is not disabled and action passed
|
|
6112
6346
|
const baseOnAction = isFormDisabled !== undefined && !isFormDisabled && action;
|
|
6113
6347
|
if (baseOnAction && action === 'AMEND' && (status === 'PUBLISHED' || status === 'AMENDED' || status === 'CORRECTED')) {
|
|
6114
|
-
return 'new
|
|
6348
|
+
return t('status-new-amendment');
|
|
6115
6349
|
}
|
|
6116
6350
|
if (baseOnAction && action === 'CORRECT' && (status === 'PUBLISHED' || status === 'AMENDED' || status === 'CORRECTED')) {
|
|
6117
|
-
return 'new
|
|
6351
|
+
return t('status-new-correction');
|
|
6118
6352
|
}
|
|
6119
6353
|
switch (status) {
|
|
6120
6354
|
case 'DRAFT_AMENDED':
|
|
6121
|
-
return 'draft
|
|
6355
|
+
return t('status-draft-amendment');
|
|
6122
6356
|
case 'DRAFT_CORRECTED':
|
|
6123
|
-
return 'draft
|
|
6357
|
+
return t('status-draft-correction');
|
|
6124
6358
|
case 'AMENDED':
|
|
6125
|
-
return 'published
|
|
6359
|
+
return t('status-published-amendment');
|
|
6126
6360
|
case 'CORRECTED':
|
|
6127
|
-
return 'published
|
|
6361
|
+
return t('status-published-correction');
|
|
6128
6362
|
default:
|
|
6129
|
-
return status.toLocaleLowerCase();
|
|
6363
|
+
return t(`status-${status.toLocaleLowerCase()}`);
|
|
6130
6364
|
}
|
|
6131
6365
|
};
|
|
6132
6366
|
const getMessageType = (taf, tafAction) => {
|
|
@@ -6302,14 +6536,16 @@ const getCustomError = (error, isChangeGroup, rowIndex) => {
|
|
|
6302
6536
|
rowIndex
|
|
6303
6537
|
});
|
|
6304
6538
|
};
|
|
6305
|
-
const getIssuesLabel = sumOfErrors => {
|
|
6539
|
+
const getIssuesLabel = (sumOfErrors, t) => {
|
|
6306
6540
|
switch (sumOfErrors) {
|
|
6307
6541
|
case 0:
|
|
6308
|
-
return '0
|
|
6542
|
+
return t('issues-button-0');
|
|
6309
6543
|
case 1:
|
|
6310
|
-
return '1
|
|
6544
|
+
return t('issues-button-1');
|
|
6311
6545
|
default:
|
|
6312
|
-
return
|
|
6546
|
+
return t('issues-button-multiple', {
|
|
6547
|
+
amount: sumOfErrors
|
|
6548
|
+
});
|
|
6313
6549
|
}
|
|
6314
6550
|
};
|
|
6315
6551
|
const getErrorValues = (fieldErrors, isChangeGroup = false, rowIndex = -1) => {
|
|
@@ -6355,6 +6591,9 @@ const IssuesButton = ({
|
|
|
6355
6591
|
isIssuesPaneOpen: _isIssuesPaneOpen = false,
|
|
6356
6592
|
setIsIssuesPaneOpen: _setIsIssuesPaneOpen = () => null
|
|
6357
6593
|
}) => {
|
|
6594
|
+
const {
|
|
6595
|
+
t
|
|
6596
|
+
} = useTafTranslation();
|
|
6358
6597
|
const errorList = filterDuplicateErrors(getErrors(_errors));
|
|
6359
6598
|
const totalErrors = errorList.length;
|
|
6360
6599
|
const errorStatus = totalErrors > 0 ? 'error' : 'success';
|
|
@@ -6377,16 +6616,16 @@ const IssuesButton = ({
|
|
|
6377
6616
|
toggleIssuesPane(newPosition);
|
|
6378
6617
|
};
|
|
6379
6618
|
return jsx(CustomTooltip, Object.assign({
|
|
6380
|
-
title:
|
|
6619
|
+
title: t('issues-button-title')
|
|
6381
6620
|
}, {
|
|
6382
6621
|
children: jsx(Chip, {
|
|
6383
6622
|
"data-testid": "issuesButton",
|
|
6384
6623
|
className: `status-${errorStatus}`,
|
|
6385
6624
|
size: "small",
|
|
6386
|
-
label: getIssuesLabel(totalErrors),
|
|
6625
|
+
label: getIssuesLabel(totalErrors, t),
|
|
6387
6626
|
onClick: onClickButton,
|
|
6388
6627
|
sx: {
|
|
6389
|
-
|
|
6628
|
+
minWidth: '74px',
|
|
6390
6629
|
color: '#ffffff',
|
|
6391
6630
|
backgroundColor: buttonColor,
|
|
6392
6631
|
'&:hover': {
|
|
@@ -6401,14 +6640,14 @@ const IssuesButton = ({
|
|
|
6401
6640
|
}));
|
|
6402
6641
|
};
|
|
6403
6642
|
|
|
6404
|
-
const getPaneTitle = sumOfErrors => {
|
|
6643
|
+
const getPaneTitle = (sumOfErrors, t) => {
|
|
6405
6644
|
switch (sumOfErrors) {
|
|
6406
6645
|
case 0:
|
|
6407
|
-
return '
|
|
6646
|
+
return t('issues-pane-none');
|
|
6408
6647
|
case 1:
|
|
6409
|
-
return '
|
|
6648
|
+
return t('issues-pane-one');
|
|
6410
6649
|
default:
|
|
6411
|
-
return '
|
|
6650
|
+
return t('issues-pane-multiple');
|
|
6412
6651
|
}
|
|
6413
6652
|
};
|
|
6414
6653
|
const humanizeErrorMessage = (errorTitle, fieldNumberedValue) => {
|
|
@@ -6455,6 +6694,9 @@ const IssuesPane = ({
|
|
|
6455
6694
|
},
|
|
6456
6695
|
onUserHasDragged: _onUserHasDragged = () => {}
|
|
6457
6696
|
}) => {
|
|
6697
|
+
const {
|
|
6698
|
+
t
|
|
6699
|
+
} = useTafTranslation();
|
|
6458
6700
|
const rootElement = document.getElementById(MODAL_DIALOG_ELEMENT) || document.body;
|
|
6459
6701
|
return /*#__PURE__*/ReactDOM.createPortal(jsx(ToolContainerDraggable, Object.assign({
|
|
6460
6702
|
startSize: {
|
|
@@ -6464,7 +6706,7 @@ const IssuesPane = ({
|
|
|
6464
6706
|
startPosition: _startPosition,
|
|
6465
6707
|
minWidth: 300,
|
|
6466
6708
|
onClose: handleClose,
|
|
6467
|
-
title: getPaneTitle(_errorList.length),
|
|
6709
|
+
title: getPaneTitle(_errorList.length, t),
|
|
6468
6710
|
isOpen: isOpen,
|
|
6469
6711
|
"data-testid": "moveable-issues-pane",
|
|
6470
6712
|
bounds: "parent",
|
|
@@ -6852,23 +7094,26 @@ const TafFormOptionsButton = ({
|
|
|
6852
7094
|
clearRow,
|
|
6853
7095
|
index
|
|
6854
7096
|
}) => {
|
|
7097
|
+
const {
|
|
7098
|
+
t
|
|
7099
|
+
} = useTafTranslation();
|
|
6855
7100
|
const insertAbove = {
|
|
6856
|
-
text: '
|
|
7101
|
+
text: t('options-insert-above'),
|
|
6857
7102
|
icon: jsx(Add, {}),
|
|
6858
7103
|
action: addChangeGroupAbove
|
|
6859
7104
|
};
|
|
6860
7105
|
const insertBelow = {
|
|
6861
|
-
text: '
|
|
7106
|
+
text: t('options-insert-below'),
|
|
6862
7107
|
icon: jsx(Add, {}),
|
|
6863
7108
|
action: addChangeGroupBelow
|
|
6864
7109
|
};
|
|
6865
7110
|
const deleteRow = {
|
|
6866
|
-
text: '
|
|
7111
|
+
text: t('options-delete'),
|
|
6867
7112
|
icon: jsx(Delete, {}),
|
|
6868
7113
|
action: removeChangeGroup
|
|
6869
7114
|
};
|
|
6870
7115
|
const clear = {
|
|
6871
|
-
text: '
|
|
7116
|
+
text: t('options-clear'),
|
|
6872
7117
|
icon: jsx(Close, {}),
|
|
6873
7118
|
action: clearRow
|
|
6874
7119
|
};
|
|
@@ -7296,9 +7541,6 @@ const TafFormRow = /*#__PURE__*/React__default.forwardRef((_a, ref) => {
|
|
|
7296
7541
|
|
|
7297
7542
|
// prevents default functionality
|
|
7298
7543
|
const noop = () => {};
|
|
7299
|
-
const getSnackbarMessage$2 = (isChecked, location) => {
|
|
7300
|
-
return `You are now ${isChecked ? '' : 'no longer '}the editor for TAF ${location}`;
|
|
7301
|
-
};
|
|
7302
7544
|
const TafForm = /*#__PURE__*/React__default.memo(({
|
|
7303
7545
|
tafFromBackend,
|
|
7304
7546
|
onFormAction: _onFormAction = () => null,
|
|
@@ -7310,6 +7552,9 @@ const TafForm = /*#__PURE__*/React__default.memo(({
|
|
|
7310
7552
|
fetchNewTafList: _fetchNewTafList = () => null,
|
|
7311
7553
|
previousTaf: _previousTaf = null
|
|
7312
7554
|
}) => {
|
|
7555
|
+
const {
|
|
7556
|
+
t
|
|
7557
|
+
} = useTafTranslation();
|
|
7313
7558
|
const formRef = React__default.useRef(null);
|
|
7314
7559
|
const {
|
|
7315
7560
|
taf: originalTaf,
|
|
@@ -7369,11 +7614,11 @@ const TafForm = /*#__PURE__*/React__default.memo(({
|
|
|
7369
7614
|
console.log('submit:', convertTafValuesToObject(data));
|
|
7370
7615
|
};
|
|
7371
7616
|
const showConfirmDialog = action => confirmDialog({
|
|
7372
|
-
title: getConfirmationDialogTitle(action),
|
|
7617
|
+
title: getConfirmationDialogTitle(action, t),
|
|
7373
7618
|
description: getConfirmationDialogContent(action, () => isTafAmendedCorrectedChanged(
|
|
7374
7619
|
// If already saved as draft amd/cor then send over the previous taf
|
|
7375
|
-
originalTaf.status === 'DRAFT_AMENDED' || originalTaf.status === 'DRAFT_CORRECTED' ? _previousTaf : originalTaf, convertTafValuesToObject(getValues()))),
|
|
7376
|
-
confirmLabel: getConfirmationDialogButtonLabel(action)
|
|
7620
|
+
originalTaf.status === 'DRAFT_AMENDED' || originalTaf.status === 'DRAFT_CORRECTED' ? _previousTaf : originalTaf, convertTafValuesToObject(getValues())), t),
|
|
7621
|
+
confirmLabel: getConfirmationDialogButtonLabel(action, t)
|
|
7377
7622
|
});
|
|
7378
7623
|
const resetFormValues = (formData, keepDirty = false) => {
|
|
7379
7624
|
Object.keys(formData).forEach(key => {
|
|
@@ -7421,16 +7666,20 @@ const TafForm = /*#__PURE__*/React__default.memo(({
|
|
|
7421
7666
|
}
|
|
7422
7667
|
if (checked && isLatestEditor(latestEditor, auth === null || auth === void 0 ? void 0 : auth.username)) {
|
|
7423
7668
|
yield confirmDialog({
|
|
7424
|
-
title: '
|
|
7425
|
-
description: '
|
|
7426
|
-
confirmLabel: '
|
|
7669
|
+
title: t('switch-title'),
|
|
7670
|
+
description: t('switch-description'),
|
|
7671
|
+
confirmLabel: t('switch-confirm')
|
|
7427
7672
|
});
|
|
7428
7673
|
}
|
|
7429
7674
|
const didSucceed = yield _onSwitchEditor(Object.assign(Object.assign({}, tafFromBackend), {
|
|
7430
7675
|
editor: username
|
|
7431
7676
|
}));
|
|
7432
7677
|
if (didSucceed) {
|
|
7433
|
-
showSnackbar(
|
|
7678
|
+
showSnackbar(checked ? t('editor-on', {
|
|
7679
|
+
location: originalTaf.location
|
|
7680
|
+
}) : t('editor-off', {
|
|
7681
|
+
location: originalTaf.location
|
|
7682
|
+
}));
|
|
7434
7683
|
}
|
|
7435
7684
|
return didSucceed;
|
|
7436
7685
|
});
|
|
@@ -7440,9 +7689,9 @@ const TafForm = /*#__PURE__*/React__default.memo(({
|
|
|
7440
7689
|
} = event.target;
|
|
7441
7690
|
if (!checked && isFormDirty) {
|
|
7442
7691
|
confirmDialog({
|
|
7443
|
-
title: '
|
|
7444
|
-
description: '
|
|
7445
|
-
confirmLabel: '
|
|
7692
|
+
title: t('confirm-dialog-title'),
|
|
7693
|
+
description: t('switch-description-viewer'),
|
|
7694
|
+
confirmLabel: t('switch-confirm-viewer')
|
|
7446
7695
|
}).then(() => __awaiter(void 0, void 0, void 0, function* () {
|
|
7447
7696
|
const didSucceed = yield setIsEditor(checked);
|
|
7448
7697
|
if (didSucceed) {
|
|
@@ -7468,7 +7717,7 @@ const TafForm = /*#__PURE__*/React__default.memo(({
|
|
|
7468
7717
|
showConfirmDialog(action).then(() => {
|
|
7469
7718
|
const emptiedForm = clearTafFormData(getValues());
|
|
7470
7719
|
resetFormValues(emptiedForm, true);
|
|
7471
|
-
showSnackbar('
|
|
7720
|
+
showSnackbar(t('clear-message'));
|
|
7472
7721
|
});
|
|
7473
7722
|
break;
|
|
7474
7723
|
case 'AMEND':
|
|
@@ -7523,9 +7772,9 @@ const TafForm = /*#__PURE__*/React__default.memo(({
|
|
|
7523
7772
|
};
|
|
7524
7773
|
const onRemoverow = index => {
|
|
7525
7774
|
confirmDialog({
|
|
7526
|
-
title: '
|
|
7527
|
-
description: '
|
|
7528
|
-
confirmLabel: '
|
|
7775
|
+
title: t('options-delete'),
|
|
7776
|
+
description: t('confirm-delete-description'),
|
|
7777
|
+
confirmLabel: t('confirm-yes')
|
|
7529
7778
|
}).then(() => {
|
|
7530
7779
|
remove(index);
|
|
7531
7780
|
trigger(); // trigger all fields validation
|
|
@@ -7553,9 +7802,9 @@ const TafForm = /*#__PURE__*/React__default.memo(({
|
|
|
7553
7802
|
};
|
|
7554
7803
|
const onClearRow = (rowIndex = -1, isChangeGroup = false) => {
|
|
7555
7804
|
confirmDialog({
|
|
7556
|
-
title: '
|
|
7557
|
-
description: '
|
|
7558
|
-
confirmLabel: '
|
|
7805
|
+
title: t('options-clear'),
|
|
7806
|
+
description: t('confirm-clear-description'),
|
|
7807
|
+
confirmLabel: t('confirm-yes')
|
|
7559
7808
|
}).then(() => {
|
|
7560
7809
|
if (isChangeGroup) {
|
|
7561
7810
|
remove(rowIndex);
|
|
@@ -8127,12 +8376,15 @@ const StatusIcon = ({
|
|
|
8127
8376
|
status,
|
|
8128
8377
|
timeSlot
|
|
8129
8378
|
}) => {
|
|
8379
|
+
const {
|
|
8380
|
+
t
|
|
8381
|
+
} = useTafTranslation();
|
|
8130
8382
|
switch (status) {
|
|
8131
8383
|
case 'DRAFT':
|
|
8132
8384
|
case 'DRAFT_AMENDED':
|
|
8133
8385
|
case 'DRAFT_CORRECTED':
|
|
8134
8386
|
return jsx(IconWithTooltip, Object.assign({
|
|
8135
|
-
title: getTafStatusLabel(status)
|
|
8387
|
+
title: getTafStatusLabel(t, status)
|
|
8136
8388
|
}, {
|
|
8137
8389
|
children: jsx(Edit, {
|
|
8138
8390
|
"data-testid": "status-draft",
|
|
@@ -8145,7 +8397,7 @@ const StatusIcon = ({
|
|
|
8145
8397
|
case 'CORRECTED':
|
|
8146
8398
|
case 'AMENDED':
|
|
8147
8399
|
return jsx(IconWithTooltip, Object.assign({
|
|
8148
|
-
title: getTafStatusLabel(status)
|
|
8400
|
+
title: getTafStatusLabel(t, status)
|
|
8149
8401
|
}, {
|
|
8150
8402
|
children: timeSlot === 'ACTIVE' ? jsx(Success, {
|
|
8151
8403
|
"data-testid": "status-active",
|
|
@@ -8161,7 +8413,7 @@ const StatusIcon = ({
|
|
|
8161
8413
|
}));
|
|
8162
8414
|
case 'CANCELLED':
|
|
8163
8415
|
return jsx(IconWithTooltip, Object.assign({
|
|
8164
|
-
title: getTafStatusLabel(status)
|
|
8416
|
+
title: getTafStatusLabel(t, status)
|
|
8165
8417
|
}, {
|
|
8166
8418
|
children: jsx(Cancel, {
|
|
8167
8419
|
"data-testid": "status-cancelled",
|
|
@@ -8172,7 +8424,7 @@ const StatusIcon = ({
|
|
|
8172
8424
|
}));
|
|
8173
8425
|
case 'EXPIRED':
|
|
8174
8426
|
return jsx(IconWithTooltip, Object.assign({
|
|
8175
|
-
title: getTafStatusLabel(status)
|
|
8427
|
+
title: getTafStatusLabel(t, status)
|
|
8176
8428
|
}, {
|
|
8177
8429
|
children: jsx(Clock, {
|
|
8178
8430
|
"data-testid": "status-expired",
|
|
@@ -8188,17 +8440,19 @@ const StatusIcon = ({
|
|
|
8188
8440
|
}
|
|
8189
8441
|
};
|
|
8190
8442
|
|
|
8191
|
-
const TOOLTIP_TITLE = 'Import TAC';
|
|
8192
8443
|
const ExportButton = ({
|
|
8193
8444
|
onClick,
|
|
8194
8445
|
isHidden
|
|
8195
8446
|
}) => {
|
|
8447
|
+
const {
|
|
8448
|
+
t
|
|
8449
|
+
} = useTafTranslation();
|
|
8196
8450
|
return isHidden ? null : jsx(CustomIconButton, Object.assign({
|
|
8197
8451
|
onClick: onClick,
|
|
8198
8452
|
"data-testid": "export-tac-button",
|
|
8199
8453
|
variant: "tool",
|
|
8200
8454
|
tooltipProps: {
|
|
8201
|
-
title:
|
|
8455
|
+
title: t('taf-import-title'),
|
|
8202
8456
|
placement: 'left'
|
|
8203
8457
|
}
|
|
8204
8458
|
}, {
|
|
@@ -8244,14 +8498,14 @@ const AdverseWeatherTACMessage = ({
|
|
|
8244
8498
|
}));
|
|
8245
8499
|
};
|
|
8246
8500
|
|
|
8247
|
-
const getSnackbarMessage$1 = (location, locationLabel) => {
|
|
8248
|
-
return `TAF ${location} ${locationLabel} was imported successfully`;
|
|
8249
|
-
};
|
|
8250
8501
|
const TacContainer = ({
|
|
8251
8502
|
taf,
|
|
8252
8503
|
isActive: _isActive = false,
|
|
8253
8504
|
isFormDisabled: _isFormDisabled = false
|
|
8254
8505
|
}) => {
|
|
8506
|
+
const {
|
|
8507
|
+
t
|
|
8508
|
+
} = useTafTranslation();
|
|
8255
8509
|
const {
|
|
8256
8510
|
api
|
|
8257
8511
|
} = useApiContext();
|
|
@@ -8301,7 +8555,10 @@ const TacContainer = ({
|
|
|
8301
8555
|
setTimeout(() => {
|
|
8302
8556
|
trigger(); // trigger all fields validation
|
|
8303
8557
|
}, 0);
|
|
8304
|
-
showSnackbar(
|
|
8558
|
+
showSnackbar(t('taf-import-message', {
|
|
8559
|
+
location,
|
|
8560
|
+
locationLabel
|
|
8561
|
+
}));
|
|
8305
8562
|
};
|
|
8306
8563
|
React__default.useEffect(() => {
|
|
8307
8564
|
if (_isActive) {
|
|
@@ -8377,7 +8634,7 @@ const TacContainer = ({
|
|
|
8377
8634
|
}))]
|
|
8378
8635
|
})), jsx(ExportButton, {
|
|
8379
8636
|
onClick: handleExport,
|
|
8380
|
-
isHidden: _isFormDisabled || tacHasError(TAC)
|
|
8637
|
+
isHidden: _isFormDisabled || tacHasError(TAC, t)
|
|
8381
8638
|
})]
|
|
8382
8639
|
})), jsx(Box, Object.assign({
|
|
8383
8640
|
sx: {
|
|
@@ -8413,13 +8670,16 @@ const TacOverview = ({
|
|
|
8413
8670
|
activeTaf: _activeTaf = null,
|
|
8414
8671
|
isFormDisabled: _isFormDisabled = false
|
|
8415
8672
|
}) => {
|
|
8673
|
+
const {
|
|
8674
|
+
t
|
|
8675
|
+
} = useTafTranslation();
|
|
8416
8676
|
const [activeTab, setActiveTab] = React__default.useState(0);
|
|
8417
8677
|
const scrollRef = React__default.useRef(null);
|
|
8418
8678
|
const tabs = [{
|
|
8419
|
-
title: '
|
|
8679
|
+
title: t('top-tabs-upcoming'),
|
|
8420
8680
|
tafList: _upcomingTafs
|
|
8421
8681
|
}, {
|
|
8422
|
-
title: '
|
|
8682
|
+
title: t('top-tabs-current-expired'),
|
|
8423
8683
|
tafList: sortTafsOnLocation([..._currentTafs, ..._expiredTafs])
|
|
8424
8684
|
}];
|
|
8425
8685
|
const activeLocation = (_activeTaf === null || _activeTaf === void 0 ? void 0 : _activeTaf.taf.location) || null;
|
|
@@ -8469,7 +8729,7 @@ const TacOverview = ({
|
|
|
8469
8729
|
}
|
|
8470
8730
|
}, {
|
|
8471
8731
|
children: [!_hideTitle && jsx(TafHeader, {
|
|
8472
|
-
title:
|
|
8732
|
+
title: t('tac-overview')
|
|
8473
8733
|
}), jsx(Tabs, Object.assign({
|
|
8474
8734
|
value: activeTab,
|
|
8475
8735
|
onChange: onChangeTab,
|
|
@@ -8519,6 +8779,9 @@ const TacOverviewMobile = ({
|
|
|
8519
8779
|
activeTaf,
|
|
8520
8780
|
defaultOpen: _defaultOpen = false
|
|
8521
8781
|
}) => {
|
|
8782
|
+
const {
|
|
8783
|
+
t
|
|
8784
|
+
} = useTafTranslation();
|
|
8522
8785
|
const [isOpen, toggleOpen] = React.useState(_defaultOpen);
|
|
8523
8786
|
const onClose = () => toggleOpen(false);
|
|
8524
8787
|
return jsxs(Fragment, {
|
|
@@ -8551,7 +8814,7 @@ const TacOverviewMobile = ({
|
|
|
8551
8814
|
"data-testid": "tac-overview-mobile"
|
|
8552
8815
|
}, {
|
|
8553
8816
|
children: [jsx(ToolHeader, {
|
|
8554
|
-
title:
|
|
8817
|
+
title: t('tac-overview'),
|
|
8555
8818
|
size: "small",
|
|
8556
8819
|
isDraggable: false,
|
|
8557
8820
|
onClose: onClose
|
|
@@ -8577,6 +8840,9 @@ const TopTabs = ({
|
|
|
8577
8840
|
}
|
|
8578
8841
|
}
|
|
8579
8842
|
}) => {
|
|
8843
|
+
const {
|
|
8844
|
+
t
|
|
8845
|
+
} = useTafTranslation();
|
|
8580
8846
|
const {
|
|
8581
8847
|
formState: {
|
|
8582
8848
|
isDirty
|
|
@@ -8591,10 +8857,10 @@ const TopTabs = ({
|
|
|
8591
8857
|
nextBaseTime
|
|
8592
8858
|
} = getBaseTime(_tafFromBackend.taf.baseTime, _tafFromBackend.taf.location);
|
|
8593
8859
|
const tabs = [{
|
|
8594
|
-
title:
|
|
8860
|
+
title: `${t('top-tabs-upcoming')} ${formatBaseTime(nextBaseTime)}`,
|
|
8595
8861
|
timeSlot: 'UPCOMING'
|
|
8596
8862
|
}, {
|
|
8597
|
-
title:
|
|
8863
|
+
title: `${t('top-tabs-current')} ${formatBaseTime(currentBaseTime)}`,
|
|
8598
8864
|
timeSlot: 'ACTIVE'
|
|
8599
8865
|
}];
|
|
8600
8866
|
const onChangeTab = (_event, newValue) => {
|
|
@@ -8728,7 +8994,7 @@ const fromActionToStatus = tafAction => {
|
|
|
8728
8994
|
}
|
|
8729
8995
|
};
|
|
8730
8996
|
const isWarning = error => (error === null || error === void 0 ? void 0 : error.type) === 'WARNING';
|
|
8731
|
-
const parseErrorMessage = (error, params) => {
|
|
8997
|
+
const parseErrorMessage = (error, params, t) => {
|
|
8732
8998
|
const message = getErrorMessage$1(error);
|
|
8733
8999
|
const warningMessage = getWarningMessage(error);
|
|
8734
9000
|
if (warningMessage) {
|
|
@@ -8739,15 +9005,18 @@ const parseErrorMessage = (error, params) => {
|
|
|
8739
9005
|
}
|
|
8740
9006
|
return params.changeStatusTo === 'CANCELLED' ? {
|
|
8741
9007
|
type: 'CANCELLED',
|
|
8742
|
-
title: '
|
|
9008
|
+
title: t('error-cancel'),
|
|
8743
9009
|
message
|
|
8744
9010
|
} : {
|
|
8745
9011
|
type: 'SERVER',
|
|
8746
|
-
title: '
|
|
9012
|
+
title: t('error-save'),
|
|
8747
9013
|
message
|
|
8748
9014
|
};
|
|
8749
9015
|
};
|
|
8750
|
-
const usePostTafRequest =
|
|
9016
|
+
const usePostTafRequest = request => {
|
|
9017
|
+
const {
|
|
9018
|
+
t
|
|
9019
|
+
} = useTafTranslation();
|
|
8751
9020
|
const {
|
|
8752
9021
|
isMounted
|
|
8753
9022
|
} = useIsMounted();
|
|
@@ -8767,10 +9036,11 @@ const usePostTafRequest = (request, errorParser = parseErrorMessage) => {
|
|
|
8767
9036
|
if (!isMounted.current) {
|
|
8768
9037
|
return;
|
|
8769
9038
|
}
|
|
8770
|
-
const
|
|
9039
|
+
const newError = parseErrorMessage(error, params, t);
|
|
8771
9040
|
setLoading(false);
|
|
8772
|
-
setError(
|
|
8773
|
-
throw
|
|
9041
|
+
setError(newError);
|
|
9042
|
+
// eslint-disable-next-line @typescript-eslint/no-throw-literal
|
|
9043
|
+
throw newError;
|
|
8774
9044
|
}
|
|
8775
9045
|
});
|
|
8776
9046
|
return {
|
|
@@ -8796,6 +9066,9 @@ const TafPanel = ({
|
|
|
8796
9066
|
previousTaf: _previousTaf = null,
|
|
8797
9067
|
tafAction
|
|
8798
9068
|
}) => {
|
|
9069
|
+
const {
|
|
9070
|
+
t
|
|
9071
|
+
} = useTafTranslation();
|
|
8799
9072
|
const severity = isWarning(error) ? 'warning' : 'error';
|
|
8800
9073
|
const onTafAction = (action, taf) => __awaiter(void 0, void 0, void 0, function* () {
|
|
8801
9074
|
try {
|
|
@@ -8827,7 +9100,7 @@ const TafPanel = ({
|
|
|
8827
9100
|
"data-testid": `taf-panel${activeTafIndex === index ? '-active' : ''}`
|
|
8828
9101
|
}, {
|
|
8829
9102
|
children: [jsx(TafHeader, {
|
|
8830
|
-
title: getTafStatusLabel(tafFromBackend.taf.status, tafAction, _isFormDisabled),
|
|
9103
|
+
title: getTafStatusLabel(t, tafFromBackend.taf.status, tafAction, _isFormDisabled),
|
|
8831
9104
|
sx: {
|
|
8832
9105
|
marginBottom: '4px'
|
|
8833
9106
|
}
|
|
@@ -8880,44 +9153,44 @@ const IssuesPaneWrapper = props => {
|
|
|
8880
9153
|
}, props));
|
|
8881
9154
|
};
|
|
8882
9155
|
|
|
8883
|
-
const
|
|
8884
|
-
title: 'Whoops',
|
|
8885
|
-
description: "It's not possible to autosave this TAF due to the presence of issue(s). Are you sure you want to close this TAF? Any changes made will be lost.",
|
|
8886
|
-
confirmLabel: 'Exit without saving'
|
|
8887
|
-
};
|
|
8888
|
-
const getTafMessagePrefix = ({
|
|
9156
|
+
const getTafMessageContent = ({
|
|
8889
9157
|
location,
|
|
8890
9158
|
validDateStart,
|
|
8891
9159
|
messageType
|
|
8892
|
-
}
|
|
9160
|
+
}) => {
|
|
8893
9161
|
const formattedDate = formatBaseTime(dateUtils.utc(validDateStart));
|
|
8894
|
-
return
|
|
9162
|
+
return {
|
|
9163
|
+
location,
|
|
9164
|
+
formattedDate,
|
|
9165
|
+
messageType
|
|
9166
|
+
};
|
|
8895
9167
|
};
|
|
8896
|
-
const getSnackbarMessage = (tafFromFrontEnd, isAutoSaved
|
|
9168
|
+
const getSnackbarMessage = (tafFromFrontEnd, isAutoSaved, t) => {
|
|
8897
9169
|
const {
|
|
8898
9170
|
changeStatusTo,
|
|
8899
9171
|
taf
|
|
8900
9172
|
} = tafFromFrontEnd;
|
|
8901
9173
|
if (isAutoSaved) {
|
|
8902
|
-
return '
|
|
9174
|
+
return t('snackbar-auto-save');
|
|
8903
9175
|
}
|
|
9176
|
+
const content = getTafMessageContent(taf);
|
|
8904
9177
|
switch (changeStatusTo) {
|
|
8905
9178
|
case 'DRAFT':
|
|
8906
|
-
return '
|
|
9179
|
+
return t('snackbar-draft');
|
|
8907
9180
|
case 'DRAFT_AMENDED':
|
|
8908
|
-
return '
|
|
9181
|
+
return t('snackbar-draft-amend');
|
|
8909
9182
|
case 'DRAFT_CORRECTED':
|
|
8910
|
-
return '
|
|
9183
|
+
return t('snackbar-draft-correct');
|
|
8911
9184
|
case 'PUBLISHED':
|
|
8912
|
-
return
|
|
9185
|
+
return t('snackbar-publish', content);
|
|
8913
9186
|
case 'CANCELLED':
|
|
8914
|
-
return
|
|
9187
|
+
return t('snackbar-cancel', content);
|
|
8915
9188
|
case 'CORRECTED':
|
|
8916
|
-
return
|
|
9189
|
+
return t('snackbar-correct', content);
|
|
8917
9190
|
case 'AMENDED':
|
|
8918
|
-
return
|
|
9191
|
+
return t('snackbar-amend', content);
|
|
8919
9192
|
default:
|
|
8920
|
-
return
|
|
9193
|
+
return t('snackbar-save', content);
|
|
8921
9194
|
}
|
|
8922
9195
|
};
|
|
8923
9196
|
const TafLayout = ({
|
|
@@ -8925,6 +9198,9 @@ const TafLayout = ({
|
|
|
8925
9198
|
onUpdateTaf: _onUpdateTaf = () => null,
|
|
8926
9199
|
lastUpdateTime
|
|
8927
9200
|
}) => {
|
|
9201
|
+
const {
|
|
9202
|
+
t
|
|
9203
|
+
} = useTafTranslation();
|
|
8928
9204
|
const {
|
|
8929
9205
|
api
|
|
8930
9206
|
} = useApiContext();
|
|
@@ -8970,7 +9246,7 @@ const TafLayout = ({
|
|
|
8970
9246
|
try {
|
|
8971
9247
|
setError(null);
|
|
8972
9248
|
yield postTafRequest(data);
|
|
8973
|
-
showSnackbar(getSnackbarMessage(data, isAutoSaved));
|
|
9249
|
+
showSnackbar(getSnackbarMessage(data, isAutoSaved, t));
|
|
8974
9250
|
// callback
|
|
8975
9251
|
_onUpdateTaf();
|
|
8976
9252
|
} catch (error) {
|
|
@@ -8991,6 +9267,11 @@ const TafLayout = ({
|
|
|
8991
9267
|
return false;
|
|
8992
9268
|
}
|
|
8993
9269
|
});
|
|
9270
|
+
const CONFIRM_DIALOG_OPTIONS = {
|
|
9271
|
+
title: t('confirm-dialog-title'),
|
|
9272
|
+
description: t('confirm-dialog-description'),
|
|
9273
|
+
confirmLabel: t('confirm-dialog-confirm-label')
|
|
9274
|
+
};
|
|
8994
9275
|
function onChangeTab(action, value, isFormDirty) {
|
|
8995
9276
|
return __awaiter(this, void 0, void 0, function* () {
|
|
8996
9277
|
if (isFormDirty) {
|
|
@@ -9239,6 +9520,9 @@ const TafWrapper = _a => {
|
|
|
9239
9520
|
|
|
9240
9521
|
const getCurrentDate = () => dateUtils.dateToString(dateUtils.utc(), dateUtils.DATE_FORMAT_HOURS);
|
|
9241
9522
|
const TafModule = () => {
|
|
9523
|
+
const {
|
|
9524
|
+
t
|
|
9525
|
+
} = useTafTranslation();
|
|
9242
9526
|
const {
|
|
9243
9527
|
api
|
|
9244
9528
|
} = useApiContext();
|
|
@@ -9249,8 +9533,8 @@ const TafModule = () => {
|
|
|
9249
9533
|
const {
|
|
9250
9534
|
isLoggedIn
|
|
9251
9535
|
} = useAuthenticationContext();
|
|
9252
|
-
const ERROR_AUTH = '
|
|
9253
|
-
const ERROR_AUTH_MESSAGE = '
|
|
9536
|
+
const ERROR_AUTH = t('error-auth');
|
|
9537
|
+
const ERROR_AUTH_MESSAGE = t('error-auth-message');
|
|
9254
9538
|
const fetchNewTafList = () => __awaiter(void 0, void 0, void 0, function* () {
|
|
9255
9539
|
setIsLoading(true);
|
|
9256
9540
|
setErrorMessage(null);
|
|
@@ -9262,7 +9546,7 @@ const TafModule = () => {
|
|
|
9262
9546
|
return result.data;
|
|
9263
9547
|
} catch (error) {
|
|
9264
9548
|
setErrorMessage({
|
|
9265
|
-
title: '
|
|
9549
|
+
title: t('error-list'),
|
|
9266
9550
|
info: error.message
|
|
9267
9551
|
});
|
|
9268
9552
|
setIsLoading(false);
|
|
@@ -9305,7 +9589,7 @@ const TafModule = () => {
|
|
|
9305
9589
|
info: errorMessage.info,
|
|
9306
9590
|
"data-testid": "error-message",
|
|
9307
9591
|
actionButtonProps: errorMessage.title !== ERROR_AUTH ? {
|
|
9308
|
-
title: '
|
|
9592
|
+
title: t('error-title-retry'),
|
|
9309
9593
|
onClick: fetchNewTafList
|
|
9310
9594
|
} : undefined
|
|
9311
9595
|
}) : null, jsx(TafLayout, {
|
|
@@ -10452,4 +10736,4 @@ ConnectedModuleWrapper = null) => {
|
|
|
10452
10736
|
}
|
|
10453
10737
|
};
|
|
10454
10738
|
|
|
10455
|
-
export { TafApiWrapper, TafForm, Wrapper as TafModule, componentsLookUp, createApi$1 as createApi, createApi as createFakeApi, tafScreenPreset,
|
|
10739
|
+
export { TAF_NAMESPACE, TafApiWrapper, TafForm, Wrapper as TafModule, componentsLookUp, createApi$1 as createApi, createApi as createFakeApi, tafScreenPreset, tafTranslations };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@opengeoweb/taf",
|
|
3
|
-
"version": "9.
|
|
3
|
+
"version": "9.22.0",
|
|
4
4
|
"description": "GeoWeb TAF library for the opengeoweb project",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"repository": {
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
"@redux-eggs/redux-toolkit": "^2.2.0",
|
|
13
13
|
"@opengeoweb/shared": "*",
|
|
14
14
|
"react-hook-form": "^7.50.1",
|
|
15
|
-
"@mui/material": "
|
|
15
|
+
"@mui/material": "^5.16.0",
|
|
16
16
|
"@opengeoweb/theme": "*",
|
|
17
17
|
"@redux-eggs/saga-extension": "^2.2.0",
|
|
18
18
|
"@opengeoweb/form-fields": "*",
|
package/src/index.d.ts
CHANGED
|
@@ -4,4 +4,5 @@ export * from './lib/components/TafModule';
|
|
|
4
4
|
export { createApi } from './lib/utils/api';
|
|
5
5
|
export { createApi as createFakeApi } from './lib/utils/fakeApi';
|
|
6
6
|
export * from './lib/components/ComponentsLookUp';
|
|
7
|
+
export { TAF_NAMESPACE } from './lib/utils/i18n';
|
|
7
8
|
export { tafTranslations };
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { FieldError, FieldErrors } from 'react-hook-form';
|
|
2
|
+
import { TFunction } from 'i18next';
|
|
2
3
|
import { CustomErrorField } from './types';
|
|
3
4
|
export declare const getCustomError: (error: FieldError, isChangeGroup: boolean, rowIndex: number) => CustomErrorField;
|
|
4
|
-
export declare const getIssuesLabel: (sumOfErrors: number) => string;
|
|
5
|
+
export declare const getIssuesLabel: (sumOfErrors: number, t: TFunction) => string;
|
|
5
6
|
export declare const getErrorValues: (fieldErrors: FieldErrors, isChangeGroup?: boolean, rowIndex?: number) => FieldError[];
|
|
6
7
|
export declare const filterDuplicateErrors: (errors: CustomErrorField[]) => CustomErrorField[];
|
|
7
8
|
export declare const getErrors: (errors: FieldErrors) => CustomErrorField[];
|
|
@@ -9,9 +9,6 @@ export interface TafThemeApiProviderProps {
|
|
|
9
9
|
theme?: Theme;
|
|
10
10
|
store?: Store;
|
|
11
11
|
}
|
|
12
|
-
interface TafTranslationWrapperProps {
|
|
13
|
-
children?: React.ReactNode;
|
|
14
|
-
}
|
|
15
12
|
export declare const TafThemeApiProvider: React.FC<TafThemeApiProviderProps>;
|
|
16
13
|
interface TafThemeFormProviderProps {
|
|
17
14
|
children: React.ReactNode;
|
|
@@ -19,6 +16,4 @@ interface TafThemeFormProviderProps {
|
|
|
19
16
|
theme?: Theme;
|
|
20
17
|
}
|
|
21
18
|
export declare const TafThemeFormProvider: React.FC<TafThemeFormProviderProps>;
|
|
22
|
-
export declare const TafTranslationsWrapper: React.FC<TafTranslationWrapperProps>;
|
|
23
|
-
export declare const TafI18nProvider: React.FC<TafTranslationWrapperProps>;
|
|
24
19
|
export {};
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { BaseTaf, Taf, TafActions, TafFromBackend, TafFromFrontEnd } from '../../types';
|
|
3
3
|
import { IssuesPanePosition } from '../IssuesPane/types';
|
|
4
|
-
export declare const getSnackbarMessage: (isChecked: boolean, location: string) => string;
|
|
5
4
|
export interface TafFormProps {
|
|
6
5
|
isDisabled?: boolean;
|
|
7
6
|
setIsDisabled?: (isDisabled: boolean) => void;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import Sortable from 'sortablejs';
|
|
2
|
+
import { TFunction } from 'i18next';
|
|
2
3
|
import { BaseForecast, BaseForecastFormData, ChangeGroup, ChangeGroupFormData, TAC, Taf, TafActions, TafFormData, TafStatus } from '../../types';
|
|
3
4
|
import { FieldNames } from './TafFormRow/types';
|
|
4
5
|
import { IssuesPanePosition } from '../IssuesPane/types';
|
|
@@ -26,11 +27,7 @@ export declare function parseFormValues<T extends ChangeGroupFormData | BaseFore
|
|
|
26
27
|
export declare const convertTafValuesToObject: (formData: TafFormData) => Taf;
|
|
27
28
|
export declare const shouldRetrieveTAC: (product: Taf) => boolean;
|
|
28
29
|
export declare const getFieldNames: (isChangeGroup: boolean, index: number) => FieldNames;
|
|
29
|
-
export declare const
|
|
30
|
-
export declare const TAC_NOT_AVAILABLE = "No TAC available";
|
|
31
|
-
export declare const TAC_RETRIEVING_DATA = "Retrieving TAC";
|
|
32
|
-
export declare const TAC_FAILED = "Failed to retrieve TAC";
|
|
33
|
-
export declare const tacHasError: (tac: TAC) => boolean;
|
|
30
|
+
export declare const tacHasError: (tac: TAC, t: TFunction) => boolean;
|
|
34
31
|
export declare const useTACGenerator: (taf: Taf, requestTAC: (postTaf: Taf, getJSON?: boolean, abortSignal?: AbortSignal) => Promise<{
|
|
35
32
|
data: TAC;
|
|
36
33
|
}>, getJSON?: boolean) => [TAC, (tafToPost: Taf) => void, (newTAC: TAC) => void];
|
|
@@ -43,10 +40,10 @@ export declare const useDragOrder: (trigger: (name?: string | string[]) => Promi
|
|
|
43
40
|
onStartDrag: (event: Sortable.SortableEvent) => void;
|
|
44
41
|
activeDraggingIndex: number | boolean;
|
|
45
42
|
};
|
|
46
|
-
export declare const getConfirmationDialogTitle: (action: TafActions) => string;
|
|
43
|
+
export declare const getConfirmationDialogTitle: (action: TafActions, t: TFunction) => string;
|
|
47
44
|
export declare const isTafAmendedCorrectedChanged: (originalTaf: Taf, currentTaf: Taf) => boolean;
|
|
48
|
-
export declare const getConfirmationDialogContent: (action: TafActions, isFormDirty: () => boolean) => string;
|
|
49
|
-
export declare const getConfirmationDialogButtonLabel: (action: TafActions) => string;
|
|
45
|
+
export declare const getConfirmationDialogContent: (action: TafActions, isFormDirty: () => boolean, t: TFunction) => string;
|
|
46
|
+
export declare const getConfirmationDialogButtonLabel: (action: TafActions, t: TFunction) => string;
|
|
50
47
|
export declare const emptyChangegroup: {
|
|
51
48
|
valid: string;
|
|
52
49
|
wind: string;
|
|
@@ -65,7 +62,7 @@ export declare const emptyChangegroup: {
|
|
|
65
62
|
change: string;
|
|
66
63
|
probability: string;
|
|
67
64
|
};
|
|
68
|
-
export declare const getTafStatusLabel: (status: TafStatus, action?: TafActions, isFormDisabled?: boolean) => string;
|
|
65
|
+
export declare const getTafStatusLabel: (t: TFunction, status: TafStatus, action?: TafActions, isFormDisabled?: boolean) => string;
|
|
69
66
|
export declare const getMessageType: (taf: Taf, tafAction: TafActions) => string;
|
|
70
67
|
export declare const getAmendedCorrectedTafTimes: (taf: Taf, tafAction: TafActions) => Taf;
|
|
71
68
|
export declare const createChangeGroup: (changeGroup: ChangeGroupFormData) => ChangeGroupFormData;
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
+
import { TFunction } from 'i18next';
|
|
2
3
|
import { TafFromBackend, TafFromFrontEnd, Taf } from '../../types';
|
|
3
|
-
export declare const
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
4
|
+
export declare const getTafMessageContent: ({ location, validDateStart, messageType, }: Taf) => {
|
|
5
|
+
location: string;
|
|
6
|
+
formattedDate: string;
|
|
7
|
+
messageType: string;
|
|
7
8
|
};
|
|
8
|
-
export declare const
|
|
9
|
-
export declare const getSnackbarMessage: (tafFromFrontEnd: TafFromFrontEnd, isAutoSaved?: boolean) => string;
|
|
9
|
+
export declare const getSnackbarMessage: (tafFromFrontEnd: TafFromFrontEnd, isAutoSaved: boolean, t: TFunction) => string;
|
|
10
10
|
interface TafLayoutProps {
|
|
11
11
|
tafList: TafFromBackend[];
|
|
12
12
|
onUpdateTaf: () => Promise<TafFromBackend[]>;
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { AxiosError } from 'axios';
|
|
3
2
|
import { TafFromBackend, Taf, TafActions, TafStatus, TafFromFrontEnd } from '../../../types';
|
|
4
3
|
import { IssuesPanePosition } from '../../IssuesPane/types';
|
|
5
4
|
export declare const fromActionToStatus: (tafAction: TafActions) => TafStatus;
|
|
@@ -26,7 +25,7 @@ interface TafPanelProps {
|
|
|
26
25
|
tafAction: TafActions;
|
|
27
26
|
}
|
|
28
27
|
export declare const isWarning: (error: TafError) => boolean;
|
|
29
|
-
export declare const usePostTafRequest: (request: (params?: unknown) => Promise<void
|
|
28
|
+
export declare const usePostTafRequest: (request: (params?: unknown) => Promise<void>) => {
|
|
30
29
|
isLoading: boolean;
|
|
31
30
|
error: TafError | undefined;
|
|
32
31
|
setError: (newError: TafError) => void;
|
package/src/lib/utils/i18n.d.ts
CHANGED
|
@@ -1,2 +1,6 @@
|
|
|
1
|
+
import i18n from 'i18next';
|
|
2
|
+
import { UseTranslationResponse } from 'react-i18next';
|
|
1
3
|
export declare const TAF_NAMESPACE = "taf";
|
|
2
4
|
export declare const initTafI18n: () => void;
|
|
5
|
+
export declare const translateKeyOutsideComponents: (key: string, params?: Record<string, string | number> | undefined) => string;
|
|
6
|
+
export declare const useTafTranslation: () => UseTranslationResponse<typeof TAF_NAMESPACE, typeof i18n>;
|