Skip to content

Commit ee76f8e

Browse files
authored
Merge pull request #1105 from nasa/develop
Develop to main Release 12.0.1
2 parents 539e3a2 + 2f9f15c commit ee76f8e

File tree

23 files changed

+12961
-11159
lines changed

23 files changed

+12961
-11159
lines changed

.nvmrc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
14.19.1
1+
16.19.0

CHANGELOG.md

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,20 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
77

88
## [Unreleased]
99

10+
## [v12.0.1] - 2023-05-25
11+
### Breaking Changes
12+
13+
This version of the dashboard requires Cumulus API v2 (Core version >= v16.0.0)
14+
15+
### Changed
16+
17+
- **CUMULUS-3092**
18+
- Updated all PUT /granules/${granuleId} actions to use PATCH and supply the
19+
required `Cumulus-API-Version` headers implemented in CUMULUS-3072
20+
- Removed unused `reprocessGranule` action method
21+
- **CUMULUS-3299**
22+
- Docs: Update and fix links that reference the docs after Docusaurus upgrade
23+
1024
## [v12.0.0] - 2023-01-23
1125

1226
## Breaking Changes
@@ -1313,7 +1327,8 @@ Fix for serving the dashboard through the Cumulus API.
13131327
### Added
13141328

13151329
- Versioning and changelog [CUMULUS-197] by @kkelly51
1316-
[Unreleased]: https://github.com/nasa/cumulus-dashboard/compare/v12.0.0...HEAD
1330+
[Unreleased]: https://github.com/nasa/cumulus-dashboard/compare/v12.0.1...HEAD
1331+
[v12.0.1]: https://github.com/nasa/cumulus-dashboard/compare/v12.0.0...v12.0.1
13171332
[v12.0.0]: https://github.com/nasa/cumulus-dashboard/compare/v11.0.0...v12.0.0
13181333
[v11.0.0]: https://github.com/nasa/cumulus-dashboard/compare/v10.0.0...v11.0.0
13191334
[v10.0.0]: https://github.com/nasa/cumulus-dashboard/compare/v9.0.0...v10.0.0

README.md

Lines changed: 10 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -69,12 +69,12 @@ Set the environment and build the dashboard with these commands:
6969
$ source production.env && ./bin/build_dashboard_via_docker.sh
7070
```
7171

72-
This script uses Docker Compose to build and copy the compiled dashboard into the `./dist` directory. You can now deploy this directory to AWS behind [CloudFront](https://aws.amazon.com/cloudfront/). If you are in NGAP, follow the instructions for "Request Public or Protected Access to the APIs and Dashboard" on the earthdata wiki page [Using Cumulus with Private APIs](https://wiki.earthdata.nasa.gov/display/CUMULUS/Cumulus+Deployments+in+NGAP).
72+
This script uses Docker Compose to build and copy the compiled dashboard into the `./dist` directory. You can now deploy this directory to AWS behind [CloudFront](https://aws.amazon.com/cloudfront/). If you are in NGAP, follow the instructions for "Request Public or Protected Access to the APIs and Dashboard" on the earthdata wiki page [Using Cumulus with Private APIs](https://wiki.earthdata.nasa.gov/display/CUMULUS/Using+Cumulus+with+Private+APIs).
7373

7474

7575
### Run the dashboard locally via Docker Image
7676

77-
You can also create a Docker container that will serve the dashboard behind a simple nginx configuration. Having a runnable Docker image is useful for testing a build before deployment or for NGAP Sandbox environments, where if you configure your computer to [access Cumulus APIs via SSM](https://wiki.earthdata.nasa.gov/display/CUMULUS/Accessing+Cumulus+APIs+via+SSM), you can run the dashboard container locally against the live Sandbox Cumulus API.
77+
You can also create a Docker container that will serve the dashboard behind a simple nginx configuration. Having a runnable Docker image is useful for testing a build before deployment or for NGAP Sandbox environments, where if you configure your computer to [access Cumulus APIs via SSM](https://wiki.earthdata.nasa.gov/display/CUMULUS/Accessing+Cumulus+APIs+via+SSM+Port+Forwarding), you can run the dashboard container locally against the live Sandbox Cumulus API.
7878

7979
The script `./bin/build_dashboard_image.sh` will build a docker image containing the dashboard bundle served behind a basic [nginx](https://www.nginx.com/) configuration. The script takes one optional parameter, the tag to name the generated image which defaults to cumulus-dashboard:latest. The same customizations as described in the [previous section](#build-the-dashboard-using-docker-and-docker-compose) are available to configure your dashboard.
8080

@@ -96,10 +96,10 @@ In this example, the dashboard would be available at `http://localhost:3000/` in
9696

