-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
MIR-1412 Show MD5 sum for each file in the derivate file list #1089
MIR-1412 Show MD5 sum for each file in the derivate file list #1089
Conversation
mir-layout/src/main/resources/META-INF/resources/mir-layout/scss/common/mir_browse.scss
Outdated
Show resolved
Hide resolved
mir-module/src/main/resources/META-INF/resources/hbs/derivate-fileList.hbs
Outdated
Show resolved
Hide resolved
mir-module/src/main/resources/META-INF/resources/hbs/derivate-fileList.hbs
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
change target branch version to 2024.06.x
const toggleMD5LinkElement = '#toggleMD5Link'; | ||
// Derivate action dropdown toggle button element | ||
const derivateActionDropdownToggleButton = '.headline .dropdown.options .dropdown-toggle'; | ||
// Element selector with md5 information | ||
const md5ElementSelector = '.file_md5'; | ||
|
||
// Show md5 sums by derivate files by clicking on the 'toggleMD5LinkElement' element | ||
$(toggleMD5LinkElement).click((evt) => { | ||
evt.preventDefault(); | ||
// Get the element to show/hide | ||
const elements = document.querySelectorAll(md5ElementSelector); | ||
|
||
elements.forEach(element => { | ||
element.classList.toggle('hidden'); | ||
}); | ||
}); | ||
|
||
// Getting i18n translation for the link to switch state 'show/hide MD5 amounts' depending on the visibility of the | ||
// message with this amount when clicking on the 'derivateActionDropdownToggleButton' element | ||
$(derivateActionDropdownToggleButton).click((evt) => { | ||
if ($(md5ElementSelector)) { | ||
let i18nKey = ''; | ||
if ($(md5ElementSelector).hasClass('hidden')) { | ||
i18nKey = 'component.mods.metaData.options.MD5.show'; | ||
} else { | ||
i18nKey = 'component.mods.metaData.options.MD5.hide'; | ||
} | ||
getI18n(i18nKey, toggleMD5LinkElement); | ||
} | ||
}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
use 2 spaces. Encapsulate the code to improve overview (IIFE).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed
let i18nKey = ''; | ||
if ($(md5ElementSelector).hasClass('hidden')) { | ||
i18nKey = 'component.mods.metaData.options.MD5.show'; | ||
} else { | ||
i18nKey = 'component.mods.metaData.options.MD5.hide'; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
const i18nKey = md5Elements.hasClass('hidden')
? 'component.mods.metaData.options.MD5.show'
: 'component.mods.metaData.options.MD5.hide';
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed
// Getting i18n translation for the link to switch state 'show/hide MD5 amounts' depending on the visibility of the | ||
// message with this amount when clicking on the 'derivateActionDropdownToggleButton' element | ||
$(derivateActionDropdownToggleButton).click((evt) => { | ||
if ($(md5ElementSelector)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
use $(md5ElementSelector).length > 0
, because this check is always true.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I use now $(md5ElementSelector).length,
see link: https://learn.jquery.com/using-jquery-core/faq/how-do-i-test-whether-an-element-exists/
|
||
// Getting i18n translation for the link to switch state 'show/hide MD5 amounts' depending on the visibility of the | ||
// message with this amount when clicking on the 'derivateActionDropdownToggleButton' element | ||
$(derivateActionDropdownToggleButton).click((evt) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would define the dropdown more explicitly, the display should only refer to a specific derivate.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed
but we need this in 2023.06.x |
* 2023.06.x: MIR-1416 pin glassfish jaxb-runtime to MIRAccessKeyPairTransformer MIR-1412 Show MD5 sum for each file in the derivate file list (#1089) MIR-1413-subject xml:lang should not be removed MIR-1408 Added class attributes to list items in action menu (#1083) MIR-1361 Allow to enter ROR as affiliation for authors (#1074) MIR-1365 Allow to configure max value for xed template subject.simple and subject.simple.required MIR-1359 fix choose publication button in related item (#1071) Bump express in /mir-webapp/src/main/vue/name-search Bump dompurify in /mir-webapp/src/main/vue/editor-tools Bump webpack in /mir-webapp/src/main/vue/editor-tools Bump braces from 3.0.2 to 3.0.3 in /mir-wizard
* 2024.06.x: Bump nanoid from 3.3.6 to 3.3.8 in /mir-webapp/src/main/vue/name-search MIR-1416 pin glassfish jaxb-runtime to MIRAccessKeyPairTransformer MIR-1412 Show MD5 sum for each file in the derivate file list (#1089) Update README.md (#1091) MIR-1413-subject xml:lang should not be removed MIR-1408 Added class attributes to list items in action menu (#1083) Bump http-proxy-middleware in /mir-webapp/src/main/vue/name-search Bump express in /mir-webapp/src/main/vue/editor-tools Update README.md (#1086) MIR-1361 Allow to enter ROR as affiliation for authors (#1074) update PMD ruleset.xml (#1082) MIR-1365 Allow to configure max value for xed template subject.simple and subject.simple.required MIR-1359 fix choose publication button in related item (#1071) Bump express in /mir-webapp/src/main/vue/name-search Bump dompurify in /mir-webapp/src/main/vue/editor-tools Bump webpack in /mir-webapp/src/main/vue/editor-tools Bump braces from 3.0.2 to 3.0.3 in /mir-wizard
The list of derivate files should have the ability to display the MD5 amount
MIR-1412.