Skip to content

Commit d00a749

Browse files
authored
Merge pull request #58 from Zimbra/PREAPPS-965
PREAPPS-965: graphql fixes and account attr addition
2 parents fe4ef6c + 607dd33 commit d00a749

File tree

3 files changed

+22
-11
lines changed

3 files changed

+22
-11
lines changed

src/batch-client/index.ts

+20-11
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import DataLoader from 'dataloader';
2+
import castArray from 'lodash/castArray';
23
import get from 'lodash/get';
34
import isError from 'lodash/isError';
45
import mapValues from 'lodash/mapValues';
@@ -120,17 +121,25 @@ export class ZimbraBatchClient {
120121
this.jsonRequest({
121122
name: 'GetInfo',
122123
namespace: Namespace.Account
123-
}).then(res => ({
124-
...res,
125-
attrs: mapValuesDeep(res.attrs._attrs, coerceStringToBoolean),
126-
prefs: mapValuesDeep(res.prefs._attrs, coerceStringToBoolean),
127-
...(get(res, 'license.attr') && {
128-
license: {
129-
status: res.license.status,
130-
attr: mapValuesDeep(res.license.attr, coerceStringToBoolean)
131-
}
132-
})
133-
}));
124+
}).then(res => {
125+
let prefs: any = mapValuesDeep(res.prefs._attrs, coerceStringToBoolean);
126+
prefs.zimbraPrefMailTrustedSenderList =
127+
typeof prefs.zimbraPrefMailTrustedSenderList === 'string'
128+
? castArray(prefs.zimbraPrefMailTrustedSenderList)
129+
: prefs.zimbraPrefMailTrustedSenderList;
130+
131+
return {
132+
...res,
133+
attrs: mapValuesDeep(res.attrs._attrs, coerceStringToBoolean),
134+
prefs,
135+
...(get(res, 'license.attr') && {
136+
license: {
137+
status: res.license.status,
138+
attr: mapValuesDeep(res.license.attr, coerceStringToBoolean)
139+
}
140+
})
141+
};
142+
});
134143

135144
public action = (type: ActionType, options: ActionOptions) => {
136145
const { ids, id, ...rest } = options;

src/schema/generated-schema-types.ts

+1
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,7 @@ export interface AccountInfoAttrs {
140140
zimbraFeatureRelatedContactsEnabled?: boolean | null;
141141
zimbraFeatureChangePasswordEnabled?: boolean | null;
142142
zimbraFeatureResetPasswordEnabled?: boolean | null;
143+
zimbraMailBlacklistMaxNumEntries?: number | null;
143144
}
144145

145146
export interface Preferences {

src/schema/schema.graphql

+1
Original file line numberDiff line numberDiff line change
@@ -940,6 +940,7 @@ type AccountInfoAttrs {
940940
zimbraFeatureRelatedContactsEnabled: Boolean
941941
zimbraFeatureChangePasswordEnabled: Boolean
942942
zimbraFeatureResetPasswordEnabled: Boolean
943+
zimbraMailBlacklistMaxNumEntries: Int
943944
}
944945

945946
type Identities {

0 commit comments

Comments
 (0)