@arsedizioni/ars-utils 21.2.122 → 21.2.123
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.
|
@@ -2233,6 +2233,9 @@ class ClipperService {
|
|
|
2233
2233
|
get teams() {
|
|
2234
2234
|
return this._teams;
|
|
2235
2235
|
}
|
|
2236
|
+
set teams(value) {
|
|
2237
|
+
this._teams = value;
|
|
2238
|
+
}
|
|
2236
2239
|
ngOnDestroy() {
|
|
2237
2240
|
if (this.broadcastServiceSubscription) {
|
|
2238
2241
|
this.broadcastServiceSubscription.unsubscribe();
|
|
@@ -2499,6 +2502,36 @@ class ClipperService {
|
|
|
2499
2502
|
// Reset login
|
|
2500
2503
|
this.reset();
|
|
2501
2504
|
}
|
|
2505
|
+
/**
|
|
2506
|
+
* Update channel state
|
|
2507
|
+
* @param value : the new dashboard result with updated channels and dashboard info
|
|
2508
|
+
*/
|
|
2509
|
+
setChannelState(value) {
|
|
2510
|
+
// Update channels
|
|
2511
|
+
if (this._loginInfo) {
|
|
2512
|
+
this._loginInfo.channels = value.channels ?? [];
|
|
2513
|
+
}
|
|
2514
|
+
// Update dashboard
|
|
2515
|
+
this.dashboard.documentUpdates = value.documentUpdates;
|
|
2516
|
+
this.dashboard.expiredDeadlines = value.expiredDeadlines;
|
|
2517
|
+
this.dashboard.expiringDeadlines = value.expiringDeadlines;
|
|
2518
|
+
this.dashboard.isTrial = value.isTrial;
|
|
2519
|
+
this.dashboard.items.set(value.items ?? []);
|
|
2520
|
+
this.broadcastService.sendMessage(ClipperMessages.COMMAND_DASHBOARD_UPDATED);
|
|
2521
|
+
this.storeContext();
|
|
2522
|
+
this.initializeChannels();
|
|
2523
|
+
}
|
|
2524
|
+
/**
|
|
2525
|
+
* Update channels
|
|
2526
|
+
* @param channels: the new channels settings
|
|
2527
|
+
*/
|
|
2528
|
+
setChannels(channels) {
|
|
2529
|
+
if (this._loginInfo) {
|
|
2530
|
+
this._loginInfo.channels = channels;
|
|
2531
|
+
this.storeContext();
|
|
2532
|
+
this.initializeChannels();
|
|
2533
|
+
}
|
|
2534
|
+
}
|
|
2502
2535
|
/**
|
|
2503
2536
|
* Initialize channels
|
|
2504
2537
|
*/
|
|
@@ -2731,23 +2764,6 @@ class ClipperService {
|
|
|
2731
2764
|
this.broadcastService.sendMessage(ClipperMessages.COMMAND_DASHBOARD_UPDATED);
|
|
2732
2765
|
}
|
|
2733
2766
|
///
|
|
2734
|
-
// LINKS
|
|
2735
|
-
///
|
|
2736
|
-
/**
|
|
2737
|
-
* Save a user link
|
|
2738
|
-
* @param item: the user link
|
|
2739
|
-
*/
|
|
2740
|
-
saveLink(item) {
|
|
2741
|
-
return this.httpClient.post(this._serviceUri + '/account/links/save', item);
|
|
2742
|
-
}
|
|
2743
|
-
/**
|
|
2744
|
-
* Delete a user link
|
|
2745
|
-
* @param item: the user link
|
|
2746
|
-
*/
|
|
2747
|
-
deleteLink(item) {
|
|
2748
|
-
return this.httpClient.post(this._serviceUri + '/account/links/delete', item);
|
|
2749
|
-
}
|
|
2750
|
-
///
|
|
2751
2767
|
// BAG - WORKING DOCUMENTS
|
|
2752
2768
|
///
|
|
2753
2769
|
/**
|
|
@@ -2883,136 +2899,6 @@ class ClipperService {
|
|
|
2883
2899
|
.post(this.serviceUri + '/documents/searches/delete', { id: id });
|
|
2884
2900
|
}
|
|
2885
2901
|
///
|
|
2886
|
-
// USER SETTINGS AND TRIAL
|
|
2887
|
-
///
|
|
2888
|
-
/**
|
|
2889
|
-
* Reset a user password
|
|
2890
|
-
* @param params parameters
|
|
2891
|
-
*/
|
|
2892
|
-
resetPassword(params) {
|
|
2893
|
-
return this.httpClient.post(this._serviceUri + '/account/password/reset', params);
|
|
2894
|
-
}
|
|
2895
|
-
/**
|
|
2896
|
-
* Recover password
|
|
2897
|
-
* @param params parameters
|
|
2898
|
-
*/
|
|
2899
|
-
recoverPassword(params) {
|
|
2900
|
-
return this.httpClient.post(this._serviceUri + '/account/password/recover', params);
|
|
2901
|
-
}
|
|
2902
|
-
/**
|
|
2903
|
-
* Update settings
|
|
2904
|
-
* @param params parameters
|
|
2905
|
-
*/
|
|
2906
|
-
updateSettings(params) {
|
|
2907
|
-
return this.httpClient.post(this._serviceUri + '/account/settings/update', params).pipe(map(r => {
|
|
2908
|
-
if (r.success) {
|
|
2909
|
-
if (params.channels) {
|
|
2910
|
-
// Update channels
|
|
2911
|
-
if (this._loginInfo) {
|
|
2912
|
-
this._loginInfo.channels = params.channels;
|
|
2913
|
-
this.storeContext();
|
|
2914
|
-
this.initializeChannels();
|
|
2915
|
-
}
|
|
2916
|
-
}
|
|
2917
|
-
}
|
|
2918
|
-
return r;
|
|
2919
|
-
}));
|
|
2920
|
-
}
|
|
2921
|
-
/**
|
|
2922
|
-
* Update channel state
|
|
2923
|
-
* @param id: the channel id (1, 2, 3, 4)
|
|
2924
|
-
*/
|
|
2925
|
-
updateChannelsState(params) {
|
|
2926
|
-
return this.httpClient.post(this._serviceUri + '/account/settings/channels/update', params).pipe(map(r => {
|
|
2927
|
-
if (r.success) {
|
|
2928
|
-
// Update channels
|
|
2929
|
-
if (this._loginInfo) {
|
|
2930
|
-
this._loginInfo.channels = r.value.channels ?? [];
|
|
2931
|
-
}
|
|
2932
|
-
// Update dashboard
|
|
2933
|
-
this.dashboard.documentUpdates = r.value.documentUpdates;
|
|
2934
|
-
this.dashboard.expiredDeadlines = r.value.expiredDeadlines;
|
|
2935
|
-
this.dashboard.expiringDeadlines = r.value.expiringDeadlines;
|
|
2936
|
-
this.dashboard.isTrial = r.value.isTrial;
|
|
2937
|
-
this.dashboard.items.set(r.value.items ?? []);
|
|
2938
|
-
this.broadcastService.sendMessage(ClipperMessages.COMMAND_DASHBOARD_UPDATED);
|
|
2939
|
-
this.storeContext();
|
|
2940
|
-
this.initializeChannels();
|
|
2941
|
-
}
|
|
2942
|
-
return r;
|
|
2943
|
-
}));
|
|
2944
|
-
}
|
|
2945
|
-
/**
|
|
2946
|
-
* Get trial info
|
|
2947
|
-
*/
|
|
2948
|
-
getTrialInfo() {
|
|
2949
|
-
return this.httpClient.get(this._serviceUri + '/account/trial');
|
|
2950
|
-
}
|
|
2951
|
-
/**
|
|
2952
|
-
* Update trial info
|
|
2953
|
-
*/
|
|
2954
|
-
updateTrialInfo() {
|
|
2955
|
-
if (!this._loginInfo || this._loginInfo?.context?.hasTrial === false)
|
|
2956
|
-
return; // Not supported
|
|
2957
|
-
this.getTrialInfo().subscribe((r) => {
|
|
2958
|
-
if (r.success) {
|
|
2959
|
-
if (this._loginInfo?.context) {
|
|
2960
|
-
if (r.value) {
|
|
2961
|
-
this._loginInfo.context.hasTrial = true;
|
|
2962
|
-
this._loginInfo.context.trialInfo = r.value;
|
|
2963
|
-
}
|
|
2964
|
-
else {
|
|
2965
|
-
this._loginInfo.context.hasTrial = false;
|
|
2966
|
-
this._loginInfo.context.trialInfo = undefined;
|
|
2967
|
-
}
|
|
2968
|
-
}
|
|
2969
|
-
}
|
|
2970
|
-
});
|
|
2971
|
-
}
|
|
2972
|
-
///
|
|
2973
|
-
// TEAMS
|
|
2974
|
-
///
|
|
2975
|
-
/**
|
|
2976
|
-
* Rename a team
|
|
2977
|
-
* @param newName : the new name
|
|
2978
|
-
*/
|
|
2979
|
-
renameTeam(newName) {
|
|
2980
|
-
return this.httpClient.post(this._serviceUri + '/account/teams/update', { title: newName });
|
|
2981
|
-
}
|
|
2982
|
-
/**
|
|
2983
|
-
* Retrieve teams
|
|
2984
|
-
*/
|
|
2985
|
-
getTeams(params) {
|
|
2986
|
-
return this.httpClient.post(this._serviceUri + '/account/teams', params)
|
|
2987
|
-
.pipe(map((r) => {
|
|
2988
|
-
// Store teams
|
|
2989
|
-
if (!params.adminsOnly) {
|
|
2990
|
-
this._teams = r.value.items;
|
|
2991
|
-
}
|
|
2992
|
-
return r;
|
|
2993
|
-
}));
|
|
2994
|
-
}
|
|
2995
|
-
/**
|
|
2996
|
-
* Retrieve team members
|
|
2997
|
-
*/
|
|
2998
|
-
getTeamMembers(params) {
|
|
2999
|
-
return this.httpClient.post(this._serviceUri + '/account/teams/members', params);
|
|
3000
|
-
}
|
|
3001
|
-
/**
|
|
3002
|
-
* Delete members
|
|
3003
|
-
* @param ids: the id list to delete
|
|
3004
|
-
*/
|
|
3005
|
-
deleteTeamMembers(ids) {
|
|
3006
|
-
return this.httpClient.post(this._serviceUri + '/account/teams/members/delete', { ids: ids });
|
|
3007
|
-
}
|
|
3008
|
-
/**
|
|
3009
|
-
* Save member
|
|
3010
|
-
* @param item: the item to save
|
|
3011
|
-
*/
|
|
3012
|
-
saveTeamMember(item) {
|
|
3013
|
-
return this.httpClient.post(this._serviceUri + '/account/teams/members/save', item);
|
|
3014
|
-
}
|
|
3015
|
-
///
|
|
3016
2902
|
// CALENDAR
|
|
3017
2903
|
///
|
|
3018
2904
|
/**
|