sha256
stringlengths
64
64
language
stringclasses
28 values
size
int32
1
491k
lines
int32
1
23.2k
content
stringlengths
1
200k
49fd8045da619cc4c754d5fb4c9f2f095430980913a896597526ba860a0bbf53
TypeScript
1,082
28
import { defineStore } from "pinia"; import { GalaxyApi } from "@/api"; import type { JobDestinationParams } from "@/api/jobs"; import { type FetchParams, useKeyedCache } from "@/composables/keyedCache"; import { rethrowSimpleWithStatus } from "@/utils/simple-error"; export const useJobDestinationParametersStore = de...
419e91048f27f7b56dd5c8ebf65ee53e7bc4cc3f0485eff6fd25aa84327c1765
TypeScript
1,086
31
import { computed, ref } from "vue"; import { useUserStore } from "@/stores/userStore"; import { useWorkflowStore } from "@/stores/workflowStore"; import { errorMessageAsString } from "@/utils/simple-error"; export function useWorkflowInstance(workflowId: string) { const workflowStore = useWorkflowStore(); co...
fc0c715f7ff3cd7e7b01edac94283fa3d34200db2c894a0c73c99bda402113e4
TypeScript
1,087
29
import type { ComputedRef, InjectionKey } from "vue"; import type { ComponentColor, ComponentSize } from "../componentVariants"; /** One entry of GRadioGroup's `options` prop. */ export interface RadioGroupOption<T = unknown> { /** Label shown next to the radio */ text: string; /** Value the group's v-mod...
1967235f2887ed1a3a93eff1378c87d098942424c08d8306653064a50747dd84
TypeScript
1,088
29
import { createTestingPinia } from "@pinia/testing"; import { mount } from "@vue/test-utils"; import { describe, expect, it, vi } from "vitest"; import { useWorkflowNodeInspectorStore } from "@/stores/workflowNodeInspectorStore"; import type { Step } from "@/stores/workflowStepStore"; import { simpleSteps } from "./t...
8e77344f5f23de7f3f0b3ff03a868b198dda598b5c16942a7476e3f79b5e3fe7
TypeScript
1,091
25
import { computed, type Ref } from "vue"; import type { ObjectStoreTemplateSummary } from "@/components/ObjectStore/Templates/types"; import { useObjectStoreInstancesStore } from "@/stores/objectStoreInstancesStore"; import { useObjectStoreTemplatesStore } from "@/stores/objectStoreTemplatesStore"; import type { User...
7d423f2ff7e684218809c8131aad6b5a2d219b036bd221c3f355ae614a5ee16b
TypeScript
1,092
45
import { faArrowRightFromBracket, faArrowRightToBracket, faCodeBranch, faComment, faFile, faFolderOpen, faMessage, faObjectGroup, faPause, faPen, faSitemap, faWrench, } from "font-awesome-6"; import type { SearchData } from "@/stores/workflowSearchStore"; export const i...
78b8bc0f84e70ac05d206a96508b692c612193283131e824c08811f18d30246e
TypeScript
1,094
29
import { defineStore } from "pinia"; import { ref } from "vue"; import { type BrowsableFilesSourcePlugin, fetchFileSources, type FilterFileSourcesOptions } from "@/api/remoteFiles"; export const useFileSourcesStore = defineStore("fileSourcesStore", () => { const cachedFileSources = ref<{ [key: string]: Br...
e5676455e756f347e26e201667859a05aacad58849e667a2c2415f6c3920ee22
TypeScript
1,099
28
import { defineStore } from "pinia"; import { GalaxyApi } from "@/api"; import type { DatasetExtraFiles } from "@/api/datasets"; import { type FetchParams, useKeyedCache } from "@/composables/keyedCache"; import { rethrowSimpleWithStatus } from "@/utils/simple-error"; export const useDatasetExtraFilesStore = defineSt...
be0b90488a5475fe441405eccb8721bcdf196922f5b974cc61c4f65f97b40e66
TypeScript
1,104
32
import { computed } from "vue"; import { isDetailedCollection } from "@/api"; import { useDatasetCollectionStore } from "@/stores/datasetCollectionStore"; import { errorMessageAsString } from "@/utils/simple-error"; interface Props { collectionId: string; } export function useDetailedCollection<T extends Props>(...
47141cb38ed2a60ad2eb02cabdd31d9cfb4d47b1776673b7a7f668136225d4a8
TypeScript
1,107
42
import { type MaybeRefOrGetter, resolveUnref } from "@vueuse/core"; import { reactive, ref } from "vue"; import { useAnimationFrame } from "./animationFrame"; export function useAnimationFrameScroll(element: MaybeRefOrGetter<HTMLElement | null>) { const scrollLeft = ref(0); const scrollTop = ref(0); cons...
97fe7f621539e4db6152690ff522beaeffb1e40bda2ca3e8603d4e90e1ea4163
TypeScript
1,111
37
import { getLocalVue } from "@tests/vitest/helpers"; import { mount } from "@vue/test-utils"; import flushPromises from "flush-promises"; import { describe, expect, it, vi } from "vitest"; import svc from "./model/service"; import APIKey from "./APIKey.vue"; vi.mock("@/app", () => ({ getGalaxyInstance: () => ({ ...
dd3c740f58be0cfea7e70715f8002351dd7e3187fcbbd519610b16a1669698ce
TypeScript
1,111
31
import { storeToRefs } from "pinia"; import type { CollectionElementIdentifiers, CreateNewCollectionPayload } from "@/api"; import { createCollectionPayload } from "@/api/datasetCollections"; import { useHistoryStore } from "@/stores/historyStore"; /** `historyId` is the history to create collections in; the current ...
0c47c4ca6939634f3cf8f38ed3dafbba6399a2a1e90f9063d36816ea5b786290
TypeScript
1,113
25
import { getLocalVue } from "@tests/vitest/helpers"; import { shallowMount } from "@vue/test-utils"; import { describe, expect, it, vi } from "vitest"; import { sanitizeHtml } from "@/directives/sanitizeHtml"; import FormElementHelpMarkdown from "./FormElementHelpMarkdown.vue"; vi.mock("@/onload/loadConfig", () => (...
77b2a1c27982c496e541916a31792d2aff8313ed54a0464c9ebce4486b5ce202
TypeScript
1,115
27
import { mount } from "@vue/test-utils"; import { describe, expect, it } from "vitest"; import type { RowOptionDescriptor } from "@/composables/upload/uploadOptionBindings"; import UploadTableOptionsCell from "./UploadTableOptionsCell.vue"; const options: RowOptionDescriptor[] = [ { key: "spaceToTab", label: "Sp...
7da1d28b0e188187965b6974058caa1f118cff07c25d3865e83def8c56bcdab0
TypeScript
1,117
32
/** Parse a TRS version name like "v1.2.3" into numeric parts, or null if it holds no version number. */ function parseTrsVersion(name: string): number[] | null { const match = name.match(/(\d+)(?:\.(\d+))?(?:\.(\d+))?/); if (!match) { return null; } return [ parseInt(match[1] as string,...
9271c1ca8edd11301b83b88288e9012eb1097b360b54162f53d3982d014a407c
TypeScript
1,119
27
import { getLocalVue } from "@tests/vitest/helpers"; import { mount } from "@vue/test-utils"; import { describe, expect, it } from "vitest"; import CardDownloadWorkbook from "./CardDownloadWorkbook.vue"; const DOWNLOAD_LINK = '[data-description="workbook download link"]'; describe("CardDownloadWorkbook", () => { ...
b5adff2583e1f25671c4467736402412163ce7c2a33037acd7b736f7441316a4
TypeScript
1,119
37
import { getLocalVue } from "@tests/vitest/helpers"; import { shallowMount } from "@vue/test-utils"; import { describe, expect, it } from "vitest"; import FormSection from "./FormSection.vue"; import FormElement from "@/components/Form/FormElement.vue"; const localVue = getLocalVue(); function mountFormSection(suppo...
379ff20c60b31b8c3c8eae87bbee3080b760b72e2e719987c62614f20f368490
TypeScript
1,126
33
import { defineStore } from "pinia"; import { useUserLocalStorage } from "@/composables/userLocalStorage"; export type PreferredFormSelect = "none" | "multi" | "many"; export const useUserFlagsStore = defineStore("userFlagsStore", () => { const showSelectionQueryBreakWarning = useUserLocalStorage("user-flags-sto...
95f43c145ac5ea2b1182c90a8051ac71cc7615a82511c9d4f39869fba9e8bd8a
TypeScript
1,128
31
import { describe, expect, it } from "vitest"; import { isValidUrl } from "./zipExplorer"; describe("useZipExplorer", () => { describe("isValidUrl", () => { it("should return true for valid URLs", () => { expect(isValidUrl("http://example.com")).toBe(true); expect(isValidUrl("https...
238c364f57c9dd1cc0b768f8de5d52d70c87900d688f912fd8832a9869acba52
TypeScript
1,137
31
import { http as mswHttp } from "msw"; import { createPinia, setActivePinia } from "pinia"; import { beforeEach, expect, it, vi } from "vitest"; import { HttpResponse, useServerMock } from "@/api/client/__mocks__"; import { useConfigStore } from "@/stores/configurationStore"; const { server, http } = useServerMock();...
cb8000eeff362d7d3eb3e0ab2a3ab9f1c3b5abc89dfc60ddaa7a36c2e3f02e1d
TypeScript
1,139
33
import { getLocalVue } from "@tests/vitest/helpers"; import { mount } from "@vue/test-utils"; import { describe, expect, it } from "vitest"; import CodeRow from "./CodeRow.vue"; const localVue = getLocalVue(); function mountCodeRow(codeItem: string) { return mount(CodeRow as object, { props: { codeLabel:...
0d0d002585f5e2e3cb80ffa40bda99a7c411ca211e48daec933e31792bd06f39
TypeScript
1,147
33
import { getLocalVue } from "@tests/vitest/helpers"; import { shallowMount } from "@vue/test-utils"; import { describe, expect, it } from "vitest"; import CreateInstance from "./CreateInstance.vue"; const localVue = getLocalVue(true); describe("CreateInstance", () => { it("should render a loading message during ...
bc82735151068ddf411d06e2b4bd1f5dd710fc35dd02afeb1b7dca201e758aba
TypeScript
1,148
29
import "highlight.js/styles/github.css"; import hljs from "highlight.js/lib/core"; import bash from "highlight.js/lib/languages/bash"; import json from "highlight.js/lib/languages/json"; import yaml from "highlight.js/lib/languages/yaml"; hljs.registerLanguage("bash", bash); hljs.registerLanguage("console", bash); hl...
969544d02335b986af4f53fe9acd0721441ef7d3cc072e3c085757083d82c37b
TypeScript
1,151
33
/** * Asserts that a value is not undefined or null * @param value value to test * @param error optional error message, or Error object */ export function assertDefined<T>(value: T, error?: string | Error): asserts value is NonNullable<T> { if (value === undefined || value === null) { const message = er...
351fb7c5a09574222d1b4931c0ce1a162cf0e198fad998e3a2e69212421ebd0c
TypeScript
1,152
24
import "vitest"; // Custom matchers from tests/vitest/helpers.js interface CustomMatchers<R = unknown> { toBeLocalized(): R; toBeLocalizationOf(str: string): R; } declare module "vitest" { // Export vitest functions for explicit imports (non-globals mode) export const describe: (typeof import("vitest/...
45fa908f5add8b2a21b3b4a7caaf85a0da9949ddf8b17a0ce1f71388a826262c
TypeScript
1,152
32
import { getLocalVue } from "@tests/vitest/helpers"; import { mount } from "@vue/test-utils"; import flushPromises from "flush-promises"; import { describe, expect, it, vi } from "vitest"; import { deletedUnusedPaths, getDependencyUnusedPaths } from "../AdminServices"; import UnusedIndex from "./UnusedIndex.vue"; vi...
77cafc9e777164949ededdf43bf98c5ce950ab3874535b3e617182628385760f
TypeScript
1,152
35
import { computed, type ComputedRef } from "vue"; import type { AnyHistory } from "@/api"; import { useHistoryStore } from "@/stores/historyStore"; import { getHistoryUploadBlockReason, getHistoryUploadWarningMessage, type HistoryUploadBlockReason, } from "@/utils/historyUpload"; interface TargetHistoryUp...
c77e1c0f95e16cbd5ab209656a5343f7947d6f01b91fc67089f584d7031ca254
TypeScript
1,173
37
import type { Step, WorkflowStepStore } from "@/stores/workflowStepStore"; import { cloneRaw } from "@/utils/toRawDeep"; /** * Copies a step and increments a trailing number in it's label, * or adds said trailing number * * @param step step to clone * @param labelSet set containing all labels. Will me mutated to ...
74bb2333cea98e4788fded9e6b9183f61de328395eda2b4a45d36c7a63471974
TypeScript
1,174
31
import { describe, expect, it } from "vitest"; import { ref } from "vue"; import { useRankedSearch } from "./useRankedSearch"; function toItems(ids: string[]) { return ids.map((id) => ({ id, text: id })); } describe("useRankedSearch", () => { it("returns the items unchanged until a search is entered", () => ...
b78fcf061fc5cf37c744ff540cc8f1c37e5511f4121cfd420684277eff7e203b
TypeScript
1,177
28
import type { UseElementBoundingReturn } from "@vueuse/core"; import type { ZoomTransform } from "d3-zoom"; import type { UnwrapRef } from "vue"; type ElementBounding = UnwrapRef<UseElementBoundingReturn>; const MIN_OFFSET = -50; const MAX_OFFSET = 50; const NODE_WIDTH = 200; const NODE_HEIGHT = 50; // To insert a no...
069137b3f351a048338683777f9fe81f1fc6aaca9825c0743bcb2bf7614cc96d
TypeScript
1,178
46
import { toast } from "sonner"; import { ZodError } from "zod"; import { redirectToLogin } from "./auth"; export class ApiError extends Error { constructor( message: string, public status: number, public endpoint: string, ) { super(message); this.name = "ApiError"; }...
9b87049145221b871fc44d56968be46f56cfe9121899732f56098944da33806f
TypeScript
1,179
29
import { createTestingPinia } from "@pinia/testing"; import { getLocalVue } from "@tests/vitest/helpers"; import { shallowMount } from "@vue/test-utils"; import { describe, expect, it, vi } from "vitest"; import { sanitizeHtml } from "@/directives/sanitizeHtml"; import DatasetDetails from "./DatasetDetails.vue"; con...
3d27ecebe71a11b36283002ec1425d330174249e752eae2e0df7e0b741ca17fd
TypeScript
1,183
52
import { describe, expect, it } from "vitest"; import { useKeyedObjects } from "./keyedObjects"; describe("useKeyedObjects", () => { it("returns the same id for the same object", () => { const { keyObject } = useKeyedObjects(); const obj = { a: 1, b: 2, } as { ...
dab284402747a235bcff02b27089c66fd02795460b011a73e403f4ed02a8b984
TypeScript
1,195
38
import { vi } from "vitest"; import { reactive, ref, watch } from "vue"; import type { SelectOption, useSelectMany as UseSelectMany } from "../selectMany"; import { main } from "../selectManyMain"; vi.mock("@/components/Form/Elements/FormSelectMany/worker/selectMany", () => ({ useSelectMany, })); export const us...
0005629b012cffaeca1b28479ebc4d11dbb8b020c50e9bf1f8cd89d99f9901e9
TypeScript
1,198
33
import { getLocalVue } from "@tests/vitest/helpers"; import { shallowMount } from "@vue/test-utils"; import axios from "axios"; import flushPromises from "flush-promises"; import { describe, expect, it, vi } from "vitest"; import UserDatasetPermissions from "./UserDatasetPermissions.vue"; import GAlert from "@/compone...
e4b3077293e781473b44c31e04a569db64934e1c0d9b5f99cb87c5e889b226f9
TypeScript
1,198
39
import { describe, expect, it } from "vitest"; import { parseBool } from "./parseBool"; describe("parseBool", () => { it("should return true for boolean true", () => { expect(parseBool(true)).toBe(true); }); it("should return false for boolean false", () => { expect(parseBool(false)).toBe...
69d15f792eafcb766cdeeb526e92b9f9b6e1bde9ad42999d7aa6a5556dbb8c5b
TypeScript
1,201
37
import { type MaybeRefOrGetter, toValue } from "@vueuse/core"; import { computed } from "vue"; import { useRoute, useRouter } from "vue-router"; /** use a route query parameter as a boolean computed */ export function useRouteQueryBool( parameter: MaybeRefOrGetter<string>, defaultValue: MaybeRefOrGetter<boolea...
ec2b74a8561c559913868855ba98135976b8e35d593a961343432085aa3924d0
TypeScript
1,209
33
import { getLocalVue } from "@tests/vitest/helpers"; import { mount } from "@vue/test-utils"; import { describe, expect, it } from "vitest"; import ProgressBar from "./ProgressBar.vue"; const localVue = getLocalVue(); describe("ProgressBar", () => { it("distinguishes completed, failed, running and waiting counts...
7aa565f0584cec8d55bf577e95108e9e6c8278c095ac9676e24ce4f4d599462c
TypeScript
1,221
38
import { getLocalVue } from "@tests/vitest/helpers"; import { mount } from "@vue/test-utils"; import { describe, expect, it } from "vitest"; import DatasetPermissionsForm from "./DatasetPermissionsForm.vue"; const localVue = getLocalVue(); function mountForm(checked: boolean) { return mount(DatasetPermissionsFor...
cb1f125392b6f4beaa8a4609fa2330f7e65aefd6593a6655e32c764ff3734c7d
TypeScript
1,224
32
/** * This module provides composable functions for working with different types (views) of history objects. * Containing different amounts of required information about a history object depending on the use case. */ import { computed, onMounted } from "vue"; import type { HistorySummaryExtended } from "@/api"; imp...
5728b01c6eddf4fc52236692c95320d41854258ac94103cd70174ee93e26f837
TypeScript
1,226
31
import { test, expect } from "@playwright/test"; test.describe("Landing page (mock mode)", () => { test("renders welcome heading and the mock-only login button", async ({ page, }) => { await page.goto("/"); await expect( page.getByRole("heading", { name: /welcome to code ca...
4dfba59fa9e81a9928ffb5815f2a824dc3d0350c283f745bb6a6afd49f1fe1a3
TypeScript
1,228
29
/** * Sets `innerHTML` without cleaning it. This is the named alternative to raw * `v-html` for the rare content that only the Galaxy server, shipped client * code or the operator's config files can produce and that DOMPurify would * alter (see `v-sanitize-html` for everything else). Admin-only content entered * t...
c43a0f9d98ab593d49fce71a204e06636d0b872da0a8319967b9e91d1f84f428
TypeScript
1,237
32
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 TextSummary from "./TextSummary.vue"; const DESCRIPTION = "Trimmed <b>paired</b> reads"; function mountSum...
68f95468dd9e00389bf087e3e0f470491c3ca222aa456a7366e1e7a50a9d0813
TypeScript
1,239
37
import { describe, it, expect, vi, beforeEach, afterEach } from "vitest"; beforeEach(() => { vi.stubEnv( "VITE_PROJECT_ENCRYPTION_KEY", "f1d2e3a4c5b6a78902e1f0d3c4b5a6e7", ); }); afterEach(() => { vi.unstubAllEnvs(); vi.restoreAllMocks(); }); describe("crypto util", () => { it("de...
868ecfddff84f4751e913dca2fb6cfb741cc7bbdcc3eff58cd3f787783252a9f
TypeScript
1,245
22
import { describe, expect, it, vi } from "vitest"; import { createMemoryHistory, createRouter } from "vue-router"; import storageRoutes from "./storage-routes"; vi.mock("@/components/User/DiskUsage/Management/StorageManager.vue", () => ({ default: {} })); vi.mock("@/components/User/DiskUsage/StorageDashboard.vue", ()...
973987c786a65a5c9e5de27dff148360ab7cd8b69c91476f5f3dc0b952750ac0
TypeScript
1,246
41
import { getLocalVue } from "@tests/vitest/helpers"; import { mount } from "@vue/test-utils"; import { describe, expect, it } from "vitest"; import type { ExportRecord } from "@/components/Common/models/exportRecordModel"; import ExportRecordDetails from "./ExportRecordDetails.vue"; const localVue = getLocalVue(); ...
85c2705c49ea4e88ff7fb04ddb34dd3dab6808b882b3ba4076fad043fc343c3f
TypeScript
1,257
38
// abstractions for dealing with workflows labels and // connecting them to the Markdown editor import type { Steps } from "@/stores/workflowStepStore"; type WorkflowLabelKind = "input" | "output" | "step"; export interface WorkflowLabel { label: string; type: WorkflowLabelKind; } export type WorkflowLabels...
943e17fb6e8e7397f636ef85b00f9ecd5bb9166d85d1327bafa0449f5d2d98a0
TypeScript
1,260
30
import { describe, expect, it } from "vitest"; import { getHistoryUploadActionErrorMessage, getHistoryUploadBlockReason, getHistoryUploadWarningMessage, } from "./historyUpload"; describe("historyUpload", () => { it("returns archived when history is archived", () => { const reason = getHistory...
1af6ab6968731b73470eb0a3e415351aa19bc7cfa9c3a7ec300f138047907a07
TypeScript
1,261
45
import { onMounted, type Ref, ref } from "vue"; import { fetchUserExportRecords } from "@/api/exports"; import type { ExportRecord } from "@/components/Common/models/exportRecordModel"; /** * Composable to track remote exports (exports to file sources). * Fetches export records from the API and provides reactive da...
69d50e85efa1ec507bf40c9e968050bac21f80fab18300109b6b69245afa18f9
TypeScript
1,267
26
import type { Middleware } from "openapi-fetch"; import { getPendingAbortSignal, SKIP_PENDING_REQUESTS_HEADER } from "@/api/pendingRequests"; /** * Attaches the shared pending-requests signal to every ``GalaxyApi`` request. * The ``openapi-fetch`` client uses native ``fetch()`` so the axios * interceptor does not ...
3794089cc8f87e01f02b7cdb170dc77c6d9cc4fde9fd4417be442e8fc86180fe
TypeScript
1,269
41
import { onMounted, ref } from "vue"; import { GalaxyApi } from "@/api"; import { errorMessageAsString } from "@/utils/simple-error"; /** * One-shot loader for the AI history-summary endpoint. Fetches on mount; * exposes loading / error / summary refs for the view. */ export function useHistoryGraphSummary(history...
6a434acbaf2a75366872742eaa580943f0df3ee2aaf472b8a23acde0f5814143
TypeScript
1,269
39
import { getLocalVue } from "@tests/vitest/helpers"; import { mount } from "@vue/test-utils"; import { createPinia, setActivePinia } from "pinia"; import { beforeEach, describe, expect, it, vi } from "vitest"; import { ref } from "vue"; import { mockOffset } from "./test_fixtures"; import Draggable from "./Draggable....
5875a850f276d08c134f881aff056856e5f2e02f1af534cab8ae695a19abdaf2
TypeScript
1,275
29
import { createTestingPinia } from "@pinia/testing"; import { getLocalVue } from "@tests/vitest/helpers"; import { mount } from "@vue/test-utils"; import flushPromises from "flush-promises"; import { describe, expect, it, vi } from "vitest"; import { sanitizeHtml } from "@/directives/sanitizeHtml"; import EmailReport...
6dc7b6a72312596614351d1ed18441f6edb77b883f561a6dc39bd86e07615a72
TypeScript
1,281
41
export function extractEmbeddedJs(inputString: string, fieldRegex?: RegExp): { fragment: string; start: number }[] { let i = 0; let end = inputString.length; if (fieldRegex) { const fieldMatch = fieldRegex.exec(inputString); if (fieldMatch && fieldMatch.length) { i = fieldMatch.i...
67230ed76524a653d59c2f35e38bed25c394f043b0414e41edd83e1afca9b5f8
TypeScript
1,284
28
import type { Middleware } from "openapi-fetch"; import { isForeignHtmlResponse, NO_CACHE_HEADERS, REQUEST_ID_HEADER } from "@/api/staleCacheRetry"; /** ``openapi-fetch`` counterpart of ``installStaleCacheRetryInterceptor``, see ``@/api/staleCacheRetry``. */ export const staleCacheRetryMiddleware: Middleware = { ...
398a43abecff76f9e6b579eee7a988e9843e8651d5d09062b525e9c6131685f6
TypeScript
1,287
36
import { useElementBounding } from "@vueuse/core"; import { type ComputedRef, onUnmounted, type Ref, unref, watch } from "vue"; import type { useWorkflowStateStore } from "@/stores/workflowEditorStateStore"; export function useNodePosition( nodeRef: Ref<HTMLElement | null>, stepId: number, workflowStateSt...
391fed316230aff7d40aaef8d21da11da2fb01ab5954c7971bcdbb7ba3ca5bba
TypeScript
1,294
35
import "ag-grid-community/styles/ag-grid.min.css"; import "ag-grid-community/styles/ag-theme-alpine.min.css"; import type { GridApi, GridReadyEvent } from "ag-grid-community"; import { defineAsyncComponent, nextTick, ref } from "vue"; // ag-grid-vue3 is a Vue 3 component; under the app's MODE 2 compat its `v-model` w...
54e81669a0c610d64cfa1c2f94191ed80f2d9050094049c9e93204c1a085bc54
TypeScript
1,295
32
import { getLocalVue } from "@tests/vitest/helpers"; import { mount } from "@vue/test-utils"; import { describe, expect, it } from "vitest"; import UploadTableNameCell from "./UploadTableNameCell.vue"; function mountCell(props: { value: string; state?: boolean | null }) { return mount(UploadTableNameCell, { props...
0dee9ca28851265528443ccdd8afb2a0e166cfb1bb0ef037dfb36e44fdc25704
TypeScript
1,307
45
import { type Ref, ref } from "vue"; import { getRemoteEntriesAt } from "@/components/Upload/utils"; import type { ListUriResponse, RemoteDirectory, RemoteFile } from "./types"; export function useFileSetSources(isBusy: Ref<boolean>) { const pasteData = ref<string[][]>([] as string[][]); const tabularDataset...
173cb665c4f8b43e77a72aa2af4940faf7c2a79d4ab04ab916cc2540575a7de2
TypeScript
1,310
45
// Alphanumeric/natural sort fn export function naturalSort(a = "", b = ""): number { // setup temp-scope variables for comparison evauluation const re = /(-?[0-9.]+)/g; const x = a.toString().toLowerCase() || ""; const y = b.toString().toLowerCase() || ""; const nC = String.fromCharCode(0); co...
88b5f9adc532ba6eabd2ef956cbd7c859e6d04bc40c43f4005c7f3a5374af9ad
TypeScript
1,310
44
import type { Plugin } from "@/api/plugins"; export function getRequiresDataset(plugin?: Plugin): boolean { return plugin?.params?.dataset_id?.required || false; } export function getTestExtensions(plugin?: Plugin): string[] { const results: string[] = []; if (plugin?.data_sources) { for (const da...
290a807f55f8b2b04ee6f357cdd3ab75cabebc58f3f2be78bb970f922afff340
TypeScript
1,312
41
import { describe, expect, it } from "vitest"; import { capitalizeFirstLetter, pluralize } from "./strings"; describe("capitalizeFirstLetter", () => { it("capitalizes a normal string", () => { expect(capitalizeFirstLetter("google")).toBe("Google"); }); it("trims whitespace", () => { expec...
f3fd720158b8242ed2c2926797863b043c0458e5602fa4aab0b29414615a6991
TypeScript
1,312
37
import { GalaxyApi } from "@/api"; import { rethrowSimple } from "@/utils/simple-error"; import { useGenericMonitor } from "./genericTaskMonitor"; export const DEFAULT_POLL_DELAY = 10000; const DEFAULT_EXPIRATION_TIME = 1000 * 60 * 60 * 24; // 24 hours export const READY_STATE = "READY"; const PENDING_STATE = "PENDI...
6a3c37a59215a1f0e7746722bcb4e409a152660b031e767e432860659958be1c
TypeScript
1,314
33
import { getLocalVue } from "@tests/vitest/helpers"; import { mount } from "@vue/test-utils"; import { createPinia } from "pinia"; import { describe, expect, it, vi } from "vitest"; import PairedDatasetCellComponent from "./PairedDatasetCellComponent.vue"; function mountPairedCell() { const context = { pinia: cre...
ee3906b11fd7cb4581d34235da38619728939321629c17550b5c21e8aede8e9a
TypeScript
1,323
30
import { createTestingPinia } from "@pinia/testing"; import { getLocalVue } from "@tests/vitest/helpers"; import { mount } from "@vue/test-utils"; import flushPromises from "flush-promises"; import { describe, expect, it, vi } from "vitest"; import { sanitizeHtml } from "@/directives/sanitizeHtml"; import MarkdownDef...
6307d488d31771462f85d59c779699861ee921ba37529625baf01a5541719751
TypeScript
1,328
31
import { getLocalVue } from "@tests/vitest/helpers"; import { mount, shallowMount } from "@vue/test-utils"; import { describe, expect, it, vi } from "vitest"; import { sanitizeHtml } from "@/directives/sanitizeHtml"; import NodeInvocationText from "./NodeInvocationText.vue"; describe("NodeInvocationText", () => { ...
3e74abea826509f4a34bdb6d10d6158a6ed86215feae99430aae882feb3c54e9
TypeScript
1,329
31
import { computed, type Ref, ref, watch } from "vue"; import type { DatatypesMapperModel } from "@/components/Datatypes/model"; import { terminalFactory } from "@/components/Workflow/Editor/modules/terminals"; import { useWorkflowStores } from "@/composables/workflowStores"; import type { Step, TerminalSource } from "...
5e6d9e5a612a2ea60d0879b20cfffb31dab69652d855d0852bde0584066fc206
TypeScript
1,330
33
import { shallowMount } from "@vue/test-utils"; import { describe, expect, it } from "vitest"; import { defineComponent } from "vue"; import GFormInput from "@/components/BaseComponents/Form/GFormInput.vue"; describe("vitest setup createStubs hook", () => { it("keeps v-model on a shallow-mounted component that op...
6ffb8ec60e1d6b0808ac76a36e93c7fee96b05e45747742c485ce10e5a777d81
TypeScript
1,330
29
import { createTestingPinia } from "@pinia/testing"; import { getLocalVue, withPlugins } from "@tests/vitest/helpers"; import { mount } from "@vue/test-utils"; import { describe, expect, it, vi } from "vitest"; import HistoryStorageOperationsIndicator from "./HistoryStorageOperationsIndicator.vue"; import GPopover fro...
d8c068c6bbd6ed40a1ec05c0a462a1788209b1892f0b6712e0b8d48c6ef386f3
TypeScript
1,338
39
interface Workflow { id: string; name: string; owner: string; tags: string[]; deleted: boolean; published: boolean; description: string; create_time: string; update_time: string; annotations: string[]; show_in_tool_panel: boolean; latest_workflow_uuid: string; } export f...
80402611d91bf3117340d7db6bb7caf20ac81b06dacc7d8aa438052d55ab6d01
TypeScript
1,341
37
import { describe, expect, it } from "vitest"; import { effectScope, nextTick, ref } from "vue"; import { useScrollEdges } from "./useScrollEdges"; /** The test DOM has no layout, so the row gets fixed scroll metrics */ function makeRow(scrollWidth: number, clientWidth: number): HTMLElement { const row = document...
0dc01986b5062b30ddd3d8902290e0b333106e11e4965c0d79c0b5fe2d28f9c3
TypeScript
1,345
26
import { cancelPendingRequests } from "@/api/pendingRequests"; import { useEntryPointStore } from "@/stores/entryPointStore"; import { useHistoryStore } from "@/stores/historyStore"; import { useNotificationsStore } from "@/stores/notificationsStore"; /** * Tear down every long-lived connection and cancel every in-fl...
54fd2c0ec6a3700ba73aed11bd1c581278d179d7da7d35a8dac6bca37ea94800
TypeScript
1,349
44
import { emittedArg, getLocalVue } from "@tests/vitest/helpers"; import { mount } from "@vue/test-utils"; import { describe, expect, it } from "vitest"; import GDateTime from "./GDateTime.vue"; const localVue = getLocalVue(true); async function mountGDateTime(props: object) { const wrapper = mount(GDateTime as o...
4f0854b54b1002352e5f3dbe5215dc078f92d3b9b65c0cb0e12ef746e11714e9
TypeScript
1,352
46
import { GalaxyApi } from "@/api"; import { rethrowSimple } from "@/utils/simple-error"; import { useGenericMonitor } from "./genericTaskMonitor"; const SUCCESS_STATE = "SUCCESS"; const FAILURE_STATE = "FAILURE"; const DEFAULT_POLL_DELAY = 10000; const DEFAULT_EXPIRATION_TIME = 1000 * 60 * 60 * 24; // 24 hours /** ...
3acc965dd8abb49c59034510b8a02a8e4b0b12b9fdc8b562ee683cfda83b38c2
TypeScript
1,353
31
import { createTestingPinia } from "@pinia/testing"; import { getLocalVue } from "@tests/vitest/helpers"; import { mount } from "@vue/test-utils"; import flushPromises from "flush-promises"; import { describe, expect, it, vi } from "vitest"; import { sanitizeHtml } from "@/directives/sanitizeHtml"; import ToolHelpMar...
bee1cad497922ce5387e50deb553b4be2c61613844214a277a5471dbb1117cb7
TypeScript
1,357
38
import axios from "axios"; import { type Input, permissionInputParts } from "@/composables/datasetPermissions"; import { withPrefix } from "@/utils/redirect"; export function getPermissionsUrl(historyId: string) { return `/history/permissions?id=${historyId}`; } export interface PermissionsResponse { inputs:...
735bceec50357372126860cb47e7cd0141c10dd993123e873144601f1e66d9cb
TypeScript
1,361
37
export type HistoryUploadBlockReason = "archived" | "deleted"; type UploadTargetHistory = { archived?: boolean; deleted?: boolean; }; const BLOCK_WARNING_BY_REASON: Record<HistoryUploadBlockReason, string> = { archived: "This history has been archived and cannot receive uploads. Select a different history...
cc3b888b525838f5a1298611b6477034fbfb4594910d41da0fd417da0b9ade07
TypeScript
1,366
38
/** * Cached fetcher for `/api/jobs/{job_id}/parameters_display`. The endpoint * carries both the tool parameter tree and the job outputs — naming follows * the established `jobStore` convention. */ import { defineStore } from "pinia"; import { GalaxyApi } from "@/api"; import type { JobDisplayParametersSummary }...
4b73434e2a2dcb24e0f7c74b0d6e9e30d8eca27421154afa2f4418483d2e7b5c
TypeScript
1,367
37
import { mount } from "@vue/test-utils"; import { describe, expect, it, vi } from "vitest"; import { defineComponent } from "vue"; import GForm from "./GForm.vue"; describe("GForm", () => { it("hands the native submit event to a parent's @submit.prevent handler", async () => { const onSubmit = vi.fn(); ...
85eb2a8dc36825ba6929ad9649e9d7beaf488e32b7cf172f20b252fccdad0455
TypeScript
1,367
42
import { beforeEach, describe, expect, it, vi } from "vitest"; import { copyLink } from "./utilities"; const writeText = vi.fn(); Object.defineProperty(navigator, "clipboard", { writable: true, configurable: true, value: { writeText, }, }); describe("copyLink", () => { beforeEach(() => {...
1ed7c20fbbd69a66bb6bf1faa233bc4ac06c3ff23556f48b8ce0522fe995ed0c
TypeScript
1,370
51
import { Hsluv } from "hsluv"; export const colors = { black: "#000", blue: "#004cec", turquoise: "#00bbd9", green: "#319400", lime: "#68c000", orange: "#f48400", yellow: "#fdbd0b", red: "#e31920", pink: "#fb00a6", } as const; export type Color = keyof typeof colors; export type He...
046b2bd492090adb4fbe40485f450332e8827804257b43972df726bdb6f33391
TypeScript
1,373
42
/** * Composable for validating upload item properties. * Provides validation functions for item names and name restoration logic. * * @example * ```typescript * const { isNameValid, restoreOriginalName } = useUploadItemValidation(); * * // In template * <BFormInput :state="isNameValid(item.name)" @blur="resto...
4eff22a9ff42478e3bcc06be5898a80657caee5a3fd39890284ed1894801672d
TypeScript
1,375
48
import type { MaybeRef } from "@vueuse/core"; import { useStepper } from "@vueuse/core"; /** * Represents a step in a wizard. */ export interface WizardStep { /** * The label of the step. It will be displayed in the wizard navigation. */ label: MaybeRef<string>; /** * The instructions for...
771adca5a29ca2cc305b1341a719b4191b68f894ff97c5935c76b355d8c5beca
TypeScript
1,378
37
import type { IconDefinition } from "@fortawesome/fontawesome-svg-core"; export type ActivityVariant = "primary" | "danger" | "disabled"; export interface Activity { // determine wether an anonymous user can access this activity anonymous?: boolean; // description of the activity description: string; ...
2a1d5d158a50d6627300b9822603424280c1180c0e6130e0b59681d6a33887a7
TypeScript
1,384
35
import { computed } from "vue"; import { getOIDCIdpsWithRegistration } from "@/components/User/ExternalIdentities/ExternalIDHelper"; import { useConfig } from "@/composables/config"; /** Where registering leads; `external` is an OIDC provider's own endpoint, outside the app's router */ export interface RegistrationTa...
bfacab82199961bc858e1f54de55db658b48e0c1d88c0bfbd2fd8e01f38d2453
TypeScript
1,397
43
import { ref } from "vue"; import type { GenericPair } from "@/components/Collections/common/buildCollectionModal"; import { autoPairWithCommonFilters, type HasName } from "./pairing"; import AutoPairing from "./common/AutoPairing.vue"; export function useAutoPairing<T extends HasName>() { const currentForwardF...
947c9f13ce0eb7c61c7734a9ec4d3c3f06ee257d94c16ef62094a91f126e5008
TypeScript
1,399
43
import { GalaxyApi, type GalaxyApiPaths } from "@/api"; import { rethrowSimple } from "@/utils/simple-error"; // TODO: Move these functions to broadcastStore and refactor other calls to go through the store export async function fetchAllBroadcasts() { const { data, error } = await GalaxyApi().GET("/api/notificati...
275716088ba30587c40126009b25413cd17ea3aa8939e089d3e7206cf15ec2e2
TypeScript
1,411
43
import { storeToRefs } from "pinia"; import { computed, ref } from "vue"; import { useConfigStore } from "@/stores/configurationStore"; /** * Shared open/close state for the global command palette. The palette * component is mounted once in `entry/analysis/App.vue`; any consumer * (hotkey, masthead button) can ope...
92e87b6b908282391d6d82d7ac473a5483e6df52aeb53cfcd9e0194aefc5827a
TypeScript
1,413
43
import { describe, expect, it } from "vitest"; import { deepEach } from "./utils"; describe("deepEach", () => { it("recurses into every nested object by default", () => { const tree = { a: { b: { c: {} } } }; const seen: object[] = []; deepEach(tree, (node) => { seen.push(node)...
c417be3e43a8893a7129d9eef0534ebbfe784b99cabe16fc063dbf1fa1ac949e
TypeScript
1,414
45
import { type MaybeRefOrGetter, resolveUnref } from "@vueuse/core"; import { useAnimationFrame } from "./animationFrame"; export type Size = { width: number; height: number }; type CallbackValue = { clientSize: Size; scrollSize: Size }; export type AnimationFrameResizeObserverCallback = (newValue: CallbackValue, oldV...
95044272e742dd2dde2856cae1c414279b5f98ffdfaae0887f4be0d977ecd341
TypeScript
1,418
37
import { getLocalVue } from "@tests/vitest/helpers"; import { mount } from "@vue/test-utils"; import { describe, expect, it } from "vitest"; import { STANDARD_FILE_SOURCE_TEMPLATE, STANDARD_OBJECT_STORE_TEMPLATE } from "./test_fixtures"; import EditSecretsForm from "./EditSecretsForm.vue"; const localVue = getLocalV...
ca94fc74e983794dcbdfc08ed18f13c1988557c02f71d095c8582fdbe5a65f2a
TypeScript
1,419
47
import axios from "axios"; import { withPrefix } from "@/utils/redirect"; import { rethrowSimple } from "@/utils/simple-error"; /** * Interface for datatype to visualization mapping */ export interface DatatypeVisualization { datatype: string; // Datatype extension (e.g., "h5", "tabular") visualization: str...
0b69940a2403066678bd0edc1a52c785f1f76156bad6b72f585a63c65933e091
TypeScript
1,420
42
import { describe, expect, it } from "vitest"; import { describeFailures, settleEach } from "./settleEach"; describe("settleEach", () => { it("runs every item in order and continues past failures", async () => { const seen: number[] = []; const operation = async (n: number) => { seen.p...
b79b4cfe6ebbf0e392d9ee477d1aee1ec330cb08bfc58215f1dadc04074f09ff
TypeScript
1,421
35
import { getLocalVue } from "@tests/vitest/helpers"; import { mount } from "@vue/test-utils"; import { describe, expect, it } from "vitest"; import Index from "./Index.vue"; const localVue = getLocalVue(); function mountIndex() { return mount(Index as object, { global: { ...localVue, stubs: { ...localVue...
8bb179893d306b1f932271e2ed27dcf230745db6cb876552f3add81b9072584c
TypeScript
1,429
37
import { describe, expect, it } from "vitest"; import { generateStepLabel } from "./useInvocationMessageStepData"; describe("generateStepLabel", () => { it("returns basic step label when no additional info available", () => { const step = { type: "tool" }; expect(generateStepLabel(0, step)).toBe("...
6ff29c9723495bdac18441a048e2a9cc71089d4e9da80e8973ffa83e4dc00788
TypeScript
1,431
37
import { GAlert } from "@galaxyproject/galaxy-ui"; import { mount } from "@vue/test-utils"; import { describe, expect, it } from "vitest"; import { h } from "vue"; import LoadingSpan from "./LoadingSpan.vue"; describe("LoadingSpan", () => { it("announces its message as a status", () => { const wrapper = m...
b219f63c4bd3a1708baf03d1b34c3f0bfe38757217cfcf748af981ea257c0130
TypeScript
1,446
38
import { mount } from "@vue/test-utils"; import { describe, expect, it } from "vitest"; import { defineComponent, h } from "vue"; import { createMemoryHistory, createRouter, RouterView } from "vue-router"; import { zipImportResultsLocation, zipImportResultsProps } from "./resultsRoute"; const Results = defineComponen...
575b03f1d6b51a9348af5ccba2cd56f6771e28c7522ec20d5378973dfdb3c9db
TypeScript
1,447
44
import { defineStore } from "pinia"; import { computed } from "vue"; import { type HDADetailed, type HistoryContentItemBase, isInaccessible } from "@/api"; import { fetchDatasetDetails } from "@/api/datasets"; import { useKeyedCache } from "@/composables/keyedCache"; export const useDatasetStore = defineStore("datase...
72f17f2bc41078d59383494d6eb3cca0cb4cd4d69dec2f3ab49273b4e2065ac7
TypeScript
1,467
38
import { getLocalVue } from "@tests/vitest/helpers"; import { mount } from "@vue/test-utils"; import { describe, expect, it, vi } from "vitest"; import { nextTick } from "vue"; import TagsSelectionDialog from "./TagsSelectionDialog.vue"; vi.mock("@/stores/userTagsStore", () => ({ useUserTagsStore: vi.fn(() => ({ ...
6e128d51bd4de760e27b8c5a2faa6df5bd5b4f67faa972d0335b414351f50f6a
TypeScript
1,476
30
import type { IconDefinition } from "@fortawesome/fontawesome-svg-core"; import { type RecentPaletteItem, useRecentPaletteItems } from "@/composables/useRecentPaletteItems"; import type { PaletteItem } from "../types"; import { rankPaletteItems } from "../utilities"; /** How one provider renders the entities the pal...