From 93d8d23560a3b6c238ef89c610628ef613630f40 Mon Sep 17 00:00:00 2001 From: jrgriffiniii <1443986+jrgriffiniii@users.noreply.github.com> Date: Wed, 15 Jan 2025 14:49:39 -0500 Subject: [PATCH] Integrates Prettier for formatting YAML, SCSS and JavaScript --- .circleci/config.yml | 14 +- .eslintrc.yaml | 13 +- .github/workflows/pages.yml | 6 +- .prettierignore | 8 + .prettierrc | 22 ++ app/assets/config/manifest.js | 1 - app/assets/stylesheets/application.scss | 11 +- app/assets/stylesheets/components/header.scss | 2 +- app/javascript/entrypoints/application.js | 8 +- .../entrypoints/edit_group_utils.js | 29 +- .../entrypoints/pdc/copy_to_clipboard.es6 | 37 +- .../entrypoints/pdc/edit_required_fields.es6 | 32 +- .../entrypoints/pdc/edit_table_actions.es6 | 6 +- .../entrypoints/pdc/email_change_all.es6 | 32 +- .../entrypoints/pdc/pdc_ui_loader.es6 | 34 +- .../pdc/work_readme_file_upload.es6 | 4 +- app/javascript/entrypoints/pdc/work_ror.es6 | 3 +- babel.config.js | 52 +-- config/dspace.yml | 6 +- config/globus.yml | 8 +- config/honeybadger.yml | 6 +- config/locales/devise.en.yml | 2 +- config/locales/en.yml | 10 +- config/s3.yml | 20 +- config/update_ark_url.yml | 12 +- package.json | 2 + postcss.config.js | 10 +- public/422.html | 118 +++---- s3-checksum.yaml | 167 +++++---- s3-config/logs-lifecycle.json | 20 +- s3-config/prod-lifecycle.json | 32 +- s3-config/staging-lifecycle.json | 32 +- spec/fixtures/cytoskeletal_metadata.json | 324 +++++++++--------- spec/fixtures/doi_publish_response.json | 2 +- spec/fixtures/doi_register_response.json | 2 +- spec/fixtures/doi_response.json | 2 +- spec/fixtures/doi_update_response.json | 2 +- ...oData_combined_v1_2020-07_datapackage.json | 14 +- .../files/dspace_bitstreams_response.json | 138 ++++---- spec/fixtures/files/dspace_handle.json | 23 +- .../files/dspace_metadata_response.json | 270 +++++++-------- spec/fixtures/rename_pppl_dept1.json | 205 ++++++----- yarn.lock | 10 + 43 files changed, 939 insertions(+), 812 deletions(-) create mode 100644 .prettierignore create mode 100644 .prettierrc diff --git a/.circleci/config.yml b/.circleci/config.yml index 45e540da0..8186c3a28 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -44,8 +44,8 @@ jobs: - run: sudo apt update && sudo apt install postgresql-client libmsgpack-dev - install_dependencies - persist_to_workspace: - root: &root '~/pdc_describe' - paths: '*' + root: &root "~/pdc_describe" + paths: "*" rubocop: working_directory: *root @@ -67,8 +67,11 @@ jobs: RAILS_ENV: test steps: - attach_workspace: - at: '~/pdc_describe' + at: "~/pdc_describe" - install_dependencies + - run: + name: Run prettier + command: yarn run prettier --check . - run: name: Run eslint command: yarn lint @@ -85,7 +88,7 @@ jobs: steps: - attach_workspace: at: *root - - browser-tools/install-firefox + - browser-tools/install-firefox - run: name: Wait for PostgreSQL command: dockerize -wait tcp://localhost:5432 -timeout 1m @@ -95,8 +98,7 @@ jobs: name: Run Rspec command: bundle exec rspec spec - store_artifacts: - path: - ~/pdc_describe/coverage + path: ~/pdc_describe/coverage - coveralls/upload workflows: diff --git a/.eslintrc.yaml b/.eslintrc.yaml index 74ff54d7a..56fd961f7 100644 --- a/.eslintrc.yaml +++ b/.eslintrc.yaml @@ -1,20 +1,21 @@ env: browser: true es2021: true -extends: 'airbnb-base' +extends: + - "airbnb-base" + - "prettier" overrides: [] parserOptions: ecmaVersion: latest sourceType: module -ignorePatterns: - 'app/javascript/entrypoints/vendor/**' +ignorePatterns: "app/javascript/entrypoints/vendor/**" globals: $: readonly - pdc: readonly # TODO: Used to pass datacite enums from Ruby to JS. When we move form construction to Ruby, should not be needed. + pdc: readonly # TODO: Used to pass datacite enums from Ruby to JS. When we move form construction to Ruby, should not be needed. isOrcid: readonly # TODO: Clean this up by using ESM import/export. rules: no-alert: off # OK: A lot easier than coding up new UI. - no-console: # OK: console.log is fine for debugging, but we don't want to keep it around indefinitely. - - error # Also make sure that warnings and errors are marked as such. + no-console: # OK: console.log is fine for debugging, but we don't want to keep it around indefinitely. + - error # Also make sure that warnings and errors are marked as such. - { allow: ["warn", "error"] } no-restricted-syntax: off # TODO: Just one failure diff --git a/.github/workflows/pages.yml b/.github/workflows/pages.yml index 3d1907d61..2bf2994da 100644 --- a/.github/workflows/pages.yml +++ b/.github/workflows/pages.yml @@ -2,7 +2,7 @@ name: Deploy API docs to GitHub Pages on: push: - branches: ['main'] + branches: ["main"] # paths: # - '.github/workflows/pages.yml' # - '.yardopts' @@ -19,7 +19,7 @@ permissions: # Allow one concurrent deployment concurrency: - group: 'pages' + group: "pages" cancel-in-progress: true jobs: @@ -37,4 +37,4 @@ jobs: # default `doc` as default of `.yardopts` # output-dir: 'doc' # default version is 3.2 - ruby-version: '3.2' + ruby-version: "3.2" diff --git a/.prettierignore b/.prettierignore new file mode 100644 index 000000000..75e6b4aab --- /dev/null +++ b/.prettierignore @@ -0,0 +1,8 @@ +README.md +docs/ +architecture-decisions/ +.prettierrc +vendor/ +.yarn/ +vite.config.mts +spec/fixtures/**/*yaml diff --git a/.prettierrc b/.prettierrc new file mode 100644 index 000000000..d8f50d1ed --- /dev/null +++ b/.prettierrc @@ -0,0 +1,22 @@ +singleQuote: true +proseWrap: never +printWidth: 96 +overrides: + - files: + - '*.md' + - 'docs/**/*.md' + options: + proseWrap: preserve + singleQuote: false + - files: + - 'config/**/*.yml' + - '*.yml' + - '*.yaml' + options: + proseWrap: preserve + singleQuote: false + - files: + - 'app/assets/stylesheets/**/*.scss' + options: + proseWrap: preserve + singleQuote: false diff --git a/app/assets/config/manifest.js b/app/assets/config/manifest.js index 4dd78ed8d..64733b910 100644 --- a/app/assets/config/manifest.js +++ b/app/assets/config/manifest.js @@ -1,4 +1,3 @@ //= link_tree ../images //= link_directory ../stylesheets .css //= link edit_work_utils.js - diff --git a/app/assets/stylesheets/application.scss b/app/assets/stylesheets/application.scss index 8f9deb906..de3f13086 100644 --- a/app/assets/stylesheets/application.scss +++ b/app/assets/stylesheets/application.scss @@ -20,7 +20,6 @@ @import "components/users.scss"; @import "components/nav.scss"; - #pdc-discovery-label { float: left; margin: 0 auto; @@ -29,7 +28,8 @@ text-align: center; } -.welcome-headers, #welcome-to-pdc { +.welcome-headers, +#welcome-to-pdc { font-size: 2rem !important; } @@ -52,7 +52,7 @@ ol > li::marker { .strong { text-shadow: 1px 0 #000; letter-spacing: 1px; - font-weight:bold; + font-weight: bold; } ul li { @@ -369,10 +369,9 @@ div.form-subcommunities { @media all and (min-width: 765px) { grid-template-columns: 1fr 1fr 1fr; } - } -div.form-subcommunities .form-check{ +div.form-subcommunities .form-check { padding: 0em 1rem; margin-top: 0.5rem; margin-bottom: 0; @@ -383,7 +382,7 @@ div.form-subcommunities .form-check{ } table.dataTable { - overflow-wrap: anywhere + overflow-wrap: anywhere; } .user-edit-long-field { diff --git a/app/assets/stylesheets/components/header.scss b/app/assets/stylesheets/components/header.scss index 38c59a456..46085d6f5 100644 --- a/app/assets/stylesheets/components/header.scss +++ b/app/assets/stylesheets/components/header.scss @@ -13,7 +13,7 @@ header { } .about, - .groups, + .groups, .how-to-submit, .help { background-color: #595959; diff --git a/app/javascript/entrypoints/application.js b/app/javascript/entrypoints/application.js index e618f5601..251ddc54c 100644 --- a/app/javascript/entrypoints/application.js +++ b/app/javascript/entrypoints/application.js @@ -37,7 +37,11 @@ import EditGroupUtils from './edit_group_utils'; import.meta.glob('../channels/*.js'); // Load Rails JavaScript API -if (typeof (window._rails_loaded) === 'undefined' || window._rails_loaded == null || !window._rails_loaded) { +if ( + typeof window._rails_loaded === 'undefined' || + window._rails_loaded == null || + !window._rails_loaded +) { Rails.start(); } @@ -53,7 +57,7 @@ function ready() { WorksWizardReview.bind('#grant-button'); // This should be moved into the Rails object - if (typeof (pdc) !== 'undefined' && pdc != null && pdc) { + if (typeof pdc !== 'undefined' && pdc != null && pdc) { const groupUtils = new EditGroupUtils(window.jQuery); groupUtils.bind(pdc); } diff --git a/app/javascript/entrypoints/edit_group_utils.js b/app/javascript/entrypoints/edit_group_utils.js index 7d37ba51d..55079cd34 100644 --- a/app/javascript/entrypoints/edit_group_utils.js +++ b/app/javascript/entrypoints/edit_group_utils.js @@ -82,14 +82,26 @@ class EditGroupUtils { onAddSubmitter() { const url = this.pdc.addSubmitterUrl; - this.addUserToGroup(url, '#submitter-uid-to-add', '#add-submitter-message', '#submitter-list', 'submit'); + this.addUserToGroup( + url, + '#submitter-uid-to-add', + '#add-submitter-message', + '#submitter-list', + 'submit', + ); $('#submitter-uid-to-add').focus(); return false; } onAddAdmin() { const url = this.pdc.addAdminUrl; - this.addUserToGroup(url, '#admin-uid-to-add', '#add-admin-message', '#curator-list', 'admin'); + this.addUserToGroup( + url, + '#admin-uid-to-add', + '#add-admin-message', + '#curator-list', + 'admin', + ); $('#admin-uid-to-add').focus(); return false; } @@ -130,7 +142,8 @@ class EditGroupUtils { html += ' (you)'; } if (isSuperAdmin) { - html += ' '; + html += + ' '; } if (canDelete) { html += ` @@ -171,7 +184,15 @@ class EditGroupUtils { const isYou = false; const isSuperAdmin = false; // eslint-disable-next-line max-len - this.addUserHtml(this.elList, this.uid, this.groupId, this.role, canDelete, isYou, isSuperAdmin); + this.addUserHtml( + this.elList, + this.uid, + this.groupId, + this.role, + canDelete, + isYou, + isSuperAdmin, + ); // eslint-enable-next-line max-len }; diff --git a/app/javascript/entrypoints/pdc/copy_to_clipboard.es6 b/app/javascript/entrypoints/pdc/copy_to_clipboard.es6 index fec3f175b..50e11ac9e 100644 --- a/app/javascript/entrypoints/pdc/copy_to_clipboard.es6 +++ b/app/javascript/entrypoints/pdc/copy_to_clipboard.es6 @@ -13,13 +13,25 @@ export default class CopytoClipboard { copy_doi() { const doi = $('#copy-doi').data('url'); - this.copyToClipboard(doi, '#copy-doi-icon', '#copy-doi-label', 'copy-doi-label-normal', 'copy-doi-label-copied'); + this.copyToClipboard( + doi, + '#copy-doi-icon', + '#copy-doi-label', + 'copy-doi-label-normal', + 'copy-doi-label-copied', + ); return false; } copy_citation(target) { const value = target.parentElement.dataset.text; - this.copyToClipboard(value, target.parentElement.children[0], target.parentElement.children[1], 'copy-doi-label-normal', 'copy-doi-label-copied'); + this.copyToClipboard( + value, + target.parentElement.children[0], + target.parentElement.children[1], + 'copy-doi-label-normal', + 'copy-doi-label-copied', + ); return false; } @@ -58,15 +70,18 @@ export default class CopytoClipboard { // to an element) copyToClipboard(value, iconEl, labelEl, normalClass, copiedClass) { // Copy value to the clipboard.... - navigator.clipboard.writeText(value).then(() => { - // ...and notify the user - this.setCopiedToClipboard(iconEl, labelEl, normalClass, copiedClass); - setTimeout(() => { - this.resetCopyToClipboard(iconEl, labelEl, normalClass, copiedClass); - }, 20000); - }, () => { - this.errorCopyToClipboard(iconEl, 'Copy to clipboard failed'); - }); + navigator.clipboard.writeText(value).then( + () => { + // ...and notify the user + this.setCopiedToClipboard(iconEl, labelEl, normalClass, copiedClass); + setTimeout(() => { + this.resetCopyToClipboard(iconEl, labelEl, normalClass, copiedClass); + }, 20000); + }, + () => { + this.errorCopyToClipboard(iconEl, 'Copy to clipboard failed'); + }, + ); // Clear focus from the button. document.activeElement.blur(); } diff --git a/app/javascript/entrypoints/pdc/edit_required_fields.es6 b/app/javascript/entrypoints/pdc/edit_required_fields.es6 index 27b59c271..b0989a9ef 100644 --- a/app/javascript/entrypoints/pdc/edit_required_fields.es6 +++ b/app/javascript/entrypoints/pdc/edit_required_fields.es6 @@ -67,7 +67,7 @@ export default class EditRequiredFields { let i; const rows = $('.creators-table-row'); for (i = 0; i < rows.length; i += 1) { - if (!((new TableRow(rows[i])).is_empty())) { + if (!new TableRow(rows[i]).is_empty()) { return true; } } @@ -79,12 +79,24 @@ export default class EditRequiredFields { let validCreators = true; const rows = $('.creators-table-row'); for (i = 0; i < rows.length; i += 1) { - if (!(new TableRow(rows[i])).is_empty()) { - if (!this.valid_required_field(rows[i], '.given-entry-creator', '.given-name-required-message')) { + if (!new TableRow(rows[i]).is_empty()) { + if ( + !this.valid_required_field( + rows[i], + '.given-entry-creator', + '.given-name-required-message', + ) + ) { validCreators = false; } - if (!this.valid_required_field(rows[i], '.family-entry-creator', '.family-name-required-message')) { + if ( + !this.valid_required_field( + rows[i], + '.family-entry-creator', + '.family-name-required-message', + ) + ) { validCreators = false; } } @@ -97,7 +109,7 @@ export default class EditRequiredFields { let i; const rows = $('.contributors-table-row'); for (i = 0; i < rows.length; i += 1) { - if (!((new TableRow(rows[i])).is_empty())) { + if (!new TableRow(rows[i]).is_empty()) { return true; } } @@ -109,8 +121,14 @@ export default class EditRequiredFields { let validContributors = true; const rows = $('.contributors-table-row'); for (i = 0; i < rows.length; i += 1) { - if (!(new TableRow(rows[i])).is_empty()) { - if (!this.valid_required_field(rows[i], '.type-entry-contributor', '.type-required-message')) { + if (!new TableRow(rows[i]).is_empty()) { + if ( + !this.valid_required_field( + rows[i], + '.type-entry-contributor', + '.type-required-message', + ) + ) { validContributors = false; } } diff --git a/app/javascript/entrypoints/pdc/edit_table_actions.es6 b/app/javascript/entrypoints/pdc/edit_table_actions.es6 index 396fc6fcf..a0a01710d 100644 --- a/app/javascript/entrypoints/pdc/edit_table_actions.es6 +++ b/app/javascript/entrypoints/pdc/edit_table_actions.es6 @@ -56,8 +56,8 @@ export default class EditTableActions { // https://api.ror.org/organizations?query.advanced=name:Prin* $.getJSON(`${pdc.ror_url}?query.advanced=name:${request.term}*`, (data) => { const candidates = []; - let i; let - candidate; + let i; + let candidate; for (i = 0; i < data.items.length; i += 1) { candidate = { key: data.items[i].id, label: data.items[i].name }; candidates.push(candidate); @@ -93,7 +93,7 @@ export default class EditTableActions { const rows = $(button).closest('table').find('tbody').find('tr'); let empty = null; for (const row of rows) { - if ((new TableRow(row)).is_empty()) { + if (new TableRow(row).is_empty()) { empty = $(row); break; } diff --git a/app/javascript/entrypoints/pdc/email_change_all.es6 b/app/javascript/entrypoints/pdc/email_change_all.es6 index e3f7f3b89..4782306fc 100644 --- a/app/javascript/entrypoints/pdc/email_change_all.es6 +++ b/app/javascript/entrypoints/pdc/email_change_all.es6 @@ -4,18 +4,34 @@ export default class EmailChangeAll { attach_change() { // Setup the DOI's COPY button to copy the DOI URL to the clipboard - document.querySelectorAll('.form-email-all').forEach((check) => check.addEventListener('change', (e) => { this.change_all(e); })); - document.querySelectorAll('.form-subcommunity-check').forEach((check) => check.addEventListener('change', (e) => { this.change_parent_group(e); })); - document.querySelectorAll('.form-group-check').forEach((check) => check.addEventListener('change', (e) => { this.change_subcommunity(e); })); + document.querySelectorAll('.form-email-all').forEach((check) => + check.addEventListener('change', (e) => { + this.change_all(e); + }), + ); + document.querySelectorAll('.form-subcommunity-check').forEach((check) => + check.addEventListener('change', (e) => { + this.change_parent_group(e); + }), + ); + document.querySelectorAll('.form-group-check').forEach((check) => + check.addEventListener('change', (e) => { + this.change_subcommunity(e); + }), + ); } change_all(item) { // Check all or uncheck all - document.querySelectorAll('.form-check-input').forEach((check) => { check.checked = item.currentTarget.checked; }); + document.querySelectorAll('.form-check-input').forEach((check) => { + check.checked = item.currentTarget.checked; + }); } change_subcommunity(item) { - item.currentTarget.parentNode.querySelectorAll('.form-check-input').forEach((check) => { check.checked = item.currentTarget.checked; }); + item.currentTarget.parentNode.querySelectorAll('.form-check-input').forEach((check) => { + check.checked = item.currentTarget.checked; + }); // make sure the all email is enabled if any sub group is enabled if (item.currentTarget.checked) { @@ -26,7 +42,11 @@ export default class EmailChangeAll { change_parent_group(item) { // make sure all email and = the parent group is enabled if any sub community is enabled if (item.currentTarget.checked) { - item.currentTarget.parentNode.parentNode.parentNode.querySelectorAll('.form-group-check').forEach((check) => { check.checked = item.currentTarget.checked; }); + item.currentTarget.parentNode.parentNode.parentNode + .querySelectorAll('.form-group-check') + .forEach((check) => { + check.checked = item.currentTarget.checked; + }); document.querySelector('.form-email-all').checked = item.currentTarget.checked; } } diff --git a/app/javascript/entrypoints/pdc/pdc_ui_loader.es6 b/app/javascript/entrypoints/pdc/pdc_ui_loader.es6 index 2575774f1..88c813295 100644 --- a/app/javascript/entrypoints/pdc/pdc_ui_loader.es6 +++ b/app/javascript/entrypoints/pdc/pdc_ui_loader.es6 @@ -15,17 +15,31 @@ export default class PdcUiLoader { } setup_fileupload_validation() { - (new CopytoClipboard()).attach_copy(); - (new EditRequiredFields()).attach_validations(); - (new EditTableActions()).attach_actions('creators-table'); - (new EmailChangeAll()).attach_change(); - (new WorkEditFileUpload('pre_curation_uploads_added', 'file-upload-list')).attach_validation(); - (new WorkReadmeFileUpload('add-readme', 'file-upload-area')).attach_validation(); - (new WorkOrcid('.orcid-entry-creator', 'creators[][given_name]', 'creators[][family_name]')).attach_validation(); - (new WorkOrcid('.orcid-entry-contributor', 'contributors[][given_name]', 'contributors[][family_name]')).attach_validation(); - (new WorkRoR(pdc.ror_url)).attach_query(); + new CopytoClipboard().attach_copy(); + new EditRequiredFields().attach_validations(); + new EditTableActions().attach_actions('creators-table'); + new EmailChangeAll().attach_change(); + new WorkEditFileUpload( + 'pre_curation_uploads_added', + 'file-upload-list', + ).attach_validation(); + new WorkReadmeFileUpload('add-readme', 'file-upload-area').attach_validation(); + new WorkOrcid( + '.orcid-entry-creator', + 'creators[][given_name]', + 'creators[][family_name]', + ).attach_validation(); + new WorkOrcid( + '.orcid-entry-contributor', + 'contributors[][given_name]', + 'contributors[][family_name]', + ).attach_validation(); + new WorkRoR(pdc.ror_url).attach_query(); const datasetOptions = { - searching: false, paging: true, info: false, order: [], + searching: false, + paging: true, + info: false, + order: [], }; $('#user-notification-table').DataTable(datasetOptions); } diff --git a/app/javascript/entrypoints/pdc/work_readme_file_upload.es6 b/app/javascript/entrypoints/pdc/work_readme_file_upload.es6 index 83dc24477..be27db396 100644 --- a/app/javascript/entrypoints/pdc/work_readme_file_upload.es6 +++ b/app/javascript/entrypoints/pdc/work_readme_file_upload.es6 @@ -61,7 +61,9 @@ export default class WorkReadmeFileUpload { bundle: true, // upload all selected files at once formData: true, // required when bundle: true getResponseData(filename) { - $('#new-readme').html(`File ${filename} has been uploaded and set as the README for this dataset.`); + $('#new-readme').html( + `File ${filename} has been uploaded and set as the README for this dataset.`, + ); $('#readme-upload').prop('disabled', false); }, }); diff --git a/app/javascript/entrypoints/pdc/work_ror.es6 b/app/javascript/entrypoints/pdc/work_ror.es6 index f8b51a1b0..72e7929a7 100644 --- a/app/javascript/entrypoints/pdc/work_ror.es6 +++ b/app/javascript/entrypoints/pdc/work_ror.es6 @@ -14,7 +14,8 @@ export default class WorkRoR { fetchROR(element) { const $target = $(element.target); const ror = $target.val().trim(); - fetch(`${this.rorUrl}/${ror}`).then() + fetch(`${this.rorUrl}/${ror}`) + .then() .then((response) => response.json()) .then((responseJson) => { const { name } = responseJson; diff --git a/babel.config.js b/babel.config.js index 4df194934..69b01838e 100644 --- a/babel.config.js +++ b/babel.config.js @@ -1,9 +1,9 @@ -module.exports = function(api) { - var validEnv = ['development', 'test', 'production'] - var currentEnv = api.env() - var isDevelopmentEnv = api.env('development') - var isProductionEnv = api.env('production') - var isTestEnv = api.env('test') +module.exports = function (api) { + var validEnv = ['development', 'test', 'production']; + var currentEnv = api.env(); + var isDevelopmentEnv = api.env('development'); + var isProductionEnv = api.env('production'); + var isTestEnv = api.env('test'); if (!validEnv.includes(currentEnv)) { throw new Error( @@ -11,8 +11,8 @@ module.exports = function(api) { '`BABEL_ENV` environment variables. Valid values are "development", ' + '"test", and "production". Instead, received: ' + JSON.stringify(currentEnv) + - '.' - ) + '.', + ); } return { @@ -21,9 +21,9 @@ module.exports = function(api) { '@babel/preset-env', { targets: { - node: 'current' - } - } + node: 'current', + }, + }, ], (isProductionEnv || isDevelopmentEnv) && [ '@babel/preset-env', @@ -32,9 +32,9 @@ module.exports = function(api) { useBuiltIns: 'entry', corejs: 3, modules: false, - exclude: ['transform-typeof-symbol'] - } - ] + exclude: ['transform-typeof-symbol'], + }, + ], ].filter(Boolean), plugins: [ 'babel-plugin-macros', @@ -44,27 +44,27 @@ module.exports = function(api) { [ '@babel/plugin-proposal-class-properties', { - loose: true - } + loose: true, + }, ], [ '@babel/plugin-proposal-object-rest-spread', { - useBuiltIns: true - } + useBuiltIns: true, + }, ], [ '@babel/plugin-transform-runtime', { - helpers: false - } + helpers: false, + }, ], [ '@babel/plugin-transform-regenerator', { - async: false - } - ] - ].filter(Boolean) - } -} + async: false, + }, + ], + ].filter(Boolean), + }; +}; diff --git a/config/dspace.yml b/config/dspace.yml index 7cdb2f37d..f7098b143 100644 --- a/config/dspace.yml +++ b/config/dspace.yml @@ -1,7 +1,7 @@ --- default: &default - base_url: 'https://dataspace.princeton.edu/rest/' - download_file_path: '/tmp' + base_url: "https://dataspace.princeton.edu/rest/" + download_file_path: "/tmp" production: <<: *default staging: @@ -10,4 +10,4 @@ development: <<: *default test: <<: *default - base_url: 'https://dataspace.example.com/rest/' + base_url: "https://dataspace.example.com/rest/" diff --git a/config/globus.yml b/config/globus.yml index 49f284755..750141c01 100644 --- a/config/globus.yml +++ b/config/globus.yml @@ -1,9 +1,9 @@ --- production: - post_curation_base_url: 'https://g-ef94ef.f0ad1.36fe.data.globus.org' + post_curation_base_url: "https://g-ef94ef.f0ad1.36fe.data.globus.org" staging: - post_curation_base_url: 'https://g-5beea4.90d4e.bd7c.data.globus.org/pdc-describe-staging-postcuration' + post_curation_base_url: "https://g-5beea4.90d4e.bd7c.data.globus.org/pdc-describe-staging-postcuration" development: - post_curation_base_url: 'https://g-5beea4.90d4e.bd7c.data.globus.org/pdc-describe-staging-postcuration' + post_curation_base_url: "https://g-5beea4.90d4e.bd7c.data.globus.org/pdc-describe-staging-postcuration" test: - post_curation_base_url: 'https://example.data.globus.org' + post_curation_base_url: "https://example.data.globus.org" diff --git a/config/honeybadger.yml b/config/honeybadger.yml index 1d3a34841..63f22243c 100644 --- a/config/honeybadger.yml +++ b/config/honeybadger.yml @@ -9,9 +9,9 @@ root: "<%= Rails.root.to_s %>" # Honeybadger won't report errors in these environments. development_environments: -- test -- development -- cucumber + - test + - development + - cucumber # By default, Honeybadger won't report errors in the development_environments. # You can override this by explicitly setting report_data to true or false. diff --git a/config/locales/devise.en.yml b/config/locales/devise.en.yml index ccd5cce6f..7f8d777ad 100644 --- a/config/locales/devise.en.yml +++ b/config/locales/devise.en.yml @@ -28,7 +28,7 @@ en: password_change: subject: "Password Changed" omniauth_callbacks: - failure: "Could not authenticate you %{kind} because \"%{reason}\"." + failure: 'Could not authenticate you %{kind} because "%{reason}".' success: "Successfully authenticated %{kind} account." passwords: no_token: "You can't access this page without coming from a password reset email. If you do come from a password reset email, please make sure you used the full URL provided." diff --git a/config/locales/en.yml b/config/locales/en.yml index ec03ab668..9b7a7e2f5 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -51,8 +51,8 @@ en: file_upload: heading: "New Submission (%{work_title})" actions: 'Once you have uploaded your files, click "next" to continue.' - go_back: 'Previous' - continue: 'Next' + go_back: "Previous" + continue: "Next" curation_uploads: filename: "Filename" created_at: "Time of Upload" @@ -67,9 +67,9 @@ en: readme_upload: heading: "New Submission (%{work_title})" title: "Please upload the README file for this submission." - actions: 'We will ask you about your data files on the next step.' - go_back: 'Previous' - continue: 'Next' + actions: "We will ask you about your data files on the next step." + go_back: "Previous" + continue: "Next" uneditable: approved: "This work has been approved. Edits are no longer available." privs: "You do not have permission to edit this work." diff --git a/config/s3.yml b/config/s3.yml index 866688c60..df5eb2b3f 100644 --- a/config/s3.yml +++ b/config/s3.yml @@ -45,17 +45,17 @@ development: bucket: <%= ENV['AWS_S3_DSPACE_BUCKET'] || 'example-bucket' %> region: <%= ENV['AWS_S3_DSPACE_REGION'] || 'us-east-1' %> test: - access_key_id: 'not-used-access_key_id' - secret_access_key: 'not-used-secret_access_key' + access_key_id: "not-used-access_key_id" + secret_access_key: "not-used-secret_access_key" pre_curation: - bucket: 'example-bucket' - region: 'us-east-1' + bucket: "example-bucket" + region: "us-east-1" post_curation: - bucket: 'example-bucket-post' - region: 'us-east-1' + bucket: "example-bucket-post" + region: "us-east-1" preservation: - bucket: 'example-bucket-preservation' - region: 'us-west-1' + bucket: "example-bucket-preservation" + region: "us-west-1" dspace: - bucket: 'example-bucket-dspace' - region: 'us-east-1' + bucket: "example-bucket-dspace" + region: "us-east-1" diff --git a/config/update_ark_url.yml b/config/update_ark_url.yml index 82fe7e152..b9ac49560 100644 --- a/config/update_ark_url.yml +++ b/config/update_ark_url.yml @@ -1,9 +1,5 @@ --- -production: - true -staging: - false -development: - false -test: - false +production: true +staging: false +development: false +test: false diff --git a/package.json b/package.json index 0472464db..6d27660c0 100644 --- a/package.json +++ b/package.json @@ -15,8 +15,10 @@ "command-line-args": "^5.2.1", "eslint": "^8.26.0", "eslint-config-airbnb-base": "^15.0.0", + "eslint-config-prettier": "^10.0.1", "eslint-plugin-import": "^2.26.0", "postcss-import": "^15.1.0", + "prettier": "^3.4.2", "vite": "^5.0.0", "vite-plugin-ruby": "^5.1.0" }, diff --git a/postcss.config.js b/postcss.config.js index aa5998a80..b7ea0f26f 100644 --- a/postcss.config.js +++ b/postcss.config.js @@ -4,9 +4,9 @@ module.exports = { require('postcss-flexbugs-fixes'), require('postcss-preset-env')({ autoprefixer: { - flexbox: 'no-2009' + flexbox: 'no-2009', }, - stage: 3 - }) - ] -} + stage: 3, + }), + ], +}; diff --git a/public/422.html b/public/422.html index c08eac0d1..23c73ec55 100644 --- a/public/422.html +++ b/public/422.html @@ -1,67 +1,67 @@ - + -
-Maybe you tried to change something you didn't have access to.
+ + +Maybe you tried to change something you didn't have access to.
+If you are the application owner check the logs for more information.
If you are the application owner check the logs for more information.
-