Skip to content

Commit 9cb4038

Browse files
committed
Revert "attempt #1 to create provider for collection attributes"
This reverts commit 19ead44.
1 parent 19ead44 commit 9cb4038

6 files changed

Lines changed: 32 additions & 55 deletions

File tree

client/src/components/Collections/common/CollectionEditView.vue

Lines changed: 31 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,5 @@
11
<template>
22
<div>
3-
<dataset-collection-attributes-provider :id="collection_id" v-slot="{ item, loading }">
4-
<div v-if="!loading">
5-
{{ loading }}
6-
{{ item }}
7-
</div>
8-
</dataset-collection-attributes-provider>
93
<h4>{{ l("Edit Collection Attributes") }}</h4>
104
<b-alert show variant="info" dismissible>
115
{{ l("This will create a new collection in your History. Your quota usage will not increase. ") }}
@@ -60,6 +54,10 @@
6054
</template> --> </multiselect
6155
><i>original input: {{ datatypeFromElements }}</i>
6256
</b-tab>
57+
<b-tab>
58+
<template v-slot:title> <font-awesome-icon icon="user" /> &nbsp;{{ l("Permissions") }}</template>
59+
<p>WIP Permissions</p>
60+
</b-tab>
6361
</b-tabs>
6462
</div>
6563
</template>
@@ -81,7 +79,6 @@ import { faBars } from "@fortawesome/free-solid-svg-icons";
8179
import { faUser } from "@fortawesome/free-solid-svg-icons";
8280
import { faCog } from "@fortawesome/free-solid-svg-icons";
8381
import store from "../../../store/index";
84-
import { DatasetCollectionAttributesProvider } from "../../WorkflowInvocationState/providers";
8582
8683
//import VueObserveVisibility from "vue-observe-visibility";
8784
@@ -99,9 +96,8 @@ export default {
9996
// this.apiCallToGetAttributes();
10097
this.getDatatypesAndGenomes();
10198
this.getCollectionDataAndAttributes();
102-
console.log("item is", this.item);
10399
},
104-
components: { Multiselect, DatabaseEditTab, FontAwesomeIcon, DatasetCollectionAttributesProvider },
100+
components: { Multiselect, DatabaseEditTab, FontAwesomeIcon },
105101
data: function () {
106102
return {
107103
collection_data: {}, //all data from the response
@@ -122,6 +118,21 @@ export default {
122118
},
123119
},
124120
computed: {
121+
collectionName: {
122+
get() {
123+
return this.collection_data.name;
124+
},
125+
//TODO : #6966
126+
// set(collection_name) {
127+
// this.collection_data.name = collection_name;
128+
// },
129+
},
130+
collectionType: {
131+
// no setter; for display only
132+
get() {
133+
return this.collection_data.collection_type;
134+
},
135+
},
125136
extension: {
126137
get() {
127138
return this.selectedExtension;
@@ -152,6 +163,8 @@ export default {
152163
this.genomes = genomes;
153164
},
154165
getCollectionDataAndAttributes: async function () {
166+
this.apiCallToGetData();
167+
155168
let attributesGet = store.getters.getCollectionAttributes(this.collection_id);
156169
if (attributesGet == null) {
157170
await store.dispatch("fetchCollectionAttributes", this.collection_id);
@@ -161,6 +174,15 @@ export default {
161174
this.getDatabaseKeyFromElements();
162175
this.getExtensionFromElements();
163176
},
177+
apiCallToGetData: function () {
178+
axios
179+
.get(prependPath("/api/dataset_collections/" + this.collection_id + "?instance_type=history"))
180+
.then((response) => {
181+
this.collection_data = response.data;
182+
});
183+
184+
//TODO error handling
185+
},
164186
getDatabaseKeyFromElements: function () {
165187
this.databaseKeyFromElements = this.attributes_data.dbkey;
166188
},

client/src/components/WorkflowInvocationState/providers/DatasetCollectionAttributesProvider.js

Lines changed: 0 additions & 11 deletions
This file was deleted.

client/src/components/WorkflowInvocationState/providers/fetch.js

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,3 @@ export const fetchInvocationStepById = () => {
2323
mergeMap((url) => ajax.getJSON(url))
2424
);
2525
};
26-
27-
export const fetchDatasetCollectionAttributesById = () => {
28-
return pipe(
29-
map((id) => prependPath(`/api/dataset_collections/${id}/attributes`)),
30-
mergeMap((url) => ajax.getJSON(url))
31-
);
32-
};

client/src/components/WorkflowInvocationState/providers/index.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,4 @@ export {
88
// test provider
99
export { default as DatasetProvider } from "./DatasetProvider";
1010
export { default as DatasetCollectionProvider } from "./DatasetCollectionProvider";
11-
export { default as DatasetCollectionAttributesProvider } from "./DatasetCollectionAttributesProvider";
1211
export { default as InvocationStepProvider } from "./InvocationStepProvider";

client/src/components/WorkflowInvocationState/providers/monitors.js

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { of, race, pipe, concat, iif } from "rxjs";
22
import { filter, mergeMap, switchMap, delay, share, repeat, take, takeWhile } from "rxjs/operators";
33
import { cacheContent, monitorContentQuery } from "components/History/caching";
44
import { singleUpdateResult } from "components/History/caching/db/monitorQuery";
5-
import { fetchDatasetById, fetchDatasetCollectionById, fetchInvocationStepById, fetchDatasetCollectionAttributesById } from "./fetch";
5+
import { fetchDatasetById, fetchDatasetCollectionById, fetchInvocationStepById } from "./fetch";
66
import { loadHistoryContents } from "components/History/caching";
77

88
// prettier-ignore
@@ -21,11 +21,6 @@ export const datasetCollectionMonitor = (cfg = {}) => {
2121
return pipe(switchMap((id) => createContentMonitor(id, "dataset_collection", spinUpDelay)));
2222
};
2323

24-
export const datasetCollectionAttributesMonitor = (cfg = {}) => {
25-
const { spinUpDelay } = cfg;
26-
return pipe(switchMap((id) => createContentMonitor(id, "dataset_collection_attributes", spinUpDelay)));
27-
};
28-
2924
const createContentMonitor = (id, contentType, spinUpDelay = 250) => {
3025
let fetcher;
3126
switch (contentType) {
@@ -35,9 +30,6 @@ const createContentMonitor = (id, contentType, spinUpDelay = 250) => {
3530
case "dataset_collection":
3631
fetcher = fetchDatasetCollectionById;
3732
break;
38-
case "dataset_collection_attributes":
39-
fetcher = fetchDatasetCollectionAttributesById;
40-
break;
4133
default:
4234
console.error(`Can't create monitor for ${contentType}-${id}`);
4335
}

client/src/components/WorkflowInvocationState/providers/storeProviders.js

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -80,24 +80,6 @@ export const DatasetCollectionProvider = {
8080
},
8181
};
8282

83-
export const DatasetCollectionAttributesProvider = {
84-
mixins: [SimpleProviderMixin, StoreProviderMixin],
85-
methods: {
86-
...mapCacheActions("datasetCollectionAttributes", ["fetchDatasetCollectionAttributes"]),
87-
async load() {
88-
this.loading = true;
89-
this.item = await this.fetchDatasetCollectionAttributes(this.id);
90-
this.loading = false;
91-
},
92-
},
93-
computed: {
94-
...mapGetters("datasetCollectionAttributes", ["getDatasetCollectionAttributesById"]),
95-
storeItem() {
96-
return this.getDatasetCollectionAttributesById(this.id);
97-
},
98-
},
99-
};
100-
10183
export const DatasetCollectionContentProvider = {
10284
mixins: [SimpleProviderMixin],
10385
computed: {

0 commit comments

Comments
 (0)