@quillsql/admin 1.3.6 → 1.3.7

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/cjs/Admin.js CHANGED
@@ -81,7 +81,7 @@ function EditFiltersModal({ isOpen, dashboardData, selectedDashboard, client, se
81
81
  }
82
82
  }, [data]);
83
83
  (0, react_1.useEffect)(() => {
84
- setIsDateComparison(!!state.dateFilter.comparison);
84
+ setIsDateComparison(!!state.dateFilter?.comparison ?? false);
85
85
  }, [state.dateFilter]);
86
86
  (0, react_1.useEffect)(() => {
87
87
  if (state.tables.length) {
@@ -144,7 +144,7 @@ function EditFiltersModal({ isOpen, dashboardData, selectedDashboard, client, se
144
144
  }
145
145
  });
146
146
  if (hasDuplicateField ||
147
- (Object.keys(newDateFilter).length > 0 &&
147
+ (newDateFilter && Object.keys(newDateFilter).length > 0 &&
148
148
  updatedFilters.some((filter) => filter.filterType === 'date'))) {
149
149
  alert('Maximum of one filter per field');
150
150
  return;
@@ -164,11 +164,11 @@ function EditFiltersModal({ isOpen, dashboardData, selectedDashboard, client, se
164
164
  const body = {
165
165
  newDashboardName: selectedDashboardName,
166
166
  filters: updatedFilters,
167
- dateFilter: {
167
+ dateFilter: newDateFilter ? {
168
168
  ...newDateFilter,
169
169
  comparison: isDateComparison,
170
170
  primaryRange: initialRange,
171
- },
171
+ } : null,
172
172
  name: selectedDashboard,
173
173
  };
174
174
  dispatch({ type: 'SET_DATE_FILTER', payload: body.dateFilter });
@@ -195,7 +195,7 @@ function EditFiltersModal({ isOpen, dashboardData, selectedDashboard, client, se
195
195
  };
196
196
  const handleDeleteDateFilter = async () => {
197
197
  setShowDateFilter(false);
198
- setNewDateFilter({});
198
+ setNewDateFilter(null);
199
199
  };
200
200
  const handleAddDateFilter = async () => {
201
201
  setShowDateFilter(true);
@@ -219,7 +219,7 @@ function EditFiltersModal({ isOpen, dashboardData, selectedDashboard, client, se
219
219
  return ((0, jsx_runtime_1.jsx)(ModalComponent, { isOpen: isOpen, close: () => {
220
220
  setIsOpen(false);
221
221
  setNewFilters([]);
222
- setIsDateComparison(state.dateFilter.comparison);
222
+ setIsDateComparison(state.dateFilter?.comparison ?? false);
223
223
  }, style: {
224
224
  minWidth: '814px',
225
225
  maxWidth: '814px',
@@ -22,5 +22,5 @@ export declare const defaultDateRange: {
22
22
  readonly value: "LAST_90_DAYS";
23
23
  readonly label: "Last 90 days";
24
24
  };
25
- export declare const QUILL_SERVER = "https://quill-344421.uc.r.appspot.com";
25
+ export declare const QUILL_SERVER: string;
26
26
  //# sourceMappingURL=constants.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../src/utils/constants.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,eAAO,MAAM,uBAAuB;;;;;;;;;;;;;;;EAM1B,CAAC;AACX,MAAM,MAAM,eAAe,GAAG,CAAC,OAAO,uBAAuB,CAAC,CAAC,MAAM,CAAC,CAAC;AACvE,eAAO,MAAM,gBAAgB;;;CAA6B,CAAC;AAG3D,eAAO,MAAM,YAAY,0CAA0C,CAAC"}
1
+ {"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../src/utils/constants.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,eAAO,MAAM,uBAAuB;;;;;;;;;;;;;;;EAM1B,CAAC;AACX,MAAM,MAAM,eAAe,GAAG,CAAC,OAAO,uBAAuB,CAAC,CAAC,MAAM,CAAC,CAAC;AACvE,eAAO,MAAM,gBAAgB;;;CAA6B,CAAC;AAE3D,eAAO,MAAM,YAAY,QACiD,CAAC"}
@@ -12,5 +12,4 @@ exports.InitialDateRangeOptions = [
12
12
  { value: 'ALL_TIME', label: 'All time' },
13
13
  ];
14
14
  exports.defaultDateRange = exports.InitialDateRangeOptions[0];
15
- // export const QUILL_SERVER = 'http://localhost:8080';
16
- exports.QUILL_SERVER = 'https://quill-344421.uc.r.appspot.com';
15
+ exports.QUILL_SERVER = process.env.QUILL_SERVER_HOST ?? 'https://quill-344421.uc.r.appspot.com';
package/dist/esm/Admin.js CHANGED
@@ -52,7 +52,7 @@ export function EditFiltersModal({ isOpen, dashboardData, selectedDashboard, cli
52
52
  }
53
53
  }, [data]);
54
54
  useEffect(() => {
55
- setIsDateComparison(!!state.dateFilter.comparison);
55
+ setIsDateComparison(!!state.dateFilter?.comparison ?? false);
56
56
  }, [state.dateFilter]);
57
57
  useEffect(() => {
58
58
  if (state.tables.length) {
@@ -115,7 +115,7 @@ export function EditFiltersModal({ isOpen, dashboardData, selectedDashboard, cli
115
115
  }
116
116
  });
117
117
  if (hasDuplicateField ||
118
- (Object.keys(newDateFilter).length > 0 &&
118
+ (newDateFilter && Object.keys(newDateFilter).length > 0 &&
119
119
  updatedFilters.some((filter) => filter.filterType === 'date'))) {
120
120
  alert('Maximum of one filter per field');
121
121
  return;
@@ -135,11 +135,11 @@ export function EditFiltersModal({ isOpen, dashboardData, selectedDashboard, cli
135
135
  const body = {
136
136
  newDashboardName: selectedDashboardName,
137
137
  filters: updatedFilters,
138
- dateFilter: {
138
+ dateFilter: newDateFilter ? {
139
139
  ...newDateFilter,
140
140
  comparison: isDateComparison,
141
141
  primaryRange: initialRange,
142
- },
142
+ } : null,
143
143
  name: selectedDashboard,
144
144
  };
145
145
  dispatch({ type: 'SET_DATE_FILTER', payload: body.dateFilter });
@@ -166,7 +166,7 @@ export function EditFiltersModal({ isOpen, dashboardData, selectedDashboard, cli
166
166
  };
167
167
  const handleDeleteDateFilter = async () => {
168
168
  setShowDateFilter(false);
169
- setNewDateFilter({});
169
+ setNewDateFilter(null);
170
170
  };
171
171
  const handleAddDateFilter = async () => {
172
172
  setShowDateFilter(true);
@@ -190,7 +190,7 @@ export function EditFiltersModal({ isOpen, dashboardData, selectedDashboard, cli
190
190
  return (_jsx(ModalComponent, { isOpen: isOpen, close: () => {
191
191
  setIsOpen(false);
192
192
  setNewFilters([]);
193
- setIsDateComparison(state.dateFilter.comparison);
193
+ setIsDateComparison(state.dateFilter?.comparison ?? false);
194
194
  }, style: {
195
195
  minWidth: '814px',
196
196
  maxWidth: '814px',
@@ -22,5 +22,5 @@ export declare const defaultDateRange: {
22
22
  readonly value: "LAST_90_DAYS";
23
23
  readonly label: "Last 90 days";
24
24
  };
25
- export declare const QUILL_SERVER = "https://quill-344421.uc.r.appspot.com";
25
+ export declare const QUILL_SERVER: string;
26
26
  //# sourceMappingURL=constants.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../src/utils/constants.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,eAAO,MAAM,uBAAuB;;;;;;;;;;;;;;;EAM1B,CAAC;AACX,MAAM,MAAM,eAAe,GAAG,CAAC,OAAO,uBAAuB,CAAC,CAAC,MAAM,CAAC,CAAC;AACvE,eAAO,MAAM,gBAAgB;;;CAA6B,CAAC;AAG3D,eAAO,MAAM,YAAY,0CAA0C,CAAC"}
1
+ {"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../src/utils/constants.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,eAAO,MAAM,uBAAuB;;;;;;;;;;;;;;;EAM1B,CAAC;AACX,MAAM,MAAM,eAAe,GAAG,CAAC,OAAO,uBAAuB,CAAC,CAAC,MAAM,CAAC,CAAC;AACvE,eAAO,MAAM,gBAAgB;;;CAA6B,CAAC;AAE3D,eAAO,MAAM,YAAY,QACiD,CAAC"}
@@ -9,5 +9,4 @@ export const InitialDateRangeOptions = [
9
9
  { value: 'ALL_TIME', label: 'All time' },
10
10
  ];
11
11
  export const defaultDateRange = InitialDateRangeOptions[0];
12
- // export const QUILL_SERVER = 'http://localhost:8080';
13
- export const QUILL_SERVER = 'https://quill-344421.uc.r.appspot.com';
12
+ export const QUILL_SERVER = process.env.QUILL_SERVER_HOST ?? 'https://quill-344421.uc.r.appspot.com';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@quillsql/admin",
3
- "version": "1.3.6",
3
+ "version": "1.3.7",
4
4
  "description": "Admin tools for Quill",
5
5
  "exports": {
6
6
  ".": {