Skip to content

Commit

Permalink
add executable option to distinguish views & events
Browse files Browse the repository at this point in the history
  • Loading branch information
ungarson committed Jan 29, 2021
1 parent 0aae397 commit 75a65be
Show file tree
Hide file tree
Showing 4 changed files with 52 additions and 42 deletions.
81 changes: 45 additions & 36 deletions src/components/Cards/EntrypointsCard.vue
Original file line number Diff line number Diff line change
@@ -1,50 +1,59 @@
<template>
<v-card flat outlined :style="`max-width:${cardMaxWidth >= 0 ? cardMaxWidth + 'px' : '100%'};`">
<v-navigation-drawer floating permanent :style="`max-height: ${navigationMaxHeight}vh; width: 100%;`">
<v-expansion-panels
flat
accordion
mandatory
active-class="entrypoint-selected"
v-model="selected"
>
<v-expansion-panel
v-for="(item, i) in entrypoints"
:key="i"
:class="i > 0 ? 'bt-1' : ''"
class="entrypoint-panel"
>
<v-expansion-panel-header>
<div class="d-flex">
<span class="hash">{{ item.name }}</span>
</div>
</v-expansion-panel-header>
<v-expansion-panel-content v-if="isImplementations">
<ImplementationsList
v-for="(implementations, i) in item.implementations"
v-bind:key="`implementation${i}`"
:implementations="implementations"
/>
</v-expansion-panel-content>
<v-expansion-panel-content v-else>
<TypeDef :typedef="item.typedef" first="parameter"/>
</v-expansion-panel-content>
</v-expansion-panel>
</v-expansion-panels>
</v-navigation-drawer>
</v-card>
<v-row>
<v-col cols="6">
<Schema v-if="executable" />
</v-col>
<v-col :cols="executable ? 6 : 12">
<v-card flat outlined :style="`max-width:${cardMaxWidth >= 0 ? cardMaxWidth + 'px' : '100%'};`">
<v-navigation-drawer floating permanent :style="`max-height: ${navigationMaxHeight}vh; width: 100%;`">
<v-expansion-panels
flat
accordion
mandatory
active-class="entrypoint-selected"
v-model="selected"
>
<v-expansion-panel
v-for="(item, i) in entrypoints"
:key="i"
:class="i > 0 ? 'bt-1' : ''"
class="entrypoint-panel"
>
<v-expansion-panel-header>
<div class="d-flex">
<span class="hash">{{ item.name }}</span>
</div>
</v-expansion-panel-header>
<v-expansion-panel-content v-if="isImplementations">
<ImplementationsList
v-for="(implementations, i) in item.implementations"
v-bind:key="`implementation${i}`"
:implementations="implementations"
/>
</v-expansion-panel-content>
<v-expansion-panel-content v-else>
<TypeDef :typedef="item.typedef" first="parameter"/>
</v-expansion-panel-content>
</v-expansion-panel>
</v-expansion-panels>
</v-navigation-drawer>
</v-card>
</v-col>
</v-row>
</template>

<script>
import TypeDef from "@/views/contract/TypeDef";
import ImplementationsList from "@/components/Lists/ImplementationsList";
import Schema from "@/components/schema/Schema";
export default {
name: "EntrypointsCard",
components: {ImplementationsList, TypeDef},
components: {Schema, ImplementationsList, TypeDef},
props: {
entrypoints: Array,
selectedOutside: Number,
executable: Boolean,
isImplementations: {
type: Boolean,
default: false,
Expand Down Expand Up @@ -83,4 +92,4 @@ export default {
}
}
}
</script>
</script>
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
:card-max-width="-1"
:entrypoints="implementsList"
:is-implementations="true"
:executable="executable"
/>
</v-list>
</template>
Expand All @@ -18,6 +19,10 @@ export default {
props: {
name: String,
implementsList: Array,
executable: {
type: Boolean,
default: false,
}
}
}
</script>
7 changes: 1 addition & 6 deletions src/views/contract/MetadataTab/ListBlocks/ReservedFields.vue
Original file line number Diff line number Diff line change
Expand Up @@ -81,13 +81,8 @@ export default {
color: #9e9e9e;
}
.value-field {
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
white-space: normal;
color: var(--v-tree-base);
&:hover {
white-space: normal;
}
}
}
</style>
1 change: 1 addition & 0 deletions src/views/contract/MetadataTab/MetadataTab.vue
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
v-if="metadata.views"
:implementsList="metadata.views"
name="Views"
executable
/>
</v-skeleton-loader>
</v-container>
Expand Down

0 comments on commit 75a65be

Please sign in to comment.