|
1 | 1 | <template> |
2 | 2 | <div class="vertical-container"> |
3 | | - <div class="d-flex mb-6"> |
4 | | - <v-spacer></v-spacer> |
5 | | - <div class="mr-2"> |
6 | | - <v-btn v-if="projectArtifactsStore.datasets.length > 0" class="ml-2" href="https://docs.giskard.ai/en/latest/guides/wrap_dataset/index.html" target="_blank" rel="noopener"> |
7 | | - add a dataset |
8 | | - <v-icon right>mdi-open-in-new</v-icon> |
9 | | - </v-btn> |
10 | | - </div> |
11 | | - </div> |
| 3 | + <v-row class="mt-2 pl-3"> |
| 4 | + <v-col cols='4'> |
| 5 | + <v-text-field v-model='searchDataset' append-icon='search' label='Search for a dataset' outlined></v-text-field> |
| 6 | + </v-col> |
| 7 | + <v-col cols="8"> |
| 8 | + <div class="d-flex justify-end mb-6"> |
| 9 | + <v-btn v-if="projectArtifactsStore.datasets.length > 0" class="mr-2" href="https://docs.giskard.ai/en/latest/guides/wrap_dataset/index.html" target="_blank" rel="noopener"> |
| 10 | + add a dataset |
| 11 | + <v-icon right>mdi-open-in-new</v-icon> |
| 12 | + </v-btn> |
| 13 | + </div> |
| 14 | + </v-col> |
| 15 | + </v-row> |
| 16 | + |
12 | 17 | <LoadingFullscreen v-if="isLoading" name="datasets" /> |
13 | 18 | <v-container v-if="projectArtifactsStore.datasets.length > 0 && !isLoading" fluid class="vc"> |
14 | 19 | <v-expansion-panels flat> |
|
20 | 25 | <v-col cols="1" class="col-container">Id</v-col> |
21 | 26 | <v-col cols="2" class="col-container">Actions</v-col> |
22 | 27 | </v-row> |
23 | | - <v-expansion-panel v-for="f in projectArtifactsStore.datasets" :key="f.id"> |
| 28 | + <v-expansion-panel v-for="f in filteredDatasets" :key="f.id"> |
24 | 29 | <v-expansion-panel-header @click="peakDataFile(f.id)" class="grey lighten-5 py-1 pl-2"> |
25 | 30 | <v-row class="px-2 py-1 align-center"> |
26 | 31 | <v-col cols="4" class="font-weight-bold" :title="f.name ? f.name : f.id"> |
@@ -114,6 +119,17 @@ const isLoading = ref<boolean>(false); |
114 | 119 | const lastVisitedFileId = ref<string | null>(null); |
115 | 120 | const filePreviewHeader = ref<{ text: string, value: string, sortable: boolean }[]>([]); |
116 | 121 | const filePreviewData = ref<any[]>([]); |
| 122 | +const searchDataset = ref<string>(''); |
| 123 | +
|
| 124 | +const filteredDatasets = computed(() => { |
| 125 | + return projectArtifactsStore.datasets.filter((dataset) => { |
| 126 | + const search = searchDataset.value.toLowerCase(); |
| 127 | + return ( |
| 128 | + dataset.name.toLowerCase().includes(search) || |
| 129 | + dataset.id.toString().includes(search) |
| 130 | + ); |
| 131 | + }); |
| 132 | +}); |
117 | 133 |
|
118 | 134 | const project = computed(() => { |
119 | 135 | return projectStore.project(props.projectId) |
|
0 commit comments