@zextras/carbonio-shell-ui 7.0.1-devel.1720532764888 → 7.0.1-devel.1720609013362
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/lib/store/account/updaters.d.ts +9 -2
- package/lib/store/account/updaters.js +10 -6
- package/lib/store/account/updaters.js.map +1 -1
- package/lib/store/account/utils.d.ts +1 -1
- package/lib/store/account/utils.js +28 -22
- package/lib/store/account/utils.js.map +1 -1
- package/lib/types/account/index.d.ts +11 -1
- package/lib/types/network/index.d.ts +2 -2
- package/lib/types/network/index.js.map +1 -1
- package/package.json +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { AccountSettingsAttrs, AccountSettingsPrefs, Identity } from '../../types/account';
|
|
1
|
+
import type { AccountSettingsAttrs, AccountSettingsPrefs, Identity, Signature } from '../../types/account';
|
|
2
2
|
import type { IdentityMods } from '../../types/network';
|
|
3
3
|
type UpdateSettingsParams = {
|
|
4
4
|
attrs?: AccountSettingsAttrs;
|
|
@@ -9,7 +9,14 @@ type UpdateSettingsParams = {
|
|
|
9
9
|
}>;
|
|
10
10
|
};
|
|
11
11
|
export type UpdateSettings = (settingsMods: UpdateSettingsParams) => void;
|
|
12
|
-
|
|
12
|
+
type UpdateAccountParams = {
|
|
13
|
+
identities?: {
|
|
14
|
+
identitiesMods: IdentityMods;
|
|
15
|
+
newIdentities: Identity[];
|
|
16
|
+
};
|
|
17
|
+
signatures?: Signature[];
|
|
18
|
+
};
|
|
19
|
+
export type UpdateAccount = (accountMods: UpdateAccountParams) => void;
|
|
13
20
|
export declare const updateSettings: UpdateSettings;
|
|
14
21
|
export declare const updateAccount: UpdateAccount;
|
|
15
22
|
export {};
|
|
@@ -18,16 +18,20 @@ const updateSettings = (settingsMods) => store_1.useAccountStore.setState((state
|
|
|
18
18
|
}
|
|
19
19
|
}));
|
|
20
20
|
exports.updateSettings = updateSettings;
|
|
21
|
-
const updateAccount = (
|
|
21
|
+
const updateAccount = ({ identities, signatures }) => store_1.useAccountStore.setState((state) => state.account
|
|
22
22
|
? {
|
|
23
23
|
...state,
|
|
24
24
|
account: {
|
|
25
25
|
...state.account,
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
26
|
+
...(identities
|
|
27
|
+
? {
|
|
28
|
+
displayName: (0, lodash_1.find)(identities?.identitiesMods?.modifyList, (item) => item.id === state?.account?.id)?.prefs.zimbraPrefIdentityName ?? state.account?.displayName,
|
|
29
|
+
identities: {
|
|
30
|
+
identity: (0, utils_1.updateIdentities)(state, identities.identitiesMods, identities.newIdentities) ?? []
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
: {}),
|
|
34
|
+
...(signatures ? { signatures: { signature: signatures } } : {})
|
|
31
35
|
}
|
|
32
36
|
}
|
|
33
37
|
: state);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"updaters.js","sourceRoot":"","sources":["../../../src/store/account/updaters.ts"],"names":[],"mappings":";;;AAAA;;;;GAIG;AACH,mCAA8B;AAE9B,mCAA0C;AAC1C,mCAA+E;
|
|
1
|
+
{"version":3,"file":"updaters.js","sourceRoot":"","sources":["../../../src/store/account/updaters.ts"],"names":[],"mappings":";;;AAAA;;;;GAIG;AACH,mCAA8B;AAE9B,mCAA0C;AAC1C,mCAA+E;AA2BxE,MAAM,cAAc,GAAmB,CAAC,YAAY,EAAE,EAAE,CAC9D,uBAAe,CAAC,QAAQ,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC;IACpC,GAAG,KAAK;IACR,QAAQ,EAAE;QACT,KAAK,EAAE,IAAA,kBAAU,EAAC,YAAY,CAAC,KAAK,EAAE,KAAK,CAAC;QAC5C,KAAK,EAAE,IAAA,kBAAU,EAAC,YAAY,CAAC,KAAK,EAAE,KAAK,CAAC;QAC5C,KAAK,EAAE,IAAA,kBAAU,EAAC,YAAY,CAAC,KAAK,EAAE,KAAK,CAAC;KAC5C;CACD,CAAC,CAAC,CAAC;AARQ,QAAA,cAAc,kBAQtB;AAEE,MAAM,aAAa,GAAkB,CAAC,EAAE,UAAU,EAAE,UAAU,EAAE,EAAE,EAAE,CAC1E,uBAAe,CAAC,QAAQ,CAAC,CAAC,KAAK,EAAE,EAAE,CAClC,KAAK,CAAC,OAAO;IACZ,CAAC,CAAC;QACA,GAAG,KAAK;QACR,OAAO,EAAE;YACR,GAAG,KAAK,CAAC,OAAO;YAChB,GAAG,CAAC,UAAU;gBACb,CAAC,CAAC;oBACA,WAAW,EACV,IAAA,aAAI,EACH,UAAU,EAAE,cAAc,EAAE,UAAU,EACtC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,EAAE,KAAK,KAAK,EAAE,OAAO,EAAE,EAAE,CACxC,EAAE,KAAK,CAAC,sBAAsB,IAAI,KAAK,CAAC,OAAO,EAAE,WAAW;oBAC9D,UAAU,EAAE;wBACX,QAAQ,EACP,IAAA,wBAAgB,EACf,KAAK,EACL,UAAU,CAAC,cAAc,EACzB,UAAU,CAAC,aAAa,CACxB,IAAI,EAAE;qBACR;iBACD;gBACF,CAAC,CAAC,EAAE,CAAC;YACN,GAAG,CAAC,UAAU,CAAC,CAAC,CAAC,EAAE,UAAU,EAAE,EAAE,SAAS,EAAE,UAAU,EAAE,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;SAChE;KACD;IACF,CAAC,CAAC,KAAK,CACR,CAAC;AA5BU,QAAA,aAAa,iBA4BvB"}
|
|
@@ -3,4 +3,4 @@ import type { IdentityMods, PropsMods } from '../../types/network';
|
|
|
3
3
|
export declare function mergePrefs(mods: AccountSettingsPrefs | undefined, state: AccountState): AccountSettingsPrefs;
|
|
4
4
|
export declare function mergeProps(mods: PropsMods | undefined, state: AccountState): Array<ZimletProp>;
|
|
5
5
|
export declare function mergeAttrs(mods: AccountSettingsAttrs | undefined, state: AccountState): AccountSettingsAttrs;
|
|
6
|
-
export declare function updateIdentities(state: AccountState, identityMods: IdentityMods,
|
|
6
|
+
export declare function updateIdentities(state: AccountState, identityMods: IdentityMods, newIdentities: Identity[]): Identity[] | undefined;
|
|
@@ -36,28 +36,34 @@ function mergeAttrs(mods, state) {
|
|
|
36
36
|
}), state.settings.attrs);
|
|
37
37
|
}
|
|
38
38
|
exports.mergeAttrs = mergeAttrs;
|
|
39
|
-
function updateIdentities(state, identityMods,
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
return
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
...
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
39
|
+
function updateIdentities(state, identityMods, newIdentities) {
|
|
40
|
+
if (!state.account) {
|
|
41
|
+
return undefined;
|
|
42
|
+
}
|
|
43
|
+
const sortedAndFilteredIdentities = [
|
|
44
|
+
...(0, lodash_1.filter)(state.account.identities.identity, (item) => !identityMods?.deleteList?.includes(item.id)).filter((i) => i.name !== 'DEFAULT'),
|
|
45
|
+
...newIdentities,
|
|
46
|
+
...(0, lodash_1.filter)(state.account.identities.identity, (item) => !identityMods?.deleteList?.includes(item.id)).filter((i) => i.name === 'DEFAULT')
|
|
47
|
+
];
|
|
48
|
+
if (!identityMods?.modifyList) {
|
|
49
|
+
return sortedAndFilteredIdentities;
|
|
50
|
+
}
|
|
51
|
+
return sortedAndFilteredIdentities.map((identity) => {
|
|
52
|
+
const identityMod = (0, lodash_1.find)(identityMods.modifyList, (mod) => mod.id === identity.id);
|
|
53
|
+
if (!identityMod) {
|
|
54
|
+
return identity;
|
|
55
|
+
}
|
|
56
|
+
return {
|
|
57
|
+
...identity,
|
|
58
|
+
_attrs: {
|
|
59
|
+
...identity._attrs,
|
|
60
|
+
...identityMod.prefs
|
|
61
|
+
},
|
|
62
|
+
...(identityMod.prefs.zimbraPrefIdentityName && identity.name !== 'DEFAULT'
|
|
63
|
+
? { name: identityMod.prefs.zimbraPrefIdentityName }
|
|
64
|
+
: {})
|
|
65
|
+
};
|
|
66
|
+
});
|
|
61
67
|
}
|
|
62
68
|
exports.updateIdentities = updateIdentities;
|
|
63
69
|
//# sourceMappingURL=utils.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../src/store/account/utils.ts"],"names":[],"mappings":";;;AAAA;;;;GAIG;AACH,
|
|
1
|
+
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../src/store/account/utils.ts"],"names":[],"mappings":";;;AAAA;;;;GAIG;AACH,mCAAyD;AAWzD,SAAgB,UAAU,CACzB,IAAsC,EACtC,KAAmB;IAEnB,OAAO,IAAA,eAAM,EACZ,IAAI,EACJ,CAAC,GAAG,EAAE,IAAI,EAAE,GAAG,EAAE,EAAE,CAAC,CAAC;QACpB,GAAG,GAAG;QACN,CAAC,GAAG,CAAC,EAAE,IAAI;KACX,CAAC,EACF,KAAK,CAAC,QAAQ,CAAC,KAAK,CACpB,CAAC;AACH,CAAC;AAZD,gCAYC;AAED,SAAgB,UAAU,CAAC,IAA2B,EAAE,KAAmB;IAC1E,OAAO,IAAA,eAAM,EACZ,IAAI,EACJ,CAAC,GAAG,EAAE,EAAE,GAAG,EAAE,KAAK,EAAE,EAAE,GAAG,EAAE,EAAE;QAC5B,MAAM,YAAY,GAAG;YACpB,IAAI,EAAE,GAAG;YACT,MAAM,EAAE,GAAG;YACX,QAAQ,EAAE,KAAe;SACzB,CAAC;QACF,MAAM,SAAS,GAAG,IAAA,kBAAS,EAAC,GAAG,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,KAAK,GAAG,IAAI,CAAC,CAAC,MAAM,KAAK,GAAG,CAAC,CAAC;QAC5E,IAAI,SAAS,IAAI,CAAC,EAAE,CAAC;YACpB,OAAO,GAAG,CAAC,GAAG,CAAC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C,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,KAAK,SAAS,CAAC;KACrC,CAAC;IAEF,IAAI,CAAC,YAAY,EAAE,UAAU,EAAE,CAAC;QAC/B,OAAO,2BAA2B,CAAC;IACpC,CAAC;IAED,OAAO,2BAA2B,CAAC,GAAG,CAAC,CAAC,QAAQ,EAAE,EAAE;QACnD,MAAM,WAAW,GAAG,IAAA,aAAI,EAAC,YAAY,CAAC,UAAU,EAAE,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,CAAC,EAAE,KAAK,QAAQ,CAAC,EAAE,CAAC,CAAC;QACnF,IAAI,CAAC,WAAW,EAAE,CAAC;YAClB,OAAO,QAAQ,CAAC;QACjB,CAAC;QAED,OAAO;YACN,GAAG,QAAQ;YACX,MAAM,EAAE;gBACP,GAAG,QAAQ,CAAC,MAAM;gBAClB,GAAG,WAAW,CAAC,KAAK;aACpB;YACD,GAAG,CAAC,WAAW,CAAC,KAAK,CAAC,sBAAsB,IAAI,QAAQ,CAAC,IAAI,KAAK,SAAS;gBAC1E,CAAC,CAAC,EAAE,IAAI,EAAE,WAAW,CAAC,KAAK,CAAC,sBAAsB,EAAE;gBACpD,CAAC,CAAC,EAAE,CAAC;SACN,CAAC;IACH,CAAC,CAAC,CAAC;AACJ,CAAC;AA1CD,4CA0CC"}
|
|
@@ -20,12 +20,22 @@ export interface Identity {
|
|
|
20
20
|
/** Attributes */
|
|
21
21
|
_attrs: IdentityAttrs;
|
|
22
22
|
}
|
|
23
|
+
export type Signature = {
|
|
24
|
+
name: string;
|
|
25
|
+
id: string;
|
|
26
|
+
content?: [
|
|
27
|
+
{
|
|
28
|
+
type: 'text/plain' | 'text/html';
|
|
29
|
+
_content: string;
|
|
30
|
+
}
|
|
31
|
+
];
|
|
32
|
+
};
|
|
23
33
|
export type Account = {
|
|
24
34
|
id: string;
|
|
25
35
|
name: string;
|
|
26
36
|
displayName: string;
|
|
27
37
|
signatures: {
|
|
28
|
-
signature: Array<
|
|
38
|
+
signature: Array<Signature>;
|
|
29
39
|
};
|
|
30
40
|
identities: {
|
|
31
41
|
identity: Array<Identity>;
|
|
@@ -3,7 +3,7 @@ import type { AccountACEInfo } from './entities';
|
|
|
3
3
|
import type { SoapBody, SoapContext } from './soap';
|
|
4
4
|
import type { JSNS } from '../../constants';
|
|
5
5
|
import type { Exactify, RequireAtLeastOne, ValueOf } from '../../utils/typeUtils';
|
|
6
|
-
import type { AccountRights, AccountSettingsPrefs, Identity, IdentityAttrs, ZimletProp } from '../account';
|
|
6
|
+
import type { AccountRights, AccountSettingsPrefs, Identity, IdentityAttrs, Signature, ZimletProp } from '../account';
|
|
7
7
|
export * from './soap';
|
|
8
8
|
export type ZimletPkgDescription = {
|
|
9
9
|
zimlet: Array<{
|
|
@@ -37,7 +37,7 @@ export type GetInfoResponse = {
|
|
|
37
37
|
_attrs: AccountSettingsPrefs;
|
|
38
38
|
};
|
|
39
39
|
signatures: {
|
|
40
|
-
signature: Array<
|
|
40
|
+
signature: Array<Signature>;
|
|
41
41
|
};
|
|
42
42
|
identities: {
|
|
43
43
|
identity: Array<Identity>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/types/network/index.ts"],"names":[],"mappings":";AAAA;;;;GAIG;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/types/network/index.ts"],"names":[],"mappings":";AAAA;;;;GAIG;;;;;;;;;;;;;;;;AAeH,yCAAuB"}
|