@qrvey/utils 1.7.1 → 1.8.0-0

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 CHANGED
@@ -1,4 +1,4 @@
1
- # [@qrvey/utils](https://bitbucket.org/qrvey/qrvey_utils/wiki/Home) *1.7.1*
1
+ # [@qrvey/utils](https://bitbucket.org/qrvey/qrvey_utils/wiki/Home) *1.8.0-0*
2
2
 
3
3
  > Helper, Utils for all Qrvey Projects
4
4
 
@@ -48,7 +48,11 @@ function getFilterSettingsByMultipleScopes(settings, allowedScopes) {
48
48
  else if (scopesSettings.length <= 2) {
49
49
  newSettings = getFilterSettingsByDefaultWithOneAdditionalScope(newSettings);
50
50
  }
51
- if ((0, isEmpty_1.isEmpty)(scopesSettings.find((scope) => scope.id === FILTER_SCOPE_1.FILTER_SCOPE.CHART))) {
51
+ if ((0, isEmpty_1.isEmpty)(scopesSettings.find((scope) => scope.id === FILTER_SCOPE_1.FILTER_SCOPE.CHART)) &&
52
+ !(0, isEmpty_1.isEmpty)(scopesSettings.find((scope) => scope.id === FILTER_SCOPE_1.FILTER_SCOPE.GLOBAL))) {
53
+ newSettings = getFilterSettingsByMultipleNoPanelGlobalScopes(newSettings);
54
+ }
55
+ else if ((0, isEmpty_1.isEmpty)(scopesSettings.find((scope) => scope.id === FILTER_SCOPE_1.FILTER_SCOPE.CHART))) {
52
56
  newSettings = getFilterSettingsByMultipleNoPanelScopes(newSettings);
53
57
  }
54
58
  if ((0, isEmpty_1.isEmpty)(scopesSettings.find((scope) => scope.id === FILTER_SCOPE_1.FILTER_SCOPE.CHART)) &&
@@ -313,6 +317,19 @@ function getFilterSettingsBySkippingGeneralScopes(settings) {
313
317
  };
314
318
  return (0, mergeDeep_1.mergeDeep)(settings, newSettings);
315
319
  }
320
+ /**
321
+ * Gets the filter settings when there are no panel scopes and multiple scopes allowed.
322
+ * @param {IFSettings} settings the given filter settings
323
+ * @returns a new filter settings object
324
+ */
325
+ function getFilterSettingsByMultipleNoPanelGlobalScopes(settings) {
326
+ const newSettings = {
327
+ panel: {
328
+ filterAccessEnabled: false,
329
+ },
330
+ };
331
+ return (0, mergeDeep_1.mergeDeep)(settings, newSettings);
332
+ }
316
333
  /**
317
334
  * Gets the filter settings when there are no panel scopes and multiple scopes allowed.
318
335
  * @param {IFSettings} settings the given filter settings
@@ -8,6 +8,7 @@ export interface IBModel {
8
8
  branchesMap?: IBModelBranchesMap[];
9
9
  createDate: string;
10
10
  datalinkInfo?: any[];
11
+ geoGroups?: any[];
11
12
  modifyDate: string;
12
13
  name: string;
13
14
  numResponses: number;
@@ -17,6 +17,7 @@ function BModelToUIModel(model) {
17
17
  }),
18
18
  createDate: model.createDate,
19
19
  datalinkInfo: model.datalinkInfo,
20
+ geoGroups: model.geoGroups,
20
21
  modifyDate: model.modifyDate,
21
22
  label: model.name,
22
23
  totalRecords: model.numResponses,
@@ -44,7 +44,11 @@ function getFilterSettingsByMultipleScopes(settings, allowedScopes) {
44
44
  else if (scopesSettings.length <= 2) {
45
45
  newSettings = getFilterSettingsByDefaultWithOneAdditionalScope(newSettings);
46
46
  }
47
- if (isEmpty(scopesSettings.find((scope) => scope.id === FILTER_SCOPE.CHART))) {
47
+ if (isEmpty(scopesSettings.find((scope) => scope.id === FILTER_SCOPE.CHART)) &&
48
+ !isEmpty(scopesSettings.find((scope) => scope.id === FILTER_SCOPE.GLOBAL))) {
49
+ newSettings = getFilterSettingsByMultipleNoPanelGlobalScopes(newSettings);
50
+ }
51
+ else if (isEmpty(scopesSettings.find((scope) => scope.id === FILTER_SCOPE.CHART))) {
48
52
  newSettings = getFilterSettingsByMultipleNoPanelScopes(newSettings);
49
53
  }
50
54
  if (isEmpty(scopesSettings.find((scope) => scope.id === FILTER_SCOPE.CHART)) &&
@@ -309,6 +313,19 @@ function getFilterSettingsBySkippingGeneralScopes(settings) {
309
313
  };
310
314
  return mergeDeep(settings, newSettings);
311
315
  }
316
+ /**
317
+ * Gets the filter settings when there are no panel scopes and multiple scopes allowed.
318
+ * @param {IFSettings} settings the given filter settings
319
+ * @returns a new filter settings object
320
+ */
321
+ function getFilterSettingsByMultipleNoPanelGlobalScopes(settings) {
322
+ const newSettings = {
323
+ panel: {
324
+ filterAccessEnabled: false,
325
+ },
326
+ };
327
+ return mergeDeep(settings, newSettings);
328
+ }
312
329
  /**
313
330
  * Gets the filter settings when there are no panel scopes and multiple scopes allowed.
314
331
  * @param {IFSettings} settings the given filter settings
@@ -8,6 +8,7 @@ export interface IBModel {
8
8
  branchesMap?: IBModelBranchesMap[];
9
9
  createDate: string;
10
10
  datalinkInfo?: any[];
11
+ geoGroups?: any[];
11
12
  modifyDate: string;
12
13
  name: string;
13
14
  numResponses: number;
@@ -14,6 +14,7 @@ export function BModelToUIModel(model) {
14
14
  }),
15
15
  createDate: model.createDate,
16
16
  datalinkInfo: model.datalinkInfo,
17
+ geoGroups: model.geoGroups,
17
18
  modifyDate: model.modifyDate,
18
19
  label: model.name,
19
20
  totalRecords: model.numResponses,
package/package.json CHANGED
@@ -1,22 +1,22 @@
1
1
  {
2
2
  "name": "@qrvey/utils",
3
- "version": "1.7.1",
3
+ "version": "1.8.0-0",
4
4
  "description": "Helper, Utils for all Qrvey Projects",
5
5
  "homepage": "https://bitbucket.org/qrvey/qrvey_utils/wiki/Home",
6
6
  "main": "dist/index.js",
7
7
  "scripts": {
8
8
  "build": "tsc && tsc -m commonjs --outDir dist/cjs",
9
- "build-clean": "node ./scripts/clean-build",
9
+ "build.clean": "node ./scripts/clean-build",
10
10
  "compodoc": "npx compodoc -p tsconfig.doc.json",
11
- "compodoc:server": "./node_modules/.bin/compodoc -p ./tsconfig.doc.json -s --port=4400",
11
+ "compodoc.server": "./node_modules/.bin/compodoc -p ./tsconfig.doc.json -s --port=4400",
12
12
  "lint": "eslint . --quiet --exit-on-fatal-error --ext .ts,.js",
13
- "lint-dev": "eslint . --debug --ext .ts,.tsx",
13
+ "lint.dev": "eslint . --debug --ext .ts,.tsx",
14
14
  "prepare": "husky install",
15
- "publishing-beta-1": "node ./scripts/publishing --np-new-version=$npm_config_np_new_version --np-any-branch=$npm_config_np_any_branch --np-tag=$npm_config_np_tag",
15
+ "publishing.beta.1": "node ./scripts/publishing --np-new-version=$npm_config_np_new_version --np-any-branch=$npm_config_np_any_branch --np-tag=$npm_config_np_tag",
16
16
  "publishing": "node ./scripts/clean-build && node ./scripts/generating-docs --np-new-version=$npm_config_np_new_version && np $npm_config_np_new_version --any-branch --tag=$npm_config_np_tag",
17
- "publishing-win": "node ./scripts/clean-build && node ./scripts/generating-docs --np-new-version=%npm_config_np_new_version% && np %npm_config_np_new_version% --any-branch --tag=%npm_config_np_tag%",
17
+ "publishing.win": "node ./scripts/clean-build && node ./scripts/generating-docs --np-new-version=%npm_config_np_new_version% && np %npm_config_np_new_version% --any-branch --tag=%npm_config_np_tag%",
18
18
  "test": "jest test",
19
- "test:watch": "jest --watch test"
19
+ "test.watch": "jest --watch test"
20
20
  },
21
21
  "author": "Qrvey Inc",
22
22
  "license": "MIT",