forked from galaxyproject/galaxy
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
handle errors caused by wf creation without annotation
- Loading branch information
1 parent
44b2c86
commit b00879a
Showing
5 changed files
with
57 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
import Vue, { ref } from "vue"; | ||
|
||
const uuidCounter = ref<number>(0); | ||
const uuidRef = ref<Record<string, string[]>>({}); | ||
|
||
/** | ||
* @param identifier What is this uuid for? default: "generic" | ||
* @returns uuid and destroy function | ||
*/ | ||
export function useUuid(identifier = "generic") { | ||
const uuid = ref(String(`_${identifier}_uuid_${uuidCounter.value++}`)); | ||
if (!uuidRef.value[identifier]) { | ||
Vue.set(uuidRef.value, identifier, [uuid.value]); | ||
} else { | ||
uuidRef.value[identifier]?.push(uuid.value); | ||
} | ||
|
||
/** Destroy the current uuid */ | ||
const destroyUuid = () => { | ||
const uuids = uuidRef.value[identifier]; | ||
if (uuids) { | ||
const index = uuids.indexOf(uuid.value); | ||
if (index && index > -1) { | ||
uuids.splice(index, 1); | ||
} | ||
} else { | ||
Vue.delete(uuidRef.value, identifier); | ||
} | ||
}; | ||
return { uuid, destroyUuid }; | ||
} | ||
|
||
export function hasUuid(identifier = "generic", uuid: string) { | ||
return uuidRef.value[identifier]?.includes(uuid); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters