Skip to content

Commit

Permalink
pkp/pkp-lib#9497 Migrate pubid plugin to vue3
Browse files Browse the repository at this point in the history
  • Loading branch information
jardakotesovec authored and bozana committed Jan 15, 2025
1 parent 5643a18 commit 1e9b6af
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
2 changes: 1 addition & 1 deletion plugins/pubIds/urn/URNPubIdPlugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -470,7 +470,7 @@ public function loadUrnFieldComponent(string $hookName, array $args): void
$templateMgr = $args[0];
$template = $args[1];

if ($template !== 'workflow/workflow.tpl') {
if ($template !== 'dashboard/editors.tpl') {
return;
}

Expand Down
9 changes: 5 additions & 4 deletions plugins/pubIds/urn/js/FieldPubIdUrn.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,10 @@
* @brief A Vue.js component for URN field, that is used for pattern suffixes and that considers check number.
*/

pkp.Vue.component('field-pub-id-urn', {
console.log('pubid test', pkp.registry.getComponent('field-pub-id'));
pkp.registry.registerComponent('FieldPubIdUrn', {
name: 'FieldPubIdUrn',
extends: pkp.Vue.component('field-pub-id'),
extends: pkp.registry.getComponent('PkpFieldPubId'),
props: {
applyCheckNumber: {
type: Boolean,
Expand All @@ -22,10 +23,10 @@ pkp.Vue.component('field-pub-id-urn', {
},
methods: {
generateId() {
var id = pkp.Vue.component('field-pub-id').options.methods['generateId'].apply(this);
var id = pkp.Vue.component('field-pub-id').methods['generateId'].apply(this);
return this.applyCheckNumber
? id + $.pkp.plugins.generic.urn.getCheckNumber(id, this.prefix)
: id;
}
},
});
})

0 comments on commit 1e9b6af

Please sign in to comment.