Skip to content

Commit

Permalink
Merge branch 'develop' of https://github.com/IQSS/dataverse-frontend
Browse files Browse the repository at this point in the history
…into feature/221-integration-files-table-row-selection-download
  • Loading branch information
MellyGray committed Dec 14, 2023
2 parents d032777 + 14a74ae commit aa622e3
Show file tree
Hide file tree
Showing 75 changed files with 1,711 additions and 419 deletions.
14 changes: 12 additions & 2 deletions .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,19 @@
"unused-imports/no-unused-imports": "error",
"unused-imports/no-unused-vars": [
"warn",
{ "vars": "all", "varsIgnorePattern": "^_", "args": "after-used", "argsIgnorePattern": "^_" }
{
"vars": "all",
"varsIgnorePattern": "^_",
"args": "after-used",
"argsIgnorePattern": "^_"
}
],
"@typescript-eslint/no-empty-function": [
"error",
{
"allow": ["arrowFunctions"]
}
],
"@typescript-eslint/no-empty-function": ["error", { "allow": ["arrowFunctions"] }],
"react/react-in-jsx-scope": "off",
"prettier/prettier": [
"error",
Expand Down
39 changes: 39 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,45 @@

First install node >=16 and npm >=8. Recommended versions `node v19` and `npm v9`.

### Create a `.npmrc` file and add a token

To install the [@iqss/dataverse-client-javascript](https://github.com/IQSS/dataverse-client-javascript/pkgs/npm/dataverse-client-javascript)
from the GitHub registry, necessary for connecting with the Dataverse API, follow these steps to create an `.npmrc` file in
the root of your project using your GitHub token.

1. **Copy `.npmrc.example`**

Duplicate the `.npmrc.example` file in your project and save it as `.npmrc`.

2. **Replace the Token**

Open the newly created `.npmrc` file and replace `YOUR_GITHUB_TOKEN` with your actual GitHub token.

```plaintext
legacy-peer-deps=true
//npm.pkg.github.com/:_authToken=<YOUR_GITHUB_AUTH_TOKEN>
@iqss:registry=https://npm.pkg.github.com/
```

#### How to Get a GitHub Token

If you don't have a GitHub token yet, follow these steps:

1. Go to your GitHub account settings.

2. Navigate to "Developer settings" -> "Personal access tokens."

3. Click "Personal access tokens" -> "Tokens (classic)" -> "Generate new token (classic)".

4. Give the token a name and select the "read:packages" scope.

5. Copy the generated token.

6. Replace `YOUR_GITHUB_AUTH_TOKEN` in the `.npmrc` file with the copied token.

Now, you should be able to install the Dataverse JavaScript client using npm.

### `npm install`

Run this command to install the dependencies. You may see a message about vulnerabilities after running this command. \
Expand Down
1 change: 1 addition & 0 deletions dev.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ RUN npm run build

WORKDIR /usr/src/app
COPY package.json ./
COPY package-lock.json ./
COPY .npmrc ./
RUN npm install

Expand Down
28 changes: 24 additions & 4 deletions package-lock.json

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

3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
},
"dependencies": {
"@faker-js/faker": "7.6.0",
"@iqss/dataverse-client-javascript": "2.0.0-pr97.418bf5e",
"@iqss/dataverse-client-javascript": "2.0.0-pr99.c36f1db",
"@iqss/dataverse-design-system": "*",
"@istanbuljs/nyc-config-typescript": "1.0.2",
"@tanstack/react-table": "8.9.2",
Expand All @@ -28,6 +28,7 @@
"i18next": "22.4.9",
"i18next-browser-languagedetector": "7.0.1",
"i18next-http-backend": "2.1.1",
"moment-timezone": "0.5.43",
"react-bootstrap": "2.7.2",
"react-bootstrap-icons": "1.10.3",
"react-i18next": "12.1.5",
Expand Down
29 changes: 28 additions & 1 deletion public/locales/en/dataset.json
Original file line number Diff line number Diff line change
Expand Up @@ -53,11 +53,38 @@
}
},
"accessDataset": {
"title": "Access Dataset"
"title": "Access Dataset",
"downloadZip": "Download ZIP",
"downloadOriginalZip": "Original Format ZIP",
"downloadArchiveZip": "Archive Format (.tab) ZIP"
},
"uploadFiles": "Upload Files"
},
"alerts": {
"publishInProgress": {
"heading": "Publish in Progress",
"alertText": "The dataset is locked while the persistent identifiers are being registered or updated, and/or the physical files are being validated."
},
"filesUpdated": {
"heading": "Success!",
"alertText": "One or more files have been updated."
},
"termsUpdated": {
"heading": "Success!",
"alertText": "The terms for this dataset have been updated."
},
"thumbnailUpdated": {
"heading": "Success!",
"alertText": "Dataset thumbnail updated."
},
"datasetDeleted": {
"heading": "Success!",
"alertText": "This dataset draft has been deleted."
},
"metadataUpdated": {
"heading": "Success!",
"alertText": "The metadata for this dataset has been updated."
},
"draftVersion": {
"heading": "This draft version needs to be published",
"alertText": "When ready for sharing, please <b>publish</b> it so that others can see these changes"
Expand Down
23 changes: 23 additions & 0 deletions src/alert/domain/models/Alert.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
import { AlertVariant } from '@iqss/dataverse-design-system/dist/components/alert/AlertVariant'

export enum AlertMessageKey {
DRAFT_VERSION = 'draftVersion',
REQUESTED_VERSION_NOT_FOUND = 'requestedVersionNotFound',
REQUESTED_VERSION_NOT_FOUND_SHOW_DRAFT = 'requestedVersionNotFoundShowDraft',
SHARE_UNPUBLISHED_DATASET = 'shareUnpublishedDataset',
UNPUBLISHED_DATASET = 'unpublishedDataset',
METADATA_UPDATED = 'metadataUpdated',
FILES_UPDATED = 'filesUpdated',
TERMS_UPDATED = 'termsUpdated',
THUMBNAIL_UPDATED = 'thumbnailUpdated',
DATASET_DELETED = 'datasetDeleted',
PUBLISH_IN_PROGRESS = 'publishInProgress'
}

export class Alert {
constructor(
public readonly variant: AlertVariant,
public readonly messageKey: AlertMessageKey,
public dynamicFields?: object
) {}
}
Loading

0 comments on commit aa622e3

Please sign in to comment.