@civicactions/cmsds-open-data-components 3.0.0-alpha.19 → 3.0.0-alpha.20

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/main.js CHANGED
@@ -1988,7 +1988,7 @@ var $2ed0091f7e32d1e6$export$2e2bcd8739ae039 = $2ed0091f7e32d1e6$var$DataTablePa
1988
1988
 
1989
1989
 
1990
1990
 
1991
- const $6380a4a580b24362$var$DataTableHeader = ({ resource: resource , downloadURL: downloadURL })=>{
1991
+ const $6380a4a580b24362$var$DataTableHeader = ({ resource: resource , downloadURL: downloadURL , jsonUrl: jsonUrl })=>{
1992
1992
  const { limit: limit , offset: offset , count: count } = resource;
1993
1993
  const intCount = count ? count : 0;
1994
1994
  return /*#__PURE__*/ (0, $hgUW1$jsx)("div", {
@@ -2044,6 +2044,23 @@ const $6380a4a580b24362$var$DataTableHeader = ({ resource: resource , downloadUR
2044
2044
  ]
2045
2045
  })
2046
2046
  })
2047
+ }),
2048
+ jsonUrl && /*#__PURE__*/ (0, $hgUW1$jsx)("div", {
2049
+ className: "ds-l-col--12 ds-l-sm-col--auto ds-u-padding-x--0 ds-u-margin-left--2 ds-u-margin-top--2 ds-u-sm-margin-top--0",
2050
+ children: /*#__PURE__*/ (0, $hgUW1$jsx)((0, $hgUW1$Button), {
2051
+ className: "ds-u-text-align--center ds-u-font-weight--normal ds-u-font-size--base ds-u-margin-right--1 ds-u-display--inline-block ds-l-col--12",
2052
+ href: jsonUrl,
2053
+ "aria-label": "Export to .JSON",
2054
+ children: /*#__PURE__*/ (0, $hgUW1$jsxs)("span", {
2055
+ className: "ds-u-font-weight--semibold ds-u-margin-left--1 ds-u-padding--0",
2056
+ children: [
2057
+ /*#__PURE__*/ (0, $hgUW1$jsx)("i", {
2058
+ className: "fas fa-file-code"
2059
+ }),
2060
+ " Export to JSON"
2061
+ ]
2062
+ })
2063
+ })
2047
2064
  })
2048
2065
  ]
2049
2066
  })
@@ -2066,7 +2083,7 @@ var $6380a4a580b24362$export$2e2bcd8739ae039 = $6380a4a580b24362$var$DataTableHe
2066
2083
 
