Skip to content

Commit

Permalink
pkp/pkp-lib#9538 Apply recommended lint rules for vue3
Browse files Browse the repository at this point in the history
  • Loading branch information
jardakotesovec committed Nov 27, 2023
1 parent bca2972 commit c2aa1fe
Show file tree
Hide file tree
Showing 215 changed files with 1,937 additions and 1,936 deletions.
2 changes: 1 addition & 1 deletion .eslintrc.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ module.exports = {
node: true,
},
extends: [
'plugin:vue/vue3-essential',
'plugin:vue/vue3-recommended',
'eslint:recommended',
'@vue/eslint-config-prettier/skip-formatting',
'plugin:storybook/recommended',
Expand Down
2 changes: 1 addition & 1 deletion src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
<vue-announcer class="sr-only" />
<PkpDialog
:open="$store.dialog.dialogOpened"
@close="$store.dialog.closeDialog()"
v-bind="$store.dialog.dialogProps"
@close="$store.dialog.closeDialog()"
></PkpDialog>
<nav class="nav" aria-label="Primary Navigation">
<nav-group>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
</template>

<div>
<badge :isPrimary="true">
<badge :is-primary="true">
<icon icon="comment-o" :inline="true" />
Ongoing review - request accepted
</badge>
Expand All @@ -23,11 +23,11 @@
.
</div>
<div>
<PkpButton :isLink="true">Edit due date</PkpButton>
<PkpButton :is-link="true">Edit due date</PkpButton>
</div>
<div class="mt-4">
<PkpButton>View details</PkpButton>
<PkpButton class="ml-4" :isWarnable="true">Unassign</PkpButton>
<PkpButton class="ml-4" :is-warnable="true">Unassign</PkpButton>
</div>
</PkpPopover>
</template>
Expand Down
2 changes: 1 addition & 1 deletion src/components/Button/Button.vue
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

<script>
export default {
name: 'pkpButton',
name: 'PkpButton',
props: {
element: {
type: String,
Expand Down
92 changes: 46 additions & 46 deletions src/components/Composer/Composer.vue
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@
</div>
<search
v-if="emailTemplatesApiUrl"
:searchLabel="findTemplateLabel"
:search-label="findTemplateLabel"
class="composer__templates__search"
:searchPhrase="searchPhrase"
:search-phrase="searchPhrase"
@search-phrase-changed="
(newSearchPhrase) => (this.searchPhrase = newSearchPhrase)
(newSearchPhrase) => (searchPhrase = newSearchPhrase)
"
/>
<ul
Expand Down Expand Up @@ -113,12 +113,12 @@
class="composer__recipients"
name="to"
:label="recipientsLabel"
:isLabelInline="true"
:deselectLabel="deselectLabel"
:is-label-inline="true"
:deselect-label="deselectLabel"
:all-errors="errors"
groupId="composer"
:formId="id"
:selectedLabel="recipientsLabel"
group-id="composer"
:form-id="id"
:selected-label="recipientsLabel"
:options="localizedRecipientOptions"
:selected="recipientsSelected"
:value="recipients"
Expand All @@ -127,8 +127,8 @@
/>
<button
v-if="!ccIsEnabled"
class="composer__ccToggle -linkButton"
ref="ccButtons"
class="composer__ccToggle -linkButton"
@click="enableCC"
>
{{ addCCLabel }}
Expand All @@ -142,14 +142,14 @@
>
<label :for="id + '-cc'">{{ ccLabel }}</label>
<input
type="text"
name="cc"
:id="id + '-cc'"
v-model="ccBinded"
type="text"
name="cc"
:aria-described-by="!!errors.cc ? id + '-cc-error' : ''"
:aria-invalid="!!errors.cc"
@focus="() => (this.isFocused = 'cc')"
@blur="() => (this.isFocused = '')"
@focus="() => (isFocused = 'cc')"
@blur="() => (isFocused = '')"
/>
</div>
<field-error
Expand All @@ -165,14 +165,14 @@
>
<label :for="id + '-bcc'">{{ bccLabel }}</label>
<input
type="text"
name="bcc"
:id="id + '-bcc'"
v-model="bccBinded"
type="text"
name="bcc"
:aria-described-by="!!errors.bcc ? id + '-bcc-error' : ''"
:aria-invalid="!!errors.bcc"
@focus="() => (this.isFocused = 'bcc')"
@blur="() => (this.isFocused = '')"
@focus="() => (isFocused = 'bcc')"
@blur="() => (isFocused = '')"
/>
</div>
<field-error
Expand All @@ -187,14 +187,14 @@
>
<label :for="id + '-subject'">{{ subjectLabel }}</label>
<input
type="text"
name="subject"
:id="id + '-subject'"
v-model="subjectBinded"
type="text"
name="subject"
:aria-described-by="!!errors.subject ? id + '-subject-error' : ''"
:aria-invalid="!!errors.subject"
@focus="() => (this.isFocused = 'subject')"
@blur="() => (this.isFocused = '')"
@focus="() => (isFocused = 'subject')"
@blur="() => (isFocused = '')"
/>
</div>
<field-error
Expand All @@ -206,27 +206,27 @@
class="composer__body"
name="body"
:label="bodyLabel"
groupId="message"
primaryLocale="en"
group-id="message"
primary-locale="en"
:all-errors="errors"
:init="bodyInit"
:formId="id"
:form-id="id"
plugins="link"
size="large"
toolbar="bold italic superscript subscript | link"
:value="body"
:preparedContent="compiledVariables"
:insertLabel="insertLabel"
:insertModalLabel="insertModalLabel"
:preparedContentLabel="insertContentLabel"
:searchLabel="insertSearchLabel"
@change="(name, prop, value) => this.emitChange({body: value})"
:prepared-content="compiledVariables"
:insert-label="insertLabel"
:insert-modal-label="insertModalLabel"
:prepared-content-label="insertContentLabel"
:search-label="insertSearchLabel"
@change="(name, prop, value) => emitChange({body: value})"
>
<template #footer>
<div
v-if="attachments.length"
class="composer__attachments"
ref="attachedFiles"
class="composer__attachments"
>
<span class="-screenReader">
{{ attachedFilesLabel }}
Expand Down Expand Up @@ -256,7 +256,7 @@
</template>
</field-prepared-content>
<modal
:closeLabel="t('common.close')"
:close-label="t('common.close')"
:name="fileAttacherModalId"
:title="attachFilesLabel"
:open="isModalOpenedFileAttacher"
Expand Down Expand Up @@ -298,7 +298,6 @@ import preparedContent from '@/mixins/preparedContent';
export default {
name: 'Composer',
mixins: [ajaxErrorCallback, dialog, preparedContent],
components: {
FieldAutosuggestPreset,
FieldError,
Expand All @@ -307,6 +306,7 @@ export default {
Modal,
Search,
},
mixins: [ajaxErrorCallback, dialog, preparedContent],
props: {
addCCLabel: {
type: String,
Expand Down Expand Up @@ -664,6 +664,19 @@ export default {
);
},
},
watch: {
searchPhrase() {
this.$nextTick(() => this.search());
},
},
created() {
if (this.initialTemplateKey) {
this.loadTemplate(this.initialTemplateKey);
}
},
mounted() {
this.updateToPadding();
},
methods: {
/**
* Add file attachments to the email
Expand Down Expand Up @@ -986,19 +999,6 @@ export default {
});
},
},
created() {
if (this.initialTemplateKey) {
this.loadTemplate(this.initialTemplateKey);
}
},
mounted() {
this.updateToPadding();
},
watch: {
searchPhrase() {
this.$nextTick(() => this.search());
},
},
};
</script>
Expand Down
18 changes: 9 additions & 9 deletions src/components/Container/AccessPage.vue
Original file line number Diff line number Diff line change
Expand Up @@ -4,23 +4,15 @@ import NotifyUsersForm from '@/components/Form/context/NotifyUsersForm.vue';
export default {
name: 'AccessPage',
extends: Page,
components: {
NotifyUsersForm,
},
extends: Page,
data() {
return {
totalBulkJobs: 0,
};
},
methods: {
/**
* Reload the page to send another email
*/
reload() {
window.location.reload();
},
},
mounted() {
pkp.eventBus.$on('form-success', (formId, data) => {
if (formId !== pkp.const.FORM_NOTIFY_USERS) {
Expand All @@ -33,6 +25,14 @@ export default {
unmounted() {
pkp.eventBus.$off('form-success');
},
methods: {
/**
* Reload the page to send another email
*/
reload() {
window.location.reload();
},
},
};
</script>

Expand Down
2 changes: 1 addition & 1 deletion src/components/Container/AddContextContainer.vue
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ import AddContextForm from '@/components/Form/context/AddContextForm.vue';
export default {
name: 'AddContextContainer',
extends: Container,
components: {
AddContextForm,
},
extends: Container,
};
</script>
2 changes: 1 addition & 1 deletion src/components/Container/AdminPage.vue
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,14 @@ import ActionPanel from '../ActionPanel/ActionPanel.vue';
import AnnouncementsListPanel from '../ListPanel/announcements/AnnouncementsListPanel.vue';
export default {
extends: Page,
name: 'AdminPage',
components: {
ActionPanel,
HighlightsListPanel,
AnnouncementsListPanel,
ThemeForm,
},
extends: Page,
data() {
return {
announcementsEnabled: false,
Expand Down
20 changes: 10 additions & 10 deletions src/components/Container/AdvancedSearchReviewerContainer.vue
Original file line number Diff line number Diff line change
Expand Up @@ -5,26 +5,26 @@
<div class="list_outline">
<ol class="list_box">
<li
class="author_row"
v-for="(affiliations, author) in displayedItems"
:key="author"
class="author_row"
>
<strong>{{ author }}</strong>
<span v-if="affiliations"> - </span>
<span v-if="affiliations">-</span>
<span>{{ affiliations }}</span>
</li>
</ol>
<div class="action_container" v-if="authorCount > 4">
<div v-if="authorCount > 4" class="action_container">
<span
class="show_authors_action"
v-if="!showAllAuthors"
class="show_authors_action"
@click="toggleShowAllAuthors"
>
{{ `${labels.showAll} ${authorCount} ${labels.authorsLabel}` }}
</span>
<span
class="show_authors_action"
v-if="showAllAuthors"
class="show_authors_action"
@click="toggleShowAllAuthors"
>
{{ labels.showLess }}
Expand All @@ -49,11 +49,6 @@ export default {
showAllAuthors: false,
};
},
methods: {
toggleShowAllAuthors() {
this.showAllAuthors = !this.showAllAuthors;
},
},
computed: {
displayedItems() {
if (this.showAllAuthors) {
Expand All @@ -73,6 +68,11 @@ export default {
return Object.keys(this.authors).length;
},
},
methods: {
toggleShowAllAuthors() {
this.showAllAuthors = !this.showAllAuthors;
},
},
};
</script>
<style lang="less">
Expand Down
Loading

0 comments on commit c2aa1fe

Please sign in to comment.