Skip to content

Commit

Permalink
chore(vue3): migrate :key on <template v-for>
Browse files Browse the repository at this point in the history
Signed-off-by: Grigorii K. Shartsev <me@shgk.me>
  • Loading branch information
ShGKme committed May 15, 2024
1 parent a6cb77c commit 66abfe9
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 25 deletions.
7 changes: 3 additions & 4 deletions src/components/AdminSettings/RecordingServers.vue
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,8 @@
<template v-if="servers.length && recordingConsentCapability">
<h3>{{ t('spreed', 'Recording consent') }}</h3>

<template v-for="level in recordingConsentOptions">
<NcCheckboxRadioSwitch :key="level.value + '_radio'"
:value="level.value.toString()"
<template v-for="level in recordingConsentOptions" :key="level.value">
<NcCheckboxRadioSwitch :value="level.value.toString()"
:checked.sync="recordingConsentSelected"
name="recording-consent"
type="radio"
Expand All @@ -63,7 +62,7 @@
{{ level.label }}
</NcCheckboxRadioSwitch>

<p :key="level.value + '_description'" class="consent-description">
<p class="consent-description">
{{ getRecordingConsentDescription(level.value) }}
</p>
</template>
Expand Down
27 changes: 13 additions & 14 deletions src/components/CallView/Grid/Grid.vue
Original file line number Diff line number Diff line change
Expand Up @@ -40,20 +40,19 @@
@keydown="handleMovement">
<template v-if="!devMode && (!isLessThanTwoVideos || !isStripe)">
<EmptyCallView v-if="videos.length === 0 && !isStripe" class="video" :is-grid="true" />
<template v-for="callParticipantModel in displayedVideos">
<VideoVue :key="callParticipantModel.attributes.peerId"
:class="{'video': !isStripe}"
:show-video-overlay="showVideoOverlay"
:token="token"
:model="callParticipantModel"
:is-grid="true"
:show-talking-highlight="!isStripe"
:is-stripe="isStripe"
:is-promoted="sharedDatas[callParticipantModel.attributes.peerId].promoted"
:is-selected="isSelected(callParticipantModel)"
:shared-data="sharedDatas[callParticipantModel.attributes.peerId]"
@click-video="handleClickVideo($event, callParticipantModel.attributes.peerId)" />
</template>
<VideoVue v-for="callParticipantModel in displayedVideos"
:key="callParticipantModel.attributes.peerId"
:class="{'video': !isStripe}"
:show-video-overlay="showVideoOverlay"
:token="token"
:model="callParticipantModel"
:is-grid="true"
:show-talking-highlight="!isStripe"
:is-stripe="isStripe"
:is-promoted="sharedDatas[callParticipantModel.attributes.peerId].promoted"
:is-selected="isSelected(callParticipantModel)"
:shared-data="sharedDatas[callParticipantModel.attributes.peerId]"
@click-video="handleClickVideo($event, callParticipantModel.attributes.peerId)" />
</template>
<!-- Grid developer mode -->
<template v-if="devMode">
Expand Down
13 changes: 6 additions & 7 deletions src/components/NewMessage/NewMessageUploadEditor.vue
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,12 @@
name="fade"
tag="div"
group>
<template v-for="file in files">
<FilePreview :key="file[1].temporaryMessage.id"
:token="token"
is-upload-editor
v-bind="file[1].temporaryMessage.messageParameters.file"
@remove-file="handleRemoveFileFromSelection" />
</template>
<FilePreview v-for="file in files"
:key="file[1].temporaryMessage.id"
:token="token"
is-upload-editor
v-bind="file[1].temporaryMessage.messageParameters.file"
@remove-file="handleRemoveFileFromSelection" />
<div :key="'addMore'"
class="add-more">
<NcButton :aria-label="addMoreAriaLabel"
Expand Down

0 comments on commit 66abfe9

Please sign in to comment.