Skip to content

Commit

Permalink
Supporting upgrades to Yarn release 4.3.1 (#809)
Browse files Browse the repository at this point in the history
* Supporting upgrades to Yarn release 4.3.1

* Ensuring that authentication failures are handled for the mediafluxVersion JavaScript functionality
  • Loading branch information
jrgriffiniii authored Jul 5, 2024
1 parent 236a496 commit bb7e52b
Show file tree
Hide file tree
Showing 7 changed files with 1,173 additions and 1,050 deletions.
1 change: 0 additions & 1 deletion .tool-versions
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
ruby 3.3.0
nodejs 18.14.0
yarn 1.22.19
java openjdk-19.0.2
626 changes: 313 additions & 313 deletions .yarn/releases/yarn-4.2.2.cjs → .yarn/releases/yarn-4.3.1.cjs

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion .yarnrc.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
nodeLinker: node-modules

yarnPath: .yarn/releases/yarn-4.2.2.cjs
yarnPath: .yarn/releases/yarn-4.3.1.cjs
7 changes: 5 additions & 2 deletions app/javascript/entrypoints/mediafluxVersion.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,16 @@
// eslint-disable-next-line import/prefer-default-export
export function displayMediafluxVersion(url) {
export function displayMediafluxVersion(url, authenticated) {
const placeholderInPage = $('#mediaflux_version').length === 1;
if (placeholderInPage === true) {
if (placeholderInPage === true && authenticated) {
$.ajax({
type: 'GET',
url,
success(data) {
$('#mediaflux_version').text(`| Mediaflux: ${data.version}`);
},
error(_jqXHR, _textStatus, errorThrown) {
console.error(errorThrown);
},
});
}
}
2 changes: 1 addition & 1 deletion app/views/welcome/index.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -102,5 +102,5 @@
// Make the AJAX call for version information explicitly on this page
// (and for now only on this page) so that we don't make extra calls
// to Mediaflux for every page loaded.
displayMediafluxVersion('<%= mediaflux_info_index_path(format: "json") %>');
displayMediafluxVersion('<%= mediaflux_info_index_path(format: "json") %>', <%= !current_user.nil? %>);
</script>
5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "tiger-data-app",
"packageManager": "yarn@4.2.2",
"packageManager": "yarn@4.3.1",
"browserslist": [
"defaults"
],
Expand All @@ -22,7 +22,8 @@
"bootstrap": "^5.2.3",
"browserslist": "^4.21.5",
"jquery": "^3.6.3",
"vite-plugin-rails": "^0.5.0"
"vite-plugin-rails": "^0.5.0",
"yarn.lock": "^0.0.1-security"
},
"scripts": {
"lint": "eslint 'app/javascript/**/*.js'",
Expand Down
Loading

0 comments on commit bb7e52b

Please sign in to comment.