@masterteam/system-settings 0.0.10 → 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/assets/i18n/ar.json +6 -0
- package/assets/i18n/en.json +6 -0
- package/assets/system-settings.css +1 -1
- package/fesm2022/masterteam-system-settings.mjs +128 -8
- package/fesm2022/masterteam-system-settings.mjs.map +1 -1
- package/package.json +2 -2
- package/types/masterteam-system-settings.d.ts +60 -2
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,6 +76,20 @@ 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";
|
|
79
93
|
type TimeSheetFrequency = 'Daily' | 'Weekly' | 'BiWeekly' | 'Monthly';
|
|
80
94
|
interface TimeSheetPolicySettingValue extends SystemSettingObject {
|
|
81
95
|
frequency: TimeSheetFrequency;
|
|
@@ -106,6 +120,10 @@ interface SelectOption {
|
|
|
106
120
|
interface WeekendDayOption extends SelectOption {
|
|
107
121
|
dayNumber: number;
|
|
108
122
|
}
|
|
123
|
+
/** A `SelectOption` rendered as a radio card, so it carries its own icon. */
|
|
124
|
+
interface IconSelectOption extends SelectOption {
|
|
125
|
+
icon: string;
|
|
126
|
+
}
|
|
109
127
|
interface ScheduleItemTypeOption extends SelectOption {
|
|
110
128
|
itemType: string;
|
|
111
129
|
}
|
|
@@ -117,6 +135,7 @@ interface HolidayTableRow {
|
|
|
117
135
|
to: string;
|
|
118
136
|
}
|
|
119
137
|
interface SystemSettingsSnapshot {
|
|
138
|
+
generalConfiguration: GeneralConfigurationSettingValue;
|
|
120
139
|
holidays: HolidaysSettingValue;
|
|
121
140
|
timezone: TimezoneSettingValue;
|
|
122
141
|
currency: CurrencySettingValue;
|
|
@@ -126,6 +145,9 @@ interface SystemSettingsSnapshot {
|
|
|
126
145
|
globalWorkingHours: GlobalWorkingHoursSettingValue;
|
|
127
146
|
}
|
|
128
147
|
type SystemSettingsForm = FormGroup<{
|
|
148
|
+
generalConfiguration: FormGroup<{
|
|
149
|
+
defaultExploreView: FormControl<ExploreDefaultView>;
|
|
150
|
+
}>;
|
|
129
151
|
timezone: FormGroup<{
|
|
130
152
|
regionId: FormControl<string | null>;
|
|
131
153
|
dateFormat: FormControl<string | null>;
|
|
@@ -162,6 +184,20 @@ type SystemSettingsForm = FormGroup<{
|
|
|
162
184
|
}>;
|
|
163
185
|
}>;
|
|
164
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;
|
|
165
201
|
declare const DEFAULT_DATE_FORMAT_OPTIONS: FormatSchemaOption[];
|
|
166
202
|
declare const DEFAULT_TIME_FORMAT_OPTIONS: FormatSchemaOption[];
|
|
167
203
|
declare const WEEKEND_DAY_DEFINITIONS: readonly [{
|
|
@@ -272,6 +308,9 @@ declare class SystemSettings implements OnInit {
|
|
|
272
308
|
readonly selectedTimeFormat: _angular_core.Signal<string | null>;
|
|
273
309
|
readonly selectedCurrencyCode: _angular_core.Signal<string | null>;
|
|
274
310
|
readonly formValue: _angular_core.Signal<Partial<{
|
|
311
|
+
generalConfiguration: Partial<{
|
|
312
|
+
defaultExploreView: ExploreDefaultView;
|
|
313
|
+
}>;
|
|
275
314
|
timezone: Partial<{
|
|
276
315
|
regionId: string | null;
|
|
277
316
|
dateFormat: string | null;
|
|
@@ -307,6 +346,9 @@ declare class SystemSettings implements OnInit {
|
|
|
307
346
|
holidaysCsv: string;
|
|
308
347
|
}>;
|
|
309
348
|
}> | {
|
|
349
|
+
generalConfiguration: {
|
|
350
|
+
defaultExploreView: ExploreDefaultView;
|
|
351
|
+
};
|
|
310
352
|
timezone: {
|
|
311
353
|
regionId: string | null;
|
|
312
354
|
dateFormat: string | null;
|
|
@@ -342,6 +384,12 @@ declare class SystemSettings implements OnInit {
|
|
|
342
384
|
holidaysCsv: string;
|
|
343
385
|
};
|
|
344
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>;
|
|
345
393
|
readonly holidaysSetting: _angular_core.Signal<SystemSetting | null>;
|
|
346
394
|
readonly timezoneSetting: _angular_core.Signal<SystemSetting | null>;
|
|
347
395
|
readonly currencySetting: _angular_core.Signal<SystemSetting | null>;
|
|
@@ -364,6 +412,7 @@ declare class SystemSettings implements OnInit {
|
|
|
364
412
|
readonly currencyFormatOptions: _angular_core.Signal<SelectOption[]>;
|
|
365
413
|
readonly weekendOptions: _angular_core.Signal<WeekendDayOption[]>;
|
|
366
414
|
readonly dotnetDayOptions: _angular_core.Signal<WeekendDayOption[]>;
|
|
415
|
+
readonly exploreDefaultViewOptions: _angular_core.Signal<IconSelectOption[]>;
|
|
367
416
|
readonly frequencyOptions: _angular_core.Signal<SelectOption[]>;
|
|
368
417
|
readonly isReady: _angular_core.Signal<boolean>;
|
|
369
418
|
readonly isLoading: _angular_core.Signal<boolean>;
|
|
@@ -384,11 +433,19 @@ declare class SystemSettings implements OnInit {
|
|
|
384
433
|
private buildCurrentSnapshot;
|
|
385
434
|
private buildTimezoneValue;
|
|
386
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;
|
|
387
443
|
private buildWeekendValue;
|
|
388
444
|
private buildSmtpValue;
|
|
389
445
|
private buildTimeSheetPolicyValue;
|
|
390
446
|
private buildGlobalWorkingHoursValue;
|
|
391
447
|
private findSettingByKey;
|
|
448
|
+
private extractGeneralConfigurationValue;
|
|
392
449
|
private extractHolidaysValue;
|
|
393
450
|
private extractTimezoneValue;
|
|
394
451
|
private extractCurrencyValue;
|
|
@@ -399,6 +456,7 @@ declare class SystemSettings implements OnInit {
|
|
|
399
456
|
private normalizeHolidayItem;
|
|
400
457
|
private normalizeTimezoneRegion;
|
|
401
458
|
private normalizeCurrencyUnit;
|
|
459
|
+
private normalizeGeneralConfigurationSnapshot;
|
|
402
460
|
private normalizeTimezoneSnapshot;
|
|
403
461
|
private normalizeCurrencySnapshot;
|
|
404
462
|
private normalizeWeekendSnapshot;
|
|
@@ -450,5 +508,5 @@ declare class SystemSettingsHolidayEditor {
|
|
|
450
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>;
|
|
451
509
|
}
|
|
452
510
|
|
|
453
|
-
export { DEFAULT_DATE_FORMAT_OPTIONS, DEFAULT_TIME_FORMAT_OPTIONS, DOTNET_DAY_DEFINITIONS, FIXED_CURRENCIES, RATE_SOURCE_OPTIONS, SCHEDULE_ITEM_TYPE_OPTIONS, SystemSettings, SystemSettingsHolidayEditor, TIMESHEET_FREQUENCY_OPTIONS, WEEKEND_DAY_DEFINITIONS };
|
|
454
|
-
export type { ApiResponse, CurrencyCatalogItem, CurrencySettingValue, CurrencyUnitLabel, FormatSchemaOption, GlobalWorkingHoursSettingValue, HolidayItem, HolidayTableRow, HolidaysSettingValue, ScheduleItemTypeOption, SelectOption, SmtpSettingValue, SystemSetting, SystemSettingObject, SystemSettingPrimitive, SystemSettingValue, SystemSettingsForm, SystemSettingsFormatSchema, SystemSettingsSnapshot, TimeSheetFrequency, 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 };
|