@masterteam/system-settings 0.0.9 → 0.0.11
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 +34 -34
- package/assets/i18n/ar.json +24 -0
- package/assets/i18n/en.json +24 -0
- package/assets/system-settings.css +2 -2
- package/fesm2022/masterteam-system-settings.mjs +218 -162
- package/fesm2022/masterteam-system-settings.mjs.map +1 -1
- package/package.json +2 -2
- package/types/masterteam-system-settings.d.ts +95 -60
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@masterteam/system-settings",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.11",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"directory": "../../../dist/masterteam/system-settings",
|
|
6
6
|
"linkDirectory": false,
|
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
"rxjs": "^7.8.2",
|
|
20
20
|
"tailwindcss": "^4.2.2",
|
|
21
21
|
"tailwindcss-primeui": "^0.6.1",
|
|
22
|
-
"@masterteam/components": "^0.0.
|
|
22
|
+
"@masterteam/components": "^0.0.231",
|
|
23
23
|
"@masterteam/icons": "^0.0.17"
|
|
24
24
|
},
|
|
25
25
|
"sideEffects": false,
|
|
@@ -76,28 +76,34 @@ interface SmtpSettingValue extends SystemSettingObject {
|
|
|
76
76
|
host: string;
|
|
77
77
|
port: number | null;
|
|
78
78
|
}
|
|
79
|
+
/** The landing view the app-client explore page opens with. */
|
|
80
|
+
type ExploreDefaultView = 'cards' | 'timeline';
|
|
81
|
+
/**
|
|
82
|
+
* General Configuration is persisted **inside the existing `Identity` record**
|
|
83
|
+
* (the same record `@masterteam/brand-display` owns), not under a key of its own.
|
|
84
|
+
* It is therefore a *slice* of `Identity`: reads pick these fields out, and saves
|
|
85
|
+
* must spread the untouched `Identity` value around them so no branding data is
|
|
86
|
+
* lost. See `GENERAL_CONFIGURATION_SETTING_KEY`.
|
|
87
|
+
*/
|
|
88
|
+
interface GeneralConfigurationSettingValue extends SystemSettingObject {
|
|
89
|
+
defaultExploreView: ExploreDefaultView;
|
|
90
|
+
}
|
|
91
|
+
/** The settings record General Configuration fields live in. */
|
|
92
|
+
declare const GENERAL_CONFIGURATION_SETTING_KEY = "Identity";
|
|
93
|
+
type TimeSheetFrequency = 'Daily' | 'Weekly' | 'BiWeekly' | 'Monthly';
|
|
79
94
|
interface TimeSheetPolicySettingValue extends SystemSettingObject {
|
|
80
|
-
|
|
81
|
-
generationEnabled: boolean;
|
|
82
|
-
manualGenerationEnabled: boolean;
|
|
83
|
-
regularDailyHours: number;
|
|
95
|
+
frequency: TimeSheetFrequency;
|
|
84
96
|
maxDailyHours: number;
|
|
85
|
-
allowOvertime: boolean;
|
|
86
|
-
requireOvertimeReason: boolean;
|
|
87
97
|
requireDescription: boolean;
|
|
88
98
|
allowFutureEntry: boolean;
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
allowZeroHourSubmit: boolean;
|
|
93
|
-
costEnabled: boolean;
|
|
94
|
-
rateSource: string;
|
|
99
|
+
allowBackdatedEntry: boolean;
|
|
100
|
+
autoLockOnApprove: boolean;
|
|
101
|
+
submissionDeadlineDays: number;
|
|
95
102
|
}
|
|
96
103
|
interface GlobalWorkingHoursSettingValue extends SystemSettingObject {
|
|
97
104
|
timeZoneId: string;
|
|
98
|
-
workDayStartMinute: number;
|
|
99
|
-
workDayEndMinute: number;
|
|
100
105
|
workingDays: number[];
|
|
106
|
+
hoursPerDay: number;
|
|
101
107
|
holidays: string[];
|
|
102
108
|
}
|
|
103
109
|
interface CurrencyCatalogItem {
|
|
@@ -114,6 +120,10 @@ interface SelectOption {
|
|
|
114
120
|
interface WeekendDayOption extends SelectOption {
|
|
115
121
|
dayNumber: number;
|
|
116
122
|
}
|
|
123
|
+
/** A `SelectOption` rendered as a radio card, so it carries its own icon. */
|
|
124
|
+
interface IconSelectOption extends SelectOption {
|
|
125
|
+
icon: string;
|
|
126
|
+
}
|
|
117
127
|
interface ScheduleItemTypeOption extends SelectOption {
|
|
118
128
|
itemType: string;
|
|
119
129
|
}
|
|
@@ -125,6 +135,7 @@ interface HolidayTableRow {
|
|
|
125
135
|
to: string;
|
|
126
136
|
}
|
|
127
137
|
interface SystemSettingsSnapshot {
|
|
138
|
+
generalConfiguration: GeneralConfigurationSettingValue;
|
|
128
139
|
holidays: HolidaysSettingValue;
|
|
129
140
|
timezone: TimezoneSettingValue;
|
|
130
141
|
currency: CurrencySettingValue;
|
|
@@ -134,6 +145,9 @@ interface SystemSettingsSnapshot {
|
|
|
134
145
|
globalWorkingHours: GlobalWorkingHoursSettingValue;
|
|
135
146
|
}
|
|
136
147
|
type SystemSettingsForm = FormGroup<{
|
|
148
|
+
generalConfiguration: FormGroup<{
|
|
149
|
+
defaultExploreView: FormControl<ExploreDefaultView>;
|
|
150
|
+
}>;
|
|
137
151
|
timezone: FormGroup<{
|
|
138
152
|
regionId: FormControl<string | null>;
|
|
139
153
|
dateFormat: FormControl<string | null>;
|
|
@@ -154,31 +168,36 @@ type SystemSettingsForm = FormGroup<{
|
|
|
154
168
|
port: FormControl<string>;
|
|
155
169
|
}>;
|
|
156
170
|
timeSheetPolicy: FormGroup<{
|
|
157
|
-
|
|
158
|
-
generationEnabled: FormControl<boolean>;
|
|
159
|
-
manualGenerationEnabled: FormControl<boolean>;
|
|
160
|
-
regularDailyHours: FormControl<number | null>;
|
|
171
|
+
frequency: FormControl<TimeSheetFrequency | null>;
|
|
161
172
|
maxDailyHours: FormControl<number | null>;
|
|
162
|
-
allowOvertime: FormControl<boolean>;
|
|
163
|
-
requireOvertimeReason: FormControl<boolean>;
|
|
164
173
|
requireDescription: FormControl<boolean>;
|
|
165
174
|
allowFutureEntry: FormControl<boolean>;
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
allowZeroHourSubmit: FormControl<boolean>;
|
|
170
|
-
costEnabled: FormControl<boolean>;
|
|
171
|
-
rateSource: FormControl<string | null>;
|
|
175
|
+
allowBackdatedEntry: FormControl<boolean>;
|
|
176
|
+
autoLockOnApprove: FormControl<boolean>;
|
|
177
|
+
submissionDeadlineDays: FormControl<number | null>;
|
|
172
178
|
}>;
|
|
173
179
|
globalWorkingHours: FormGroup<{
|
|
174
180
|
timeZoneId: FormControl<string | null>;
|
|
175
|
-
workDayStart: FormControl<string>;
|
|
176
|
-
workDayEnd: FormControl<string>;
|
|
177
181
|
workingDays: FormControl<number[]>;
|
|
182
|
+
hoursPerDay: FormControl<number | null>;
|
|
178
183
|
holidaysCsv: FormControl<string>;
|
|
179
184
|
}>;
|
|
180
185
|
}>;
|
|
181
186
|
declare const FIXED_CURRENCIES: CurrencyCatalogItem[];
|
|
187
|
+
/**
|
|
188
|
+
* Explore landing views, mirroring the app-client explore header switcher
|
|
189
|
+
* (same icons) so the configured default reads as the same choice.
|
|
190
|
+
*/
|
|
191
|
+
declare const EXPLORE_DEFAULT_VIEW_OPTIONS: readonly [{
|
|
192
|
+
readonly id: "cards";
|
|
193
|
+
readonly translationKey: "explore-default-view-cards";
|
|
194
|
+
readonly icon: "layout.grid-01";
|
|
195
|
+
}, {
|
|
196
|
+
readonly id: "timeline";
|
|
197
|
+
readonly translationKey: "explore-default-view-timeline";
|
|
198
|
+
readonly icon: "time.clock";
|
|
199
|
+
}];
|
|
200
|
+
declare const DEFAULT_GENERAL_CONFIGURATION: GeneralConfigurationSettingValue;
|
|
182
201
|
declare const DEFAULT_DATE_FORMAT_OPTIONS: FormatSchemaOption[];
|
|
183
202
|
declare const DEFAULT_TIME_FORMAT_OPTIONS: FormatSchemaOption[];
|
|
184
203
|
declare const WEEKEND_DAY_DEFINITIONS: readonly [{
|
|
@@ -225,6 +244,19 @@ declare const DOTNET_DAY_DEFINITIONS: readonly [{
|
|
|
225
244
|
readonly dayNumber: 6;
|
|
226
245
|
readonly translationKey: "saturday";
|
|
227
246
|
}];
|
|
247
|
+
declare const TIMESHEET_FREQUENCY_OPTIONS: readonly [{
|
|
248
|
+
readonly id: "Daily";
|
|
249
|
+
readonly translationKey: "frequency-daily";
|
|
250
|
+
}, {
|
|
251
|
+
readonly id: "Weekly";
|
|
252
|
+
readonly translationKey: "frequency-weekly";
|
|
253
|
+
}, {
|
|
254
|
+
readonly id: "BiWeekly";
|
|
255
|
+
readonly translationKey: "frequency-biweekly";
|
|
256
|
+
}, {
|
|
257
|
+
readonly id: "Monthly";
|
|
258
|
+
readonly translationKey: "frequency-monthly";
|
|
259
|
+
}];
|
|
228
260
|
declare const SCHEDULE_ITEM_TYPE_OPTIONS: readonly [{
|
|
229
261
|
readonly itemType: "Task";
|
|
230
262
|
readonly translationKey: "schedule-item-task";
|
|
@@ -276,6 +308,9 @@ declare class SystemSettings implements OnInit {
|
|
|
276
308
|
readonly selectedTimeFormat: _angular_core.Signal<string | null>;
|
|
277
309
|
readonly selectedCurrencyCode: _angular_core.Signal<string | null>;
|
|
278
310
|
readonly formValue: _angular_core.Signal<Partial<{
|
|
311
|
+
generalConfiguration: Partial<{
|
|
312
|
+
defaultExploreView: ExploreDefaultView;
|
|
313
|
+
}>;
|
|
279
314
|
timezone: Partial<{
|
|
280
315
|
regionId: string | null;
|
|
281
316
|
dateFormat: string | null;
|
|
@@ -296,30 +331,24 @@ declare class SystemSettings implements OnInit {
|
|
|
296
331
|
port: string;
|
|
297
332
|
}>;
|
|
298
333
|
timeSheetPolicy: Partial<{
|
|
299
|
-
|
|
300
|
-
generationEnabled: boolean;
|
|
301
|
-
manualGenerationEnabled: boolean;
|
|
302
|
-
regularDailyHours: number | null;
|
|
334
|
+
frequency: TimeSheetFrequency | null;
|
|
303
335
|
maxDailyHours: number | null;
|
|
304
|
-
allowOvertime: boolean;
|
|
305
|
-
requireOvertimeReason: boolean;
|
|
306
336
|
requireDescription: boolean;
|
|
307
337
|
allowFutureEntry: boolean;
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
allowZeroHourSubmit: boolean;
|
|
312
|
-
costEnabled: boolean;
|
|
313
|
-
rateSource: string | null;
|
|
338
|
+
allowBackdatedEntry: boolean;
|
|
339
|
+
autoLockOnApprove: boolean;
|
|
340
|
+
submissionDeadlineDays: number | null;
|
|
314
341
|
}>;
|
|
315
342
|
globalWorkingHours: Partial<{
|
|
316
343
|
timeZoneId: string | null;
|
|
317
|
-
workDayStart: string;
|
|
318
|
-
workDayEnd: string;
|
|
319
344
|
workingDays: number[];
|
|
345
|
+
hoursPerDay: number | null;
|
|
320
346
|
holidaysCsv: string;
|
|
321
347
|
}>;
|
|
322
348
|
}> | {
|
|
349
|
+
generalConfiguration: {
|
|
350
|
+
defaultExploreView: ExploreDefaultView;
|
|
351
|
+
};
|
|
323
352
|
timezone: {
|
|
324
353
|
regionId: string | null;
|
|
325
354
|
dateFormat: string | null;
|
|
@@ -340,30 +369,27 @@ declare class SystemSettings implements OnInit {
|
|
|
340
369
|
port: string;
|
|
341
370
|
};
|
|
342
371
|
timeSheetPolicy: {
|
|
343
|
-
|
|
344
|
-
generationEnabled: boolean;
|
|
345
|
-
manualGenerationEnabled: boolean;
|
|
346
|
-
regularDailyHours: number | null;
|
|
372
|
+
frequency: TimeSheetFrequency | null;
|
|
347
373
|
maxDailyHours: number | null;
|
|
348
|
-
allowOvertime: boolean;
|
|
349
|
-
requireOvertimeReason: boolean;
|
|
350
374
|
requireDescription: boolean;
|
|
351
375
|
allowFutureEntry: boolean;
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
allowZeroHourSubmit: boolean;
|
|
356
|
-
costEnabled: boolean;
|
|
357
|
-
rateSource: string | null;
|
|
376
|
+
allowBackdatedEntry: boolean;
|
|
377
|
+
autoLockOnApprove: boolean;
|
|
378
|
+
submissionDeadlineDays: number | null;
|
|
358
379
|
};
|
|
359
380
|
globalWorkingHours: {
|
|
360
381
|
timeZoneId: string | null;
|
|
361
|
-
workDayStart: string;
|
|
362
|
-
workDayEnd: string;
|
|
363
382
|
workingDays: number[];
|
|
383
|
+
hoursPerDay: number | null;
|
|
364
384
|
holidaysCsv: string;
|
|
365
385
|
};
|
|
366
386
|
}>;
|
|
387
|
+
/**
|
|
388
|
+
* The `Identity` record. It is shared with `@masterteam/brand-display`, which
|
|
389
|
+
* owns every other field in it — we only read/write the General Configuration
|
|
390
|
+
* slice and must preserve the rest verbatim.
|
|
391
|
+
*/
|
|
392
|
+
readonly generalConfigurationSetting: _angular_core.Signal<SystemSetting | null>;
|
|
367
393
|
readonly holidaysSetting: _angular_core.Signal<SystemSetting | null>;
|
|
368
394
|
readonly timezoneSetting: _angular_core.Signal<SystemSetting | null>;
|
|
369
395
|
readonly currencySetting: _angular_core.Signal<SystemSetting | null>;
|
|
@@ -386,8 +412,8 @@ declare class SystemSettings implements OnInit {
|
|
|
386
412
|
readonly currencyFormatOptions: _angular_core.Signal<SelectOption[]>;
|
|
387
413
|
readonly weekendOptions: _angular_core.Signal<WeekendDayOption[]>;
|
|
388
414
|
readonly dotnetDayOptions: _angular_core.Signal<WeekendDayOption[]>;
|
|
389
|
-
readonly
|
|
390
|
-
readonly
|
|
415
|
+
readonly exploreDefaultViewOptions: _angular_core.Signal<IconSelectOption[]>;
|
|
416
|
+
readonly frequencyOptions: _angular_core.Signal<SelectOption[]>;
|
|
391
417
|
readonly isReady: _angular_core.Signal<boolean>;
|
|
392
418
|
readonly isLoading: _angular_core.Signal<boolean>;
|
|
393
419
|
readonly hasChanges: _angular_core.Signal<boolean>;
|
|
@@ -407,11 +433,19 @@ declare class SystemSettings implements OnInit {
|
|
|
407
433
|
private buildCurrentSnapshot;
|
|
408
434
|
private buildTimezoneValue;
|
|
409
435
|
private buildCurrencyValue;
|
|
436
|
+
/**
|
|
437
|
+
* The `Identity` value exactly as last returned by the API (or written by a
|
|
438
|
+
* previous save in this session), used as the base every save merges onto so
|
|
439
|
+
* branding fields this page does not model survive round-trips.
|
|
440
|
+
*/
|
|
441
|
+
private getIdentityRecord;
|
|
442
|
+
private buildGeneralConfigurationValue;
|
|
410
443
|
private buildWeekendValue;
|
|
411
444
|
private buildSmtpValue;
|
|
412
445
|
private buildTimeSheetPolicyValue;
|
|
413
446
|
private buildGlobalWorkingHoursValue;
|
|
414
447
|
private findSettingByKey;
|
|
448
|
+
private extractGeneralConfigurationValue;
|
|
415
449
|
private extractHolidaysValue;
|
|
416
450
|
private extractTimezoneValue;
|
|
417
451
|
private extractCurrencyValue;
|
|
@@ -422,6 +456,7 @@ declare class SystemSettings implements OnInit {
|
|
|
422
456
|
private normalizeHolidayItem;
|
|
423
457
|
private normalizeTimezoneRegion;
|
|
424
458
|
private normalizeCurrencyUnit;
|
|
459
|
+
private normalizeGeneralConfigurationSnapshot;
|
|
425
460
|
private normalizeTimezoneSnapshot;
|
|
426
461
|
private normalizeCurrencySnapshot;
|
|
427
462
|
private normalizeWeekendSnapshot;
|
|
@@ -473,5 +508,5 @@ declare class SystemSettingsHolidayEditor {
|
|
|
473
508
|
static ɵcmp: _angular_core.ɵɵComponentDeclaration<SystemSettingsHolidayEditor, "mt-system-settings-holiday-editor", never, { "holiday": { "alias": "holiday"; "required": false; "isSignal": true; }; "isEditMode": { "alias": "isEditMode"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
|
|
474
509
|
}
|
|
475
510
|
|
|
476
|
-
export { DEFAULT_DATE_FORMAT_OPTIONS, DEFAULT_TIME_FORMAT_OPTIONS, DOTNET_DAY_DEFINITIONS, FIXED_CURRENCIES, RATE_SOURCE_OPTIONS, SCHEDULE_ITEM_TYPE_OPTIONS, SystemSettings, SystemSettingsHolidayEditor, WEEKEND_DAY_DEFINITIONS };
|
|
477
|
-
export type { ApiResponse, CurrencyCatalogItem, CurrencySettingValue, CurrencyUnitLabel, FormatSchemaOption, GlobalWorkingHoursSettingValue, HolidayItem, HolidayTableRow, HolidaysSettingValue, ScheduleItemTypeOption, SelectOption, SmtpSettingValue, SystemSetting, SystemSettingObject, SystemSettingPrimitive, SystemSettingValue, SystemSettingsForm, SystemSettingsFormatSchema, SystemSettingsSnapshot, TimeSheetPolicySettingValue, TimezoneRegionOption, TimezoneSettingValue, UpdateSystemSettingItem, WeekendDayOption, WeekendSettingValue };
|
|
511
|
+
export { DEFAULT_DATE_FORMAT_OPTIONS, DEFAULT_GENERAL_CONFIGURATION, DEFAULT_TIME_FORMAT_OPTIONS, DOTNET_DAY_DEFINITIONS, EXPLORE_DEFAULT_VIEW_OPTIONS, FIXED_CURRENCIES, GENERAL_CONFIGURATION_SETTING_KEY, RATE_SOURCE_OPTIONS, SCHEDULE_ITEM_TYPE_OPTIONS, SystemSettings, SystemSettingsHolidayEditor, TIMESHEET_FREQUENCY_OPTIONS, WEEKEND_DAY_DEFINITIONS };
|
|
512
|
+
export type { ApiResponse, CurrencyCatalogItem, CurrencySettingValue, CurrencyUnitLabel, ExploreDefaultView, FormatSchemaOption, GeneralConfigurationSettingValue, GlobalWorkingHoursSettingValue, HolidayItem, HolidayTableRow, HolidaysSettingValue, IconSelectOption, ScheduleItemTypeOption, SelectOption, SmtpSettingValue, SystemSetting, SystemSettingObject, SystemSettingPrimitive, SystemSettingValue, SystemSettingsForm, SystemSettingsFormatSchema, SystemSettingsSnapshot, TimeSheetFrequency, TimeSheetPolicySettingValue, TimezoneRegionOption, TimezoneSettingValue, UpdateSystemSettingItem, WeekendDayOption, WeekendSettingValue };
|