diff --git a/lib/components/DownloadDataContext/DownloadDataContext.js b/lib/components/DownloadDataContext/DownloadDataContext.js index 1693c1db..9be02c9c 100644 --- a/lib/components/DownloadDataContext/DownloadDataContext.js +++ b/lib/components/DownloadDataContext/DownloadDataContext.js @@ -732,8 +732,6 @@ var regenerateS3FilesFiltersAndValidValues = function regenerateS3FilesFiltersAn } }); }); - // If cachedValues and validValues differ in size then rebuild valueLookups for - // filters, adjust filter selections to suit, and regenerate filtered file count. var filterKeys = Object.keys(updated.s3Files.valueLookups || {}); filterKeys.forEach(function (key) { updated.s3Files.valueLookups[key] = {}; diff --git a/lib/service/CitationService.js b/lib/service/CitationService.js index da91eabc..4e5c77b4 100644 --- a/lib/service/CitationService.js +++ b/lib/service/CitationService.js @@ -22,10 +22,10 @@ var CitationService = { var hasDoi = hasRelease && (0, _typeUtil.exists)(productReleaseObject.productDoi) && (0, _typeUtil.isStringNonEmpty)(productReleaseObject.productDoi.url); var citationDoi = hasDoi ? productReleaseObject.productDoi.url : null; var today = CitationService.getDateFormatted(); - var productName = !hasRelease ? "".concat(product.productName, " (").concat(product.productCode, ")") : "".concat(product.productName, " (").concat(product.productCode, "), ") + "".concat(productReleaseObject.release); + var productName = !hasRelease ? "".concat(product.productName, " (").concat(product.productCode, "), provisional data") : "".concat(product.productName, " (").concat(product.productCode, "), ") + "".concat(productReleaseObject.release); var doiText = citationDoi ? ". ".concat(citationDoi) : ''; - var url = _RouteService.default.getDataProductCitationDownloadUrl(); - var accessed = !hasRelease ? "".concat(url, " (accessed ").concat(today, ")") : "Dataset accessed from ".concat(url, " on ").concat(today); + var url = _RouteService.default.getProductDetailPath(product.productCode, hasRelease ? productReleaseObject.release : undefined); + var accessed = !hasRelease ? "Dataset accessed from ".concat(url, " on ").concat(today, ". Data archived at [your DOI].") : "Dataset accessed from ".concat(url, " on ").concat(today, "."); return "".concat(NEON, ". ").concat(productName).concat(doiText, ". ").concat(accessed); }, buildPrototypeDatasetCitationText: function buildPrototypeDatasetCitationText(dataset) { @@ -40,7 +40,7 @@ var CitationService = { var today = CitationService.getDateFormatted(); var doiId = hasDoi ? doi.url.split('/').slice(-2).join('/') : uuid; var url = hasDoi ? "".concat(doi.url, ".") : "".concat(_RouteService.default.getPrototypeDatasetDetailPath(uuid)); - var accessed = hasDoi ? "Dataset accessed from ".concat(_RouteService.default.getDataProductCitationDownloadUrl(), " on ").concat(today) : "(accessed ".concat(today, ")"); + var accessed = 'Dataset accessed from ' + "".concat(_RouteService.default.getPrototypeDatasetDetailPath(uuid), " on ").concat(today, "."); var title = version ? "".concat(projectTitle, ", ").concat(version) : projectTitle; return "".concat(NEON, ". ").concat(title, " (").concat(doiId, "). ").concat(url, " ").concat(accessed); } diff --git a/package-lock.json b/package-lock.json index 98c58774..dec4cf2d 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "portal-core-components", - "version": "2.5.2", + "version": "2.6.0", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "portal-core-components", - "version": "2.5.2", + "version": "2.6.0", "dependencies": { "@date-io/moment": "^1.3.13", "@fortawesome/fontawesome-svg-core": "^6.4.0", diff --git a/package.json b/package.json index d5dcddbc..8eb0c857 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "portal-core-components", - "version": "2.5.2", + "version": "2.6.0", "main": "./lib/index.js", "private": true, "homepage": "http://localhost:3010/core-components", diff --git a/src/lib_components/components/DownloadDataContext/DownloadDataContext.jsx b/src/lib_components/components/DownloadDataContext/DownloadDataContext.jsx index d4e92dad..aca48574 100644 --- a/src/lib_components/components/DownloadDataContext/DownloadDataContext.jsx +++ b/src/lib_components/components/DownloadDataContext/DownloadDataContext.jsx @@ -742,8 +742,6 @@ const regenerateS3FilesFiltersAndValidValues = (state) => { ...file, tableData: { checked: updated.s3Files.valueMap[file.url] || false }, })); - // If cachedValues and validValues differ in size then rebuild valueLookups for - // filters, adjust filter selections to suit, and regenerate filtered file count. const filterKeys = Object.keys(updated.s3Files.valueLookups || {}); filterKeys.forEach((key) => { updated.s3Files.valueLookups[key] = {}; diff --git a/src/lib_components/service/CitationService.ts b/src/lib_components/service/CitationService.ts index 97f0b20c..cdd5162f 100644 --- a/src/lib_components/service/CitationService.ts +++ b/src/lib_components/service/CitationService.ts @@ -37,14 +37,17 @@ const CitationService: ICitationService = { : null; const today = CitationService.getDateFormatted(); const productName = !hasRelease - ? `${product.productName} (${product.productCode})` + ? `${product.productName} (${product.productCode}), provisional data` : `${product.productName} (${product.productCode}), ` + `${(productReleaseObject as DataProductRelease).release}`; const doiText = citationDoi ? `. ${citationDoi}` : ''; - const url = RouteService.getDataProductCitationDownloadUrl(); + const url = RouteService.getProductDetailPath( + product.productCode, + hasRelease ? (productReleaseObject as DataProductRelease).release : undefined, + ); const accessed = !hasRelease - ? `${url} (accessed ${today})` - : `Dataset accessed from ${url} on ${today}`; + ? `Dataset accessed from ${url} on ${today}. Data archived at [your DOI].` + : `Dataset accessed from ${url} on ${today}.`; return `${NEON}. ${productName}${doiText}. ${accessed}`; }, buildPrototypeDatasetCitationText: (dataset: any): string => { @@ -63,9 +66,8 @@ const CitationService: ICitationService = { const url = hasDoi ? `${doi.url}.` : `${RouteService.getPrototypeDatasetDetailPath(uuid)}`; - const accessed = hasDoi - ? `Dataset accessed from ${RouteService.getDataProductCitationDownloadUrl()} on ${today}` - : `(accessed ${today})`; + const accessed = 'Dataset accessed from ' + + `${RouteService.getPrototypeDatasetDetailPath(uuid)} on ${today}.`; const title = version ? `${projectTitle}, ${version}` : projectTitle;