2323 <v-divider />
2424
2525 <!-- Data tables -->
26- <template v-if = " tableSamples . length " >
26+ <div >
2727 <v-row no-gutters >
2828 <v-col cols =" 2" >
2929 <v-list class =" px-4" >
6464 </v-list >
6565 </v-col >
6666 <v-divider vertical />
67- <v-col cols =" 10" class =" px-4" >
68- <v-row
69- no-gutters
70- justify =" start"
71- >
67+ <v-col cols =" 10" class =" px-4 mt-2" >
68+ <v-row justify =" start" >
69+ <p v-if =" visibleTableSamples.length === 0" class =" pa-4 mt-2" >
70+ {{ tableSamples.length > 0
71+ ? 'Please select some tables on the left that you\'d like to include in your network.'
72+ : "You haven't uploaded any tables. This view only works when you have some tables uploaded. Return to the previous step to upload data tables."
73+ }}
74+ </p >
7275 <v-card
7376 v-for =" sample in visibleTableSamples"
7477 :key =" sample.table.name"
7578 raised
7679 outlined
77- class =" mt-4"
80+ class =" mt-4 ma-2 "
7881 >
79- <v-card-title class =" primary white--text " >
82+ <v-card-title class =" grey lighten-3 " >
8083 <v-row class =" ma-0" >
8184 {{ sample.table.name }}
8285 <v-spacer />
8386 <v-switch
84- dark
8587 hide-details
8688 class =" ma-0"
8789 :disabled =" edgeTable !== undefined && edgeTable.table.name !== sample.table.name"
8890 :value =" edgeTable !== undefined && edgeTable.table.name === sample.table.name"
8991 @change =" setEdgeTable(sample.table, $event)"
9092 >
9193 <template #label >
92- < span class = " white--text " > Edge Table</ span >
94+ Edge Table
9395 </template >
9496 </v-switch >
9597 </v-row >
104106 disable-sort
105107 >
106108 <template #header =" { props: { headers } } " >
107- <thead dark >
109+ <thead >
108110 <tr >
109111 <th
110112 v-for =" { value: col } in headers"
111113 :key =" `${sample.table.name}:${col}`"
112114 style =" width : 1px ; white-space : nowrap ;"
115+ class =" pt-2 pb-4 grey lighten-3"
113116 >
114117 <!-- Include/Exclude Column -->
115118 <v-icon
116119 v-if =" !excludedMap[sample.table.name][col]"
117120 :disabled =" checkboxDisabled(sample.table, col)"
118- dark
119121 @click =" excludedMap[sample.table.name][col] = true"
120122 >
121123 mdi-checkbox-marked
122124 </v-icon >
123125 <v-icon
124126 v-else
125- dark
126127 :disabled =" checkboxDisabled(sample.table, col)"
127128 @click =" excludedMap[sample.table.name][col] = false"
128129 >
139140 @input =" menuOpen = $event"
140141 >
141142 <template #activator =" { on } " >
142- <v-icon
143- :color =" linkColor(sample.table, col)"
144- dark
145- :class =" { 'disable-events': linkDisabled(sample.table) }"
146- v-on =" on"
147- >
148- mdi-link
149- </v-icon >
143+ <v-btn icon >
144+ <v-icon
145+ :color =" linkColor(sample.table, col)"
146+ :class =" { 'disable-events': linkDisabled(sample.table) }"
147+ v-on =" on"
148+ >
149+ mdi-link
150+ </v-icon >
151+ </v-btn >
150152 </template >
151153 <v-card max-height =" 30vh" >
152154 <!-- Edge Table -->
221223 <v-icon
222224 :color =" linkColor(sample.table, col, true)"
223225 :class =" { 'disable-events': joinDisabled(sample.table, col) }"
224- dark
225226 v-on =" on"
226227 >
227228 mdi-call-merge
288289 </v-row >
289290 </v-col >
290291 </v-row >
291- </template >
292+ </div >
292293 </v-card-text >
293294
294295 <v-card-actions class =" px-4 py-3" >
304305 id =" create-table"
305306 color =" primary"
306307 :disabled =" !valid"
308+ :loading =" networkCreating"
307309 @click =" createNetwork"
308310 >
309311 Create
@@ -408,11 +410,11 @@ const inNetworkTables = computed(() => [
408410 targetTable .value ?.joined ?.table ,
409411]);
410412
411- interface ExclusionMap {
412- [key : string ]: {
413- [innerKey : string ]: boolean
414- }
415- }
413+ interface ExclusionMap {
414+ [key : string ]: {
415+ [innerKey : string ]: boolean
416+ }
417+ }
416418
417419// Remove any no longer visible links
418420watch (tablesVisible , (visible ) => {
@@ -603,7 +605,7 @@ async function init() {
603605
604606 const rows = res .data .results ;
605607 const headers: DataTableHeader [] = rows .length > 0 ? Object .keys (rows [0 ])
606- .filter ((header ) => ! [' _id' , ' _key ' , ' _rev' ].includes (header ))
608+ .filter ((header ) => ! [' _id' , ' _rev' ].includes (header ))
607609 .map ((header ) => ({ text: header , value: header }))
608610 : [];
609611
@@ -619,7 +621,7 @@ async function init() {
619621
620622 // Store value in tableSamples
621623 tableSamples .value = sortedSamples ;
622- tablesVisible .value = reactive (sortedSamples .reduce ((obj , cur ) => ({ ... obj , [cur .table .name ]: true }), {}));
624+ tablesVisible .value = reactive (sortedSamples .reduce ((obj , cur ) => ({ ... obj , [cur .table .name ]: false }), {}));
623625}
624626
625627// Load table from workspace and store in tableSamples
@@ -812,7 +814,6 @@ function columnItemText(item: CSVRow, key: string) {
812814 return ` ${truncated }... ` ;
813815}
814816
815- /* eslint-disable prefer-destructuring */
816817function linkColor(table : BaseTable , col : string , join = false ) {
817818 // There's at most 5 links
818819 // Edge -> Source
@@ -874,14 +875,14 @@ function linkColor(table: BaseTable, col: string, join = false) {
874875
875876 return undefined ;
876877}
877- /* eslint-enable prefer-destructuring */
878878
879879// Denotes whether the dialog is in a submittable state
880880const valid = computed (() => !! (
881881 objectNameIsValid (networkName .value )
882882 && edgeTable .value ?.table
883883 && sourceTable .value
884884 && targetTable .value
885+ && ! tableSamples .value .map ((sample ) => sample .table .name ).includes (networkName .value )
885886));
886887
887888const networkCreating = ref (false );
@@ -932,11 +933,6 @@ async function createNetwork() {
932933 </script >
933934
934935<style scoped>
935- .upload-preview table th , .table-title {
936- background-color : #1976d2 !important ;
937- color : #fff !important ;
938- }
939-
940936.disable-events {
941937 pointer-events : none
942938}
0 commit comments