Skip to content
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

avoid void #16439

Draft
wants to merge 2 commits into
base: dev
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions client/src/components/Collections/ListCollectionCreator.vue
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<b-alert show variant="warning" dismissible>
{{ noElementsHeader }}
{{ allInvalidElementsPartOne }}
<a class="cancel-text" href="javascript:void(0)" role="button" @click="oncancel">
<a class="cancel-text" href="" role="button" @click.prevent="oncancel">

Check failure on line 13 in client/src/components/Collections/ListCollectionCreator.vue

View workflow job for this annotation

GitHub Actions / client-unit-test (18)

Elements with the "button" interactive role must be focusable

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Using a button for links without an href is preferable. The .ui-link helper class should style a button to look like a link.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! I am experimenting to see how it behaves where.

{{ cancelText }}
</a>
{{ allInvalidElementsPartTwo }}
Expand All @@ -30,7 +30,7 @@
</li>
</ul>
{{ allInvalidElementsPartOne }}
<a class="cancel-text" href="javascript:void(0)" role="button" @click="oncancel">
<a class="cancel-text" href="" role="button" @click.prevent="oncancel">

Check failure on line 33 in client/src/components/Collections/ListCollectionCreator.vue

View workflow job for this annotation

GitHub Actions / client-unit-test (18)

Elements with the "button" interactive role must be focusable
{{ cancelText }}
</a>
{{ allInvalidElementsPartTwo }}
Expand Down Expand Up @@ -155,13 +155,13 @@
<b-button class="sort-items" :title="titleSortButton" @click="sortByName">
<FontAwesomeIcon icon="sort-alpha-down" />
</b-button>
<a

Check failure on line 158 in client/src/components/Collections/ListCollectionCreator.vue

View workflow job for this annotation

GitHub Actions / client-unit-test (18)

Elements with the "button" interactive role must be focusable
v-if="atLeastOneDatasetIsSelected"
class="clear-selected"
href="javascript:void(0);"
href=""
role="button"
:title="titleDeselectButton"
@click="clickClearAll">
@click.prevent="clickClearAll">
{{ l("Clear selected") }}
</a>
</div>
Expand All @@ -173,7 +173,7 @@
<div v-if="noMoreValidDatasets">
<b-alert show variant="warning" dismissible>
{{ discardedElementsHeader }}
<a class="reset-text" href="javascript:void(0)" role="button" @click="reset">
<a class="reset-text" href="" role="button" @click.prevent="reset">

Check failure on line 176 in client/src/components/Collections/ListCollectionCreator.vue

View workflow job for this annotation

GitHub Actions / client-unit-test (18)

Elements with the "button" interactive role must be focusable
{{ startOverText }}
</a>
?
Expand Down
10 changes: 5 additions & 5 deletions client/src/components/Collections/PairCollectionCreator.vue
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<b-alert show variant="warning" dismissible>
{{ noElementsHeader }}
{{ allInvalidElementsPartOne }}
<a class="cancel-text" href="javascript:void(0)" role="button" @click="oncancel">
<a class="cancel-text" href="" role="button" @click.prevent="oncancel">

Check failure on line 13 in client/src/components/Collections/PairCollectionCreator.vue

View workflow job for this annotation

GitHub Actions / client-unit-test (18)

Elements with the "button" interactive role must be focusable
{{ cancelText }}
</a>
{{ allInvalidElementsPartTwo }}
Expand All @@ -30,7 +30,7 @@
</li>
</ul>
{{ allInvalidElementsPartOne }}
<a class="cancel-text" href="javascript:void(0)" role="button" @click="oncancel">
<a class="cancel-text" href="" role="button" @click.prevent="oncancel">

Check failure on line 33 in client/src/components/Collections/PairCollectionCreator.vue

View workflow job for this annotation

GitHub Actions / client-unit-test (18)

Elements with the "button" interactive role must be focusable
{{ cancelText }}
</a>
{{ allInvalidElementsPartTwo }}
Expand All @@ -54,7 +54,7 @@
</div>
<b-alert show variant="warning" dismissible>
{{ exactlyTwoValidElementsPartOne }}
<a class="cancel-text" href="javascript:void(0)" role="button" @click="oncancel">
<a class="cancel-text" href="" role="button" @click.prevent="oncancel">

Check failure on line 57 in client/src/components/Collections/PairCollectionCreator.vue

View workflow job for this annotation

GitHub Actions / client-unit-test (18)

Elements with the "button" interactive role must be focusable
{{ cancelText }}
</a>
{{ exactlyTwoValidElementsPartTwo }}
Expand Down Expand Up @@ -127,9 +127,9 @@
<div class="collection-elements-controls">
<a
class="swap"
href="javascript:void(0);"
href=""
title="l('Swap forward and reverse datasets')"
@click="swapButton">
@click.prevent="swapButton">
{{ l("Swap") }}
</a>
</div>
Expand Down
24 changes: 8 additions & 16 deletions client/src/components/Collections/PairedListCollectionCreator.vue
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<b-alert show variant="warning" dismissible>
{{ noElementsHeader }}
{{ allInvalidElementsPartOne }}
<a class="cancel-text" href="javascript:void(0)" role="button" @click="oncancel">
<a class="cancel-text" href="" role="button" @click.prevent="oncancel">

Check failure on line 13 in client/src/components/Collections/PairedListCollectionCreator.vue

View workflow job for this annotation

GitHub Actions / client-unit-test (18)

Elements with the "button" interactive role must be focusable
{{ cancelText }}
</a>
{{ allInvalidElementsPartTwo }}
Expand All @@ -30,7 +30,7 @@
</li>
</ul>
{{ allInvalidElementsPartOne }}
<a class="cancel-text" href="javascript:void(0)" role="button" @click="oncancel">
<a class="cancel-text" href="" role="button" @click.prevent="oncancel">

Check failure on line 33 in client/src/components/Collections/PairedListCollectionCreator.vue

View workflow job for this annotation

GitHub Actions / client-unit-test (18)

Elements with the "button" interactive role must be focusable
{{ cancelText }}
</a>
{{ allInvalidElementsPartTwo }}
Expand All @@ -54,7 +54,7 @@
</div>
<b-alert show variant="warning" dismissible>
{{ allInvalidElementsPartOne }}
<a class="cancel-text" href="javascript:void(0)" role="button" @click="oncancel">
<a class="cancel-text" href="" role="button" @click.prevent="oncancel">

Check failure on line 57 in client/src/components/Collections/PairedListCollectionCreator.vue

View workflow job for this annotation

GitHub Actions / client-unit-test (18)

Elements with the "button" interactive role must be focusable
{{ cancelText }}
</a>
{{ allInvalidElementsPartTwo }}
Expand Down Expand Up @@ -83,7 +83,7 @@
"Could not automatically create any pairs from the given dataset names. You may want to choose or enter different filters and try auto-pairing again."
)
}}
<a class="cancel-text" href="javascript:void(0)" role="button" @click="oncancel">
<a class="cancel-text" href="" role="button" @click.prevent="oncancel">
{{ cancelText }}
</a>
{{ allInvalidElementsPartTwo }}
Expand Down Expand Up @@ -274,17 +274,13 @@
<div class="column-header">
<a
class="clear-filters-link"
href="javascript:void(0);"
href=""
role="button"
@click="clickClearFilters">
@click.prevent="clickClearFilters">
{{ l("Clear Filters") }}
</a>
<br />
<a
class="autopair-link"
href="javascript:void(0);"
role="button"
@click="clickAutopair">
<a class="autopair-link" href="" role="button" @click.prevent="clickAutopair">
{{ l("Auto-pair") }}
</a>
</div>
Expand Down Expand Up @@ -378,11 +374,7 @@
<div class="column-title paired-column-title">
<span class="title"> {{ numOfPairs }} {{ l(" pairs") }}</span>
</div>
<a
class="unpair-all-link"
href="javascript:void(0);"
role="button"
@click="unpairAll">
<a class="unpair-all-link" href="" role="button" @click.prevent="unpairAll">
{{ l("Unpair all") }}
</a>
</div>
Expand Down
14 changes: 2 additions & 12 deletions client/src/components/Collections/common/CollectionCreator.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,7 @@
<div class="collection-creator">
<div class="header flex-row no-flex">
<div class="main-help well clear" :class="{ expanded: isExpanded }">
<a
class="more-help"
href="javascript:void(0);"
role="button"
:title="titleForHelp"
@click="_clickForHelp">
<a class="more-help" href="" role="button" :title="titleForHelp" @click.prevent="_clickForHelp">
<div v-if="!isExpanded">
<i class="fas fa-chevron-down"></i>
</div>
Expand All @@ -18,12 +13,7 @@
<div class="help-content">
<!-- each collection that extends this will add their own help content -->
<slot name="help-content"></slot>
<a
class="more-help"
href="javascript:void(0);"
role="button"
:title="titleForHelp"
@click="_clickForHelp">
<a class="more-help" href="" role="button" :title="titleForHelp" @click.prevent="_clickForHelp">
</a>
</div>
</div>
Expand Down
8 changes: 2 additions & 6 deletions client/src/components/Common/TextSummary.vue
Original file line number Diff line number Diff line change
Expand Up @@ -49,14 +49,10 @@ const text = computed(() =>
<div>
{{ text }}
<span v-if="summary">
<a
v-if="!propShowDetails"
class="text-summary-expand"
href="javascript:void(0)"
@click.stop="propShowDetails = true">
<a v-if="!propShowDetails" class="text-summary-expand" href="" @click.stop.prevent="propShowDetails = true">
... <FontAwesomeIcon :icon="collapsedEnableIcon" />
</a>
<a v-else href="javascript:void(0)" @click.stop="propShowDetails = false">
<a v-else href="" @click.stop.prevent="propShowDetails = false">
... <FontAwesomeIcon :icon="collapsedDisableIcon" />
</a>
</span>
Expand Down
2 changes: 1 addition & 1 deletion client/src/components/History/Content/model/StatesInfo.vue
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ function onFilter(value: string) {
<dl v-for="(state, key, index) in states" :key="index">
<b-alert :variant="state.status || 'success'" show>
<dt>
<a class="text-decoration-none" href="javascript:void(0)" @click="onFilter(key)"
<a class="text-decoration-none" href="" @click.prevent="onFilter(key)"
><code>{{ key }}</code></a
>
<icon v-if="state.icon" :icon="state.icon" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@
<HistoryEmpty v-if="queryDefault" :writable="writable" class="m-2" />
<b-alert v-else-if="formattedSearchError" class="m-2" variant="danger" show>
Error in filter:
<a href="javascript:void(0)" @click="showAdvanced = true">
<a href="" @click.prevent="showAdvanced = true">
{{ formattedSearchError.filter }}'{{ formattedSearchError.value }}'
</a>
</b-alert>
Expand Down
6 changes: 3 additions & 3 deletions client/src/components/Libraries/LibraryEditField.vue
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
</span>
<!-- eslint-enable vue/no-v-html -->
<span :title="text">...</span>
<a class="more-text-btn" href="javascript:void(0)" @click="toggleDescriptionExpand">(more) </a>
<a class="more-text-btn" href="" @click.prevent="toggleDescriptionExpand">(more) </a>
</div>
<!-- Regular -->
<div v-else>
Expand All @@ -25,8 +25,8 @@
<a
v-if="text.length > maxDescriptionLength"
class="more-text-btn"
href="javascript:void(0)"
@click="toggleDescriptionExpand"
href=""
@click.prevent="toggleDescriptionExpand"
>(less)
</a>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -130,9 +130,7 @@
</span>
<!-- eslint-enable vue/no-v-html -->
<span :title="getMessage(row.item)"> ...</span>
<a class="more-text-btn" href="javascript:void(0)" @click="expandMessage(row.item)">
(more)
</a>
<a class="more-text-btn" href="" @click.prevent="expandMessage(row.item)"> (more) </a>
</div>
<!-- eslint-disable-next-line vue/no-v-html -->
<div v-else v-html="linkify(sanitize(getMessage(row.item)))"></div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,16 +34,16 @@
</div>
<p v-if="is_unrestricted" class="text-center">
You can
<strong class="make-private" @click="toggleDatasetPrivacy(true)">
<a id="make-private" href="javascript:void(0)">make this dataset private</a>
</strong>
<a id="make-private" href="" class="make-private" @click.prevent="toggleDatasetPrivacy(true)"
>make this dataset private</a
>
to you.
</p>
<p v-else class="text-center">
You can
<strong class="remove-restrictions" @click="toggleDatasetPrivacy(false)">
<a href="javascript:void(0)">remove all access restrictions</a>
</strong>
<a href="" class="remove-restrictions" @click.prevent="toggleDatasetPrivacy(false)"
>remove all access restrictions</a
>
on this dataset.
</p>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,17 +65,17 @@
</button>
<div class="dropdown-menu" role="menu">
<a
href="javascript:void(0)"
href=""
role="button"
class="toolbtn-bulk-import add-to-history-datasets dropdown-item"
@click="importToHistoryModal(false)">
@click.prevent="importToHistoryModal(false)">
as Datasets
</a>
<a
href="javascript:void(0)"
href=""
role="button"
class="toolbtn-collection-import add-to-history-collection dropdown-item"
@click="importToHistoryModal(true)">
@click.prevent="importToHistoryModal(true)">
as a Collection
</a>
</div>
Expand Down
12 changes: 3 additions & 9 deletions client/src/components/Login/LoginForm.vue
Original file line number Diff line number Diff line change
Expand Up @@ -42,11 +42,7 @@
type="password" />
<b-form-text>
<span v-localize>Forgot password?</span>
<a
v-localize
href="javascript:void(0)"
role="button"
@click.prevent="resetLogin">
<a v-localize href="" role="button" @click.prevent="resetLogin">
Click here to reset your password.
</a>
</b-form-text>
Expand All @@ -65,7 +61,7 @@
<a
id="register-toggle"
v-localize
href="javascript:void(0)"
href=""
role="button"
@click.prevent="toggleLogin">
Register here.
Expand All @@ -78,9 +74,7 @@
</span>
<span v-else>
Do not wish to connect to an external provider?
<a href="javascript:void(0)" role="button" @click.prevent="returnToLogin">
Return to login here.
</a>
<a href="" role="button" @click.prevent="returnToLogin"> Return to login here. </a>
</span>
</b-card-footer>
</b-card>
Expand Down
4 changes: 1 addition & 3 deletions client/src/components/Login/NewUserConfirmation.vue
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,7 @@
</b-card-body>
<b-card-footer>
Already have an account?
<a id="login-toggle" href="javascript:void(0)" role="button" @click.prevent="login">
Log in here.
</a>
<a id="login-toggle" href="" role="button" @click.prevent="login"> Log in here. </a>
</b-card-footer>
</b-card>
</b-form>
Expand Down
7 changes: 1 addition & 6 deletions client/src/components/Login/RegisterForm.vue
Original file line number Diff line number Diff line change
Expand Up @@ -81,12 +81,7 @@
</b-collapse>
<b-card-footer v-if="showLoginLink">
<span v-localize>Already have an account?</span>
<a
id="login-toggle"
v-localize
href="javascript:void(0)"
role="button"
@click.prevent="toggleLogin">
<a id="login-toggle" v-localize href="" role="button" @click.prevent="toggleLogin">
Log in here.
</a>
</b-card-footer>
Expand Down
2 changes: 1 addition & 1 deletion client/src/components/Panels/Common/ToolSection.vue
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
v-b-tooltip.topright.hover
:class="['toolSectionTitle', `tool-menu-section-${sectionName}`]"
:title="title">
<a class="title-link" href="javascript:void(0)" @click="toggleMenu()">
<a class="title-link" href="" @click.prevent="toggleMenu()">
<span class="name">
{{ name }}
</span>
Expand Down
2 changes: 1 addition & 1 deletion client/src/components/Panels/ToolBox.vue
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
<b-badge class="alert-danger w-100">
Did you mean:
<i>
<a href="javascript:void(0)" @click="onQuery(closestTerm)">{{ closestTerm }}</a>
<a href="" @click.prevent="onQuery(closestTerm)">{{ closestTerm }}</a>
</i>
?
</b-badge>
Expand Down
10 changes: 3 additions & 7 deletions client/src/components/RuleBuilder/RuleTargetComponent.vue
Original file line number Diff line number Diff line change
@@ -1,11 +1,7 @@
<template>
<a
class="rule-link dropdown-item"
href="javascript:void(0)"
:class="linkClassName"
@click="$emit('addNewRule', ruleType)"
>{{ title }}</a
>
<a class="rule-link dropdown-item" href="" :class="linkClassName" @click.prevent="$emit('addNewRule', ruleType)">{{
title
}}</a>
</template>

<script>
Expand Down
Loading
Loading