9797
### Build the dashboard
9898

99-
The dashboard uses node v14.19.1. To build/run the dashboard on your local machine, install [nvm](https://github.com/creationix/nvm) and run `nvm install v14.19.1`.
99+
The dashboard uses node v16.19.0. To build/run the dashboard on your local machine, install [nvm](https://github.com/creationix/nvm) and run `nvm install v16.19.0`.
100100

101101
#### install requirements
102-
We use npm for local package management, run `npm install -g npm@8.6.0` to install npm 8.6.0. To install the requirements:
102+
We use npm for local package management. To install the requirements:
103103
```bash
104104
$ nvm use
105105
$ npm ci
@@ -149,7 +149,7 @@ During development you can run the webpack development webserver to serve the da
149149
```bash
150150
APIROOT=http://<myapi>.com npm run serve
151151
```
152-
The dashboard should be available at http://localhost:3000
152+
The dashboard should be available at `http://localhost:3000`
153153

154154
### Run a built dashboard
155155

@@ -222,7 +222,7 @@ For **development** and **testing** purposes only, you can run a Cumulus API loc
222222

223223
*Important Note: These `docker-compose` commands do not build distributable containers, but are a provided as testing conveniences. The docker-compose[-\*].yml files show that they work by linking your local directories into the container.*
224224

225-
In order to run the Cumulus API locally you must first [build the dashboard](#buildlocally) and then run the containers that provide LocalStack and Elasticsearch services.
225+
In order to run the Cumulus API locally you must first [build the dashboard](#build-the-dashboard) and then run the containers that provide LocalStack and Elasticsearch services.
226226

227227
These are started and stopped with the commands:
228228
```bash
@@ -264,7 +264,7 @@ and
264264
```bash
265265
localstack_1 | Ready.
266266
```
267-
you should be able to verify access to the local Cumulus API at http://localhost:5001/token
267+
you should be able to verify access to the local Cumulus API at `http://localhost:5001/token`
268268

269269

270270
Then you can run the dashboard locally (without Docker) `[HIDE_PDR=false APIROOT=http://localhost:5001] npm run serve` and open cypress tests `npm run cypress`.
@@ -290,7 +290,7 @@ dashboard_1 | Hit CTRL-C to stop the server
290290
```
291291

292292

293-
##### Troubleshooting Docker containers.
293+
#### Troubleshooting Docker Containers
294294

295295
If something is not running correctly, or you're just interested, you can view the logs with a helper script, this will print out logs from each of the running docker containers.
296296
```bash
@@ -305,7 +305,7 @@ ERROR: for localapi_shim_1 Cannot start service shim: driver failed programming
305305
ERROR: for shim Cannot start service shim: driver failed programming external connectivity on endpoint localapi_shim_1 (7105603a4ff7fbb6f92211086f617bfab45d78cff47232793d152a244eb16feb): Bind for 0.0.0.0:9200 failed: port is already allocated
306306
```
307307

308-
#### Fully contained cypress testing.
308+
#### Fully Contained Cypress Testing
309309

310310
You can run all of the cypress tests locally that Earthdata Bamboo runs with a single command:
311311
```bash
@@ -314,7 +314,7 @@ You can run all of the cypress tests locally that Earthdata Bamboo runs with a s
314314
This stands up the entire stack as well as begins the e2e service that will run all cypress commands and report an exit code for their success or failure. This is primarily used for CI, but can be useful to developers.
315315

316316

317-
#### <a name=dockerdiagram></a> Docker Container Service Diagram.
317+
#### <a name=dockerdiagram></a> Docker Container Service Diagram
318318
![Docker Service Diagram](./ancillary/DashboardDockerServices.png)
319319

320320

@@ -395,8 +395,4 @@ It is likely that no branch plan will exist for the `master` branch.
395395
- Choose Branch Name `master` and then click `create`.
396396
- Verify that the build has started for this plan.
397397

398-
399-
400-
401-
402398
<a name="bundlefootnote">1</a>: A dashboard bundle is just a ready-to-deploy compiled version of the dashboard and environment.

app/src/index.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,12 @@ import './public/favicon.ico';
66

77
import App from './js/App';
88

9-
if (process.env.NODE_ENV !== 'production') {
9+
// Broken - needs resolution in CUMULUS-3379
10+
/* if (process.env.NODE_ENV !== 'production') {
1011
import('@axe-core/react')
1112
.then((axe) => {
1213
axe.default(React, ReactDOM, 1000);
1314
});
14-
}
15+
} */
1516

1617
ReactDOM.render(<App />, document.getElementById('site-canvas'));

app/src/js/actions/index.js

Lines changed: 12 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -205,18 +205,6 @@ export const listGranules = (options) => (dispatch, getState) => {
205205
});
206206
};
207207

208-
export const reprocessGranule = (granuleId) => ({
209-
[CALL_API]: {
210-
type: types.GRANULE_REPROCESS,
211-
method: 'PUT',
212-
id: granuleId,
213-
path: `granules/${granuleId}`,
214-
data: {
215-
action: 'reprocess'
216-
}
217-
}
218-
});
219-
220208
export const applyWorkflowToCollection = (name, version, workflow) => ({
221209
[CALL_API]: {
222210
type: types.COLLECTION_APPLYWORKFLOW,
@@ -252,13 +240,16 @@ export const applyRecoveryWorkflowToCollection = (collectionId) => (dispatch) =>
252240
export const applyWorkflowToGranule = (granuleId, workflow, meta) => ({
253241
[CALL_API]: {
254242
type: types.GRANULE_APPLYWORKFLOW,
255-
method: 'PUT',
243+
method: 'PATCH',
256244
id: granuleId,
257245
path: `granules/${granuleId}`,
258246
data: {
259247
action: 'applyWorkflow',
260248
workflow,
261249
meta
250+
},
251+
headers: {
252+
'Cumulus-API-Version': '2',
262253
}
263254
}
264255
});
@@ -293,12 +284,15 @@ export const applyRecoveryWorkflowToGranule = (granuleId) => (dispatch) => dispa
293284
export const reingestGranule = (granuleId, meta) => ({
294285
[CALL_API]: {
295286
type: types.GRANULE_REINGEST,
296-
method: 'PUT',
287+
method: 'PATCH',
297288
id: granuleId,
298289
path: `granules/${granuleId}`,
299290
data: {
300291
action: 'reingest',
301292
...meta,
293+
},
294+
headers: {
295+
'Cumulus-API-Version': '2',
302296
}
303297
}
304298
});
@@ -311,11 +305,14 @@ export const reingestGranuleClearError = (granuleId) => ({
311305
export const removeGranule = (granuleId) => ({
312306
[CALL_API]: {
313307
type: types.GRANULE_REMOVE,
314-
method: 'PUT',
308+
method: 'PATCH',
315309
id: granuleId,
316310
path: `granules/${granuleId}`,
317311
data: {
318312
action: 'removeFromCmr'
313+
},
314+
headers: {
315+
'Cumulus-API-Version': '2',
319316
}
320317
}
321318
});

app/src/js/components/Granules/bulk.js

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -26,32 +26,35 @@ const getRequestAsyncOpId = (request) => get(request, ['data', 'id']);
2626
const isStatusInflight = (status) => status === 'inflight';
2727
const isStatusSuccess = (status) => status === 'success';
2828

29+
const granulesOrQueryDescription = 'add either an array of granule objects in the form:\n { "granuleId": "(value)", "collectionId": "(value)" } or an elasticsearch query and index.';
30+
const granulesOrQueryText = `In the box below, ${granulesOrQueryDescription}`;
31+
2932
const bulkOperationsDefaultQuery = {
3033
workflowName: '',
3134
index: '',
3235
query: '',
33-
ids: [],
36+
granules: '',
3437
meta: {}
3538
};
3639

3740
const bulkDeleteDefaultQuery = {
3841
index: '',
3942
query: '',
40-
ids: [],
43+
granules: [],
4144
forceRemoveFromCmr: false
4245
};
4346

4447
const bulkReingestDefaultQuery = {
4548
index: '',
4649
query: '',
47-
ids: []
50+
granules: []
4851
};
4952

5053
const bulkRecoveryDefaultQuery = {
5154
workflowName: '',
5255
index: '',
5356
query: '',
54-
ids: []
57+
granules: []
5558
};
5659

5760
const BulkGranule = ({
@@ -268,7 +271,7 @@ const BulkGranule = ({
268271
<h4 className="modal_subtitle">To run and complete your bulk granule task:</h4>
269272
<ol>
270273
<li>In the box below, enter the <strong>workflowName</strong>.</li>
271-
<li>Then add either an array of granule Ids or an elasticsearch query and index.</li>
274+
<li>Then {granulesOrQueryText}</li>
272275
</ol>
273276
</BulkGranuleModal>
274277
<BulkGranuleModal
@@ -293,7 +296,7 @@ const BulkGranule = ({
293296
>
294297
<h4 className="modal_subtitle">To run and complete your bulk delete task:</h4>
295298
<ol>
296-
<li>In the box below, add either an array of granule Ids or an elasticsearch query and index.</li>
299+
<li>{granulesOrQueryText}</li>
297300
<li>Set <strong>forceRemoveFromCmr</strong> to <strong>true</strong> to automatically have granules
298301
removed from CMR as part of deletion.
299302
If <strong>forceRemoveFromCmr</strong> is <strong>false</strong>, then the bulk granule deletion will
@@ -325,7 +328,7 @@ const BulkGranule = ({
325328
>
326329
<h4 className="modal_subtitle">To run and complete your bulk reingest task:</h4>
327330
<ol>
328-
<li>In the box below, add either an array of granule Ids or an elasticsearch query and index.</li>
331+
<li>{granulesOrQueryText}.</li>
329332
<li>Then select workflow to rerun for all the selected granules. The workflows listed are the
330333
intersection of the selected granules' workflows.</li>
331334
</ol>
@@ -353,9 +356,8 @@ const BulkGranule = ({
353356
>
354357
<h4 className="modal_subtitle">To run and complete your bulk granule task:</h4>
355358
<ol>
356-
<li>In the box below, enter the workflowName.</li>
357-
<li>Then add either an array of granule Ids or an Elasticsearch query and
358-
index (<i>see below</i>).</li>
359+
<li>In the box below, enter the <strong>workflowName</strong>.</li>
360+
<li>Then {granulesOrQueryText} (<i>see below</i>).</li>
359361
</ol>
360362
</BulkGranuleModal>
361363
}

app/src/js/config/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ const deploymentConfig = require('./config');
88
const baseConfig = {
99
environment: 'development',
1010
requireEarthdataLogin: false,
11-
minCompatibleApiVersion: 'v14.0.0',
11+
minCompatibleApiVersion: 'v16.0.0',
1212
oauthMethod: 'earthdata',
1313

1414
graphicsPath: '/src/assets/images/',

app/src/js/utils/table-config/granules.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ export const tableColumns = [
6363
Header: 'Published',
6464
accessor: 'published',
6565
Cell: ({ row: { original: { cmrLink, published } } }) => (// eslint-disable-line react/prop-types
66-
cmrLink ? <a href={cmrLink} target='_blank'>{bool(published)}</a> : bool(published)
66+
cmrLink && bool(published) ? <a href={cmrLink} target='_blank'>{bool(published)}</a> : bool(published)
6767
)
6868
},
6969
{

app/src/js/utils/table-config/reconciliation-reports.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -292,13 +292,16 @@ export const tableColumnsBackup = ({ reportType, reportName }) => ([
292292
]);
293293

294294
const fileLink = (bucket, key) => `https://${bucket}.s3.amazonaws.com/${key}`;
295+
// * es-lint disable react/prop-types */
295296
export const tableColumnsGranuleConflictDetails = ({ reportType }) => {
296297
const checkButton = <button className='button button__row button__row--check'/>;
297298
const orcaBackupColumns = [
298299
{
299300
Header: 'In Orca Only',
300301
id: 'onlyInOrca',
301302
accessor: 'reason',
303+
// TODO: Updated ES lint rules caused a changeset-unrelated violation - this should be fixed
304+
// eslint-disable-next-line react/prop-types
302305
Cell: ({ cell: { value } }) => (
303306
(value === 'onlyInOrca') ? checkButton : nullValue
304307
),
@@ -308,6 +311,8 @@ export const tableColumnsGranuleConflictDetails = ({ reportType }) => {
308311
Header: 'Should Be Excluded From Orca',
309312
id: 'shouldBeExcludedFromOrca',
310313
accessor: 'reason',
314+
// TODO: Updated ES lint rules caused a changeset-unrelated violation - this should be fixed
315+
// eslint-disable-next-line react/prop-types
311316
Cell: ({ cell: { value } }) => (
312317
(value === 'shouldBeExcludedFromOrca') ? checkButton : nullValue
313318
),
@@ -335,6 +340,8 @@ export const tableColumnsGranuleConflictDetails = ({ reportType }) => {
335340
Header: 'In Cumulus Only',
336341
id: 'onlyInCumulus',
337342
accessor: 'reason',
343+
// TODO: Updated ES lint rules caused a changeset-unrelated violation - this should be fixed
344+
// eslint-disable-next-line react/prop-types
338345
Cell: ({ cell: { value } }) => (
339346
(value === 'onlyInCumulus') ? checkButton : nullValue
340347
),

audit-ci.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@
22
"high": true,
33
"pass-enoaudit": true,
44
"retry-count": 20,
5-
"allowlist": ["d3-color", "knex", "json5", "jsonwebtoken"]
5+
"allowlist": ["fast-xml-parser", "d3-color", "json5"]
66
}

0 commit comments

Comments
 (0)