Skip to content

Commit

Permalink
v2.6.0 (#70)
Browse files Browse the repository at this point in the history
* update product, dataset citations

* prepare v2.6.0

* update prov, release citations
  • Loading branch information
sampsonj authored Oct 30, 2023
1 parent 78da765 commit 9aefb0b
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 18 deletions.
2 changes: 0 additions & 2 deletions lib/components/DownloadDataContext/DownloadDataContext.js
Original file line number Diff line number Diff line change
Expand Up @@ -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] = {};
Expand Down
8 changes: 4 additions & 4 deletions lib/service/CitationService.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand All @@ -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);
}
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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] = {};
Expand Down
16 changes: 9 additions & 7 deletions src/lib_components/service/CitationService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 => {
Expand All @@ -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;
Expand Down

0 comments on commit 9aefb0b

Please sign in to comment.