sha256 stringlengths 64 64 | language stringclasses 28
values | size int32 1 491k | lines int32 1 23.2k | content stringlengths 1 200k |
|---|---|---|---|---|
a5378dbe133f7390ab9ddbfa89202f106a8519a8a36315f94e9c977d4ed8084b | TypeScript | 1,851 | 39 | import { describe, expect, it } from "vitest";
import { chooseHeaderLayout } from "./gCardHeaderLayout";
const base = { available: 300, gap: 4, titleMin: 160 };
describe("chooseHeaderLayout", () => {
it("keeps one row when the header has no badges", () => {
expect(chooseHeaderLayout({ ...base, actions: 4... |
12282bc3e412fd80e0c9516984799e6d6337d5b83318917ffc79edcd7cb23018 | TypeScript | 1,854 | 48 | import { getLocalVue } from "@tests/vitest/helpers";
import { mount } from "@vue/test-utils";
import { describe, expect, it } from "vitest";
import type { CompositeSlot } from "../types/uploadItem";
import CompositeSlotRow from "./CompositeSlotRow.vue";
const BASE = { slotName: "data", description: "Data file", opti... |
dbabe8e5dc882a059f9c306c5652eb48d66cca6b8c72f67d5e313db9d82be4bd | TypeScript | 1,855 | 51 | 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 VaultSecret from "./VaultSecret.vue";
const localVue = getLocalVue(true);
describe("VaultSecret", (... |
ef78a6ce82efc39608df7585945dcfa2a34803a7174990de6e1071f3abb852a1 | TypeScript | 1,855 | 83 | import axios from "axios";
import { withPrefix } from "@/utils/redirect";
import { rethrowSimple } from "@/utils/simple-error";
export interface Dataset {
id: string;
hid: string;
name: string;
}
export interface DataSource {
model_class?: string;
tests: Array<DataSourceTest>;
}
export interface... |
86783879b4bd41214ebce9e20db5735e5f9cdd80dd872dd50c7c92d540154b41 | TypeScript | 1,861 | 49 | 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 ConfigurationMarkdown from "./ConfigurationMarkdown.vue";
const localVue = getLocalVue();
describe(... |
7c09f706bb3b2d7763a21722277d28de305bc2b98901bdbaf5f0bbb5fb7f9559 | TypeScript | 1,863 | 44 | import { emittedArg, getLocalVue, nth } from "@tests/vitest/helpers";
import { mount, type VueWrapper } from "@vue/test-utils";
import { beforeEach, describe, expect, it } from "vitest";
import DatasetDownload from "./DatasetDownload.vue";
const localVue = getLocalVue();
const items = [
{ id: "item_id", extensio... |
06d9c2aa852b46e9a5c2d41f08ec4b55af6f53be79b3c037dd8805e0c0f294aa | TypeScript | 1,864 | 57 | import { useEventListener } from "@vueuse/core";
import { type Ref, watch } from "vue";
import { useWorkflowStores } from "@/composables/workflowStores";
import { vecSnap } from "@/utils/geometry";
/**
* Common functionality required for handling a user resizable element.
* `resize: both` needs to be set on the ele... |
6a7712bbc4b743debce1b3686a8a7482fcf9fb460a196724c718f4843b2fd2df | TypeScript | 1,875 | 55 | import { computed, type Ref } from "vue";
/** Graph adjacency lookups for a node id. */
export interface FocusAdjacency<T> {
/** Immediate upstream (parent) node ids of `id`. */
upstream: (id: T) => Iterable<T>;
/** Immediate downstream (child) node ids of `id`. */
downstream: (id: T) => Iterable<T>;
}... |
b7000340dce2971424bfbb23152de25e6cd143acbeebbd043f6489f48e8636af | TypeScript | 1,886 | 68 | import { defineStore } from "pinia";
import { ref } from "vue";
import { GalaxyApi } from "@/api";
import { errorMessageAsString } from "@/utils/simple-error";
interface ClaimState {
toolId: string | null;
toolVersion: string | null;
requestState: { [key: string]: unknown } | null;
errorMessage: strin... |
be5b487adf9c97e8dd271b926d8589e5059fee15774fd2f2bcce9ee96603689c | TypeScript | 1,889 | 47 | import { getLocalVue } from "@tests/vitest/helpers";
import { mount } from "@vue/test-utils";
import { describe, expect, it } from "vitest";
import type { UserNotificationPreferences } from "@/api/notifications";
import NotificationsCategorySettings from "./NotificationsCategorySettings.vue";
const localVue = getLoc... |
af5979e1e1fe5505eb02860c89949d16a8d43386463fcb7427b34de667f80d27 | TypeScript | 1,890 | 73 | /**
* @file
* Example of Node.js API.
*
* @license
* Open Chinese Convert
*
* Copyright 2010-2026 Carbo Kuo and contributors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* ... |
c18489987f9e937e7e1ca7594827fcbe349c5388429e4f63b5b493ac38e6a701 | TypeScript | 1,892 | 43 | import { describe, expect, it } from "vitest";
import type { CollectionType } from "@/api/datasetCollections";
import { buildersForCollectionType, buildersForCollectionTypes } from "./collections";
describe("buildersForCollectionType", () => {
it("should return the list builder for flat list collections", () => ... |
6695bb9f751d46add2112af5f545398c0cd9fd23aca77543bb4ba0c90d290b04 | TypeScript | 1,897 | 60 | import { format, parseISO } from "date-fns";
import { computed, type Ref, ref, watch } from "vue";
import { GalaxyApi } from "@/api";
import { rethrowSimple } from "@/utils/simple-error";
export interface SelectOption {
value: string;
text: string;
}
interface Job {
id: string;
create_time: string;
}... |
8ab02540ef1f302bc3157c7d715f9d086c642b91b22283203b528780d9ae281a | TypeScript | 1,900 | 41 | import type { components } from "@/api/schema";
export type CreateInstancePayload = components["schemas"]["CreateInstancePayload"];
export type Instance =
| components["schemas"]["UserFileSourceModel"]
| components["schemas"]["UserConcreteObjectStoreModel"];
export type TemplateVariable =
| components["s... |
b66a8bb7c4753c1f05d982c6dc5aa2bd42b4b4b2c7ae7f4ac77d7c6d6a4201b7 | TypeScript | 1,903 | 76 | import { GalaxyApi } from "@/api";
import { rethrowSimple } from "@/utils/simple-error";
const LIMIT = 50;
export async function getDataset(query: string, historyId: string) {
const { data, error } = await GalaxyApi().GET("/api/datasets", {
params: {
query: {
history_id: histor... |
8e1dc2068e544f44ace361d702dff708819a5a140e75a2ef8ca0eaa6fac2fcd4 | TypeScript | 1,927 | 35 | import { describe, expect, it, vi } from "vitest";
import { createMemoryHistory, createRouter } from "vue-router";
import LibraryRoutes from "./library-routes";
vi.mock("@/components/Libraries/LibrariesList.vue", () => ({ default: {} }));
vi.mock("@/components/Libraries/LibraryFolder/LibraryFolder.vue", () => ({ defa... |
b19c4a2b3a97316c36f3845f7141378eb77aa5e8de6f4581bfbe6971dcfea0d7 | TypeScript | 1,931 | 80 | import { faEye } from "@fortawesome/free-solid-svg-icons";
import type { WorkflowInvocation } from "@/api/invocations";
import { getAppRoot } from "@/onload";
import type { FieldArray, GridConfig } from "./types";
/**
* Request and return invocations for the given workflow (and current user) from server
*/
async f... |
ac7f8afea3ed33fe588533d6ebc5ccf5618116e6c56651e06326f0a38384fabd | TypeScript | 1,939 | 48 | import { createTestingPinia } from "@pinia/testing";
import { getLocalVue, withPlugins } from "@tests/vitest/helpers";
import { mount } from "@vue/test-utils";
import { beforeEach, describe, expect, it, vi } from "vitest";
import { ref } from "vue";
import { useExportToAnotherGalaxyStore } from "@/stores/exportToAnoth... |
c365a0ebad2b131e7089fc9d32c127462da959d9f4f8e158da59ceb6d136a73c | TypeScript | 1,943 | 62 | import { createTestingPinia } from "@pinia/testing";
import { setActivePinia } from "pinia";
import { beforeEach, describe, expect, it, vi } from "vitest";
import { computed } from "vue";
import { getUserPreferencesModel } from "@/components/User/UserPreferencesModel";
import { useConfig } from "@/composables/config";... |
6ebc2229031cf0ad93b6cc5e98c0ace23f8e5ff2e38d88a9c7498e2bea4c5cb9 | TypeScript | 1,954 | 56 | import { type Ref, ref } from "vue";
import type { UserConcreteObjectStoreModel } from "@/api";
import { getPermissions, isHistoryPrivate, makePrivate, type PermissionsResponse } from "@/components/History/services";
import { useConfirmDialog } from "@/composables/confirmDialog";
interface PrivateObjectStoreConfirmat... |
3b7bc1eaf50ac2b99c71bb1dd7908a3170e8b109aa2d35548b29b68324e099a2 | TypeScript | 1,956 | 51 | import { type Ref, ref, watch } from "vue";
import { getAppRoot } from "@/onload/loadConfig";
import type { HelpElementReference } from "./gxuris-types";
import MarkdownHelpPopovers from "./MarkdownHelpPopovers.vue";
function rewriteGxUris(ref: Ref<HTMLDivElement | undefined>, internalHelpReferences: Ref<HelpElemen... |
164e4cd0f80fe8b47b48e87b7b04aa093ede5710bc283d219402880d31a69db5 | TypeScript | 1,962 | 58 | import "@tests/vitest/mockHelpPopovers";
import { getLocalVue } from "@tests/vitest/helpers";
import { setupMockConfig } from "@tests/vitest/mockConfig";
import { mount } from "@vue/test-utils";
import flushPromises from "flush-promises";
import { describe, expect, it } from "vitest";
import { setupSelectableMock } f... |
701df9fa26695695c60886d254f1922c20fd609f8d78655364659a13d16f02d2 | TypeScript | 1,966 | 67 | import { getLocalVue } from "@tests/vitest/helpers";
import { flushPromises, mount } from "@vue/test-utils";
import { createPinia, setActivePinia } from "pinia";
import { beforeEach, describe, expect, it } from "vitest";
import { useServerMock } from "@/api/client/__mocks__";
import type { MyHistory } from "@/api/hist... |
520a14cb3a2cb428b8f67604f306d0b35c49bc09f4fe3f04d26bf7bd8b0a186e | TypeScript | 1,973 | 51 | import { describe, expect, it } from "vitest";
import type { SampleSheetColumnDefinition } from "@/api";
import { parseSampleSheetValue } from "./useSampleSheetGrid";
function column(type: SampleSheetColumnDefinition["type"], extra: Partial<SampleSheetColumnDefinition> = {}) {
return { name: "column", type, opti... |
076d9771dccccdc72699baab9365faf62c43ce48d36995e7fc3965351a5128a6 | TypeScript | 1,983 | 58 | import { getLocalVue } from "@tests/vitest/helpers";
import { shallowMount } from "@vue/test-utils";
import { createPinia } from "pinia";
import { describe, expect, it } from "vitest";
import type { RegisteredUser } from "@/api";
import { useUserStore } from "@/stores/userStore";
import HistoryNavigation from "./Hist... |
c205e7656252fed3b227d354bb8340dd52a1982631b9925bc1d14aafa5a2aec4 | TypeScript | 1,984 | 58 | import "@tests/vitest/mockHelpPopovers";
import { getLocalVue } from "@tests/vitest/helpers";
import { setupMockConfig } from "@tests/vitest/mockConfig";
import { mount } from "@vue/test-utils";
import flushPromises from "flush-promises";
import { describe, expect, it } from "vitest";
import { setupSelectableMock } f... |
7795d19d66bba3b84a379039662d4fa55e2f724330b7631dfb8b8e9c61d4d257 | TypeScript | 1,988 | 64 | import { useEffect, useRef } from "react";
import { trackEvent } from "@/utils/matomo";
// Views shorter than this are scrolling past, not reading.
const MIN_VIEW_SECONDS = 2;
/*
* Reports how long a section stayed at least half on screen, in one event
* sent when the section goes away, so a chart that is looked at... |
d97c5c6092c82b9cf14b36c7feabd821a6c46589eba6eaf6160c19600c6bb9e4 | TypeScript | 1,989 | 52 | import { getLocalVue, nth } from "@tests/vitest/helpers";
import { shallowMount } from "@vue/test-utils";
import { describe, expect, it } from "vitest";
import ObjectStoreBadge from "./ObjectStoreBadge.vue";
import ObjectStoreBadges from "./ObjectStoreBadges.vue";
const localVue = getLocalVue(true);
const TEST_MESSA... |
82c8d457b31dfc15e0ec201fb707be608c3460f3422c3912b8812d8f60064e54 | TypeScript | 1,996 | 59 | import { getLocalVue } from "@tests/vitest/helpers";
import { mount } from "@vue/test-utils";
import { beforeEach, describe, expect, it, vi } from "vitest";
import { ref } from "vue";
import ThemeSelector from "./ThemeSelector.vue";
const currentTheme = ref("blue");
const settingTheme = ref(false);
const setCurrentTh... |
559e042c542a67925499a48d9cad5ff9785bed5d2de64b12ab1f9bb96049a26a | TypeScript | 1,998 | 60 | import type { Middleware } from "openapi-fetch";
import { REQUEST_ID_HEADER } from "@/api/staleCacheRetry";
import { statusMessage } from "@/utils/simple-error";
/** The error shape Galaxy's API returns. */
interface NormalizedApiError {
err_msg: string;
err_code: number;
}
function isGalaxyError(response: R... |
bc4e45ad7924492b5dd06c74f210fcadbd91b7e5997ae42ff5d8479175ead8c9 | TypeScript | 2,000 | 56 | import { getLocalVue } from "@tests/vitest/helpers";
import { mount } from "@vue/test-utils";
import { describe, expect, it } from "vitest";
import type { WorkflowLabel } from "./Editor/types";
import LabelSelector from "./LabelSelector.vue";
const localVue = getLocalVue();
const LABELS: WorkflowLabel[] = [
{ l... |
91a122e89fe84fa0aa8b31d92fe4661370b231ada580c27cfe90c94df23da16e | TypeScript | 2,028 | 63 | import { computed, type ComputedRef, type Ref } from "vue";
import type { CollectionCreationState } from "./collectionTypes";
/**
* Composable for determining if upload items are ready to be uploaded.
* Consolidates validation logic across multiple upload methods.
*
* @example
* ```typescript
* const hasItems =... |
a0e2c345572954fc06d3cde0c8b51db40414e0aa50da596710433b974a9f3762 | TypeScript | 2,032 | 57 | import { getLocalVue } from "@tests/vitest/helpers";
import { mount, type VueWrapper } from "@vue/test-utils";
import flushPromises from "flush-promises";
import { createPinia } from "pinia";
import { afterEach, beforeEach, describe, expect, it } from "vitest";
import { defineComponent, h } from "vue";
import { HttpRe... |
414455a106bae096f102351e03db2ab9b97b3916d532c359b709987cad25eb72 | TypeScript | 2,034 | 59 | import type { DataOption } from "@/components/Form/Elements/FormData/types";
import type { UploadedDataset } from "@/composables/upload/uploadItemTypes";
import type { UploadMethod } from "./types";
export type { UploadedDataset } from "@/composables/upload/uploadItemTypes";
/**
* Subset of UploadMethod that direct... |
ab4b0fbee804f37c755315230c4a4fb8005ff18991190aa72c46e9ec70018160 | TypeScript | 2,045 | 69 | import { faAws, faPython } from "@fortawesome/free-brands-svg-icons";
import { faCloud, faHdd, faNetworkWired, type IconDefinition } from "font-awesome-6";
import type { components } from "@/api/schema";
import { contains } from "@/utils/filtering";
const typeMessage = (type: string) => `This template produces a new ... |
fa0f9898f09beca3294abba7daafaf64d5c6284e946493c8f6a9d9d5cbe74f23 | TypeScript | 2,046 | 59 | import { describe, expect, it } from "vitest";
import EXPRESSION_SPECIFICATIONS from "./when_expression_spec.yml";
import { analyzeInputReferences, expressionReferencesInput } from "./whenExpression";
import type { InputPath } from "./workflowInputPath";
type InputTarget = string | InputPath;
interface ExpressionExp... |
b75ac08b38769020e4e5266eae32c169e60ce8d97491be016ff600768733dea5 | TypeScript | 2,050 | 72 | import { defineStore } from "pinia";
import { ref } from "vue";
import { GalaxyApi } from "@/api";
import { errorMessageAsString } from "@/utils/simple-error";
interface ClaimState {
workflowId: string | null;
instance: boolean;
requestState: { [key: string]: unknown } | null;
errorMessage: string | n... |
6001322d86ae11651e5109c7f78b5221ac711a74eb8ca81b3123acfdeda7f120 | TypeScript | 2,051 | 62 | import axios from "axios";
import { createPinia, setActivePinia } from "pinia";
import { beforeEach, describe, expect, it, vi } from "vitest";
import { type Tool, useToolStore } from "./toolStore";
vi.mock("axios", () => ({
default: {
get: vi.fn(),
},
}));
vi.mock("@/components/ToolsList/utilities", ... |
b013946e0b091bd3596b01d68be71a709afb825f6f9580b65aa1655453695cea | TypeScript | 2,052 | 64 | /**
* Shared SVG path generation utilities for graph edge rendering.
*
* - curveBasisPath: smooth bezier curves via d3 curveBasis (used by the workflow editor)
* - computeControlPoints: bezier control points for a connection between two endpoints
*/
import { curveBasis, line } from "d3";
// ── curveBasis renderi... |
49856e3011bdac1a6c837de983d9025009aea3f8641a35edf438f0da65fc31a2 | TypeScript | 2,054 | 71 | /*
vueuse local storage has some strange, buggy side-effects,
so were re-implementing just the parts we need here
*/
import { type Ref, ref, watch } from "vue";
import { match } from "@/utils/utils";
function stringify(value: unknown): string {
if (typeof value !== "object") {
return `${value}`;
... |
b3bfa894653b58c2c77cec73e6feeb06196537168272c68955f37e2812ea3fc3 | TypeScript | 2,062 | 58 | import { beforeEach, describe, expect, it } from "vitest";
import type { ObjectStoreTemplateType } from "@/api/objectStores";
import { useObjectStoreInstancesStore } from "@/stores/objectStoreInstancesStore";
import { setupTestPinia } from "./testUtils";
const type = "aws_s3" as ObjectStoreTemplateType;
const UUID =... |
3bd01c7dbe9e4f4983af74cf2eb988bee1c452c7e31dad43ee039b15342e3510 | TypeScript | 2,064 | 67 | import { createTestingPinia } from "@pinia/testing";
import { getLocalVue } from "@tests/vitest/helpers";
import { shallowMount } from "@vue/test-utils";
import { beforeEach, describe, expect, it, vi } from "vitest";
import { setMockConfig } from "@/composables/__mocks__/config";
import Register from "./Register.vue"... |
433cfb832dd8cf8d7c8d37222f3303016c5310cc0c5bd8b15c6a65f3e8d3486c | TypeScript | 2,070 | 74 | import { computed, type Ref } from "vue";
import type { components } from "@/api/schema";
import { useConfigStore } from "@/stores/configurationStore";
export type HelpForumTopic = components["schemas"]["HelpForumTopic"];
export type HelpForumPost = components["schemas"]["HelpForumPost"];
export type HelpForumSearc... |
9858c47888fef13f71d75a18264c162b9daaafbd1281a237ae5aabf9ea8b3605 | TypeScript | 2,077 | 60 | import { createTestingPinia } from "@pinia/testing";
import { getLocalVue } from "@tests/vitest/helpers";
import { shallowMount } from "@vue/test-utils";
import flushPromises from "flush-promises";
import { setActivePinia } from "pinia";
import { describe, expect, it, vi } from "vitest";
import { useServerMock } from ... |
c5fa64f9b5bcf2f05ab5d345d059c6e42315d373d3ab22b85465943722aeb307 | TypeScript | 2,082 | 62 | import { describe, expect, it } from "vitest";
import { TOOL_SOURCE_SCHEMA_URI, withMarkdownDescriptions } from "./schemaMarkdown";
import TOOL_SOURCE_SCHEMA from "./ToolSourceSchema.json";
describe("schema Markdown descriptions", () => {
it("keeps the schema identity used by the YAML worker", () => {
exp... |
70d776c31665b66ddd6de871a7f99c90e765baec781c25e7a452eb0810a4ccef | TypeScript | 2,091 | 52 | import { getLocalVue } from "@tests/vitest/helpers";
import { mount } from "@vue/test-utils";
import { describe, expect, it } from "vitest";
import type { CollectionCreationState } from "@/composables/upload/collectionTypes";
import CollectionCreationConfig from "./CollectionCreationConfig.vue";
import GCheckbox from... |
4bcc126f0f9db63f9aa64993a0b5e9f5ad84c6009ff68401d8dd3605d411548c | TypeScript | 2,100 | 63 | import { afterEach, beforeEach, describe, expect, it, vi } from "vitest";
import { LIST_REFRESH_INTERVAL_MS, markListRefreshed, refreshListWhenStale, resetListRefreshTracking } from "./refresh";
describe("palette list refresh", () => {
beforeEach(() => {
resetListRefreshTracking();
vi.useFakeTimer... |
2a32296b14f5ce868b077a9a4740b5f697c39fa27b99827dafca1713c7b3bcd9 | TypeScript | 2,106 | 51 | import { createTestingPinia } from "@pinia/testing";
import { getLocalVue } from "@tests/vitest/helpers";
import { shallowMount, type VueWrapper } from "@vue/test-utils";
import flushPromises from "flush-promises";
import { beforeEach, expect, it, vi } from "vitest";
import { ref } from "vue";
import InvocationGraph f... |
cce5f555bab63b134c33e6c31f8e7e550470e5eed03262ff3a200711fe9a4597 | TypeScript | 2,108 | 48 | import type { components } from "@/api/schema";
export type DatatypesCombinedMap = components["schemas"]["DatatypesCombinedMap"];
export class DatatypesMapperModel {
datatypes: DatatypesCombinedMap["datatypes"];
datatypesMapping: DatatypesCombinedMap["datatypes_mapping"];
constructor(typesAndMapping: Dat... |
9029ab92c8893cad258e95fa3bca9c54f95b67e3ed91c7f83f8dab7adf1989cb | TypeScript | 2,111 | 70 | const STATES = {
/** deleted while uploading */
DISCARDED: "discarded",
/** remote dataset not ingested yet */
DEFERRED: "deferred",
/** dataset has been deleted */
DELETED: "deleted",
/** dataset is being been deleted */
DELETING: "deleting",
/** has no data */
EMPTY: "empty",
... |
98b297bbaff11b20232a3f52294e05d458dbb66dd39a465aeedd42af424ec98b | TypeScript | 2,125 | 56 | import StorageManager from "@/components/User/DiskUsage/Management/StorageManager.vue";
import StorageDashboard from "@/components/User/DiskUsage/StorageDashboard.vue";
import HistoriesStorageOverview from "@/components/User/DiskUsage/Visualizations/HistoriesStorageOverview.vue";
import HistoryStorageOverview from "@/c... |
97ab9289fc8b52992e1b11a0ac962bc03ade700b82285cf1bf97bc3de6f7941f | TypeScript | 2,131 | 63 | function trimTrailingSlash(value: string): string {
return value.endsWith("/") ? value.slice(0, -1) : value;
}
/**
* Build a URL on the auth endpoints. Returns `null` when `VITE_API_URL` is
* not configured (typically a local `pnpm dev` session with no `.env`),
* so callers can render a disabled control instead... |
fbf6494c49d0dd281a099fba5333eb439a9ad4fb0190c0372bf1a22836d41029 | TypeScript | 2,131 | 75 | /**
* Model to track selected URI for FilesDialog - mirroring DataDialog's model.
*/
import { isSubPath } from "@/components/FilesDialog/utilities";
import type { SelectionItem } from "@/components/SelectionDialog/selectionTypes";
interface ModelOptions {
multiple?: boolean;
}
export class Model {
private v... |
7fc93ffc5ee0527bc6a1eb4990a3e63185aa3f02050621f620888288c6d02812 | TypeScript | 2,132 | 68 | import { describe, it, expect, vi, beforeEach } from "vitest";
import { createGalaxyApi } from "./client";
// Create a mock API client for testing
const mockApiClient = {
GET: vi.fn(),
POST: vi.fn(),
PUT: vi.fn(),
DELETE: vi.fn(),
PATCH: vi.fn(),
};
// Mock createClient before importing
vi.mock("o... |
57ecc49c5d7350a8330d2182c86344ba5bd638f9470433b2b391de5498276a7a | TypeScript | 2,134 | 56 | import { describe, expect, it } from "vitest";
import { columnTitleToTargetType, forBuilder } from "./fetchWorkbooks";
import SPECIFICATIONS from "./rule_target_column_specification.yml";
import type { ColumnMappingType, ParsedFetchWorkbook } from "./types";
describe("forBuilder", () => {
it("should return the co... |
e19fca7adc4f6c4b6d261ec6bc0ee34b1f88e9e56f4a385701746a92d68b0266 | TypeScript | 2,141 | 69 | import { createTestingPinia } from "@pinia/testing";
import { getFakeRegisteredUser } from "@tests/test-data";
import { getLocalVue } from "@tests/vitest/helpers";
import { mount } from "@vue/test-utils";
import { describe, expect, it, vi } from "vitest";
import { ref } from "vue";
import { createMemoryHistory, createR... |
31228a54b2fe38a7b8a86aff1024f0eeed2fe2683bf8ce6e236b15d4ccfd71a9 | TypeScript | 2,147 | 55 | // Positive tabindex values are rare enough here that document order stands in for the full sequential focus order.
const FOCUSABLE_SELECTOR = [
"a[href]",
"area[href]",
"button:not([disabled])",
'input:not([disabled]):not([type="hidden"])',
"select:not([disabled])",
"textarea:not([disabled])",
... |
c90b37fb9ed343b2387888e984df8cfd16b645a28df549a9ea1297acbeba2141 | TypeScript | 2,161 | 61 | import { nth } from "@tests/vitest/helpers";
import { mount } from "@vue/test-utils";
import { beforeEach, describe, expect, it, vi } from "vitest";
import { ref } from "vue";
import { setMockConfig } from "@/composables/__mocks__/config";
import { useFileSources } from "@/composables/fileSources";
import OnCompleteA... |
3333f221cbf213de1e8086123ba4323dab78e7bdf5dbeb942478ae3dc37f0475 | TypeScript | 2,184 | 90 | import type { IconDefinition } from "@fortawesome/fontawesome-svg-core";
import type { GalaxyConfiguration } from "@/stores/configurationStore";
import type Filtering from "@/utils/filtering";
export interface Action {
title: string;
icon?: IconDefinition;
handler: () => void;
}
export type ActionArray =... |
542f31e69d527ba9e8af82067e5a9ecb52b3aab18abeb93b924bed255ee7f484 | TypeScript | 2,207 | 69 | import type { UseElementBoundingReturn } from "@vueuse/core";
import { type Ref, ref, unref, watch } from "vue";
import { useAnimationFrameThrottle } from "@/composables/throttle";
import { AxisAlignedBoundingBox } from "@/utils/geometry";
/**
* Constructs a bounding box following the editors pan and zoom in
* anim... |
eac793344b290cc57c594306273f88d43178267efb26b9f3495ff33bdde588b7 | TypeScript | 2,218 | 62 | import flushPromises from "flush-promises";
import { createPinia, setActivePinia } from "pinia";
import { beforeEach, describe, expect, it, vi } from "vitest";
import type { DatasetCollectionAttributes } from "@/api";
import { useServerMock } from "@/api/client/__mocks__";
import { useCollectionAttributesStore } from... |
0b9f10d6d99b2d003ef0d4263a5450f0bc9ded2cae2deef303e5855c38b7cef5 | TypeScript | 2,219 | 55 | /** length of const array or tuple */
export type Length<T extends any[] | readonly any[]> = T["length"];
/** build a tuple with length L, and type T */
export type Tuple<L extends number, T = any, R extends T[] = []> = R extends { length: L } ? R : Tuple<L, T, [...R, T]>;
/** adds two constant positive whole number ... |
ec56c897f182515e516b522622980ec0630b59e0c89fac4a1195d22792a8f63c | TypeScript | 2,226 | 63 | import { computed, toRef, watch } from "vue";
import { useDatatypesMapperStore } from "@/stores/datatypesMapperStore";
interface PropsWithOptionalExtensions {
extensions?: string[];
}
interface ElementHasExtension {
extension: string | null | undefined;
}
export type ShowElementExtensionFunction = (element:... |
4766f79ce77ce8e83b04a85a1441d474eca97d2cd6dbe006825336995327a3f4 | TypeScript | 2,235 | 58 | import { getLocalVue } from "@tests/vitest/helpers";
import { mount } from "@vue/test-utils";
import { describe, expect, it } from "vitest";
import GDropdownItem from "./GDropdownItem.vue";
const localVue = getLocalVue(true);
/** Click the item and report whether the navigation was cancelled. */
async function click... |
bfce6a53ebe5d706aa5cd7e4a5a8672c0b899a1bfab05d1d1f27df0f32fc453d | TypeScript | 2,247 | 67 | import { describe, expect, it } from "vitest";
import RuleDefs from "@/components/RuleBuilder/rule-definitions";
import SPEC_TEST_CASES from "./rules_dsl_spec.yml";
function applyRules(rules: Array<any>, data: Array<Array<string>>, sources: Array<number>) {
const columns = Array(data[0]?.length).fill("new");
... |
22173de2312c6795c3bdb36c103b443f4926bb1b7a0d3c5b0566fa2b6e74987d | TypeScript | 2,253 | 81 | import { z, ZodTypeAny } from "zod";
import { ApiError, ValidationError } from "./errors";
const API_BASE = import.meta.env.VITE_API_URL;
async function throwApiError(
response: Response,
endpoint: string,
): Promise<never> {
let detail = `${response.status} ${response.statusText}`;
try {
cons... |
f8e0e867e9d5b1044485023a6addf97e8772c9faa558f8d9f4621a3ad5adb46d | TypeScript | 2,265 | 56 | /**
* Stale-while-revalidate for the store backed palette lists.
*
* Every scoped provider (workflows, histories, reports, visualizations, datasets,
* invocations) hydrates its store once and then answers keystrokes from that
* cache. Without this helper the cache would stay as old as the first palette
* use for ... |
ffa3dd9487938a79a40e2324b4dc69aaca18c5ad6bf8b9e4e442d9b695b9815a | TypeScript | 2,269 | 73 | import type { ZoomTransform } from "d3-zoom";
import { inject, onScopeDispose, type Ref, ref, watch } from "vue";
/**
* Observe a section of the dom tree using a resize observer
* @param child child node to start observation from
* @param root root node to observe
* @param observer resize observer to preform the o... |
2f06cd4c67c5fa9598e266afe8bf6cdd0c93441c2d2d017d4b447a4f511b3a75 | TypeScript | 2,275 | 49 | import type { PaletteContext } from "../types";
import { findScope, isScopeAvailable, type ScopeDefinition } from "./scopes";
/** A root-row tab; all but "All" narrow to one provider through the scope they borrow */
export interface PaletteCategory {
/** Unique, also the suffix of the row's `data-description` */
... |
b4063db035dc9d4c7926220f72f54e9c9b5f3b3830b295575e0bad5052e6e205 | TypeScript | 2,282 | 83 | import { type MaybeRefOrGetter, toValue } from "@vueuse/core";
import { nextTick, onMounted, onUnmounted, readonly, type Ref, ref, watch } from "vue";
/**
* Generic round-robin selector for a list of items.
* @param items - a Ref, computed, or raw array of items to select from
* @param pollInterval - ms between swi... |
d10da07b894b1795387287a5693955dc599a059a06d866628458593d7cef8f86 | TypeScript | 2,288 | 69 | import type { components } from "@/api/schema";
import type { CleanableSummary } from "./CleanableSummary";
import type { CleanupResult } from "./CleanupResult";
export type CleanableItem = components["schemas"]["StoredItem"];
export type SortableKey = "name" | "size" | "update_time";
type StoredItemOrderBy = compone... |
4fcac22943d0f0e3f15dfb7d54f6ff3cbb2349abf64678a27b7137756cb6b46d | TypeScript | 2,292 | 52 | import { getLocalVue } from "@tests/vitest/helpers";
import { mount } from "@vue/test-utils";
import { describe, expect, it, vi } from "vitest";
import ClickToEdit from "./ClickToEdit.vue";
describe("ClickToEdit accessibility", () => {
it.each(["enter", "space"])("starts editing with the %s key and saves the name... |
6aca890904605dae7f0fb54f7d1e123bb771748345357622258fdbce8c443d53 | TypeScript | 2,298 | 86 | import * as Sentry from "@sentry/vue";
import type { App } from "vue";
import type { Router } from "vue-router";
interface GalaxyConfig {
sentry_dsn_public?: string;
sentry_client_traces_sample_rate?: number;
version_major: string;
version_minor?: string;
}
interface GalaxyUser {
get(attr: string)... |
86bb5c188e762df0ef857c45e2f3655c0688eb4bebc2d38a333bafb0b7254c94 | TypeScript | 2,302 | 47 | //////////////////////////////////////////////////////////////////////////////
// EMISSIONS KGCO2 EQUIVALENT
//////////////////////////////////////////////////////////////////////////////
// Source: https://www.iea.org/data-and-statistics/charts/co2-total-emissions-per-capita-by-region-2000-2023
const US_CITIZEN_YEARL... |
688efa896d43c980627d1676022d7265fef896bdf3fbb5ff4818c79bd74e5737 | TypeScript | 2,311 | 62 | import { describe, expect, it, vi } from "vitest";
import { createMemoryHistory, createRouter, type RouteLocationNormalizedLoaded } from "vue-router";
import AdminRoutes from "./admin-routes";
vi.mock("@/app", () => ({
getGalaxyInstance: () => ({
config: {
registration_warning_message: "warnin... |
83cc24e5f4f8f51ce266a1829cd20c1bd0d968a997f8a39cf31ab7fb3a451ac9 | TypeScript | 2,313 | 52 | import { createPinia, setActivePinia } from "pinia";
import { describe, expect, it, vi } from "vitest";
import { defineComponent, h, nextTick } from "vue";
import { useUploadMethodModal } from "./useUploadMethodModal";
vi.mock("@/components/Panels/Upload/UploadMethodModal.vue", () => ({
default: defineComponent({... |
52bbcfaa9496e256ce096ce858673914a8b900da842883c8addc0f36cd340163 | TypeScript | 2,323 | 61 | import { describe, expect, it } from "vitest";
import { extractEmbeddedJs } from "./extractEmbeddedJs";
describe("extractEmbeddedJs", () => {
it("should extract single JavaScript fragment", () => {
const input = "Text before $(simple) text after.";
const result = extractEmbeddedJs(input);
... |
b5b2a7697372e77057c39d13a46518faa677b3c46fc33aef938c8334c57d31bc | TypeScript | 2,327 | 77 | import Filtering, { contains, equals, expandNameTag, toBool } from "@/utils/filtering";
export function getHistoryListFilters(activeList: "my" | "shared" | "published" | "archived" = "my") {
const validFilters = {
name: {
placeholder: "name",
type: String,
handler: conta... |
c33bee9cd1d759c0ec01db1e9a1e56c572241b2d138129db99be73fbc05ea287 | TypeScript | 2,340 | 69 | import { mount, type VueWrapper } from "@vue/test-utils";
import { afterEach, describe, expect, it, vi } from "vitest";
import { nextTick } from "vue";
import GTooltip from "./GTooltip.vue";
const floatingUi = vi.hoisted(() => ({ stopTracking: vi.fn() }));
vi.mock("@floating-ui/dom", () => ({
computePosition: ()... |
4a78c22e571ce6b96d08b4fc69387867998669e940329efde5f21d8150ba86c2 | TypeScript | 2,345 | 71 | import { createPinia, setActivePinia } from "pinia";
import { beforeEach, describe, expect, it } from "vitest";
import { useJobMetricsStore } from "./jobMetricsStore";
describe("stores/jobMetricsStore", () => {
const testPlugin = { plugin: "core", value: "123", title: "foo", name: "bar", raw_value: "raw-chicken" ... |
c2e1057d2dd4fec3dde0dafd12876df94c2c363abd80b91ce7ef2bfa00c32112 | TypeScript | 2,348 | 56 | import { describe, expect, it } from "vitest";
import { makeCtx } from "../test-utils";
import { ALL_CATEGORY, availableCategories, categoryProviderId, PALETTE_CATEGORIES } from "./categories";
import { paletteProviders } from "./index";
describe("PALETTE_CATEGORIES", () => {
it("names a registered provider for e... |
add76952ee35fc35ce10c2cb3f2177468b49c8839f44a4e47f6a03e5a70fa12c | TypeScript | 2,354 | 58 | /**
* Shared ``AbortController`` used by both the axios interceptor and the
* ``openapi-fetch`` middleware so we can cancel every in-flight request in
* one shot right before a login/register navigation.
*
* Why this exists: when the server processes a request that carries the old
* anonymous ``galaxysession`` co... |
3246b9299a319e18f2a98133adb1eab5889777e6a429c735072a90ea1911adb1 | TypeScript | 2,356 | 65 | import { defineStore } from "pinia";
import { ref } from "vue";
import type { HistoryItemSummary } from "@/api";
import type { ShowElementExtensionFunction } from "@/components/Collections/common/useExtensionFilter";
/**
* Stores the history items selected for collection building.
*/
export const useCollectionBuild... |
973e5b0c5d07e0ed84a22f975c2ab750f0af4823c1a6d03ddb5fe98e80550630 | TypeScript | 2,362 | 71 | import type { BrowsableFilesSourcePlugin, RemoteEntry } from "@/api/remoteFiles";
import { USER_FILE_PREFIX } from "@/utils/url";
import type { SelectionItem } from "../SelectionDialog/selectionTypes";
export const isSubPath = (originPath: string, destinationPath: string) => {
return subPathCondition(ensureTraili... |
947054f414506a59cc988042b6b167d215670c52e2ff2908668521e4a402954a | TypeScript | 2,373 | 79 | import { type MaybeRefOrGetter, toValue } from "@vueuse/core";
import { ref, watch } from "vue";
import { DEFAULT_TOOLTIP_HOVER_DELAY_MS, useDelayedAction } from "../utils/tooltipTiming";
interface AccessibleHoverOptions {
showDelayMs?: number;
delayFocusEnter?: boolean;
}
export function useAccessibleHover(... |
63adcbc349b1b8b3a51b1f934c9ed719622d8b45df2ce521636e76ef449724b6 | TypeScript | 2,377 | 74 | import type { WorkflowLabel } from "@/components/Markdown/Editor/types";
import REQUIREMENTS from "./requirements.yml";
export function getRequiredLabels(objectType: string | null) {
switch (objectType) {
case "history_dataset_id":
return ["input", "output"];
case "history_dataset_coll... |
ce24e4e72e3a816dd3f73dc65552027a59563e3e80e01c57ffe7e53826f2c256 | TypeScript | 2,400 | 60 | import { getLocalVue } from "@tests/vitest/helpers";
import { flushPromises, mount } from "@vue/test-utils";
import { describe, expect, it, vi } from "vitest";
import { sanitizeHtml } from "@/directives/sanitizeHtml";
import TrsTool from "./TrsTool.vue";
describe("TrsTool", () => {
it("renders the registry descr... |
1b90b1e64d99bc0f97c14ef00a69d90613f3e8754b0271d14277102ba5dcae7e | TypeScript | 2,416 | 75 | import { type Ref, ref, watch, type WatchSource } from "vue";
import { GalaxyApi } from "@/api";
import type { HistoryGraphResponse } from "./historyGraphMapper";
/**
* Fetch the history-scoped graph from the API.
*
* The default call returns the full history graph (within bounds).
* An optional (seedSrc, seedId... |
15b129c3667c58c4aebc04e1ec00f60d2a6453abccc856fc739d3ba4984fa99d | TypeScript | 2,420 | 83 | 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 { getOIDCIdpsWithRegistration, type OIDCConfig } from "./ExternalIDHelper";
import ExternalRegistration fr... |
e4be4c142c0a3d60d277ba3a3379c2cbe4250df121e60756b3a5bfe0b7b51ad8 | TypeScript | 2,423 | 81 | import RAW_DIRECTIVE_DATA from "./directives.yml";
export type DirectiveMode = "page" | "report";
type DirectiveMetadataValueByMode = {
[key: string]: string;
};
interface DirectiveParameter {
type: string;
context?: string;
description?: string;
default?: string | boolean;
values?: string[];... |
f61def9ed6bbe4eeb355c814b14e0ff5eba523e02c4f546abae1032ef7c6bef3 | TypeScript | 2,427 | 68 | import { defineStore } from "pinia";
import { computed, ref } from "vue";
import { GalaxyApi } from "@/api/client";
import type { JobMetric } from "@/api/jobs";
import { rethrowSimpleWithStatus } from "@/utils/simple-error";
export const useJobMetricsStore = defineStore("jobMetricsStore", () => {
const jobMetrics... |
5156b608ce12ea85fe032dd8a7fce0799a490290bfa17a376c0472bba4579d9f | TypeScript | 2,432 | 70 | import { beforeEach, describe, expect, it, vi } from "vitest";
import type { RouteLocationNormalized } from "vue-router";
import { getGalaxyInstance } from "@/app";
import { redirectToUrl } from "@/utils/redirect";
import { redirectLoggedIn } from "./guards";
vi.mock("@/app");
vi.mock("@/utils/redirect", async (impo... |
384a6a74c5072e6142452a719de59306947b9e6cb398cb718204e3d0cb04f51e | TypeScript | 2,435 | 78 | import { fetchApi, fetchApiVoid } from "./client";
import {
Organization,
OrganizationSchema,
OrganizationReport,
OrganizationReportSchema,
} from "./schemas";
import { DateRange } from "react-day-picker";
export async function getOrganizationEmissionsByProject(
organizationId: string,
dateRang... |
4a03bd9b21f8cd4b32563c6479d5fca5710cc624075014b7b366ebc7b7e9f886 | TypeScript | 2,448 | 66 | import { useEventListener } from "@vueuse/core";
import { computed, ref } from "vue";
import { useEventStore } from "@/stores/eventStore";
function isNewTabModifier(key: string) {
return key === "Meta" || key === "Control";
}
/** Whether the key stands for a character, the way a shifted letter does */
function i... |
e582bce7c27061bd142918329669c67bb70bd24d9a4ab29370bcd138172f0e75 | TypeScript | 2,460 | 71 | import { format, formatDistanceToNow, parseISO } from "date-fns";
/**
* Converts a Galaxy time string to a Date object.
* @param {string} galaxyTime - The Galaxy time string in ISO format.
* @returns {Date} The parsed Date object.
*/
export function galaxyTimeToDate(galaxyTime: string): Date {
// Galaxy doesn'... |
a9613ba6ea667a8225375899ba8ed50e9e79849d015fd585365b1a919bb8d10d | TypeScript | 2,463 | 95 | import { ExperimentReport } from "@/api/schemas";
import {
getEquivalentCarKm,
getEquivalentCitizenPercentage,
getEquivalentTvTime,
} from "./constants";
import { SECONDS_PER_DAY } from "./time-constants";
export type RadialChartData = {
energy: { label: string; value: number };
emissions: { label:... |
eb22c7e2dcaa30f66a077037ec54e697d34bf064f54a48d914bac029d269f3d0 | TypeScript | 2,464 | 67 | import { defineStore } from "pinia";
import { GalaxyApi } from "@/api";
import type { ObjectStoreTemplateSummaries, ObjectStoreTemplateSummary } from "@/api/objectStores.templates";
import { errorMessageAsString } from "@/utils/simple-error";
import { canUpgrade, findTemplate, getLatestVersion, getLatestVersionMap } ... |
ab1064a13324ca0688c2e9bc33535804e99a9af6723a6fe5a7d59dd495c23455 | TypeScript | 2,476 | 68 | import { getLocalVue } from "@tests/vitest/helpers";
import { mount, type VueWrapper } from "@vue/test-utils";
import flushPromises from "flush-promises";
import { describe, expect, it } from "vitest";
import HistorySelectionStatus from "./SelectionStatus.vue";
const localVue = getLocalVue();
const SELECT_ALL_BTN = ... |
b7f7cf83b6253d3a9afd0700ecee762bb718f3a5887c32cf006cee67785fdfe3 | TypeScript | 2,484 | 62 | 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 ItemListEditor from "./ItemListEditor.vue";
describe("ItemListEditor", () => {
it("renders the descript... |
3dfde4baf6f9d02d2231cdc07cf14e6f68030ec9763305d5be9e1a60b2f60166 | TypeScript | 2,488 | 64 | import { getLocalVue } from "@tests/vitest/helpers";
import { mount } from "@vue/test-utils";
import { describe, expect, it } from "vitest";
import WhichBuilder from "./WhichBuilder.vue";
const localVue = getLocalVue();
function mountWhichBuilder(initialAdvanced = false, value = "list") {
return mount(WhichBuild... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.