2067
2084
  const $bef7bff2823feea2$var$QueryTitle = ({ conditions: conditions , schema: schema , customColumns: customColumns })=>{
2068
2085
  const { fields: fields } = schema;
2069
- if (!conditions.length) return /*#__PURE__*/ (0, $hgUW1$jsx)((0, $hgUW1$Fragment), {
2086
+ if (!conditions || !conditions.length) return /*#__PURE__*/ (0, $hgUW1$jsx)((0, $hgUW1$Fragment), {
2070
2087
  children: "Add a filter"
2071
2088
  });
2072
2089
  function formatValue(text, property) {
@@ -2268,6 +2285,7 @@ const $ee4ad47aa483e5b5$var$QueryBuilder = (props)=>{
2268
2285
  const { resource: resource , id: id , includeSearchParams: includeSearchParams , customColumns: customColumns } = props;
2269
2286
  const { conditions: conditions , schema: schema , setConditions: setConditions } = resource;
2270
2287
  const fields = Object.keys(schema[id].fields);
2288
+ console.log(resource);
2271
2289
  const [conditionsCleared, setConditionsCleared] = (0, $hgUW1$useState)(false);
2272
2290
  const [queryConditions, setQueryConditions] = (0, $hgUW1$useState)([]);
2273
2291
  const [titleConditions, setTitleConditions] = (0, $hgUW1$useState)([]); // Add use effect to load conditions on first load if needed
@@ -2294,6 +2312,7 @@ const $ee4ad47aa483e5b5$var$QueryBuilder = (props)=>{
2294
2312
  ]);
2295
2313
  };
2296
2314
  (0, $hgUW1$react).useEffect(()=>{
2315
+ console.log(conditions);
2297
2316
  addCondition(conditions);
2298
2317
  setTitleConditions(conditions);
2299
2318
  }, []);
@@ -2325,6 +2344,7 @@ const $ee4ad47aa483e5b5$var$QueryBuilder = (props)=>{
2325
2344
  return $ee4ad47aa483e5b5$var$updateQueryForDatastore(cond);
2326
2345
  });
2327
2346
  setConditions(submitConditions);
2347
+ console.log(queryConditions);
2328
2348
  setTitleConditions(queryConditions.map((oc)=>Object.assign({}, oc)));
2329
2349
  setConditionsChanged(false);
2330
2350
  if (includeSearchParams) {
@@ -2353,6 +2373,7 @@ const $ee4ad47aa483e5b5$var$QueryBuilder = (props)=>{
2353
2373
  setConditionsChanged(true);
2354
2374
  setConditionsCleared(true);
2355
2375
  };
2376
+ console.log(titleConditions);
2356
2377
  return /*#__PURE__*/ (0, $hgUW1$jsx)("div", {
2357
2378
  className: "dc-query-builder ds-u-margin-bottom--3",
2358
2379
  children: /*#__PURE__*/ (0, $hgUW1$jsx)((0, $hgUW1$Accordion), {
@@ -2433,7 +2454,7 @@ function $a35cf16d1488f54e$export$1147582dfae658c6(columns, schema) {
2433
2454
  accessor: column
2434
2455
  }));
2435
2456
  }
2436
- const $a35cf16d1488f54e$var$DatasetTable = ({ id: id , distribution: distribution , resource: resource , rootUrl: rootUrl , customColumns: customColumns = [] })=>{
2457
+ const $a35cf16d1488f54e$var$DatasetTable = ({ id: id , distribution: distribution , resource: resource , rootUrl: rootUrl , customColumns: customColumns = [] , jsonUrl: jsonUrl })=>{
2437
2458
  const defaultPage = 1;
2438
2459
  const defaultPageSize = 10;
2439
2460
  const [page, setPage] = (0, $hgUW1$useState)(defaultPage);
@@ -2461,7 +2482,8 @@ const $a35cf16d1488f54e$var$DatasetTable = ({ id: id , distribution: distributio
2461
2482
  }),
2462
2483
  /*#__PURE__*/ (0, $hgUW1$jsx)((0, $6380a4a580b24362$export$2e2bcd8739ae039), {
2463
2484
  resource: resource,
2464
- downloadURL: downloadURL
2485
+ downloadURL: downloadURL,
2486
+ jsonUrl: jsonUrl
2465
2487
  }),
2466
2488
  /*#__PURE__*/ (0, $hgUW1$jsx)("div", {
2467
2489
  className: "ds-u-overflow--auto ds-u-border-x--1 ds-u-border-bottom--1",
@@ -2769,7 +2791,7 @@ const $789279954d8eff7f$var$ApiDocumentation = ({ endpoint: endpoint })=>{
2769
2791
  var $789279954d8eff7f$export$2e2bcd8739ae039 = $789279954d8eff7f$var$ApiDocumentation;
2770
2792
 
2771
2793
 
2772
- const $cf6eaefd6b928de3$var$DatasetAPI = ({ id: id , rootUrl: rootUrl , apiUrl: apiUrl })=>{
2794
+ const $cf6eaefd6b928de3$var$DatasetAPI = ({ id: id , rootUrl: rootUrl , apiUrl: apiUrl , additionalParams: additionalParams })=>{
2773
2795
  return /*#__PURE__*/ (0, $hgUW1$jsxs)((0, $hgUW1$Fragment), {
2774
2796
  children: [
2775
2797
  /*#__PURE__*/ (0, $hgUW1$jsxs)("div", {
@@ -2811,7 +2833,7 @@ const $cf6eaefd6b928de3$var$DatasetAPI = ({ id: id , rootUrl: rootUrl , apiUrl:
2811
2833
  ]
2812
2834
  }),
2813
2835
  /*#__PURE__*/ (0, $hgUW1$jsx)((0, $789279954d8eff7f$export$2e2bcd8739ae039), {
2814
- endpoint: `${rootUrl}/metastore/schemas/dataset/items/${id}/docs`
2836
+ endpoint: `${rootUrl}/metastore/schemas/dataset/items/${id}/docs${additionalParams && additionalParams.ACA ? "?ACA=" + additionalParams.ACA + "&redirect=false" : ""}`
2815
2837
  })
2816
2838
  ]
2817
2839
  });
@@ -2918,13 +2940,11 @@ const $a0f13962e513caa1$var$Dataset = ({ id: id , rootUrl: rootUrl , additionalP
2918
2940
  const { siteWideDataDictionary: siteWideDataDictionary } = dataDictionaryUrl ? $a0f13962e513caa1$var$getSiteWideDataDictionary(rootUrl, dataDictionaryUrl) : {
2919
2941
  siteWideDataDictionary: null
2920
2942
  };
2921
- console.log(siteWideDataDictionary);
2922
2943
  // compare schema fields with siteWideDataDictionary to display commonalities for now
2923
2944
  // until dataset level data dictionaries are implemented
2924
2945
  const datasetDictionary = siteWideDataDictionary && resource && resource.schema[distribution.identifier] ? siteWideDataDictionary.data.fields.filter((field)=>{
2925
2946
  return Object.keys(resource.schema[distribution.identifier].fields).indexOf(field.name) !== -1;
2926
2947
  }) : null;
2927
- console.log(datasetDictionary);
2928
2948
  (0, $hgUW1$useEffect)(()=>{
2929
2949
  if (distribution.identifier) {
2930
2950
  resource.setResource(distribution.identifier);
@@ -3070,7 +3090,8 @@ const $a0f13962e513caa1$var$Dataset = ({ id: id , rootUrl: rootUrl , additionalP
3070
3090
  children: /*#__PURE__*/ (0, $hgUW1$jsx)((0, $cf6eaefd6b928de3$export$2e2bcd8739ae039), {
3071
3091
  id: id,
3072
3092
  rootUrl: rootUrl,
3073
- apiUrl: apiPageUrl
3093
+ apiUrl: apiPageUrl,
3094
+ additionalParams: additionalParams
3074
3095
  })
3075
3096
  })
3076
3097
  ]
@@ -3101,6 +3122,7 @@ var $a0f13962e513caa1$export$2e2bcd8739ae039 = (0, $61ff88fb3f6ee2c8$export$2e2b
3101
3122
 
3102
3123
 
3103
3124
 
3125
+
3104
3126
  const $e5bfafc6d4e6f207$var$SearchModal = ({ searchFunc: searchFunc , appNodeId: appNodeId , headingText: headingText , searchModalText: searchModalText , buttonSize: buttonSize , inversedModalButton: inversedModalButton , inversedSearchButton: inversedSearchButton })=>{
3105
3127
  const navigate = (0, $hgUW1$useNavigate)();
3106
3128
  const [modalSearchTerm, setModalSearchTerm] = (0, $hgUW1$useState)("");
@@ -5113,6 +5135,7 @@ const $3b6ca952e79f0695$var$QueryBuilder = ({ resource: resource , id: id , incl
5113
5135
  ]);
5114
5136
  };
5115
5137
  (0, $hgUW1$react).useEffect(()=>{
5138
+ console.log(conditions);
5116
5139
  addCondition(conditions);
5117
5140
  setTitleConditions(conditions);
5118
5141
  }, []);
@@ -5136,6 +5159,7 @@ const $3b6ca952e79f0695$var$QueryBuilder = ({ resource: resource , id: id , incl
5136
5159
  return $3b6ca952e79f0695$var$updateQueryForDatastore(cond);
5137
5160
  });
5138
5161
  setConditions(submitConditions);
5162
+ console.log(queryConditions);
5139
5163
  setTitleConditions(queryConditions.map((oc)=>Object.assign({}, oc)));
5140
5164
  setConditionsChanged(false);
5141
5165
  if (includeSearchParams) {
@@ -5163,6 +5187,7 @@ const $3b6ca952e79f0695$var$QueryBuilder = ({ resource: resource , id: id , incl
5163
5187
  setQueryConditions(newConditions);
5164
5188
  setConditionsChanged(true);
5165
5189
  };
5190
+ console.log(titleConditions);
5166
5191
  return /*#__PURE__*/ (0, $hgUW1$jsx)("div", {
5167
5192
  className: "dc-query-builder ds-u-margin-bottom--3",
5168
5193
  children: /*#__PURE__*/ (0, $hgUW1$jsx)((0, $hgUW1$Accordion), {
@@ -5452,5 +5477,5 @@ var $90fb213ab8eeb2e7$export$2e2bcd8739ae039 = $90fb213ab8eeb2e7$var$useScrollTo
5452
5477
 
5453
5478
 
5454
5479
 
5455
- export {$f57121650539d8c5$export$2e2bcd8739ae039 as NavBar, $c96c4b9ef7203c1f$export$2e2bcd8739ae039 as APIPage, $026cb986f9fea2b1$export$2e2bcd8739ae039 as PageNotFound, $e873081a6e8f024e$export$2e2bcd8739ae039 as DatasetSearch, $a0f13962e513caa1$export$2e2bcd8739ae039 as Dataset, $a5a6a06d249c33b8$export$2e2bcd8739ae039 as Header, $a6df0aa147323304$export$2e2bcd8739ae039 as Footer, $669d2782ec2e2250$export$2e2bcd8739ae039 as SpecsAndLimits, $efc410f5f7ac5ef3$export$2e2bcd8739ae039 as useSearchAPI, $1d3d480a9cfaabe0$export$2e2bcd8739ae039 as useDatastore, $aa4450dcbeef3ac0$export$385a5aba38cc3325 as transformTableSortToQuerySort, $59a079354baa335c$export$2e2bcd8739ae039 as Hero, $52c6454cae137465$export$2e2bcd8739ae039 as DatasetSearchListItem, $789279954d8eff7f$export$2e2bcd8739ae039 as ApiDocumentation, $af099c546cb226c7$export$2e2bcd8739ae039 as ResourceHeader, $626282d9a03c51d5$export$2e2bcd8739ae039 as ResourcePreview, $072291d44ce1834a$export$2e2bcd8739ae039 as ResourceFooter, $ec3e23baa005dc03$export$2e2bcd8739ae039 as Breadcrumb, $bd76a91923d7e8a7$export$2e2bcd8739ae039 as TransformedDate, $d98f94c79ddf4e0e$export$2e2bcd8739ae039 as DataTable, $5644ebd2c3dbfd7b$export$eea3a12df15499ca as buildRows, $f61ecf9f84951a61$export$2e2bcd8739ae039 as FilteredResource, $bef7bff2823feea2$export$2e2bcd8739ae039 as QueryTitle, $7264a673914aa746$export$2b9377795161999 as buildOperatorOptions, $7264a673914aa746$export$e284ae5d89467c8f as convertUTCToLocalDate, $7264a673914aa746$export$6b5e57d20078142b as cleanText, $7264a673914aa746$export$8049e8f40a9bdfb8 as buildCustomColHeaders, $eb7821d186b1a389$export$2e2bcd8739ae039 as useAddLoginLink, $90fb213ab8eeb2e7$export$2e2bcd8739ae039 as useScrollToTop, $b4aa9c66f2e86959$export$2e2bcd8739ae039 as useMetastoreDataset, $6da0396069e23175$export$bc27cf7ecf44639d as defaultMetadataMapping, $2ed0091f7e32d1e6$export$2e2bcd8739ae039 as DataTablePageResults};
5480
+ export {$f57121650539d8c5$export$2e2bcd8739ae039 as NavBar, $c96c4b9ef7203c1f$export$2e2bcd8739ae039 as APIPage, $026cb986f9fea2b1$export$2e2bcd8739ae039 as PageNotFound, $e873081a6e8f024e$export$2e2bcd8739ae039 as DatasetSearch, $a0f13962e513caa1$export$2e2bcd8739ae039 as Dataset, $a35cf16d1488f54e$export$2e2bcd8739ae039 as DatasetTable, $a5a6a06d249c33b8$export$2e2bcd8739ae039 as Header, $a6df0aa147323304$export$2e2bcd8739ae039 as Footer, $669d2782ec2e2250$export$2e2bcd8739ae039 as SpecsAndLimits, $efc410f5f7ac5ef3$export$2e2bcd8739ae039 as useSearchAPI, $1d3d480a9cfaabe0$export$2e2bcd8739ae039 as useDatastore, $aa4450dcbeef3ac0$export$385a5aba38cc3325 as transformTableSortToQuerySort, $59a079354baa335c$export$2e2bcd8739ae039 as Hero, $52c6454cae137465$export$2e2bcd8739ae039 as DatasetSearchListItem, $789279954d8eff7f$export$2e2bcd8739ae039 as ApiDocumentation, $af099c546cb226c7$export$2e2bcd8739ae039 as ResourceHeader, $626282d9a03c51d5$export$2e2bcd8739ae039 as ResourcePreview, $072291d44ce1834a$export$2e2bcd8739ae039 as ResourceFooter, $ec3e23baa005dc03$export$2e2bcd8739ae039 as Breadcrumb, $bd76a91923d7e8a7$export$2e2bcd8739ae039 as TransformedDate, $d98f94c79ddf4e0e$export$2e2bcd8739ae039 as DataTable, $5644ebd2c3dbfd7b$export$eea3a12df15499ca as buildRows, $f61ecf9f84951a61$export$2e2bcd8739ae039 as FilteredResource, $bef7bff2823feea2$export$2e2bcd8739ae039 as QueryTitle, $7264a673914aa746$export$2b9377795161999 as buildOperatorOptions, $7264a673914aa746$export$e284ae5d89467c8f as convertUTCToLocalDate, $7264a673914aa746$export$6b5e57d20078142b as cleanText, $7264a673914aa746$export$8049e8f40a9bdfb8 as buildCustomColHeaders, $eb7821d186b1a389$export$2e2bcd8739ae039 as useAddLoginLink, $90fb213ab8eeb2e7$export$2e2bcd8739ae039 as useScrollToTop, $b4aa9c66f2e86959$export$2e2bcd8739ae039 as useMetastoreDataset, $6da0396069e23175$export$bc27cf7ecf44639d as defaultMetadataMapping, $2ed0091f7e32d1e6$export$2e2bcd8739ae039 as DataTablePageResults};
5456
5481
  //# sourceMappingURL=main.js.map