@keyup.esc="stopRenaming" />
</form>
- <a v-else
+ <component :is="linkTo.is"
+ v-else
ref="basename"
:aria-hidden="isRenaming"
class="files-list__row-name-link"
data-cy-files-list-row-name-link
- v-bind="linkTo"
+ v-bind="linkTo.params"
@click="$emit('click', $event)">
<!-- File name -->
<span class="files-list__row-name-text">
<span class="files-list__row-name-" v-text="displayName" />
<span class="files-list__row-name-ext" v-text="extension" />
</span>
- </a>
+ </component>
</template>
<script lang="ts">
linkTo() {
if (this.source.attributes.failed) {
return {
- title: t('files', 'This node is unavailable'),
is: 'span',
+ params: {
+ title: t('files', 'This node is unavailable'),
+ },
}
}
const action = enabledDefaultActions[0]
const displayName = action.displayName([this.source], this.currentView)
return {
- title: displayName,
- role: 'button',
- tabindex: '0',
+ is: 'a',
+ params: {
+ title: displayName,
+ role: 'button',
+ tabindex: '0',
+ },
}
}
if (this.source?.permissions & Permission.READ) {
return {
- download: this.source.basename,
- href: this.source.source,
- title: t('files', 'Download file {name}', { name: this.displayName }),
- tabindex: '0',
+ is: 'a',
+ params: {
+ download: this.source.basename,
+ href: this.source.source,
+ title: t('files', 'Download file {name}', { name: this.displayName }),
+ tabindex: '0',
+ },
}
}