sha256
stringlengths
64
64
language
stringclasses
28 values
size
int32
1
491k
lines
int32
1
23.2k
content
stringlengths
1
200k
a18c439f3b4c567a082d7860fb84f8839614b3b1444c3c2be21600092b0573c9
TypeScript
671
27
import type { HistoryPageSummary } from "@/api/pages"; export const FAKE_PAGE_SUMMARY: HistoryPageSummary = { id: "page-1", history_id: "history-1", title: "My Analysis", slug: null, source_invocation_id: null, published: false, importable: false, deleted: false, latest_revision_id:...
1d07abf9a529764aa2089d2982d4a02a23ebc6d4190ad2fd536e7bdf84328e03
TypeScript
675
28
export const SELECTION_STATES = { SELECTED: "success", UNSELECTED: "default", MIXED: "secondary", } as const; export type SelectionState = (typeof SELECTION_STATES)[keyof typeof SELECTION_STATES]; export interface SelectionItem { id: string; label: string; details: string; isLeaf: boolean;...
38398b495f533afc76d2feda98df20dcd81c37d9a15188330d2b42843eccc7dc
TypeScript
683
20
import { mount } from "@vue/test-utils"; import { describe, expect, it } from "vitest"; import WorkflowStepIcon from "./WorkflowStepIcon.vue"; describe("WorkflowStepIcon", () => { it.each([ ["tool", "wrench"], ["data_input", "file"], ["data_collection_input", "folder-open"], ["subw...
a6302b63b7f1d91087860480d21ae0aaeae03ba9c580cbde2d0c839c30ef8e5f
TypeScript
688
21
import { describe, expect, it } from "vitest"; import { textValue } from "./rocrate.utils"; describe("textValue", () => { it("keeps a plain string", () => { expect(textValue("A crate")).toBe("A crate"); }); it("joins an array of strings and language-tagged values", () => { expect(textValu...
b8a40fb02c551214b92284b38436bb55ac75f9aa93e7a0f1cc913a257528f7b6
TypeScript
688
24
/// <reference types="vitest" /> import { defineConfig } from "vitest/config"; import react from "@vitejs/plugin-react"; import path from "path"; export default defineConfig({ plugins: [react()], resolve: { alias: { "@": path.resolve(__dirname, "./src") }, }, test: { environment: "jsdom...
62ffd4f8efeeb89c659d3dc9090028c3fdda385e0f8ead624f03c2431dbd9611
TypeScript
697
25
export const DEFAULT_TOOLTIP_HOVER_DELAY_MS = 300; export const INTERACTIVE_POPOVER_CLOSE_DELAY_MS = 50; export function useDelayedAction(delayMs: number) { let timer: ReturnType<typeof setTimeout> | null = null; return { schedule: (callback: () => void) => { if (timer !== null) { ...
e765bf45d052568d6dbcac0de6d6a2a69b11e11609d8d7ac7ac11842c58c3cc3
TypeScript
704
16
/* * Single declaration of the contract for every icon in this directory. * * An icon takes nothing but a class: it draws with `currentColor` and at the * size its caller gives it, so state colour and dimensions belong to the * control around it rather than to the glyph. * * Named for where the set comes from: n...
34d82b16bb65f48f19fb8692626143f906641316557f1dd69d3815cf0105dd6a
TypeScript
712
22
// Type declarations for Vite-specific imports // Monaco editor workers with ?worker suffix declare module "monaco-editor/esm/vs/editor/editor.worker?worker" { const workerConstructor: new () => Worker; export default workerConstructor; } declare module "monaco-editor/esm/vs/language/json/json.worker?worker" ...
e8b0aa02707e6c875855057d220df67b27aa181ad87f5719c60c6e51df26a90d
TypeScript
715
22
import { createPinia, setActivePinia } from "pinia"; import { beforeEach, describe, expect, it } from "vitest"; import { usePersistentToggle } from "./persistentToggle"; describe("usePersistentToggle", () => { beforeEach(() => { setActivePinia(createPinia()); localStorage.clear(); }); it(...
12f40245c88d7f5e0f5094e2014ab11c09926fd4074273a752a2c603531354ee
TypeScript
736
20
/** * Raised by a provider whose scope could not be loaded at all — the very first * fetch of an empty cache failed, so there is nothing to render and "No * results." would be a lie. * * Every other failure stays quiet: once a store holds rows, a failing search or * background refresh still leaves the cached ones...
ca4e2f2429589479533f3f4f058cad4c7ea750468cafe4ad1dd52c6157aa3453
TypeScript
743
20
declare module "@vue/compat" { import type { AppConfig, ComponentOptions, Plugin } from "vue"; export * from "vue"; export function configureCompat(config: { MODE?: 2 | 3; [key: string]: unknown }): void; /** * The compat build's default export keeps the Vue 2 style global API * (`Vue.use(....
35409b8bd02f72b2d4bc548522444f291701ee6c7454fc34aa8e81161777ccf0
TypeScript
744
22
import { format } from "date-fns"; /** * Pick a date-fns format string that fits the span between two timestamps. * Use this for axis tick labels so a 30-second range doesn't print the date 10 * times and a 6-month range doesn't print the minute. */ export function pickTimeFormat(spanMs: number): string { cons...
8db2b638c33fc7285e829235c888855692b6e94ec0a84c583372671202ee108b
TypeScript
755
18
import { mount } from "@vue/test-utils"; import { describe, expect, it } from "vitest"; import VueMultiselect from "vue-multiselect"; import SelectBasic from "./SelectBasic.vue"; describe("SelectBasic", () => { // The rule builder shows several of these at once, so a fixed id would repeat. it("gives each sele...
959ff16f228c45051cc13078e908d39d05f0841ff1c32d5bcad26cdb25600da4
TypeScript
760
22
export type ComponentColor = "grey" | "blue" | "green" | "yellow" | "orange" | "red"; export type ComponentSize = "small" | "medium" | "large"; /** * Basic color variants for components that only support * color-based styling like alerts, badges, and backgrounds (no outline variants). */ export type ColorVariant = ...
1bac7208ab3a077a4ae860f07b1236ce22e0e9640c45e8080efb7eacb5d44b82
TypeScript
764
27
import { defineStore } from "pinia"; import { ref } from "vue"; export interface ExportableItem { historyId: string; contentType: "dataset" | "dataset_collection"; contentId: string; contentName: string; } /** * The item whose "Export to another Galaxy" dialog is open. The dialog is mounted once at t...
452b14d903b465b9778718b3aef16992004f0a971889e7bf32ad0334f2518b71
TypeScript
767
24
import { describe, expect, it, vi } from "vitest"; import { generateId, scrollToBottom } from "./chatUtils"; describe("chatUtils", () => { describe("generateId", () => { it("generates unique ids", () => { const ids = new Set(Array.from({ length: 100 }, () => generateId())); expect(...
da3cb62e2b00af294551944bb9dde313be88564b3b3fd86e5a5f67aa58ebdee7
TypeScript
770
31
export interface UploadOptionVisibility { spaceToTab: boolean; posix: boolean; deferred: boolean; autoDecompress: boolean; } export const defaultUploadOptionVisibility: UploadOptionVisibility = { spaceToTab: false, posix: false, deferred: false, autoDecompress: false, }; export functio...
4b096527e74bab81dc41967693fe65cd81295e5e7317a72461b28c367fbb398f
TypeScript
772
18
import { shallowMount } from "@vue/test-utils"; import { describe, expect, it } from "vitest"; import { MARKDOWN_CELL_TYPES } from "@/components/Markdown/directives"; import SectionWrapper from "./SectionWrapper.vue"; describe("SectionWrapper.vue", () => { it.each(MARKDOWN_CELL_TYPES)("renders the %s cell type",...
896eac8dbc30edd61d5634ed5cb94a3d266122dad4c1bfe9bf0f5a91232b9b47
TypeScript
772
25
import "@testing-library/jest-dom/vitest"; import { afterEach } from "vitest"; import { cleanup } from "@testing-library/react"; /* * jsdom implements neither of these, and Radix reaches for both: `useSize` * observes a control's box (the switch does), and its popper measures scroll * geometry. Stubbed here rather ...
7abee338e94b0c60bf272d79201ebb13874a232938176dc40bd9c40eaa10e933
TypeScript
775
22
import type { Ref, UnwrapRef } from "vue"; import type { AnyUser } from "@/api"; import { useHashedUserId } from "./hashedUserId"; import { useHashedUserId as useHashedUserIdFromStore } from "./hashedUserIdFromUserStore"; import { useUserLocalStorageFromHashId } from "./userLocalStorageFromHashedId"; /** * Local st...
dd1162d36c4127ccb052296be8e95e066f11517569ddf4625884f5c8fd66bf08
TypeScript
789
28
import { defineStore } from "pinia"; import { computed, ref } from "vue"; /** * This store allows for pointing scoped stores to other scoped stores */ export const useScopePointerStore = defineStore("scopePointerStore", () => { type FromScopeId = string; type ToScopeId = string; const scopePointers = re...
817726a791ff6d94355e95dd4ee150e21f71e1450e9154e87ed6b5234ea2e0d1
TypeScript
795
30
import { watchImmediate } from "@vueuse/core"; import { type Ref, ref, type UnwrapRef } from "vue"; import { syncRefToLocalStorage } from "./persistentRef"; /** * Local storage composable specific to current user. * @param key * @param initialValue */ export function useUserLocalStorageFromHashId<T>( key: str...
31c2b42ceb44198a827eba8db474faa97491d91ace381b173069249e5a178400
TypeScript
796
16
import type { MaybeRefOrGetter } from "@vueuse/core"; import type { Ref } from "vue"; /** * Reactively filter an array of objects, by comparing `filter` to all `fields`. * Matches are ordered exact first, then prefix, then other substring matches. * All parameters can optionally be refs. * @param array array of ob...
bd5358d30be319b310949900db87a04705c07bb1fec3f7a295d13d06b545a4f2
TypeScript
802
18
/** * Group membership test, loose like BootstrapVue's: objects match by JSON form, other values by * string form, so a numeric option still matches a value that came back from the server as a string. * Stricter than BootstrapVue's: the JSON form depends on key order (`{ a, b }` does not match `{ b, a }`), * arrays...
29b04fb3a3c807bb092ecade83ad1fb164b48079385241739f28a5c93b61aa50
TypeScript
808
28
// Open popovers that Escape dismisses, most recently opened last, so one key press closes only the top one. export interface EscapeLayer { // False while the layer cannot take the key, e.g. behind a modal dialog, so the next one down gets it. canHandle: () => boolean; } const layers: EscapeLayer[] = []; expo...
0a3650a91026c7fb2b0e86b47897e223b1771255ea5dd784fc4195df8c0a8836
TypeScript
813
34
export interface CellType { name: string; content: string; configure?: boolean; toggle?: boolean; } export interface DatasetLabel { invocation_id: string; input?: string; output?: string; } export interface Invocation { history_id: string; inputs: Record<string, { label?: string; i...
700c1e41cac5a9f6e68ad8e46d023479525ef6a0867161b9b2049afe2de2a6aa
TypeScript
816
20
import { getLocalVue } from "@tests/vitest/helpers"; import { shallowMount } from "@vue/test-utils"; import { describe, expect, it } from "vitest"; import { STANDARD_OBJECT_STORE_TEMPLATE } from "@/components/ConfigTemplates/test_fixtures"; import TemplateSummary from "./TemplateSummary.vue"; import ObjectStoreBadges...
77447d00e60d286aa1b51fc30ce73ba5e94cfcd890e81260d40b68c0bbe5ba29
TypeScript
818
38
import type { DataUri } from "../types"; export const SINGULAR_DATA_URI: DataUri = { src: "url", location: "link_to_file", ext: "txt", }; export const SINGULAR_FILE_URI: DataUri = { class: "File", ext: "txt", location: "link_to_file", }; export const SINGULAR_LIST_URI: DataUri = { class: ...
8542e6d9a8ee232ac829f39f6697ec556d5e7089d93769322d6b1557e7b11f3a
TypeScript
820
21
import { createTestingPinia } from "@pinia/testing"; import { setActivePinia } from "pinia"; import { beforeEach, describe, expect, it, vi } from "vitest"; import type { AnyHistory } from "@/api"; import { useHistoryStore } from "@/stores/historyStore"; import { useCollectionCreation } from "./useCollectionCreation";...
174c231e91bcfe9e2c959379620986075470adae545297325f43420dd05af487
TypeScript
822
18
import { getLocalVue } from "@tests/vitest/helpers"; import { mount } from "@vue/test-utils"; import { describe, expect, it } from "vitest"; import FormColor from "./FormColor.vue"; describe("FormColor", () => { it("renders a small color GFormInput and emits the picked color", async () => { const wrapper ...
a507efe35b3c8c4c44e612bb5fc581d83600439a53183931a3a967bfa2b36ab3
TypeScript
822
17
export const MY_PANEL_VIEW_ID = "my_panel"; export const MY_PANEL_VIEW_NAME = "My Tools"; export const MY_PANEL_VIEW_DESCRIPTION = "Search all tools and view your favorite tools."; export const MY_PANEL_VIEW_TYPE = "favorites"; export const FAVORITE_TAG_SECTION_PREFIX = "favorite_tag_"; export const FAVORITE_EDAM_OPERA...
36652d411689d30fa9515cbd8e6bfb47cc0f3b0d0348103a506e6445bbbb304b
TypeScript
824
23
import type { HistoryGraphNode } from "./historyGraphMapper"; // State colors resolved lazily from the global `--state-color-*` custom // properties defined in base.scss. const stateColors: Record<string, string> = {}; function stateColor(state: string): string { if (!(state in stateColors)) { stateColors...
698bc48b475d930ce31e95f68d8c4462a3fdb90720ba55e38ba31a98b7f5c9f3
TypeScript
826
23
import { getLocalVue } from "@tests/vitest/helpers"; import { shallowMount } from "@vue/test-utils"; import { describe, expect, it } from "vitest"; import { STANDARD_OBJECT_STORE_TEMPLATE } from "@/components/ConfigTemplates/test_fixtures"; import TemplateSummaryPopover from "./TemplateSummaryPopover.vue"; const loc...
3ebaf54f1947785660fe3c9b8e5ed0df0605d0449ca9fd8833ad90191c8a4b3a
TypeScript
827
28
import { afterEach, describe, expect, it } from "vitest"; import { activeToastHost, registerToastHost, unregisterToastHost } from "./toastHost"; const firstHost = "first-modal"; const secondHost = "second-modal"; afterEach(() => { unregisterToastHost(firstHost); unregisterToastHost(secondHost); }); describe...
9c4d4f1269b3344c110564357bf754ee0fe9c73d7e802686ee93dc50e0ab03e7
TypeScript
828
21
import { mount } from "@vue/test-utils"; import { describe, expect, it, vi } from "vitest"; import IdentifierDisplay from "./IdentifierDisplay.vue"; describe("IdentifierDisplay", () => { // The rule builder highlights a mapping's columns while the pointer is over it. it("passes mouseover and mouseout on to th...
a777e30aa70769d48bd4db642ee64ff5fdbff9689a6475fc846913f894ea96ee
TypeScript
831
31
/** * Galaxy Client API * A client library for the Galaxy API */ import { createGalaxyApi, type GalaxyApiClient } from "./client"; import { errorMessageAsString } from "./utils/error"; // Re-export all the types from our type compatibility layer export * from "./api-types"; // SimpleError class for error handling...
065ec428e49863a882b0631a3dee7980d4b4b03d214e04aee1331597d87b453e
TypeScript
841
26
import type { components } from "@/api"; import { GalaxyApi } from "@/api"; import { rethrowSimple } from "@/utils/simple-error"; export type CompositeFileInfo = components["schemas"]["CompositeFileInfo"]; export type DatatypeDetails = components["schemas"]["DatatypeDetails"]; /** * Get details about a specific data...
e7685552a5a5c82ed79090c7472755e8cac9c798f3638594bb9941d7cfea979c
TypeScript
844
21
import { getLocalVue } from "@tests/vitest/helpers"; import { mount } from "@vue/test-utils"; import { describe, expect, it } from "vitest"; import EditableUrl from "./EditableUrl.vue"; describe("EditableUrl", () => { it("submits the slug when Enter is pressed in the slug input", async () => { const wrapp...
d533680f536f0a3891e168c9c6c2455feb843f333f1691772145cddef4f6790d
TypeScript
848
32
import type { UploadOptionVisibility } from "./uploadOptionVisibility"; const toggleWidths = { spaceToTab: 84, posix: 54, deferred: 82, autoDecompress: 102, }; /** * Returns a table column width that matches visible upload settings toggles. */ export function getUploadSettingsColumnWidth(visibility:...
4c85feebf33a54f4c10971bbbcc0741ddcf4f30452a98e59f7a45a216d787111
TypeScript
855
35
import { toRefs } from "@vueuse/core"; import { computed, type Ref } from "vue"; import type { Step } from "@/stores/workflowStepStore"; export function useStepProps(step: Ref<Step>) { const { id: stepId, content_id: contentId, name, type, inputs: stepInputs, output...
aacefb4f48d8eb94c81c2cd42ed6584cf03ba4ab965f2c89cda1173208ddbfdd
TypeScript
872
22
import { getLocalVue } from "@tests/vitest/helpers"; import { mount } from "@vue/test-utils"; import { describe, expect, it } from "vitest"; import ZoomControl from "./ZoomControl.vue"; const localVue = getLocalVue(); describe("ZoomControl", () => { it("keeps the displayed zoom percentage in the reset button's a...
f4b61d316c3114f0a5e9818e0d6c5612451203866e8939d81405b7588337fd9c
TypeScript
877
21
import { getLocalVue } from "@tests/vitest/helpers"; import { mount } from "@vue/test-utils"; import { describe, expect, it } from "vitest"; import FormRepeat from "./FormRepeat.vue"; const localVue = getLocalVue(); describe("FormRepeat", () => { it("titles repeat blocks from 1", () => { const wrapper = ...
439b42dc06303500ade87e7a7a0402f701a9444fe2677ce94162333921ec6c22
TypeScript
880
30
import { getLocalVue } from "@tests/vitest/helpers"; import { mount } from "@vue/test-utils"; import { describe, expect, it } from "vitest"; import { nextTick } from "vue"; import DelayedInput from "./DelayedInput.vue"; const localVue = getLocalVue(); function mountDelayedInput(props = {}) { return mount(Delayed...
ab9a5cf96b4d41de251a7c7059fb543fce12d25d20c76bdd466367cff58024d8
TypeScript
881
27
import type { Ref } from "vue"; import { useUserLocalStorage } from "@/composables/userLocalStorage"; /** * Shared state for upload panel advanced mode. * All components calling this composable will share the same reactive reference. */ let sharedAdvancedMode: Ref<boolean> | null = null; /** * Composable for man...
fd6c254d9007e33d0a7a1d995bab329766613584b9c7f4ae79cd80d69edd0069
TypeScript
881
32
export interface Option { name: string; value: string; leaf?: boolean; fullPath?: string; disabled?: boolean; options: Array<Option>; } export type Value = string[] | string | null; /** * Returns an array of values from nested drill down options provided * @param headOptions Array of options...
ea9dfcedae9391473702e4ba292f204309d5c53d1d71c365cac4811753ce1c99
TypeScript
888
30
import { redirectLoggedIn } from "@/router/guards"; import Login from "@/entry/analysis/modules/Login.vue"; import Register from "@/entry/analysis/modules/Register.vue"; import ResetPassword from "@/entry/analysis/modules/ResetPassword.vue"; /** * Entry routes for logging in and registering. * * These use a `befor...
b63aa3fbdf9756480f74308a956671a1980b7ecb831b1d77c6f6d5a198dfa7f7
TypeScript
892
24
import { getLocalVue } from "@tests/vitest/helpers"; import { shallowMount } from "@vue/test-utils"; import { describe, expect, it } from "vitest"; import { STANDARD_FILE_SOURCE_TEMPLATE } from "./test_fixtures"; import TemplateSummaryPopover from "./TemplateSummaryPopover.vue"; import GPopover from "@/components/Bas...
fbf2c5b99c55ced2ea3ec8b57f78257e3e182fb5e3e14aee457981c6a873ac17
TypeScript
895
25
import type { ComputedRef, InjectionKey } from "vue"; import type { ComponentSize } from "./componentVariants"; /** One entry of GCheckboxGroup's `options` prop. */ export interface CheckboxGroupOption<T = unknown> { /** Label shown next to the checkbox */ text: string; /** Value added to the group's v-mo...
8cc481bbe35a4399ebff236b7633b9ce006c99a87fc3f1dfa075c44232ba2297
TypeScript
896
22
import { describe, expect, it } from "vitest"; import { HttpResponse, useServerMock } from "@/api/client/__mocks__"; import { submitCILogon } from "./ExternalIDHelper"; const { server, http } = useServerMock(); describe("submitCILogon", () => { it("sends the post-login destination", async () => { let ne...
be49c1d23341eb0a91d6dcfab770bfc66b9406760c24891f0968c56d37f272fc
TypeScript
896
28
import useSWR from "swr"; import { Organization } from "@/api/schemas"; import { fetcher } from "@/api/swr"; /** * The organization's name for breadcrumbs. While it is fetched, falls back to * the name the navigation cached, but only when that cache is for this same * organization, then to the bare id. */ export ...
9a0c0c2f7dfc0e22cec7d3ffb17c4d47f3766170ca743923a46209729119b879
TypeScript
900
32
import { Toast } from "@/composables/toast"; export function browserSupportsPushNotifications() { return "Notification" in window; } export function handlePermission(permission: string) { if (permission === "granted") { new Notification("Notifications enabled", { icon: "static/favicon.ico"...
a286352c1a12adbea4e4c0e1c1f6e0c574851e19c836f574e746258a2dff6f84
TypeScript
902
23
import { readFileSync, readdirSync } from "node:fs"; import path from "node:path"; import { describe, it, expect } from "vitest"; const SRC = path.resolve(__dirname, "../../src"); function sourceFiles(dir: string): string[] { return readdirSync(dir, { withFileTypes: true }).flatMap((entry) => { const full...
0c9618631c789212071422a62c990b1f2124a77f56ee199f61496774588fc9c9
TypeScript
904
32
import { createTestingPinia } from "@pinia/testing"; import { vi } from "vitest"; // IMPORTANT: This import MUST come after the mock calls above for proper module hoisting import { getSelectableObjectStores } from "@/api/objectStores"; vi.mock("@/api/objectStores"); const OBJECT_STORES = [ { id: "object_...
d45443f896cedf0aca864db971b5d04786134a18239f3aab4055ce367ad8ee6e
TypeScript
914
38
/** * Simple error handling utilities for Galaxy Client API */ /** * Convert various error formats to a readable string message */ export function errorMessageAsString(error: any): string { if (typeof error === "string") { return error; } if (error instanceof Error) { return error.mess...
862b6b6f88396e0e8a6d5b418083a4492244e18d81aa00b3c3e3474932285dad
TypeScript
917
27
import { errorMessageAsString } from "@/utils/simple-error"; export interface SettleFailure<T> { item: T; error: string; } /** Awaits `operation` on each item in order, continuing past failures; returns the failures. */ export async function settleEach<T>( items: readonly T[], operation: (item: T) => ...
e05d3571fbafdc1a8d647bcadafada3dcb38bf9b2b5996e5a26cdee2e1c40cb8
TypeScript
919
17
/** Row caps and query thresholds shared by the palette providers, so sections of a kind size alike */ export const PALETTE_LIMITS = { /** Rows of any result section: scoped, root, category, recent, bookmarked and action argument rows */ section: 8, /** Own, cached rows in a root answer */ rootOwn: 5, ...
68aacf077dbdb1218f40bee2484079e5bac02d1e12eb1c2dc7eb3c0021a14e3d
TypeScript
921
23
/** * FileBrowser — reusable remote file source browser components. * * Primary entry points: * - `RemoteFileBrowserModal` — GModal-backed dialog for selecting remote files/directories * - `RemoteFileBrowserContent` — standalone inline browser (no modal wrapper) * - `useRemoteFileBrowser` — headless composabl...
e9d27ac2cec637327c7edec628e1893d68a745f97f5e0c47fd13e82ffa9a447a
TypeScript
923
31
import { schemaToInterface } from "schema-to-ts"; import { parse } from "yaml"; import { GalaxyApi } from "@/api"; async function fetchRuntimeSchema(toolSource: any) { const { data, error } = await GalaxyApi().POST("/api/unprivileged_tools/runtime_model", { body: { active: true, hi...
2b75db98f498f36a1442ea5c64a31400458f822b1972d0e996d4e793d9ff9dfd
TypeScript
926
24
import { type Ref, ref } from "vue"; import type { DatatypesMapperModel } from "@/components/Datatypes/model"; import { useDatatypesMapperStore } from "@/stores/datatypesMapperStore"; export function useDatatypesMapper() { const datatypesMapperLoading = ref(true); const datatypesMapper: Ref<DatatypesMapperMod...
1cd43bc61d38975aee3b8fcfc48bcb20d16c0ffe066d3f3159d97e2874d9a518
TypeScript
927
31
import { defineStore } from "pinia"; import { getDatatypesMapper } from "@/components/Datatypes"; import type { DatatypesMapperModel } from "@/components/Datatypes/model"; import { rethrowSimple } from "@/utils/simple-error"; interface State { datatypesMapper: DatatypesMapperModel | null; loading: boolean; } ...
2989d48a4e6108f5d3029109c7dffd0910d2a39ff35e9511c26abfa8607d1bbb
TypeScript
929
26
import { useRoute, useRouter } from "vue-router"; import { useChatStore } from "@/stores/chatStore"; /** Shared behavior for the various "New Chat" buttons. */ export function useStartNewChat() { const route = useRoute(); const router = useRouter(); const chatStore = useChatStore(); /** @param center...
d34d0bae7c37ca77face8e2ca8316c3f671e291aace864a248d2cb9deca3ebc2
TypeScript
931
24
import { nth } from "@tests/vitest/helpers"; import { mount } from "@vue/test-utils"; import { describe, expect, it } from "vitest"; import FormColumnDefinition from "./FormColumnDefinition.vue"; describe("FormColumnDefinition", () => { it("marks the column optional when the checkbox is checked", async () => { ...
602105f1e3f7d80c21887ec3d8465cc38bf3f6afaa28a1a4ab7c40a6e5525a17
TypeScript
936
30
import flushPromises from "flush-promises"; import { afterEach, expect, it, vi } from "vitest"; import { ref } from "vue"; import { useToolTrainingMaterial } from "./toolTrainingMaterial"; vi.mock("./config", () => ({ useConfig: () => ({ config: ref({ tool_training_recommendations: true, ...
2494469b8ed1cf8f76a18197d12c6d306bb3708b114f1c90d95197ed5209b2c2
TypeScript
942
37
export interface TerminalToOutputTerminals { [index: string]: OutputTerminal[]; } export interface InvalidConnections { [index: ConnectionId]: string | undefined; } export interface State { connections: Connection[]; invalidConnections: InvalidConnections; inputTerminalToOutputTerminals: TerminalT...
ee0fd02c5afd25afde6c612bee3fc82e0c5c25660f1c3b9884864ac4dfaa9e5e
TypeScript
942
28
import { readFileSync } from "node:fs"; import path from "node:path"; import { describe, it, expect } from "vitest"; function readEnv(file: string): Record<string, string> { const text = readFileSync(path.resolve(__dirname, "../..", file), "utf8"); return Object.fromEntries( text .split("\n...
abbf7cfd69d1acbc0334a4c01decf76a132eced1d7f3215c619726ac98f924e4
TypeScript
944
36
import { vi } from "vitest"; import { ref } from "vue"; const isConfigLoadedRef = ref(true); // Default mock config values const defaultConfig = { allow_local_account_creation: true, enable_oidc: false, mailing_join_addr: "", prefer_custos_login: false, registration_warning_message: "", server...
d2b3bb413fb4bd29f43d7131d8ccda1123e39f4d11f4141aa1cc07cf27a1d1ea
TypeScript
947
29
import { computed, type Ref, toRef } from "vue"; import { useHistoryStore } from "@/stores/historyStore"; interface Props { historyId: string; } export function useHistoryBreadCrumbsToForProps<T extends Props>(props: T, historyAction: string) { const historyId = toRef(() => props.historyId); return useHi...
ff04d6c210bc068efb1cfe41fd2f08d814d8d8a34e28754975ec159be3f28f57
TypeScript
948
29
import { defineConfig, devices } from "@playwright/test"; const PORT = 4173; export default defineConfig({ testDir: "./e2e", fullyParallel: true, forbidOnly: !!process.env.CI, retries: process.env.CI ? 2 : 0, reporter: process.env.CI ? "github" : "list", use: { baseURL: `http://localho...
7aa4b1bb0fb37b445a1b713bb21c5312c9c5600630d2ed8244dc79ca53505618
TypeScript
950
33
/** * composed array of all Event Targets between the original and current target * * @param e Event to return partial composed path of */ export function composedPartialPath(e: Event): EventTarget[] { const current = e.currentTarget; const composed = e.composedPath(); const currentIndex = composed.fin...
415688d2bef84b3e6f2e6adc5372756a8d309d9ef7d68339b516f9206d545447
TypeScript
956
31
import axios from "axios"; import { getAppRoot } from "@/onload"; import { rethrowSimple } from "@/utils/simple-error"; import type { TemplateEntry } from "./types"; export interface VisualizationType { description: string; html: string; logo?: string; name: string; } export async function getVisual...
f6d41cef691bb945c204f66f9781ced7bcb6d13c885c52223722ce02fc2b575d
TypeScript
957
31
import type { Ref } from "vue"; export type SelectValue = Record<string, unknown> | string | number | null; export interface SelectOption { label: string; value: SelectValue; } export interface UseSelectManyOptions { optionsArray: Ref<SelectOption[]>; filter: Ref<string | RegExp>; selected: Ref<S...
b02386e7953676f41f85cf6c257d6ef21e54441849af9015539e6d06d6040d15
TypeScript
960
23
import { getLocalVue } from "@tests/vitest/helpers"; import { mount } from "@vue/test-utils"; import { describe, expect, it, vi } from "vitest"; import { sanitizeHtml } from "@/directives/sanitizeHtml"; import GTip from "./GTip.vue"; describe("GTip", () => { it("renders the tip markdown through v-sanitize-html w...
c675700c734861f2027771b335fbb4eb2d0979d650fa0bd321df2aeb8d07aba5
TypeScript
965
26
import type { RouteLocationNormalized, RouteLocationRaw } from "vue-router"; export interface ZipImportCounts { workflowFileCount: number; regularFileCount: number; } /** Where the wizard sends the user once the import has started. */ export function zipImportResultsLocation(counts: ZipImportCounts): RouteLoc...
b14caed4136e5fe3a7e37f867a39d715323386831dff073b97b8c4721bc8e3f7
TypeScript
969
27
import { describe, expect, it } from "vitest"; import { useServerMock } from "@/api/client/__mocks__"; import { getDatatypesMapper } from "./index"; import { typesAndMappingResponse } from "./test_fixtures"; const { server, http } = useServerMock(); server.use( http.get("/api/datatypes/types_and_mapping", ({ re...
1da3f9afd7faca6d03ca09ba6b3ac881299a127f9e8cf3619775711bba132008
TypeScript
971
30
import { mount } from "@vue/test-utils"; import flushPromises from "flush-promises"; import { expect, it, vi } from "vitest"; import { defineComponent } from "vue"; import { useDataLoading } from "./util"; const { errorToast } = vi.hoisted(() => ({ errorToast: vi.fn() })); vi.mock("@/composables/toast", () => ({ ...
57036534175d9ec92286d34d150503b06fdd69739370dfcb5460170d64658751
TypeScript
985
30
/** * Polls an async function until a condition is met or timeout is reached. * Returns the final result that satisfied the condition. * * @param fn - Async function to call on each poll iteration. * @param condition - Predicate that determines when polling should stop. * @param interval - Milliseconds between po...
d5f109792af14462dec298558dcc723ac217780344ba09c6268f5bc52f0bc28f
TypeScript
989
26
import { type MaybeRefOrGetter, toValue } from "@vueuse/core"; import { computed, ref } from "vue"; import { buildSearchIndex, type FilterField, rankSearchIndex } from "@/composables/filter/filterFunction"; /** * Search state for a select with `internal-search` disabled: wire `onSearchChange` to its * `search-chang...
131338d992a244eeeb4ef07bee5459ea04131d0d4a3505a032cf481203d5290d
TypeScript
993
36
import type { HistorySummary, RegisteredUser } from "@/api"; export function getFakeRegisteredUser(data: Partial<RegisteredUser> = {}): RegisteredUser { return { id: "fake_user_id", email: "fake_user_email", isAnonymous: false, username: "fake_username", total_disk_usage: 0,...
34c4939b0f89fc8d7f02168f73dda02901e5e53dda00d2a3a4b595695c874397
TypeScript
995
37
import type { components } from "@/api/schema"; import { bytesToString } from "@/utils/utils"; type CleanableItemsSummaryResponse = components["schemas"]["CleanableItemsSummary"]; /** * Contains summary information about how much storage space can be recovered by removing * a collection of items from it. */ export...
4444f04587baa2dacea800eb1246a1ef6d7063e99575837af4b7f50bdcb8f632
TypeScript
997
26
import { getLocalVue } from "@tests/vitest/helpers"; import { mount } from "@vue/test-utils"; import { describe, expect, it, vi } from "vitest"; import { sanitizeHtml } from "@/directives/sanitizeHtml"; import TourStep from "./TourStep.vue"; describe("TourStep", () => { it("renders the title and content through ...
3ea3e6a827bc7ba98174eb4aef7098227d068bf167b22dfd9f192a1452123f91
TypeScript
998
32
import { type components, GalaxyApi } from "@/api"; import { rethrowSimple } from "@/utils/simple-error"; export type TourDetails = components["schemas"]["TourDetails"]; export type TourSummary = components["schemas"]["Tour"]; export type TourRequirements = components["schemas"]["TourDetails"]["requirements"]; export ...
bb1220934a8766c61d15cdedff4f7ad4e18ae015ff23a7357ec063fb8feb0ef2
TypeScript
1,006
28
import { GalaxyApi, type ObjectExportTaskResponse } from "@/api"; import { ExportRecordModel } from "@/components/Common/models/exportRecordModel"; import { rethrowSimple } from "@/utils/simple-error"; import type { components } from "./schema"; export type WriteStoreToPayload = components["schemas"]["WriteStoreToPay...
9a42ffaa66cdc351d9e4572a376c43c8d61d4f08d6b5a86121e9ac83e7078810
TypeScript
1,009
34
import { unref } from "vue"; import { useUid } from "./utils/uid"; /** * Allows for keying objects by their internal ids. * Returns a function which takes an object and returns a string uid. * Passing the same object to this function twice, will return the same id. * * Passing the same object to a function creat...
d314fd5cfc91108b58caa7bdbcebaf44a531890cb8d1c10d56ab80e7a1e1d9ed
TypeScript
1,011
24
type JsonObject = Record<string, unknown>; const INSTANCE_VALUE_KEYS = new Set(["const", "default", "enum", "examples"]); export const TOOL_SOURCE_SCHEMA_URI = "https://schema.galaxyproject.org/customTool.json"; /** Preserve Markdown formatting in descriptions consumed by Monaco's YAML language service. */ export fun...
14f86b887547c502b95f76a725405abfc66765dbd263104db39de5c161230347
TypeScript
1,014
23
import { computed, type Ref } from "vue"; import type { FileSourceTemplateSummary, UserFileSourceModel } from "@/api/fileSources"; import { useFileSourceInstancesStore } from "@/stores/fileSourceInstancesStore"; import { useFileSourceTemplatesStore } from "@/stores/fileSourceTemplatesStore"; export function useInstan...
04b330382da65bb069d87a91cf18d8a82976bd5a5d3be8de4c18e80cffe21b10
TypeScript
1,016
30
import type { Store } from "pinia"; const referenceCountByStore = new WeakMap<Store, number>(); /** * Reference counts a store, and provides a function to safely dispose it after a timeout. * @param store store to reference count and dispose * @param timeout how long to wait before reference counting and attemptin...
b302a83e325bb5d75748b06006c6c2a7572e816eaeb6711d73d3a076a009913e
TypeScript
1,017
31
import { computed } from "vue"; import { RouterLink } from "vue-router"; export interface ClickableProps { to?: string; href?: string; disabled?: boolean; } /** * Returns the correct type of clickable root element based on a component's props. * * A disabled component always renders as a plain `button`...
d8549bacd81355a827b887a758f5478b2af790cbae9f1184f39da862bf76fa9a
TypeScript
1,017
25
import { getLocalVue } from "@tests/vitest/helpers"; import { mount } from "@vue/test-utils"; import { describe, expect, it, vi } from "vitest"; import type { JobExportHistoryArchiveModel } from "@/api/histories.export"; import { copy } from "@/utils/clipboard"; import ExportLink from "./ExportLink.vue"; vi.mock("@/...
8c720e2655c916564f2a1e8c76b9040d446ba7d7f82f5406ee61bebe38545024
TypeScript
1,023
29
import { getLocalVue } from "@tests/vitest/helpers"; import { mount } from "@vue/test-utils"; import flushPromises from "flush-promises"; import { afterEach, describe, expect, it, vi } from "vitest"; import GModal from "./GModal.vue"; const localVue = getLocalVue(); describe("GModal", () => { afterEach(() => { ...
40cd9672e649f962d8b191b094b87ebf2ba738bec8f0c763913dbe17225c4a56
TypeScript
1,028
21
import type { InvocationExportPlugin } from "@/components/Workflow/Invocation/Export/Plugins"; export const BIO_COMPUTE_OBJ_EXPORT_PLUGIN: InvocationExportPlugin = { id: "bco", title: "BioCompute Object", img: "https://www.biocomputeobject.org/static/media/logo.c8a91f1656efbad5d745.png", url: "https://...
49e747b9b60069c062b182171f586654eeea9fbd556801c77d0acd043904114a
TypeScript
1,031
40
import { fetchApi, fetchApiVoid } from "./client"; import { IProjectToken, ProjectTokenSchema } from "./schemas"; export async function getProjectTokens( projectId: string, ): Promise<IProjectToken[]> { try { return await fetchApi( `/projects/${projectId}/api-tokens`, ProjectTok...
7e15c8a516cc6c68bab5599c82d2ef58f5c0c09aa83d1aa071a19d1c47ae3886
TypeScript
1,031
29
import { getLocalVue } from "@tests/vitest/helpers"; import { mount } from "@vue/test-utils"; import { describe, expect, it } from "vitest"; import type { JobBaseModel } from "@/api/jobs"; import JobDetails from "./JobDetails.vue"; const localVue = getLocalVue(); const JobInformationStub = { name: "JobInformati...
2100f827a8626205e3f40b50562e51964e77b25bea881f4c54d6fdce1accd964
TypeScript
1,048
28
import { getLocalVue } from "@tests/vitest/helpers"; import { mount } from "@vue/test-utils"; import { describe, expect, it } from "vitest"; import SlugInput from "./SlugInput.vue"; function mountSlugInput() { return mount(SlugInput, { props: { slug: "my-page" }, global: getLocalVue() }); } describe("SlugInput",...
a83c0ed309a1b9fd92a6835ec35d098e03dc8bc2babb5186715ca652ff8df2dd
TypeScript
1,051
30
import axios from "axios"; import { afterEach, beforeEach, describe, expect, it, vi } from "vitest"; vi.mock("axios"); vi.mock("@/onload/loadConfig", () => ({ getAppRoot: () => "/" })); const onloadWebhook = { id: "onload_hook", type: ["onload"], activate: true }; describe("loadWebhooks", () => { beforeEach(() =...
da2a8e3765bc0c64282e1152c9d2391a6d6a71ff6a3c0d893009a8bc21fd433e
TypeScript
1,053
30
import { describe, expect, it } from "vitest"; import { makeLocalFileItem, makeRemoteFilesItem, makeUrlItem } from "@/composables/upload/testHelpers/uploadFixtures"; import type { NewUploadItem } from "@/composables/upload/uploadItemTypes"; import { getUploadItemDisplayInfo } from "./uploadProgressUi"; function with...
a2da4a043145c851c18c864ae5239d84f9d90ec189daca83b3b413eb038a3a37
TypeScript
1,055
24
import { getLocalVue } from "@tests/vitest/helpers"; import { mount } from "@vue/test-utils"; import { describe, expect, it } from "vitest"; import GHeading from "../Common/Heading.vue"; describe("collapsible headings", () => { it.each([false, true])("names the toggle and keeps its state in sync (separator=%s)", ...
c53080b96aea769313ad61cdb28a211a5309eda53e06ef3cbdb5360e17bda902
TypeScript
1,057
18
import type { InvocationExportPlugin } from "@/components/Workflow/Invocation/Export/Plugins"; export const RO_CRATE_EXPORT_PLUGIN: InvocationExportPlugin = { id: "ro-crate", title: "Research Object Crate", img: "https://www.researchobject.org/workflow-run-crate/img/ro-crate-workflow-run.svg", url: "ht...
e7283a3ae78b48220217337987be651d000d5259ee35e6c8609d9ccd7b5097dc
TypeScript
1,062
27
import { defineStore } from "pinia"; import { type DatasetCollectionAttributes, GalaxyApi } from "@/api"; import { type FetchParams, useKeyedCache } from "@/composables/keyedCache"; import { rethrowSimpleWithStatus } from "@/utils/simple-error"; export const useCollectionAttributesStore = defineStore("collectionAttri...
eac8ac796e0178fb3edfeedd248408afebb5fb8dc1071025c096beddf3da93ab
TypeScript
1,063
30
import { beforeEach, describe, expect, it, vi } from "vitest"; import { HttpResponse, useServerMock } from "@/api/client/__mocks__"; const { server, http } = useServerMock(); // Upload utils cache datatypes at module scope, so reload all modules for each test. async function setup() { const { createPinia, setAct...
8f41b8c23f906910000f629ea24894750fae61852ea89163fae8ff4e75484206
TypeScript
1,075
31
import axios from "axios"; import { getAppRoot } from "@/onload/loadConfig"; import { rethrowSimple } from "@/utils/simple-error"; import type { CitationsResult } from "."; export async function getCitations(source: string, id: string): Promise<CitationsResult> { try { const request = await axios.get(`${...