fix: proper key for v-for loops

This commit is contained in:
liyasthomas
2021-07-14 05:19:08 +05:30
parent 7ec8539540
commit eeddb6a97e
39 changed files with 139 additions and 130 deletions

View File

@@ -81,7 +81,7 @@ body {
} }
.material-icons { .material-icons {
font-size: 1.25rem; font-size: 1.25rem !important;
} }
.svg-icons { .svg-icons {

View File

@@ -15,7 +15,7 @@
> >
<kbd <kbd
v-for="(key, keyIndex) in shortcut.keys" v-for="(key, keyIndex) in shortcut.keys"
:key="`key-${keyIndex}`" :key="`shortcut-${index}-key-${keyIndex}`"
class=" class="
py-2 py-2
px-4 px-4

View File

@@ -41,7 +41,7 @@
</option> </option>
<option <option
v-for="(team, index) in myTeams" v-for="(team, index) in myTeams"
:key="index" :key="`team-${index}`"
:value="index" :value="index"
> >
{{ team.name }} {{ team.name }}

View File

@@ -140,7 +140,7 @@
</option> </option>
<option <option
v-for="(collection, index) in myCollections" v-for="(collection, index) in myCollections"
:key="index" :key="`collection-${index}`"
:value="index" :value="index"
> >
{{ collection.name }} {{ collection.name }}

View File

@@ -98,7 +98,7 @@
<div v-show="showChildren || isFiltered"> <div v-show="showChildren || isFiltered">
<CollectionsGraphqlFolder <CollectionsGraphqlFolder
v-for="(folder, index) in collection.folders" v-for="(folder, index) in collection.folders"
:key="folder.name" :key="`folder-${index}`"
class="ml-5 border-l border-dividerLight" class="ml-5 border-l border-dividerLight"
:picked="picked" :picked="picked"
:saving-mode="savingMode" :saving-mode="savingMode"
@@ -115,7 +115,7 @@
/> />
<CollectionsGraphqlRequest <CollectionsGraphqlRequest
v-for="(request, index) in collection.requests" v-for="(request, index) in collection.requests"
:key="index" :key="`request-${index}`"
class="ml-5 border-l border-dividerLight" class="ml-5 border-l border-dividerLight"
:picked="picked" :picked="picked"
:saving-mode="savingMode" :saving-mode="savingMode"
@@ -145,7 +145,7 @@
" "
> >
<i class="material-icons opacity-50 pb-2">folder_open</i> <i class="material-icons opacity-50 pb-2">folder_open</i>
<span class="text-xs"> <span class="text-xs text-center">
{{ $t("collection_empty") }} {{ $t("collection_empty") }}
</span> </span>
</div> </div>

View File

@@ -94,7 +94,7 @@
<div v-show="showChildren || isFiltered"> <div v-show="showChildren || isFiltered">
<CollectionsGraphqlFolder <CollectionsGraphqlFolder
v-for="(subFolder, subFolderIndex) in folder.folders" v-for="(subFolder, subFolderIndex) in folder.folders"
:key="subFolder.name" :key="`subFolder-${subFolderIndex}`"
class="ml-5 border-l border-dividerLight" class="ml-5 border-l border-dividerLight"
:picked="picked" :picked="picked"
:saving-mode="savingMode" :saving-mode="savingMode"
@@ -111,7 +111,7 @@
/> />
<CollectionsGraphqlRequest <CollectionsGraphqlRequest
v-for="(request, index) in folder.requests" v-for="(request, index) in folder.requests"
:key="index" :key="`request-${index}`"
class="ml-5 border-l border-dividerLight" class="ml-5 border-l border-dividerLight"
:picked="picked" :picked="picked"
:saving-mode="savingMode" :saving-mode="savingMode"
@@ -144,7 +144,7 @@
" "
> >
<i class="material-icons opacity-50 pb-2">folder_open</i> <i class="material-icons opacity-50 pb-2">folder_open</i>
<span class="text-xs"> <span class="text-xs text-center">
{{ $t("folder_empty") }} {{ $t("folder_empty") }}
</span> </span>
</div> </div>

View File

@@ -41,7 +41,7 @@
<div class="flex-col"> <div class="flex-col">
<CollectionsGraphqlCollection <CollectionsGraphqlCollection
v-for="(collection, index) in filteredCollections" v-for="(collection, index) in filteredCollections"
:key="collection.name" :key="`collection-${index}`"
:picked="picked" :picked="picked"
:name="collection.name" :name="collection.name"
:collection-index="index" :collection-index="index"
@@ -62,7 +62,7 @@
class="flex items-center text-secondaryLight flex-col p-4 justify-center" class="flex items-center text-secondaryLight flex-col p-4 justify-center"
> >
<i class="material-icons opacity-50 pb-2">create_new_folder</i> <i class="material-icons opacity-50 pb-2">create_new_folder</i>
<span class="text-xs"> <span class="text-xs text-center">
{{ $t("create_new_collection") }} {{ $t("create_new_collection") }}
</span> </span>
</div> </div>
@@ -71,7 +71,7 @@
class="flex items-center text-secondaryLight flex-col p-4 justify-center" class="flex items-center text-secondaryLight flex-col p-4 justify-center"
> >
<i class="material-icons opacity-50 pb-2">manage_search</i> <i class="material-icons opacity-50 pb-2">manage_search</i>
<span class="text-xs"> <span class="text-xs text-center">
{{ $t("nothing_found") }} "{{ filterText }}" {{ $t("nothing_found") }} "{{ filterText }}"
</span> </span>
</div> </div>

View File

@@ -4,8 +4,8 @@
:class="{ 'rounded-lg border-2 border-divider': saveRequest }" :class="{ 'rounded-lg border-2 border-divider': saveRequest }"
> >
<div <div
class="flex flex-col sticky top-10 z-10" class="flex flex-col sticky z-10 top-0 bg-primary"
:class="{ 'bg-primary': !saveRequest }" :class="{ '!top-10': !saveRequest && !doc }"
> >
<input <input
v-if="!saveRequest" v-if="!saveRequest"
@@ -70,8 +70,7 @@
: 'CollectionsTeamsCollection' : 'CollectionsTeamsCollection'
" "
v-for="(collection, index) in filteredCollections" v-for="(collection, index) in filteredCollections"
:key="collection.name" :key="`collection-${index}`"
:name="collection.name"
:collection-index="index" :collection-index="index"
:collection="collection" :collection="collection"
:doc="doc" :doc="doc"
@@ -98,7 +97,7 @@
class="flex items-center text-secondaryLight flex-col p-4 justify-center" class="flex items-center text-secondaryLight flex-col p-4 justify-center"
> >
<i class="material-icons opacity-50 pb-2">create_new_folder</i> <i class="material-icons opacity-50 pb-2">create_new_folder</i>
<span class="text-xs"> <span class="text-xs text-center">
{{ $t("create_new_collection") }} {{ $t("create_new_collection") }}
</span> </span>
</div> </div>
@@ -107,7 +106,7 @@
class="flex items-center text-secondaryLight flex-col p-4 justify-center" class="flex items-center text-secondaryLight flex-col p-4 justify-center"
> >
<i class="material-icons opacity-50 pb-2">manage_search</i> <i class="material-icons opacity-50 pb-2">manage_search</i>
<span class="text-xs"> <span class="text-xs text-center">
{{ $t("nothing_found") }} "{{ filterText }}" {{ $t("nothing_found") }} "{{ filterText }}"
</span> </span>
</div> </div>

View File

@@ -114,7 +114,7 @@
<div v-show="showChildren || isFiltered"> <div v-show="showChildren || isFiltered">
<CollectionsMyFolder <CollectionsMyFolder
v-for="(folder, index) in collection.folders" v-for="(folder, index) in collection.folders"
:key="index" :key="`folder-${index}`"
class="ml-5 border-l border-dividerLight" class="ml-5 border-l border-dividerLight"
:folder="folder" :folder="folder"
:folder-index="index" :folder-index="index"
@@ -133,7 +133,7 @@
/> />
<CollectionsMyRequest <CollectionsMyRequest
v-for="(request, index) in collection.requests" v-for="(request, index) in collection.requests"
:key="index" :key="`request-${index}`"
class="ml-5 border-l border-dividerLight" class="ml-5 border-l border-dividerLight"
:request="request" :request="request"
:collection-index="collectionIndex" :collection-index="collectionIndex"
@@ -167,7 +167,7 @@
" "
> >
<i class="material-icons opacity-50 pb-2">folder_open</i> <i class="material-icons opacity-50 pb-2">folder_open</i>
<span class="text-xs"> <span class="text-xs text-center">
{{ $t("collection_empty") }} {{ $t("collection_empty") }}
</span> </span>
</div> </div>

View File

@@ -99,7 +99,7 @@
<div v-show="showChildren || isFiltered"> <div v-show="showChildren || isFiltered">
<CollectionsMyFolder <CollectionsMyFolder
v-for="(subFolder, subFolderIndex) in folder.folders" v-for="(subFolder, subFolderIndex) in folder.folders"
:key="subFolder.name" :key="`subFolder-${subFolderIndex}`"
class="ml-5 border-l border-dividerLight" class="ml-5 border-l border-dividerLight"
:folder="subFolder" :folder="subFolder"
:folder-index="subFolderIndex" :folder-index="subFolderIndex"
@@ -118,7 +118,7 @@
/> />
<CollectionsMyRequest <CollectionsMyRequest
v-for="(request, index) in folder.requests" v-for="(request, index) in folder.requests"
:key="index" :key="`request-${index}`"
class="ml-5 border-l border-dividerLight" class="ml-5 border-l border-dividerLight"
:request="request" :request="request"
:collection-index="collectionIndex" :collection-index="collectionIndex"
@@ -153,7 +153,7 @@
" "
> >
<i class="material-icons opacity-50 pb-2">folder_open</i> <i class="material-icons opacity-50 pb-2">folder_open</i>
<span class="text-xs"> <span class="text-xs text-center">
{{ $t("folder_empty") }} {{ $t("folder_empty") }}
</span> </span>
</div> </div>

View File

@@ -111,7 +111,7 @@
<div v-show="showChildren || isFiltered"> <div v-show="showChildren || isFiltered">
<CollectionsTeamsFolder <CollectionsTeamsFolder
v-for="(folder, index) in collection.children" v-for="(folder, index) in collection.children"
:key="folder.title" :key="`folder-${folder}`"
class="ml-5 border-l border-dividerLight" class="ml-5 border-l border-dividerLight"
:folder="folder" :folder="folder"
:folder-index="index" :folder-index="index"
@@ -131,7 +131,7 @@
/> />
<CollectionsTeamsRequest <CollectionsTeamsRequest
v-for="(request, index) in collection.requests" v-for="(request, index) in collection.requests"
:key="index" :key="`request-${index}`"
class="ml-5 border-l border-dividerLight" class="ml-5 border-l border-dividerLight"
:request="request.request" :request="request.request"
:collection-index="collectionIndex" :collection-index="collectionIndex"
@@ -164,7 +164,7 @@
" "
> >
<i class="material-icons opacity-50 pb-2">folder_open</i> <i class="material-icons opacity-50 pb-2">folder_open</i>
<span class="text-xs"> <span class="text-xs text-center">
{{ $t("collection_empty") }} {{ $t("collection_empty") }}
</span> </span>
</div> </div>

View File

@@ -96,7 +96,7 @@
<div v-show="showChildren || isFiltered"> <div v-show="showChildren || isFiltered">
<CollectionsTeamsFolder <CollectionsTeamsFolder
v-for="(subFolder, subFolderIndex) in folder.children" v-for="(subFolder, subFolderIndex) in folder.children"
:key="subFolder.name" :key="`subFolder-${subFolderIndex}`"
class="ml-5 border-l border-dividerLight" class="ml-5 border-l border-dividerLight"
:folder="subFolder" :folder="subFolder"
:folder-index="subFolderIndex" :folder-index="subFolderIndex"
@@ -116,7 +116,7 @@
/> />
<CollectionsTeamsRequest <CollectionsTeamsRequest
v-for="(request, index) in folder.requests" v-for="(request, index) in folder.requests"
:key="index" :key="`request-${index}`"
class="ml-5 border-l border-dividerLight" class="ml-5 border-l border-dividerLight"
:request="request.request" :request="request.request"
:collection-index="collectionIndex" :collection-index="collectionIndex"
@@ -148,7 +148,7 @@
" "
> >
<i class="material-icons opacity-50 pb-2">folder_open</i> <i class="material-icons opacity-50 pb-2">folder_open</i>
<span class="text-xs"> <span class="text-xs text-center">
{{ $t("folder_empty") }} {{ $t("folder_empty") }}
</span> </span>
</div> </div>

View File

@@ -6,7 +6,7 @@
</h2> </h2>
<span <span
v-for="(folder, index) in collection.folders" v-for="(folder, index) in collection.folders"
:key="`sub-collection-${index}`" :key="`folder-${index}`"
class="folder" class="folder"
> >
<DocsFolder :folder="folder" /> <DocsFolder :folder="folder" />

View File

@@ -4,10 +4,13 @@
<i class="material-icons">folder_open</i> <i class="material-icons">folder_open</i>
{{ folder.name || $t("none") }} {{ folder.name || $t("none") }}
</h3> </h3>
<div v-for="(subFolder, index) in folder.folders" :key="index"> <div
v-for="(subFolder, index) in folder.folders"
:key="`subFolder-${index}`"
>
<DocsFolder :folder="subFolder" /> <DocsFolder :folder="subFolder" />
</div> </div>
<div v-for="(request, index) in folder.requests" :key="index"> <div v-for="(request, index) in folder.requests" :key="`request-${index}`">
<DocsRequest :request="request" /> <DocsRequest :request="request" />
</div> </div>
</div> </div>

View File

@@ -47,7 +47,11 @@
</p> </p>
<h4 v-if="request.headers" class="heading">{{ $t("headers") }}</h4> <h4 v-if="request.headers" class="heading">{{ $t("headers") }}</h4>
<span v-if="request.headers"> <span v-if="request.headers">
<p v-for="header in request.headers" :key="header.key" class="doc-desc"> <p
v-for="(header, index) in request.headers"
:key="`header-${index}`"
class="doc-desc"
>
<span> <span>
{{ header.key || $t("none") }}: {{ header.key || $t("none") }}:
<code>{{ header.value || $t("none") }}</code> <code>{{ header.value || $t("none") }}</code>
@@ -57,8 +61,8 @@
<h4 v-if="request.params" class="heading">{{ $t("parameters") }}</h4> <h4 v-if="request.params" class="heading">{{ $t("parameters") }}</h4>
<span v-if="request.params"> <span v-if="request.params">
<p <p
v-for="parameter in request.params" v-for="(parameter, index) in request.params"
:key="parameter.key" :key="`parameter-${index}`"
class="doc-desc" class="doc-desc"
> >
<span> <span>
@@ -70,8 +74,8 @@
<h4 v-if="request.bodyParams" class="heading">{{ $t("payload") }}</h4> <h4 v-if="request.bodyParams" class="heading">{{ $t("payload") }}</h4>
<span v-if="request.bodyParams"> <span v-if="request.bodyParams">
<p <p
v-for="payload in request.bodyParams" v-for="(payload, index) in request.bodyParams"
:key="payload.key" :key="`payload-${index}`"
class="doc-desc" class="doc-desc"
> >
<span> <span>

View File

@@ -44,7 +44,7 @@
<div class="border-2 border-divider"> <div class="border-2 border-divider">
<div <div
v-for="(variable, index) in vars" v-for="(variable, index) in vars"
:key="index" :key="`variable-${index}`"
class=" class="
flex flex
border-b border-b

View File

@@ -23,7 +23,7 @@
</option> </option>
<option <option
v-for="(environment, index) in environments" v-for="(environment, index) in environments"
:key="index" :key="`environment-${index}`"
:value="index" :value="index"
> >
{{ environment.name }} {{ environment.name }}
@@ -63,14 +63,14 @@
class="flex items-center text-secondaryLight flex-col p-4 justify-center" class="flex items-center text-secondaryLight flex-col p-4 justify-center"
> >
<i class="material-icons opacity-50 pb-2">library_add</i> <i class="material-icons opacity-50 pb-2">library_add</i>
<span class="text-xs"> <span class="text-xs text-center">
{{ $t("create_new_environment") }} {{ $t("create_new_environment") }}
</span> </span>
</div> </div>
<div class="flex flex-col"> <div class="flex flex-col">
<EnvironmentsEnvironment <EnvironmentsEnvironment
v-for="(environment, index) in environments" v-for="(environment, index) in environments"
:key="environment.name" :key="`environment-${index}`"
:environment-index="index" :environment-index="index"
:environment="environment" :environment="environment"
@edit-environment="editEnvironment(environment, index)" @edit-environment="editEnvironment(environment, index)"

View File

@@ -7,7 +7,7 @@
{{ fieldName }} {{ fieldName }}
<span v-if="fieldArgs.length > 0"> <span v-if="fieldArgs.length > 0">
( (
<span v-for="(field, index) in fieldArgs" :key="index"> <span v-for="(field, index) in fieldArgs" :key="`field-${index}`">
{{ field.name }}: {{ field.name }}:
<GraphqlTypeLink <GraphqlTypeLink
:gql-type="field.type" :gql-type="field.type"
@@ -47,7 +47,7 @@
<div v-if="fieldArgs.length > 0"> <div v-if="fieldArgs.length > 0">
<h5 class="my-2 text-xs">Arguments:</h5> <h5 class="my-2 text-xs">Arguments:</h5>
<div class="pl-4 border-l-2 border-divider"> <div class="pl-4 border-l-2 border-divider">
<div v-for="(field, index) in fieldArgs" :key="index"> <div v-for="(field, index) in fieldArgs" :key="`field-${index}`">
<span class="font-semibold text-xs"> <span class="font-semibold text-xs">
{{ field.name }}: {{ field.name }}:
<GraphqlTypeLink <GraphqlTypeLink

View File

@@ -17,7 +17,10 @@
</div> </div>
<div v-if="interfaces.length > 0"> <div v-if="interfaces.length > 0">
<h5 class="my-2 text-xs">Interfaces:</h5> <h5 class="my-2 text-xs">Interfaces:</h5>
<div v-for="gqlInterface in interfaces" :key="gqlInterface.name"> <div
v-for="(gqlInterface, index) in interfaces"
:key="`gqlInterface-${index}`"
>
<GraphqlTypeLink <GraphqlTypeLink
:gql-type="gqlInterface" :gql-type="gqlInterface"
:jump-type-callback="jumpTypeCallback" :jump-type-callback="jumpTypeCallback"
@@ -28,8 +31,8 @@
<div v-if="children.length > 0" class="mb-2"> <div v-if="children.length > 0" class="mb-2">
<h5 class="my-2 text-xs">Children:</h5> <h5 class="my-2 text-xs">Children:</h5>
<GraphqlTypeLink <GraphqlTypeLink
v-for="child in children" v-for="(child, index) in children"
:key="child.name" :key="`child-${index}`"
:gql-type="child" :gql-type="child"
:jump-type-callback="jumpTypeCallback" :jump-type-callback="jumpTypeCallback"
class="pl-4 border-l-2 border-divider" class="pl-4 border-l-2 border-divider"
@@ -38,8 +41,8 @@
<div v-if="gqlType.getFields"> <div v-if="gqlType.getFields">
<h5 class="my-2 text-xs">Fields:</h5> <h5 class="my-2 text-xs">Fields:</h5>
<GraphqlField <GraphqlField
v-for="field in gqlType.getFields()" v-for="(field, index) in gqlType.getFields()"
:key="field.name" :key="`field-${index}`"
class="pl-4 border-l-2 border-divider" class="pl-4 border-l-2 border-divider"
:gql-field="field" :gql-field="field"
:is-highlighted="isFieldHighlighted({ field })" :is-highlighted="isFieldHighlighted({ field })"
@@ -49,8 +52,8 @@
<div v-if="isEnum"> <div v-if="isEnum">
<h5 class="my-2 text-xs">Values:</h5> <h5 class="my-2 text-xs">Values:</h5>
<div <div
v-for="value in gqlType.getValues()" v-for="(value, index) in gqlType.getValues()"
:key="value.name" :key="`value-${index}`"
class="pl-4 border-l-2 border-divider" class="pl-4 border-l-2 border-divider"
v-text="value.name" v-text="value.name"
></div> ></div>

View File

@@ -59,7 +59,7 @@
class="flex items-center text-secondaryLight flex-col p-4 justify-center" class="flex items-center text-secondaryLight flex-col p-4 justify-center"
> >
<i class="material-icons opacity-50 pb-2">manage_search</i> <i class="material-icons opacity-50 pb-2">manage_search</i>
<span class="text-xs"> <span class="text-xs text-center">
{{ $t("nothing_found") }} "{{ filterText }}" {{ $t("nothing_found") }} "{{ filterText }}"
</span> </span>
</div> </div>
@@ -68,7 +68,7 @@
class="flex items-center text-secondaryLight flex-col p-4 justify-center" class="flex items-center text-secondaryLight flex-col p-4 justify-center"
> >
<i class="material-icons opacity-50 pb-2">schedule</i> <i class="material-icons opacity-50 pb-2">schedule</i>
<span class="text-xs"> <span class="text-xs text-center">
{{ $t("history_empty") }} {{ $t("history_empty") }}
</span> </span>
</div> </div>

View File

@@ -25,7 +25,7 @@
</div> </div>
<div <div
v-for="(param, index) in bodyParams" v-for="(param, index) in bodyParams"
:key="index" :key="`param-${index}`"
class=" class="
flex flex
border-b border-dashed border-b border-dashed
@@ -76,9 +76,9 @@
<div v-else class="file-chips-container"> <div v-else class="file-chips-container">
<div class="file-chips-wrapper"> <div class="file-chips-wrapper">
<SmartDeletableChip <SmartDeletableChip
v-for="(file, i) in Array.from(bodyParams[index].value)" v-for="(file, fileIndex) in Array.from(bodyParams[index].value)"
:key="`body-param-${index}-file-${i}`" :key="`param-${index}-file-${fileIndex}`"
@chip-delete="chipDelete(index, i)" @chip-delete="chipDelete(index, fileIndex)"
> >
{{ file.name }} {{ file.name }}
</SmartDeletableChip> </SmartDeletableChip>

View File

@@ -39,8 +39,8 @@
</span> </span>
</template> </template>
<SmartItem <SmartItem
v-for="gen in codegens" v-for="(gen, index) in codegens"
:key="gen.id" :key="`gen-${index}`"
:label="gen.name" :label="gen.name"
@click.native=" @click.native="
requestType = gen.id requestType = gen.id

View File

@@ -33,7 +33,7 @@
</div> </div>
<div <div
v-for="(header, index) in headers$" v-for="(header, index) in headers$"
:key="index" :key="`header-${index}`"
class=" class="
flex flex
border-b border-dashed border-b border-dashed

View File

@@ -33,7 +33,7 @@
</div> </div>
<div <div
v-for="(param, index) in params$" v-for="(param, index) in params$"
:key="index" :key="`param-${index}`"
class=" class="
flex flex
border-b border-dashed border-b border-dashed

View File

@@ -34,12 +34,12 @@
/> />
</template> </template>
<SmartItem <SmartItem
v-for="(methodMenuItem, index) in methodMenuItems" v-for="(method, index) in methods"
:key="`method-${index}`" :key="`method-${index}`"
:label="methodMenuItem" :label="method"
class="font-mono" class="font-mono"
@click.native=" @click.native="
updateMethod(methodMenuItem) updateMethod(method)
$refs.options.tippy().hide() $refs.options.tippy().hide()
" "
/> />
@@ -257,7 +257,7 @@ export default {
data() { data() {
return { return {
newMethod$: "", newMethod$: "",
methodMenuItems: [ methods: [
"GET", "GET",
"HEAD", "HEAD",
"POST", "POST",

View File

@@ -18,7 +18,7 @@
/> />
</div> </div>
</div> </div>
<ul v-for="(token, index) in tokens" :key="index"> <ul v-for="(token, index) in tokens" :key="`token-${index}`">
<li> <li>
<input <input
class="input" class="input"

View File

@@ -2,7 +2,7 @@
<div class="p-2 font-mono"> <div class="p-2 font-mono">
<div <div
v-for="(header, index) in headers" v-for="(header, index) in headers"
:key="index" :key="`header-${index}`"
class="flex items-center" class="flex items-center"
> >
<span <span

View File

@@ -3,7 +3,7 @@
<SmartTab <SmartTab
v-for="(lens, index) in validLenses" v-for="(lens, index) in validLenses"
:id="lens.lensName" :id="lens.lensName"
:key="lens.lensName" :key="`lens-${index}`"
:label="lens.lensName" :label="lens.lensName"
:selected="index === 0" :selected="index === 0"
> >

View File

@@ -4,11 +4,11 @@
<div ref="log" name="log" class="realtime-log"> <div ref="log" name="log" class="realtime-log">
<span v-if="log"> <span v-if="log">
<span <span
v-for="(logEntry, index) in log" v-for="(entry, index) in log"
:key="index" :key="`entry-${index}`"
:style="{ color: logEntry.color }" :style="{ color: entry.color }"
>@ {{ logEntry.ts }}{{ getSourcePrefix(logEntry.source) >@ {{ entry.ts }}{{ getSourcePrefix(entry.source)
}}{{ logEntry.payload }}</span }}{{ entry.payload }}</span
> >
</span> </span>
<span v-else>{{ $t("waiting_for_connection") }}</span> <span v-else>{{ $t("waiting_for_connection") }}</span>

View File

@@ -18,8 +18,8 @@
" "
> >
<div <div
v-for="(p, index) in currPath" v-for="(p, index) in currentPath"
:key="index" :key="`p-${index}`"
class=" class="
inline-flex inline-flex
items-center items-center
@@ -34,11 +34,11 @@
<span @click="onBlockClick(index)"> <span @click="onBlockClick(index)">
{{ p }} {{ p }}
</span> </span>
<i v-if="index + 1 !== currPath.length" class="material-icons mx-2"> <i v-if="index + 1 !== currentPath.length" class="material-icons mx-2">
chevron_right chevron_right
</i> </i>
<tippy <tippy
v-if="sibDropDownIndex == index" v-if="siblingDropDownIndex == index"
ref="options" ref="options"
interactive interactive
tabindex="-1" tabindex="-1"
@@ -47,11 +47,11 @@
arrow arrow
> >
<SmartItem <SmartItem
v-for="(sib, i) in currSib" v-for="(sibling, siblingIndex) in currentSibling"
:key="i" :key="`p-${index}-sibling-${siblingIndex}`"
class="font-mono" class="font-mono"
:label="sib.key ? sib.key.value : i" :label="sibling.key ? sibling.key.value : i"
@click.native="goToSib(sib)" @click.native="goToSibling(sibling)"
/> />
</tippy> </tippy>
</div> </div>
@@ -107,9 +107,9 @@ export default {
editor: null, editor: null,
cacheValue: "", cacheValue: "",
outline: outline(), outline: outline(),
currPath: [], currentPath: [],
currSib: [], currentSibling: [],
sibDropDownIndex: null, siblingDropDownIndex: null,
} }
}, },
@@ -176,7 +176,7 @@ export default {
) )
const path = this.outline.genPath(index) const path = this.outline.genPath(index)
if (path.success) { if (path.success) {
this.currPath = path.res this.currentPath = path.res
} }
}) })
} }
@@ -225,19 +225,19 @@ export default {
}, 2000), }, 2000),
onBlockClick(index) { onBlockClick(index) {
if (this.sibDropDownIndex === index) { if (this.siblingDropDownIndex === index) {
this.clearSibList() this.clearSiblingList()
} else { } else {
this.currSib = this.outline.getSiblings(index) this.currentSibling = this.outline.getSiblings(index)
if (this.currSib.length) this.sibDropDownIndex = index if (this.currentSibling.length) this.siblingDropDownIndex = index
} }
}, },
clearSibList() { clearSiblingList() {
this.currSib = [] this.currentSibling = []
this.sibDropDownIndex = null this.siblingDropDownIndex = null
}, },
goToSib(obj) { goToSibling(obj) {
this.clearSibList() this.clearSiblingList()
if (obj.start) { if (obj.start) {
const pos = this.editor.session.doc.indexToPosition(obj.start, 0) const pos = this.editor.session.doc.indexToPosition(obj.start, 0)
if (pos) { if (pos) {
@@ -252,8 +252,8 @@ export default {
try { try {
this.outline.init(content) this.outline.init(content)
if (content[0] === "[") this.currPath.push("[]") if (content[0] === "[") this.currentPath.push("[]")
else this.currPath.push("{}") else this.currentPath.push("{}")
} catch (e) { } catch (e) {
console.log("Outline error: ", e) console.log("Outline error: ", e)
} }

View File

@@ -31,7 +31,7 @@
> >
<li <li
v-for="(suggestion, index) in suggestions" v-for="(suggestion, index) in suggestions"
:key="index" :key="`suggestion-${index}`"
:class="{ active: currentSuggestionIndex === index }" :class="{ active: currentSuggestionIndex === index }"
@click.prevent="forceSuggestion(suggestion)" @click.prevent="forceSuggestion(suggestion)"
> >

View File

@@ -19,10 +19,10 @@
/> />
</template> </template>
<SmartItem <SmartItem
v-for="locale in $i18n.locales.filter( v-for="(locale, index) in $i18n.locales.filter(
({ code }) => code !== $i18n.locale ({ code }) => code !== $i18n.locale
)" )"
:key="locale.code" :key="`locale-${index}`"
:to="switchLocalePath(locale.code).toString()" :to="switchLocalePath(locale.code).toString()"
:label="`${locale.country} ${locale.name}`" :label="`${locale.country} ${locale.name}`"
@click.native="$refs.language.tippy().hide()" @click.native="$refs.language.tippy().hide()"

View File

@@ -6,11 +6,11 @@
v-tippy="{ theme: 'tooltip' }" v-tippy="{ theme: 'tooltip' }"
:title="`${color.charAt(0).toUpperCase()}${color.slice(1)}`" :title="`${color.charAt(0).toUpperCase()}${color.slice(1)}`"
:class="[ :class="[
{ 'bg-primary': color === $colorMode.preference }, { 'bg-primary': color === activeColor },
{ 'text-accent hover:text-accent': color === $colorMode.value }, { 'text-accent hover:text-accent': color === activeColor },
]" ]"
:icon="getIcon(color)" :icon="getIcon(color)"
@click.native="$colorMode.preference = color" @click.native="setBGMode(color)"
/> />
</div> </div>
</template> </template>

View File

@@ -5,7 +5,7 @@
<div class="inline-flex"> <div class="inline-flex">
<button <button
v-for="(tab, index) in tabs" v-for="(tab, index) in tabs"
:key="index" :key="`tab-${index}`"
class="tab" class="tab"
:class="{ active: tab.active }" :class="{ active: tab.active }"
:tabindex="0" :tabindex="0"

View File

@@ -25,7 +25,7 @@
</label> </label>
<ul <ul
v-for="(member, index) in members" v-for="(member, index) in members"
:key="`new-${index}`" :key="`member-${index}`"
class=" class="
border-b border-dashed border-b border-dashed
divide-y divide-y
@@ -106,7 +106,7 @@
</ul> </ul>
<ul <ul
v-for="(member, index) in newMembers" v-for="(member, index) in newMembers"
:key="index" :key="`member-${index}`"
class=" class="
border-b border-dashed border-b border-dashed
divide-y divide-y

14
package-lock.json generated
View File

@@ -31,7 +31,7 @@
"rxjs": "^7.2.0", "rxjs": "^7.2.0",
"socket.io-client": "^4.1.3", "socket.io-client": "^4.1.3",
"socketio-wildcard": "^2.0.0", "socketio-wildcard": "^2.0.0",
"splitpanes": "^2.3.6", "splitpanes": "^2.3.8",
"tern": "^0.24.3", "tern": "^0.24.3",
"three": "^0.130.1", "three": "^0.130.1",
"three-globe": "^2.18.5", "three-globe": "^2.18.5",
@@ -26675,9 +26675,9 @@
} }
}, },
"node_modules/splitpanes": { "node_modules/splitpanes": {
"version": "2.3.6", "version": "2.3.8",
"resolved": "https://registry.npmjs.org/splitpanes/-/splitpanes-2.3.6.tgz", "resolved": "https://registry.npmjs.org/splitpanes/-/splitpanes-2.3.8.tgz",
"integrity": "sha512-2sif1pmOQw/N+/jRbVzqTJ32lkhJax8jQfaXCebRK/SFCadHOnAaXDcWW8PpEcr9vKpfzH7gxJ8Sq/74HECr/g==" "integrity": "sha512-eM/qZ1v7U5BMV8FQR7oeqVlllz3sTGTm0//g/eJMa0hZ4s+A1VK68j26FWzcaVlw2P5+dCXk7/X6ZRjjwcbrgw=="
}, },
"node_modules/sprintf-js": { "node_modules/sprintf-js": {
"version": "1.0.3", "version": "1.0.3",
@@ -53996,9 +53996,9 @@
} }
}, },
"splitpanes": { "splitpanes": {
"version": "2.3.6", "version": "2.3.8",
"resolved": "https://registry.npmjs.org/splitpanes/-/splitpanes-2.3.6.tgz", "resolved": "https://registry.npmjs.org/splitpanes/-/splitpanes-2.3.8.tgz",
"integrity": "sha512-2sif1pmOQw/N+/jRbVzqTJ32lkhJax8jQfaXCebRK/SFCadHOnAaXDcWW8PpEcr9vKpfzH7gxJ8Sq/74HECr/g==" "integrity": "sha512-eM/qZ1v7U5BMV8FQR7oeqVlllz3sTGTm0//g/eJMa0hZ4s+A1VK68j26FWzcaVlw2P5+dCXk7/X6ZRjjwcbrgw=="
}, },
"sprintf-js": { "sprintf-js": {
"version": "1.0.3", "version": "1.0.3",

View File

@@ -47,7 +47,7 @@
"rxjs": "^7.2.0", "rxjs": "^7.2.0",
"socket.io-client": "^4.1.3", "socket.io-client": "^4.1.3",
"socketio-wildcard": "^2.0.0", "socketio-wildcard": "^2.0.0",
"splitpanes": "^2.3.6", "splitpanes": "^2.3.8",
"tern": "^0.24.3", "tern": "^0.24.3",
"three": "^0.130.1", "three": "^0.130.1",
"three-globe": "^2.18.5", "three-globe": "^2.18.5",

View File

@@ -53,7 +53,7 @@
</ul> </ul>
<ul <ul
v-for="(header, index) in headers" v-for="(header, index) in headers"
:key="`${header.value}_${index}`" :key="`header-${index}`"
class=" class="
divide-y divide-dashed divide-divider divide-y divide-dashed divide-divider
border-b border-dashed border-divider border-b border-dashed border-divider
@@ -363,8 +363,8 @@
class="divide-y divide-dividerLight" class="divide-y divide-dividerLight"
> >
<GraphqlField <GraphqlField
v-for="field in filteredQueryFields" v-for="(field, index) in filteredQueryFields"
:key="field.name" :key="`field-${index}`"
:gql-field="field" :gql-field="field"
:jump-type-callback="handleJumpToType" :jump-type-callback="handleJumpToType"
class="p-4" class="p-4"
@@ -377,8 +377,8 @@
class="divide-y divide-dividerLight" class="divide-y divide-dividerLight"
> >
<GraphqlField <GraphqlField
v-for="field in filteredMutationFields" v-for="(field, index) in filteredMutationFields"
:key="field.name" :key="`field-${index}`"
:gql-field="field" :gql-field="field"
:jump-type-callback="handleJumpToType" :jump-type-callback="handleJumpToType"
class="p-4" class="p-4"
@@ -391,8 +391,8 @@
class="divide-y divide-dividerLight" class="divide-y divide-dividerLight"
> >
<GraphqlField <GraphqlField
v-for="field in filteredSubscriptionFields" v-for="(field, index) in filteredSubscriptionFields"
:key="field.name" :key="`field-${index}`"
:gql-field="field" :gql-field="field"
:jump-type-callback="handleJumpToType" :jump-type-callback="handleJumpToType"
class="p-4" class="p-4"
@@ -406,8 +406,8 @@
class="divide-y divide-dividerLight" class="divide-y divide-dividerLight"
> >
<GraphqlType <GraphqlType
v-for="type in filteredGraphqlTypes" v-for="(type, index) in filteredGraphqlTypes"
:key="type.name" :key="`type-${index}`"
:gql-type="type" :gql-type="type"
:gql-types="graphqlTypes" :gql-types="graphqlTypes"
:is-highlighted=" :is-highlighted="
@@ -438,7 +438,7 @@
" "
> >
<i class="material-icons opacity-50 pb-2">description</i> <i class="material-icons opacity-50 pb-2">description</i>
<span class="text-xs"> <span class="text-xs text-center">
{{ $t("send_request_first") }} {{ $t("send_request_first") }}
</span> </span>
</div> </div>

View File

@@ -51,13 +51,13 @@
</div> </div>
</template> </template>
<SmartItem <SmartItem
v-for="(contentTypeMenuItem, index) in validContentTypes" v-for="(contentTypeItem, index) in validContentTypes"
:key="`content-type-${index}`" :key="`contentTypeItem-${index}`"
@click.native=" @click.native="
contentType = contentTypeMenuItem contentType = contentTypeItem
$refs.contentTypeOptions.tippy().hide() $refs.contentTypeOptions.tippy().hide()
" "
:label="contentTypeMenuItem" :label="contentTypeItem"
/> />
</tippy> </tippy>
<SmartToggle <SmartToggle
@@ -411,7 +411,7 @@
</div> </div>
<div <div
v-for="(testReport, index) in testReports" v-for="(testReport, index) in testReports"
:key="index" :key="`testReport-${index}`"
class="px-4" class="px-4"
> >
<div v-if="testReport.startBlock"> <div v-if="testReport.startBlock">
@@ -556,7 +556,7 @@
> >
<option <option
v-for="(req, index) in tokenReqs" v-for="(req, index) in tokenReqs"
:key="index" :key="`req-${index}`"
:value="req.name" :value="req.name"
> >
{{ req.name }} {{ req.name }}