@qrvey/utils 1.13.0-9 → 1.14.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/dist/cache-managers/cache-chart-manager.d.ts +5 -17
- package/dist/cache-managers/cache-chart-manager.js +25 -23
- package/dist/cache-managers/cache-manager.d.ts +25 -29
- package/dist/cache-managers/cache-manager.js +92 -32
- package/dist/cache-managers/cache-metric-manager.d.ts +6 -18
- package/dist/cache-managers/cache-metric-manager.js +26 -30
- package/dist/cache-managers/cache-model-manager.d.ts +5 -17
- package/dist/cache-managers/cache-model-manager.js +23 -25
- package/dist/cache-managers/cache-permissions-manager.d.ts +5 -18
- package/dist/cache-managers/cache-permissions-manager.js +22 -24
- package/dist/cache-managers/cache-theme-manager.d.ts +5 -18
- package/dist/cache-managers/cache-theme-manager.js +22 -24
- package/dist/cache-managers/clean-cache-managers.d.ts +1 -0
- package/dist/cache-managers/clean-cache-managers.js +26 -0
- package/dist/cache-managers/index.d.ts +7 -0
- package/dist/cache-managers/index.js +7 -0
- package/dist/cjs/cache-managers/cache-chart-manager.d.ts +5 -17
- package/dist/cjs/cache-managers/cache-chart-manager.js +25 -23
- package/dist/cjs/cache-managers/cache-manager.d.ts +25 -29
- package/dist/cjs/cache-managers/cache-manager.js +92 -32
- package/dist/cjs/cache-managers/cache-metric-manager.d.ts +6 -18
- package/dist/cjs/cache-managers/cache-metric-manager.js +26 -30
- package/dist/cjs/cache-managers/cache-model-manager.d.ts +5 -17
- package/dist/cjs/cache-managers/cache-model-manager.js +23 -25
- package/dist/cjs/cache-managers/cache-permissions-manager.d.ts +5 -18
- package/dist/cjs/cache-managers/cache-permissions-manager.js +22 -24
- package/dist/cjs/cache-managers/cache-theme-manager.d.ts +5 -18
- package/dist/cjs/cache-managers/cache-theme-manager.js +22 -24
- package/dist/cjs/cache-managers/clean-cache-managers.d.ts +1 -0
- package/dist/cjs/cache-managers/clean-cache-managers.js +30 -0
- package/dist/cjs/cache-managers/index.d.ts +7 -0
- package/dist/cjs/cache-managers/index.js +23 -0
- package/dist/cjs/globalization/interfaces/dashboard/II18nDashboardMessages.d.ts +2 -0
- package/dist/cjs/globalization/interfaces/panel/II18nPanelTooltips.d.ts +1 -0
- package/dist/cjs/globalization/labels/dashboard/I18N_DASHBOARD.js +3 -1
- package/dist/cjs/globalization/labels/panel/I18N_PANEL.js +1 -0
- package/dist/cjs/index.d.ts +2 -1
- package/dist/cjs/index.js +2 -1
- package/dist/cjs/qrvey/interfaces/IBDataset.d.ts +2 -0
- package/dist/cjs/qrvey/interfaces/IDataset.d.ts +3 -1
- package/dist/cjs/services/adapters/BDatasetsToUIDatasets.adapter.js +1 -0
- package/dist/cjs/services/api/metrics.api.js +1 -1
- package/dist/cjs/services/helpers/Request.js +5 -1
- package/dist/globalization/interfaces/dashboard/II18nDashboardMessages.d.ts +2 -0
- package/dist/globalization/interfaces/panel/II18nPanelTooltips.d.ts +1 -0
- package/dist/globalization/labels/dashboard/I18N_DASHBOARD.js +3 -1
- package/dist/globalization/labels/panel/I18N_PANEL.js +1 -0
- package/dist/index.d.ts +2 -1
- package/dist/index.js +2 -1
- package/dist/qrvey/interfaces/IBDataset.d.ts +2 -0
- package/dist/qrvey/interfaces/IDataset.d.ts +3 -1
- package/dist/services/adapters/BDatasetsToUIDatasets.adapter.js +1 -0
- package/dist/services/api/metrics.api.js +1 -1
- package/dist/services/helpers/Request.js +5 -1
- package/package.json +1 -1
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { OnChangeType, QrveyCacheManager } from "./cache-manager";
|
|
1
|
+
import { QrveyCacheManager, QvCacheStoreProperties } from "./cache-manager";
|
|
3
2
|
export interface IGetPermissionsConfig {
|
|
4
3
|
qv_token?: string;
|
|
5
4
|
api_key?: string;
|
|
@@ -7,21 +6,9 @@ export interface IGetPermissionsConfig {
|
|
|
7
6
|
user_id?: string;
|
|
8
7
|
domain?: string;
|
|
9
8
|
}
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
error: any;
|
|
14
|
-
}
|
|
15
|
-
export declare class PermissionsCacheManager extends QrveyCacheManager<IPermissionsStoreState, IGetPermissionsConfig> {
|
|
16
|
-
static getInstance(): PermissionsCacheManager;
|
|
17
|
-
protected getConfigPropertyName(): keyof IGetPermissionsConfig;
|
|
18
|
-
protected getStorePropertyName(): keyof IPermissionsStoreState;
|
|
9
|
+
export declare class PermissionsCacheManager extends QrveyCacheManager<QvCacheStoreProperties, IGetPermissionsConfig> {
|
|
10
|
+
static getInstance(): any;
|
|
11
|
+
protected getConfigEntityId(): keyof IGetPermissionsConfig;
|
|
19
12
|
protected buildStoreId({ user_id }: IGetPermissionsConfig): string;
|
|
20
|
-
protected
|
|
21
|
-
state: IPermissionsStoreState;
|
|
22
|
-
onChange: OnChangeType;
|
|
23
|
-
set: (property: keyof IPermissionsStoreState, value: unknown) => void;
|
|
24
|
-
};
|
|
25
|
-
protected fetchDataAndUpdateStore(state: IPermissionsStoreState, config: IGetPermissionsConfig): void;
|
|
13
|
+
protected fetchDataAndUpdateStore(state: QvCacheStoreProperties, config: IGetPermissionsConfig): Promise<void>;
|
|
26
14
|
}
|
|
27
|
-
export {};
|
|
@@ -1,42 +1,40 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
2
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
12
|
exports.PermissionsCacheManager = void 0;
|
|
4
|
-
const store_1 = require("@stencil/store");
|
|
5
13
|
const cache_manager_1 = require("./cache-manager");
|
|
6
14
|
const adminPermissions_api_1 = require("../services/api/adminPermissions.api");
|
|
7
15
|
class PermissionsCacheManager extends cache_manager_1.QrveyCacheManager {
|
|
8
16
|
static getInstance() {
|
|
9
|
-
if (!window.
|
|
10
|
-
window.
|
|
17
|
+
if (!window.qvPermissionsCacheManager) {
|
|
18
|
+
window.qvPermissionsCacheManager = new PermissionsCacheManager();
|
|
11
19
|
}
|
|
12
|
-
return window.
|
|
20
|
+
return window.qvPermissionsCacheManager;
|
|
13
21
|
}
|
|
14
|
-
|
|
22
|
+
getConfigEntityId() {
|
|
15
23
|
return "user_id";
|
|
16
24
|
}
|
|
17
|
-
getStorePropertyName() {
|
|
18
|
-
return "permissions";
|
|
19
|
-
}
|
|
20
25
|
buildStoreId({ user_id }) {
|
|
21
26
|
return `${user_id}`;
|
|
22
27
|
}
|
|
23
|
-
createStore() {
|
|
24
|
-
return (0, store_1.createStore)({
|
|
25
|
-
permissions: null,
|
|
26
|
-
loading: true,
|
|
27
|
-
error: null,
|
|
28
|
-
});
|
|
29
|
-
}
|
|
30
28
|
fetchDataAndUpdateStore(state, config) {
|
|
31
|
-
(0,
|
|
32
|
-
.
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
29
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
30
|
+
return (0, adminPermissions_api_1.getAdminPermissions)(config)
|
|
31
|
+
.then((permissions) => {
|
|
32
|
+
state.entity = permissions;
|
|
33
|
+
state.error = null;
|
|
34
|
+
})
|
|
35
|
+
.catch((e) => {
|
|
36
|
+
state.error = e;
|
|
37
|
+
});
|
|
40
38
|
});
|
|
41
39
|
}
|
|
42
40
|
}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { AnTheme } from "../interfaces/themes/an-theme";
|
|
1
|
+
import { QrveyCacheManager, QvCacheStoreProperties } from "./cache-manager";
|
|
3
2
|
export interface IGetThemeConfig {
|
|
4
3
|
qv_token?: string;
|
|
5
4
|
api_key?: string;
|
|
@@ -8,21 +7,9 @@ export interface IGetThemeConfig {
|
|
|
8
7
|
domain?: string;
|
|
9
8
|
theme_id?: string;
|
|
10
9
|
}
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
error: any;
|
|
15
|
-
}
|
|
16
|
-
export declare class ThemeCacheManager extends QrveyCacheManager<IThemeStoreState, IGetThemeConfig> {
|
|
17
|
-
static getInstance(): ThemeCacheManager;
|
|
18
|
-
protected getConfigPropertyName(): keyof IGetThemeConfig;
|
|
19
|
-
protected getStorePropertyName(): keyof IThemeStoreState;
|
|
10
|
+
export declare class ThemeCacheManager extends QrveyCacheManager<QvCacheStoreProperties, IGetThemeConfig> {
|
|
11
|
+
static getInstance(): any;
|
|
12
|
+
protected getConfigEntityId(): keyof IGetThemeConfig;
|
|
20
13
|
protected buildStoreId({ theme_id, app_id }: IGetThemeConfig): string;
|
|
21
|
-
protected
|
|
22
|
-
state: IThemeStoreState;
|
|
23
|
-
onChange: OnChangeType;
|
|
24
|
-
set: (property: keyof IThemeStoreState, value: unknown) => void;
|
|
25
|
-
};
|
|
26
|
-
protected fetchDataAndUpdateStore(state: IThemeStoreState, config: IGetThemeConfig): void;
|
|
14
|
+
protected fetchDataAndUpdateStore(state: QvCacheStoreProperties, config: IGetThemeConfig): Promise<void>;
|
|
27
15
|
}
|
|
28
|
-
export {};
|
|
@@ -1,42 +1,40 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
2
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
12
|
exports.ThemeCacheManager = void 0;
|
|
4
|
-
const store_1 = require("@stencil/store");
|
|
5
13
|
const cache_manager_1 = require("./cache-manager");
|
|
6
14
|
const Themes_api_1 = require("../services/api/Themes.api");
|
|
7
15
|
class ThemeCacheManager extends cache_manager_1.QrveyCacheManager {
|
|
8
16
|
static getInstance() {
|
|
9
|
-
if (!window.
|
|
10
|
-
window.
|
|
17
|
+
if (!window.qvThemeCacheManager) {
|
|
18
|
+
window.qvThemeCacheManager = new ThemeCacheManager();
|
|
11
19
|
}
|
|
12
|
-
return window.
|
|
20
|
+
return window.qvThemeCacheManager;
|
|
13
21
|
}
|
|
14
|
-
|
|
22
|
+
getConfigEntityId() {
|
|
15
23
|
return "theme_id";
|
|
16
24
|
}
|
|
17
|
-
getStorePropertyName() {
|
|
18
|
-
return "theme";
|
|
19
|
-
}
|
|
20
25
|
buildStoreId({ theme_id, app_id }) {
|
|
21
26
|
return `${app_id}-${theme_id !== null && theme_id !== void 0 ? theme_id : "current"}`;
|
|
22
27
|
}
|
|
23
|
-
createStore() {
|
|
24
|
-
return (0, store_1.createStore)({
|
|
25
|
-
theme: null,
|
|
26
|
-
loading: true,
|
|
27
|
-
error: null,
|
|
28
|
-
});
|
|
29
|
-
}
|
|
30
28
|
fetchDataAndUpdateStore(state, config) {
|
|
31
|
-
(
|
|
32
|
-
.
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
29
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
30
|
+
return (config.theme_id ? (0, Themes_api_1.getThemeById)(config) : (0, Themes_api_1.getCurrentTheme)(config))
|
|
31
|
+
.then((theme) => {
|
|
32
|
+
state.entity = theme;
|
|
33
|
+
state.error = null;
|
|
34
|
+
})
|
|
35
|
+
.catch((e) => {
|
|
36
|
+
state.error = e;
|
|
37
|
+
});
|
|
40
38
|
});
|
|
41
39
|
}
|
|
42
40
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const cleanCacheManagers: () => Promise<void>;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.cleanCacheManagers = void 0;
|
|
13
|
+
const cache_chart_manager_1 = require("./cache-chart-manager");
|
|
14
|
+
const cache_metric_manager_1 = require("./cache-metric-manager");
|
|
15
|
+
const cache_model_manager_1 = require("./cache-model-manager");
|
|
16
|
+
const cache_permissions_manager_1 = require("./cache-permissions-manager");
|
|
17
|
+
const cache_theme_manager_1 = require("./cache-theme-manager");
|
|
18
|
+
const cleanCacheManagers = () => __awaiter(void 0, void 0, void 0, function* () {
|
|
19
|
+
const chartManager = cache_chart_manager_1.ChartCacheManager.getInstance();
|
|
20
|
+
yield chartManager.cleanAllStores();
|
|
21
|
+
const metricManager = cache_metric_manager_1.MetricCacheManager.getInstance();
|
|
22
|
+
yield metricManager.cleanAllStores();
|
|
23
|
+
const modelManager = cache_model_manager_1.ModelCacheManager.getInstance();
|
|
24
|
+
yield modelManager.cleanAllStores();
|
|
25
|
+
const permissionsManager = cache_permissions_manager_1.PermissionsCacheManager.getInstance();
|
|
26
|
+
yield permissionsManager.cleanAllStores();
|
|
27
|
+
const themeManager = cache_theme_manager_1.ThemeCacheManager.getInstance();
|
|
28
|
+
yield themeManager.cleanAllStores();
|
|
29
|
+
});
|
|
30
|
+
exports.cleanCacheManagers = cleanCacheManagers;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export * from "./cache-chart-manager";
|
|
2
|
+
export * from "./cache-manager";
|
|
3
|
+
export * from "./cache-metric-manager";
|
|
4
|
+
export * from "./cache-model-manager";
|
|
5
|
+
export * from "./cache-permissions-manager";
|
|
6
|
+
export * from "./cache-theme-manager";
|
|
7
|
+
export * from "./clean-cache-managers";
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./cache-chart-manager"), exports);
|
|
18
|
+
__exportStar(require("./cache-manager"), exports);
|
|
19
|
+
__exportStar(require("./cache-metric-manager"), exports);
|
|
20
|
+
__exportStar(require("./cache-model-manager"), exports);
|
|
21
|
+
__exportStar(require("./cache-permissions-manager"), exports);
|
|
22
|
+
__exportStar(require("./cache-theme-manager"), exports);
|
|
23
|
+
__exportStar(require("./clean-cache-managers"), exports);
|
|
@@ -27,6 +27,8 @@ exports.I18N_DASHBOARD = {
|
|
|
27
27
|
no_response: "No responses yet, they'll come when they do!",
|
|
28
28
|
no_record_found: "No Records Found",
|
|
29
29
|
inactivity: "Your qrvey has ended. Create a new one or duplicate this to run it again.",
|
|
30
|
+
loading_charts: "Loading charts",
|
|
31
|
+
loading_metrics: "Loading metrics",
|
|
30
32
|
},
|
|
31
33
|
toast: {
|
|
32
34
|
add_record_message: "Record Successfully Added.",
|
|
@@ -34,7 +36,7 @@ exports.I18N_DASHBOARD = {
|
|
|
34
36
|
delete_record_message: "Record Successfully Deleted.",
|
|
35
37
|
refresh_table_message: "Record Successfully Edited.",
|
|
36
38
|
failed_download: "The file(s) could not be exported at this time.",
|
|
37
|
-
successful_download: "{{fileType}} exported",
|
|
39
|
+
successful_download: "{{fileName}} - {{fileType}} exported.",
|
|
38
40
|
panels_loading: "Visualizations are currently loading. Try exporting again once all visualizations have loaded properly.",
|
|
39
41
|
},
|
|
40
42
|
tooltips: {
|
|
@@ -127,6 +127,7 @@ exports.I18N_PANEL = {
|
|
|
127
127
|
},
|
|
128
128
|
timeout_message: "Calculating {{type}}. This process may take a while.",
|
|
129
129
|
tooltips: {
|
|
130
|
+
exporting: "Exporting",
|
|
130
131
|
fit_panel: "Fit to panel",
|
|
131
132
|
no_filters: "No filters applied",
|
|
132
133
|
select_columns: "Select columns",
|
package/dist/cjs/index.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
export * from "./cache-managers/index";
|
|
1
2
|
export * from "./charts/index";
|
|
2
3
|
export * from "./constants/index";
|
|
3
4
|
export * from "./columns/index";
|
|
@@ -14,4 +15,4 @@ export * from "./services/index";
|
|
|
14
15
|
export * from "./typescript/index";
|
|
15
16
|
export * from "./tokens/index";
|
|
16
17
|
export * from "./column_format/index";
|
|
17
|
-
export * from "./themes";
|
|
18
|
+
export * from "./themes/index";
|
package/dist/cjs/index.js
CHANGED
|
@@ -14,6 +14,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
14
14
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./cache-managers/index"), exports);
|
|
17
18
|
__exportStar(require("./charts/index"), exports);
|
|
18
19
|
__exportStar(require("./constants/index"), exports);
|
|
19
20
|
__exportStar(require("./columns/index"), exports);
|
|
@@ -30,4 +31,4 @@ __exportStar(require("./services/index"), exports);
|
|
|
30
31
|
__exportStar(require("./typescript/index"), exports);
|
|
31
32
|
__exportStar(require("./tokens/index"), exports);
|
|
32
33
|
__exportStar(require("./column_format/index"), exports);
|
|
33
|
-
__exportStar(require("./themes"), exports);
|
|
34
|
+
__exportStar(require("./themes/index"), exports);
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { IAppType } from "./IAppType";
|
|
1
2
|
import { IBColumn } from "../../columns/interfaces/IBColumn";
|
|
2
3
|
import { IBTimezone } from "../../dates/interfaces/IBTimezone";
|
|
3
4
|
/**
|
|
@@ -9,4 +10,5 @@ export interface IBDataset {
|
|
|
9
10
|
options?: IBColumn[];
|
|
10
11
|
qrveyid: string;
|
|
11
12
|
timezone?: IBTimezone;
|
|
13
|
+
appType?: IAppType;
|
|
12
14
|
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
+
import { IAppType } from "./IAppType";
|
|
2
|
+
import { IBDataset } from "./IBDataset";
|
|
1
3
|
import { IColumn } from "../../columns/interfaces/IColumn";
|
|
2
4
|
import { IDTimezone } from "../../dates/interfaces/IDTimezone";
|
|
3
|
-
import { IBDataset } from "./IBDataset";
|
|
4
5
|
/**
|
|
5
6
|
* Structure for Dataset in the frontend side of Qrvey App
|
|
6
7
|
*/
|
|
@@ -8,4 +9,5 @@ export interface IDataset extends Omit<IBDataset, "name" | "options" | "timezone
|
|
|
8
9
|
label?: string;
|
|
9
10
|
options?: IColumn[];
|
|
10
11
|
timezone?: IDTimezone;
|
|
12
|
+
appType?: IAppType;
|
|
11
13
|
}
|
|
@@ -6,6 +6,7 @@ const BColumnsToUIColumns_adapter_1 = require("./BColumnsToUIColumns.adapter");
|
|
|
6
6
|
const BTimezoneToUITimezone_1 = require("./BTimezoneToUITimezone");
|
|
7
7
|
function BDatasetsToUIDatasets(datasets = []) {
|
|
8
8
|
return datasets.map((dataset) => ({
|
|
9
|
+
appType: dataset.appType,
|
|
9
10
|
qrveyid: (0, getAttribute_1.getAttribute)(dataset, "qrvey_id"),
|
|
10
11
|
label: dataset.name,
|
|
11
12
|
options: (0, BColumnsToUIColumns_adapter_1.BColumnsToUIColumns)(dataset.options, dataset),
|
|
@@ -13,7 +13,7 @@ class MetricPanelApi {
|
|
|
13
13
|
let params = lang ? `?lang=${lang}` : "";
|
|
14
14
|
params += `${connector}translated=${translated}`;
|
|
15
15
|
params += (timezone === null || timezone === void 0 ? void 0 : timezone.offset) ? `&tzoffset=${timezone.offset}` : "";
|
|
16
|
-
return Request_1.Request.get(Object.assign(Object.assign({}, config), { endpoint: METRIC_ENDPOINT_1.METRICVIEW_ENDPOINT }), "/:metric_id" + params);
|
|
16
|
+
return Request_1.Request.get(Object.assign(Object.assign({}, config), { endpoint: METRIC_ENDPOINT_1.METRICVIEW_ENDPOINT, headers: { "temporal-tokens": true } }), "/:metric_id" + params);
|
|
17
17
|
}
|
|
18
18
|
}
|
|
19
19
|
exports.default = MetricPanelApi;
|
|
@@ -51,7 +51,7 @@ class Request {
|
|
|
51
51
|
const admin = endpoint.admin ? "/admin" : "";
|
|
52
52
|
const api = Request.getApiUrl(config);
|
|
53
53
|
const user = Request.getUserUrl(config);
|
|
54
|
-
const base = `${
|
|
54
|
+
const base = `${api}${admin}${version}${user}`;
|
|
55
55
|
_url = (config.domain || "") + base + endpoint.uri + _url;
|
|
56
56
|
}
|
|
57
57
|
return this.parseUrl(_url, config);
|
|
@@ -75,6 +75,7 @@ class Request {
|
|
|
75
75
|
: "";
|
|
76
76
|
}
|
|
77
77
|
static requestConfig(reqData) {
|
|
78
|
+
var _a;
|
|
78
79
|
const cfg = {
|
|
79
80
|
method: reqData.type,
|
|
80
81
|
headers: {
|
|
@@ -98,6 +99,9 @@ class Request {
|
|
|
98
99
|
if (timezoneOffset) {
|
|
99
100
|
cfg.headers["q-timezone-control"] = `offset=${timezoneOffset}`;
|
|
100
101
|
}
|
|
102
|
+
if ((_a = reqData === null || reqData === void 0 ? void 0 : reqData.config) === null || _a === void 0 ? void 0 : _a.headers) {
|
|
103
|
+
cfg.headers = Object.assign(Object.assign({}, cfg.headers), reqData.config.headers);
|
|
104
|
+
}
|
|
101
105
|
// AbortSignal (https://developers.google.com/web/updates/2017/09/abortable-fetch)
|
|
102
106
|
if (reqData.config && reqData.config.signal) {
|
|
103
107
|
cfg.signal = reqData.config.signal;
|
|
@@ -24,6 +24,8 @@ export const I18N_DASHBOARD = {
|
|
|
24
24
|
no_response: "No responses yet, they'll come when they do!",
|
|
25
25
|
no_record_found: "No Records Found",
|
|
26
26
|
inactivity: "Your qrvey has ended. Create a new one or duplicate this to run it again.",
|
|
27
|
+
loading_charts: "Loading charts",
|
|
28
|
+
loading_metrics: "Loading metrics",
|
|
27
29
|
},
|
|
28
30
|
toast: {
|
|
29
31
|
add_record_message: "Record Successfully Added.",
|
|
@@ -31,7 +33,7 @@ export const I18N_DASHBOARD = {
|
|
|
31
33
|
delete_record_message: "Record Successfully Deleted.",
|
|
32
34
|
refresh_table_message: "Record Successfully Edited.",
|
|
33
35
|
failed_download: "The file(s) could not be exported at this time.",
|
|
34
|
-
successful_download: "{{fileType}} exported",
|
|
36
|
+
successful_download: "{{fileName}} - {{fileType}} exported.",
|
|
35
37
|
panels_loading: "Visualizations are currently loading. Try exporting again once all visualizations have loaded properly.",
|
|
36
38
|
},
|
|
37
39
|
tooltips: {
|
|
@@ -124,6 +124,7 @@ export const I18N_PANEL = {
|
|
|
124
124
|
},
|
|
125
125
|
timeout_message: "Calculating {{type}}. This process may take a while.",
|
|
126
126
|
tooltips: {
|
|
127
|
+
exporting: "Exporting",
|
|
127
128
|
fit_panel: "Fit to panel",
|
|
128
129
|
no_filters: "No filters applied",
|
|
129
130
|
select_columns: "Select columns",
|
package/dist/index.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
export * from "./cache-managers/index";
|
|
1
2
|
export * from "./charts/index";
|
|
2
3
|
export * from "./constants/index";
|
|
3
4
|
export * from "./columns/index";
|
|
@@ -14,4 +15,4 @@ export * from "./services/index";
|
|
|
14
15
|
export * from "./typescript/index";
|
|
15
16
|
export * from "./tokens/index";
|
|
16
17
|
export * from "./column_format/index";
|
|
17
|
-
export * from "./themes";
|
|
18
|
+
export * from "./themes/index";
|
package/dist/index.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
export * from "./cache-managers/index";
|
|
1
2
|
export * from "./charts/index";
|
|
2
3
|
export * from "./constants/index";
|
|
3
4
|
export * from "./columns/index";
|
|
@@ -14,4 +15,4 @@ export * from "./services/index";
|
|
|
14
15
|
export * from "./typescript/index";
|
|
15
16
|
export * from "./tokens/index";
|
|
16
17
|
export * from "./column_format/index";
|
|
17
|
-
export * from "./themes";
|
|
18
|
+
export * from "./themes/index";
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { IAppType } from "./IAppType";
|
|
1
2
|
import { IBColumn } from "../../columns/interfaces/IBColumn";
|
|
2
3
|
import { IBTimezone } from "../../dates/interfaces/IBTimezone";
|
|
3
4
|
/**
|
|
@@ -9,4 +10,5 @@ export interface IBDataset {
|
|
|
9
10
|
options?: IBColumn[];
|
|
10
11
|
qrveyid: string;
|
|
11
12
|
timezone?: IBTimezone;
|
|
13
|
+
appType?: IAppType;
|
|
12
14
|
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
+
import { IAppType } from "./IAppType";
|
|
2
|
+
import { IBDataset } from "./IBDataset";
|
|
1
3
|
import { IColumn } from "../../columns/interfaces/IColumn";
|
|
2
4
|
import { IDTimezone } from "../../dates/interfaces/IDTimezone";
|
|
3
|
-
import { IBDataset } from "./IBDataset";
|
|
4
5
|
/**
|
|
5
6
|
* Structure for Dataset in the frontend side of Qrvey App
|
|
6
7
|
*/
|
|
@@ -8,4 +9,5 @@ export interface IDataset extends Omit<IBDataset, "name" | "options" | "timezone
|
|
|
8
9
|
label?: string;
|
|
9
10
|
options?: IColumn[];
|
|
10
11
|
timezone?: IDTimezone;
|
|
12
|
+
appType?: IAppType;
|
|
11
13
|
}
|
|
@@ -3,6 +3,7 @@ import { BColumnsToUIColumns } from "./BColumnsToUIColumns.adapter";
|
|
|
3
3
|
import { BTimezoneToUITimezone } from "./BTimezoneToUITimezone";
|
|
4
4
|
export function BDatasetsToUIDatasets(datasets = []) {
|
|
5
5
|
return datasets.map((dataset) => ({
|
|
6
|
+
appType: dataset.appType,
|
|
6
7
|
qrveyid: getAttribute(dataset, "qrvey_id"),
|
|
7
8
|
label: dataset.name,
|
|
8
9
|
options: BColumnsToUIColumns(dataset.options, dataset),
|
|
@@ -11,6 +11,6 @@ export default class MetricPanelApi {
|
|
|
11
11
|
let params = lang ? `?lang=${lang}` : "";
|
|
12
12
|
params += `${connector}translated=${translated}`;
|
|
13
13
|
params += (timezone === null || timezone === void 0 ? void 0 : timezone.offset) ? `&tzoffset=${timezone.offset}` : "";
|
|
14
|
-
return Request.get(Object.assign(Object.assign({}, config), { endpoint: METRICVIEW_ENDPOINT }), "/:metric_id" + params);
|
|
14
|
+
return Request.get(Object.assign(Object.assign({}, config), { endpoint: METRICVIEW_ENDPOINT, headers: { "temporal-tokens": true } }), "/:metric_id" + params);
|
|
15
15
|
}
|
|
16
16
|
}
|
|
@@ -48,7 +48,7 @@ export class Request {
|
|
|
48
48
|
const admin = endpoint.admin ? "/admin" : "";
|
|
49
49
|
const api = Request.getApiUrl(config);
|
|
50
50
|
const user = Request.getUserUrl(config);
|
|
51
|
-
const base = `${
|
|
51
|
+
const base = `${api}${admin}${version}${user}`;
|
|
52
52
|
_url = (config.domain || "") + base + endpoint.uri + _url;
|
|
53
53
|
}
|
|
54
54
|
return this.parseUrl(_url, config);
|
|
@@ -72,6 +72,7 @@ export class Request {
|
|
|
72
72
|
: "";
|
|
73
73
|
}
|
|
74
74
|
static requestConfig(reqData) {
|
|
75
|
+
var _a;
|
|
75
76
|
const cfg = {
|
|
76
77
|
method: reqData.type,
|
|
77
78
|
headers: {
|
|
@@ -95,6 +96,9 @@ export class Request {
|
|
|
95
96
|
if (timezoneOffset) {
|
|
96
97
|
cfg.headers["q-timezone-control"] = `offset=${timezoneOffset}`;
|
|
97
98
|
}
|
|
99
|
+
if ((_a = reqData === null || reqData === void 0 ? void 0 : reqData.config) === null || _a === void 0 ? void 0 : _a.headers) {
|
|
100
|
+
cfg.headers = Object.assign(Object.assign({}, cfg.headers), reqData.config.headers);
|
|
101
|
+
}
|
|
98
102
|
// AbortSignal (https://developers.google.com/web/updates/2017/09/abortable-fetch)
|
|
99
103
|
if (reqData.config && reqData.config.signal) {
|
|
100
104
|
cfg.signal = reqData.config.signal;
|