@alexisapp/leave-core 0.0.1-beta.1
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/README.md +260 -0
- package/dist/chunk-P5WZALLT.mjs +1633 -0
- package/dist/chunk-R7NHFDIU.mjs +53 -0
- package/dist/chunk-TUQKZ7GW.mjs +207 -0
- package/dist/chunk-VS74AXZ6.mjs +70 -0
- package/dist/components/index.d.ts +11 -0
- package/dist/components/index.mjs +23 -0
- package/dist/domain/index.d.ts +2 -0
- package/dist/domain/index.mjs +0 -0
- package/dist/en-GB-TSTNTOGN.mjs +81 -0
- package/dist/forms/index.d.ts +2 -0
- package/dist/forms/index.mjs +0 -0
- package/dist/graphql-BI4OTV8N.d.ts +1814 -0
- package/dist/hooks/index.d.ts +50 -0
- package/dist/hooks/index.mjs +106 -0
- package/dist/i18n/index.d.ts +18 -0
- package/dist/i18n/index.mjs +16 -0
- package/dist/index.d.ts +133 -0
- package/dist/index.mjs +109 -0
- package/dist/leaveStatusUtils-C26heVdh.d.ts +11 -0
- package/dist/mutations/index.d.ts +2 -0
- package/dist/mutations/index.mjs +0 -0
- package/dist/queries/index.d.ts +489 -0
- package/dist/queries/index.mjs +15 -0
- package/dist/stores/index.d.ts +2 -0
- package/dist/stores/index.mjs +0 -0
- package/dist/utils/index.d.ts +40 -0
- package/dist/utils/index.mjs +53 -0
- package/package.json +94 -0
- package/src/client/createKyInstance.ts +34 -0
- package/src/client/execute.ts +153 -0
- package/src/client/index.ts +4 -0
- package/src/client/initializeClient.ts +48 -0
- package/src/client/resetClient.ts +10 -0
- package/src/client/types.ts +12 -0
- package/src/components/AsyncBoundary.tsx +29 -0
- package/src/components/index.ts +1 -0
- package/src/domain/index.ts +2 -0
- package/src/errors/AuthError.ts +12 -0
- package/src/errors/DomainError.ts +15 -0
- package/src/errors/GraphQLError.ts +16 -0
- package/src/errors/LeaveError.ts +13 -0
- package/src/errors/NetworkError.ts +12 -0
- package/src/errors/classifyError.ts +46 -0
- package/src/errors/errorMessages.ts +69 -0
- package/src/errors/index.ts +13 -0
- package/src/forms/index.ts +2 -0
- package/src/graphql/codegen-gateway.ts +26 -0
- package/src/graphql/codegen-hr-core.ts +31 -0
- package/src/graphql/generated-gateway/fragment-masking.ts +84 -0
- package/src/graphql/generated-gateway/gql.ts +140 -0
- package/src/graphql/generated-gateway/graphql.ts +10828 -0
- package/src/graphql/generated-gateway/index.ts +2 -0
- package/src/graphql/generated-hr-core/fragment-masking.ts +84 -0
- package/src/graphql/generated-hr-core/gql.ts +185 -0
- package/src/graphql/generated-hr-core/graphql.ts +19385 -0
- package/src/graphql/generated-hr-core/index.ts +2 -0
- package/src/graphql/index.ts +278 -0
- package/src/graphql/operations/gateway/leave-change/mutations.graphql +74 -0
- package/src/graphql/operations/gateway/leave-change/queries.graphql +51 -0
- package/src/graphql/operations/gateway/leave-policy-employee-reference/mutations.graphql +26 -0
- package/src/graphql/operations/gateway/leave-self-certified/mutations.graphql +45 -0
- package/src/graphql/operations/gateway/leave-self-certified/queries.graphql +80 -0
- package/src/graphql/operations/gateway/leave-type-code/mutations.graphql +25 -0
- package/src/graphql/operations/gateway/self-certified-policy/mutations.graphql +29 -0
- package/src/graphql/operations/gateway/self-certified-policy/queries.graphql +34 -0
- package/src/graphql/operations/gateway/time-bank/mutations.graphql +23 -0
- package/src/graphql/operations/gateway/time-bank/queries.graphql +5 -0
- package/src/graphql/operations/gateway/time-off-settings/mutations.graphql +19 -0
- package/src/graphql/operations/gateway/time-off-settings/queries.graphql +15 -0
- package/src/graphql/operations/gateway/user/queries.graphql +11 -0
- package/src/graphql/operations/hr-core/balance/mutations.graphql +34 -0
- package/src/graphql/operations/hr-core/balance/queries.graphql +21 -0
- package/src/graphql/operations/hr-core/employee/queries.graphql +27 -0
- package/src/graphql/operations/hr-core/employment/queries.graphql +40 -0
- package/src/graphql/operations/hr-core/file/mutations.graphql +15 -0
- package/src/graphql/operations/hr-core/group/queries.graphql +13 -0
- package/src/graphql/operations/hr-core/leave/mutations.graphql +68 -0
- package/src/graphql/operations/hr-core/leave/queries.graphql +150 -0
- package/src/graphql/operations/hr-core/leave-type/queries.graphql +33 -0
- package/src/graphql/operations/hr-core/member/queries.graphql +58 -0
- package/src/graphql/operations/hr-core/office/queries.graphql +26 -0
- package/src/graphql/operations/hr-core/policy/mutations.graphql +43 -0
- package/src/graphql/operations/hr-core/policy/queries.graphql +46 -0
- package/src/graphql/operations/hr-core/scope/mutations.graphql +19 -0
- package/src/graphql/operations/hr-core/team/queries.graphql +14 -0
- package/src/graphql/operations/hr-core/user/queries.graphql +37 -0
- package/src/graphql/operations/hr-core/work-calendar/queries.graphql +60 -0
- package/src/graphql/operations/hr-core/work-week/queries.graphql +139 -0
- package/src/hooks/index.ts +3 -0
- package/src/hooks/useBalance.ts +58 -0
- package/src/hooks/useCurrentEmployeeId.ts +15 -0
- package/src/hooks/useLeaveList.ts +91 -0
- package/src/i18n/index.ts +2 -0
- package/src/i18n/instance.ts +52 -0
- package/src/i18n/locale.ts +23 -0
- package/src/i18n/translations/en-GB.json +67 -0
- package/src/index.ts +19 -0
- package/src/mutations/index.ts +2 -0
- package/src/queries/employeeQueryFactory.ts +97 -0
- package/src/queries/index.ts +5 -0
- package/src/queries/leaveQueryFactory.ts +171 -0
- package/src/queries/policyQueryFactory.ts +87 -0
- package/src/queries/settingsQueryFactory.ts +31 -0
- package/src/queries/userQueryFactory.ts +13 -0
- package/src/stores/index.ts +2 -0
- package/src/utils/__tests__/formatDateRangeUtils.test.ts +61 -0
- package/src/utils/__tests__/leaveStatusUtils.test.ts +27 -0
- package/src/utils/__tests__/splitLeaveSectionsUtils.test.ts +71 -0
- package/src/utils/formatDateRangeUtils.ts +71 -0
- package/src/utils/index.ts +8 -0
- package/src/utils/leaveStatusUtils.ts +39 -0
- package/src/utils/splitLeaveSectionsUtils.ts +46 -0
- package/src/utils/typeSafeUtils.ts +4 -0
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
// src/utils/leaveStatusUtils.ts
|
|
2
|
+
function resolveDisplayStatus(leaveId, leaveStatus, changeMap) {
|
|
3
|
+
const changeType = changeMap.get(leaveId);
|
|
4
|
+
if (changeType === "UPDATE") return "PENDING_CHANGES";
|
|
5
|
+
if (changeType === "REVOKE") return "PENDING_REVOKE";
|
|
6
|
+
switch (leaveStatus) {
|
|
7
|
+
case "APPROVED":
|
|
8
|
+
return "APPROVED";
|
|
9
|
+
case "PENDING":
|
|
10
|
+
return "PENDING";
|
|
11
|
+
case "DENIED":
|
|
12
|
+
return "DENIED";
|
|
13
|
+
case "CANCELLED":
|
|
14
|
+
return "CANCELLED";
|
|
15
|
+
default:
|
|
16
|
+
return "PENDING";
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
// src/utils/splitLeaveSectionsUtils.ts
|
|
21
|
+
function splitLeaveSections(items, today) {
|
|
22
|
+
const upcoming = [];
|
|
23
|
+
const history = [];
|
|
24
|
+
for (const item of items) {
|
|
25
|
+
if (item.localEndDate == null || item.localEndDate >= today) {
|
|
26
|
+
upcoming.push(item);
|
|
27
|
+
} else {
|
|
28
|
+
history.push(item);
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
upcoming.sort((a, b) => a.localStartDate.localeCompare(b.localStartDate));
|
|
32
|
+
history.sort((a, b) => b.localStartDate.localeCompare(a.localStartDate));
|
|
33
|
+
return { upcoming, history };
|
|
34
|
+
}
|
|
35
|
+
function getLocalToday() {
|
|
36
|
+
const now = /* @__PURE__ */ new Date();
|
|
37
|
+
const year = now.getFullYear();
|
|
38
|
+
const month = String(now.getMonth() + 1).padStart(2, "0");
|
|
39
|
+
const day = String(now.getDate()).padStart(2, "0");
|
|
40
|
+
return `${year}-${month}-${day}`;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
// src/utils/typeSafeUtils.ts
|
|
44
|
+
var isDefined = (value) => {
|
|
45
|
+
return value !== null && value !== void 0;
|
|
46
|
+
};
|
|
47
|
+
|
|
48
|
+
export {
|
|
49
|
+
resolveDisplayStatus,
|
|
50
|
+
splitLeaveSections,
|
|
51
|
+
getLocalToday,
|
|
52
|
+
isDefined
|
|
53
|
+
};
|
|
@@ -0,0 +1,207 @@
|
|
|
1
|
+
// src/client/createKyInstance.ts
|
|
2
|
+
import ky from "ky";
|
|
3
|
+
function createKyInstance(config) {
|
|
4
|
+
return ky.create({
|
|
5
|
+
hooks: {
|
|
6
|
+
beforeRequest: [
|
|
7
|
+
async (request) => {
|
|
8
|
+
if (config.devToken) {
|
|
9
|
+
request.headers.set("Authorization", `Bearer ${config.devToken}`);
|
|
10
|
+
return;
|
|
11
|
+
}
|
|
12
|
+
if (config.getToken) {
|
|
13
|
+
const token = await config.getToken();
|
|
14
|
+
if (token) {
|
|
15
|
+
request.headers.set("Authorization", `Bearer ${token}`);
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
]
|
|
20
|
+
},
|
|
21
|
+
timeout: 3e4,
|
|
22
|
+
retry: { limit: 2, statusCodes: [408, 429, 500, 502, 503, 504] }
|
|
23
|
+
});
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
// src/client/initializeClient.ts
|
|
27
|
+
var kyInstance = null;
|
|
28
|
+
var clientConfig = null;
|
|
29
|
+
function initializeClient(config) {
|
|
30
|
+
if (kyInstance !== null) {
|
|
31
|
+
throw new Error(
|
|
32
|
+
"[LeavePackage] initializeClient() called but client already exists. Call resetClient() first. If this error appears in production, it likely means two MF remotes are consuming @leave/core simultaneously \u2014 see ADR-011."
|
|
33
|
+
);
|
|
34
|
+
}
|
|
35
|
+
clientConfig = config;
|
|
36
|
+
kyInstance = createKyInstance(config);
|
|
37
|
+
}
|
|
38
|
+
function getKyInstance() {
|
|
39
|
+
return kyInstance;
|
|
40
|
+
}
|
|
41
|
+
function getClientConfig() {
|
|
42
|
+
return clientConfig;
|
|
43
|
+
}
|
|
44
|
+
function _resetInternal() {
|
|
45
|
+
kyInstance = null;
|
|
46
|
+
clientConfig = null;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
// src/client/resetClient.ts
|
|
50
|
+
function resetClient() {
|
|
51
|
+
_resetInternal();
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
// src/errors/LeaveError.ts
|
|
55
|
+
var LeaveError = class extends Error {
|
|
56
|
+
constructor(code, message) {
|
|
57
|
+
super(message);
|
|
58
|
+
this.code = code;
|
|
59
|
+
this.name = "LeaveError";
|
|
60
|
+
}
|
|
61
|
+
};
|
|
62
|
+
|
|
63
|
+
// src/errors/AuthError.ts
|
|
64
|
+
var AuthError = class extends LeaveError {
|
|
65
|
+
constructor(statusCode) {
|
|
66
|
+
super("AUTH_ERROR", statusCode === 401 ? "Session expired" : "Access denied");
|
|
67
|
+
this.statusCode = statusCode;
|
|
68
|
+
this.name = "AuthError";
|
|
69
|
+
}
|
|
70
|
+
};
|
|
71
|
+
|
|
72
|
+
// src/errors/NetworkError.ts
|
|
73
|
+
var NetworkError = class extends LeaveError {
|
|
74
|
+
constructor(cause) {
|
|
75
|
+
super("NETWORK_ERROR", "Unable to reach the server");
|
|
76
|
+
this.cause = cause;
|
|
77
|
+
this.name = "NetworkError";
|
|
78
|
+
}
|
|
79
|
+
};
|
|
80
|
+
|
|
81
|
+
// src/errors/classifyError.ts
|
|
82
|
+
import { HTTPError } from "ky";
|
|
83
|
+
function classifyError(error) {
|
|
84
|
+
if (error instanceof LeaveError) {
|
|
85
|
+
return error;
|
|
86
|
+
}
|
|
87
|
+
if (error instanceof DOMException && error.name === "AbortError") {
|
|
88
|
+
return new LeaveError("ABORT_ERROR", "Request aborted");
|
|
89
|
+
}
|
|
90
|
+
if (error instanceof HTTPError) {
|
|
91
|
+
const status = error.response.status;
|
|
92
|
+
if (status === 401 || status === 403) {
|
|
93
|
+
return new AuthError(status);
|
|
94
|
+
}
|
|
95
|
+
return new NetworkError(error);
|
|
96
|
+
}
|
|
97
|
+
if (error instanceof TypeError) {
|
|
98
|
+
return new NetworkError(error);
|
|
99
|
+
}
|
|
100
|
+
const message = error instanceof Error ? error.message : "An unexpected error occurred";
|
|
101
|
+
return new LeaveError("UNKNOWN_ERROR", message);
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
// src/errors/GraphQLError.ts
|
|
105
|
+
var GraphQLError = class extends LeaveError {
|
|
106
|
+
constructor(errors) {
|
|
107
|
+
super("GRAPHQL_ERROR", errors[0]?.message ?? "Unknown server error");
|
|
108
|
+
this.errors = errors;
|
|
109
|
+
this.name = "GraphQLError";
|
|
110
|
+
}
|
|
111
|
+
};
|
|
112
|
+
|
|
113
|
+
// src/client/execute.ts
|
|
114
|
+
async function executeBase({
|
|
115
|
+
url,
|
|
116
|
+
query,
|
|
117
|
+
variables,
|
|
118
|
+
signal
|
|
119
|
+
}) {
|
|
120
|
+
const kyInstance2 = getKyInstance();
|
|
121
|
+
if (!kyInstance2) {
|
|
122
|
+
throw new Error("GraphQL client not initialized. Call initializeClient() first.");
|
|
123
|
+
}
|
|
124
|
+
const response = await kyInstance2.post(url, {
|
|
125
|
+
json: { query, variables },
|
|
126
|
+
...signal != null && { signal }
|
|
127
|
+
}).json();
|
|
128
|
+
if (response.errors?.length) {
|
|
129
|
+
throw new GraphQLError(response.errors);
|
|
130
|
+
}
|
|
131
|
+
return response.data;
|
|
132
|
+
}
|
|
133
|
+
var GATEWAY_PATH = "/v2/graphql";
|
|
134
|
+
var HR_CORE_PATH = "/graphql";
|
|
135
|
+
function getGatewayUrl() {
|
|
136
|
+
const config = getClientConfig();
|
|
137
|
+
if (!config) {
|
|
138
|
+
throw new Error("GraphQL client not initialized. Call initializeClient() first.");
|
|
139
|
+
}
|
|
140
|
+
const base = config.gatewayEndpoint ?? config.endpoint;
|
|
141
|
+
return `${base}${GATEWAY_PATH}`;
|
|
142
|
+
}
|
|
143
|
+
function getHrCoreUrl() {
|
|
144
|
+
const config = getClientConfig();
|
|
145
|
+
if (!config) {
|
|
146
|
+
throw new Error("GraphQL client not initialized. Call initializeClient() first.");
|
|
147
|
+
}
|
|
148
|
+
return `${config.endpoint}${HR_CORE_PATH}`;
|
|
149
|
+
}
|
|
150
|
+
async function executeWithErrorHandling(fn) {
|
|
151
|
+
try {
|
|
152
|
+
return await fn();
|
|
153
|
+
} catch (error) {
|
|
154
|
+
const classified = classifyError(error);
|
|
155
|
+
if (classified instanceof AuthError) {
|
|
156
|
+
const config = getClientConfig();
|
|
157
|
+
config?.onAuthError?.();
|
|
158
|
+
throw classified;
|
|
159
|
+
}
|
|
160
|
+
throw classified;
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
var executeGateway = async ({
|
|
164
|
+
query,
|
|
165
|
+
variables,
|
|
166
|
+
signal
|
|
167
|
+
}) => {
|
|
168
|
+
const url = getGatewayUrl();
|
|
169
|
+
return executeWithErrorHandling(
|
|
170
|
+
() => executeBase({
|
|
171
|
+
url,
|
|
172
|
+
query,
|
|
173
|
+
variables,
|
|
174
|
+
signal
|
|
175
|
+
})
|
|
176
|
+
);
|
|
177
|
+
};
|
|
178
|
+
var executeHrCore = async ({
|
|
179
|
+
query,
|
|
180
|
+
variables,
|
|
181
|
+
signal
|
|
182
|
+
}) => {
|
|
183
|
+
const url = getHrCoreUrl();
|
|
184
|
+
return executeWithErrorHandling(
|
|
185
|
+
() => executeBase({
|
|
186
|
+
url,
|
|
187
|
+
query,
|
|
188
|
+
variables,
|
|
189
|
+
signal
|
|
190
|
+
})
|
|
191
|
+
);
|
|
192
|
+
};
|
|
193
|
+
var execute = {
|
|
194
|
+
gateway: executeGateway,
|
|
195
|
+
hrCore: executeHrCore
|
|
196
|
+
};
|
|
197
|
+
|
|
198
|
+
export {
|
|
199
|
+
initializeClient,
|
|
200
|
+
resetClient,
|
|
201
|
+
LeaveError,
|
|
202
|
+
AuthError,
|
|
203
|
+
NetworkError,
|
|
204
|
+
classifyError,
|
|
205
|
+
GraphQLError,
|
|
206
|
+
execute
|
|
207
|
+
};
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
// src/i18n/instance.ts
|
|
2
|
+
import i18next from "i18next";
|
|
3
|
+
|
|
4
|
+
// src/i18n/locale.ts
|
|
5
|
+
var Locale = {
|
|
6
|
+
EN: "en-GB",
|
|
7
|
+
SV: "sv-SE",
|
|
8
|
+
NB: "nb-NO",
|
|
9
|
+
DA: "da-DK",
|
|
10
|
+
FI: "fi-FI"
|
|
11
|
+
};
|
|
12
|
+
var supportedLocales = Object.values(Locale);
|
|
13
|
+
var LanguageCodeToLocale = {
|
|
14
|
+
en: Locale.EN,
|
|
15
|
+
sv: Locale.SV,
|
|
16
|
+
nb: Locale.NB,
|
|
17
|
+
da: Locale.DA,
|
|
18
|
+
fi: Locale.FI
|
|
19
|
+
};
|
|
20
|
+
function resolveLocale(input) {
|
|
21
|
+
return LanguageCodeToLocale[input] ?? Locale.EN;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
// src/i18n/instance.ts
|
|
25
|
+
var instance = null;
|
|
26
|
+
async function initLeaveI18n(locale = Locale.EN) {
|
|
27
|
+
if (instance) {
|
|
28
|
+
if (instance.language !== locale) {
|
|
29
|
+
await instance.changeLanguage(locale);
|
|
30
|
+
}
|
|
31
|
+
return instance;
|
|
32
|
+
}
|
|
33
|
+
instance = i18next.createInstance();
|
|
34
|
+
await instance.init({
|
|
35
|
+
compatibilityJSON: "v4",
|
|
36
|
+
lng: locale,
|
|
37
|
+
fallbackLng: Locale.EN,
|
|
38
|
+
supportedLngs: supportedLocales,
|
|
39
|
+
load: "currentOnly",
|
|
40
|
+
interpolation: { escapeValue: false },
|
|
41
|
+
resources: {
|
|
42
|
+
"en-GB": {
|
|
43
|
+
translation: (await import("./en-GB-TSTNTOGN.mjs")).default
|
|
44
|
+
}
|
|
45
|
+
// Phase 2: uncomment when sv translations are complete
|
|
46
|
+
// sv: {
|
|
47
|
+
// translation: (await import('./translations/sv.json')).default,
|
|
48
|
+
// },
|
|
49
|
+
}
|
|
50
|
+
});
|
|
51
|
+
return instance;
|
|
52
|
+
}
|
|
53
|
+
function getLeaveI18n() {
|
|
54
|
+
if (!instance) {
|
|
55
|
+
throw new Error("[LeavePackage] Leave i18n not initialized. Call initLeaveI18n() first.");
|
|
56
|
+
}
|
|
57
|
+
return instance;
|
|
58
|
+
}
|
|
59
|
+
function resetLeaveI18n() {
|
|
60
|
+
instance = null;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
export {
|
|
64
|
+
Locale,
|
|
65
|
+
supportedLocales,
|
|
66
|
+
resolveLocale,
|
|
67
|
+
initLeaveI18n,
|
|
68
|
+
getLeaveI18n,
|
|
69
|
+
resetLeaveI18n
|
|
70
|
+
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { ReactNode, JSX } from 'react';
|
|
2
|
+
import { ErrorBoundaryProps } from 'react-error-boundary';
|
|
3
|
+
|
|
4
|
+
interface AsyncBoundaryProps {
|
|
5
|
+
suspenseFallback?: ReactNode;
|
|
6
|
+
errorBoundaryProps: ErrorBoundaryProps;
|
|
7
|
+
children?: ReactNode;
|
|
8
|
+
}
|
|
9
|
+
declare const AsyncBoundary: ({ suspenseFallback, errorBoundaryProps, children, }: AsyncBoundaryProps) => JSX.Element;
|
|
10
|
+
|
|
11
|
+
export { AsyncBoundary };
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
// src/components/AsyncBoundary.tsx
|
|
2
|
+
import { QueryErrorResetBoundary } from "@tanstack/react-query";
|
|
3
|
+
import { Suspense } from "react";
|
|
4
|
+
import { ErrorBoundary } from "react-error-boundary";
|
|
5
|
+
import { jsx } from "react/jsx-runtime";
|
|
6
|
+
var AsyncBoundary = ({
|
|
7
|
+
suspenseFallback,
|
|
8
|
+
errorBoundaryProps,
|
|
9
|
+
children
|
|
10
|
+
}) => /* @__PURE__ */ jsx(QueryErrorResetBoundary, { children: ({ reset }) => /* @__PURE__ */ jsx(
|
|
11
|
+
ErrorBoundary,
|
|
12
|
+
{
|
|
13
|
+
...errorBoundaryProps,
|
|
14
|
+
onReset: (...args) => {
|
|
15
|
+
reset();
|
|
16
|
+
errorBoundaryProps.onReset?.(...args);
|
|
17
|
+
},
|
|
18
|
+
children: /* @__PURE__ */ jsx(Suspense, { fallback: suspenseFallback, children })
|
|
19
|
+
}
|
|
20
|
+
) });
|
|
21
|
+
export {
|
|
22
|
+
AsyncBoundary
|
|
23
|
+
};
|
|
File without changes
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
// src/i18n/translations/en-GB.json
|
|
2
|
+
var errors = {
|
|
3
|
+
UNEXPECTED_ERROR: {
|
|
4
|
+
title: "Something went wrong",
|
|
5
|
+
description: "An unexpected error occurred. Please try again."
|
|
6
|
+
},
|
|
7
|
+
CONNECTION_FAILURE: {
|
|
8
|
+
title: "Connection failed",
|
|
9
|
+
description: "Unable to reach the server. Check your connection and try again."
|
|
10
|
+
},
|
|
11
|
+
BAD_REQUEST: {
|
|
12
|
+
title: "Invalid request",
|
|
13
|
+
description: "The request could not be processed."
|
|
14
|
+
},
|
|
15
|
+
NOT_FOUND: {
|
|
16
|
+
title: "Not found",
|
|
17
|
+
description: "The requested resource was not found."
|
|
18
|
+
},
|
|
19
|
+
SYSTEM_FAILURE: {
|
|
20
|
+
title: "Server error",
|
|
21
|
+
description: "A server error occurred. Please try again later."
|
|
22
|
+
},
|
|
23
|
+
UNAUTHORIZED: {
|
|
24
|
+
title: "Session expired",
|
|
25
|
+
description: "Your session has expired. Please sign in again."
|
|
26
|
+
},
|
|
27
|
+
FORBIDDEN: {
|
|
28
|
+
title: "Access denied",
|
|
29
|
+
description: "You do not have permission to access this resource."
|
|
30
|
+
}
|
|
31
|
+
};
|
|
32
|
+
var retry = "Retry";
|
|
33
|
+
var close = "Close";
|
|
34
|
+
var balance = {
|
|
35
|
+
remaining: {
|
|
36
|
+
label: "Remaining",
|
|
37
|
+
subtitle: "vacation days"
|
|
38
|
+
},
|
|
39
|
+
spent: {
|
|
40
|
+
label: "Spent",
|
|
41
|
+
subtitle: "vacation days"
|
|
42
|
+
},
|
|
43
|
+
saved: {
|
|
44
|
+
label: "Saved",
|
|
45
|
+
subtitle: "vacation days"
|
|
46
|
+
},
|
|
47
|
+
unpaid: {
|
|
48
|
+
label: "Unpaid",
|
|
49
|
+
subtitle: "days left"
|
|
50
|
+
}
|
|
51
|
+
};
|
|
52
|
+
var leave = {
|
|
53
|
+
upcoming: "Upcoming",
|
|
54
|
+
history: "History",
|
|
55
|
+
emptyTitle: "No leave requests",
|
|
56
|
+
emptyDescription: "Your leave requests will appear here",
|
|
57
|
+
ongoing: "ongoing",
|
|
58
|
+
status: {
|
|
59
|
+
APPROVED: "Approved",
|
|
60
|
+
PENDING: "Pending",
|
|
61
|
+
DENIED: "Denied",
|
|
62
|
+
CANCELLED: "Cancelled",
|
|
63
|
+
PENDING_CHANGES: "Pending changes",
|
|
64
|
+
PENDING_REVOKE: "Pending revoke"
|
|
65
|
+
}
|
|
66
|
+
};
|
|
67
|
+
var en_GB_default = {
|
|
68
|
+
errors,
|
|
69
|
+
retry,
|
|
70
|
+
close,
|
|
71
|
+
balance,
|
|
72
|
+
leave
|
|
73
|
+
};
|
|
74
|
+
export {
|
|
75
|
+
balance,
|
|
76
|
+
close,
|
|
77
|
+
en_GB_default as default,
|
|
78
|
+
errors,
|
|
79
|
+
leave,
|
|
80
|
+
retry
|
|
81
|
+
};
|
|
File without changes
|