sha256 stringlengths 64 64 | language stringclasses 28
values | size int32 1 491k | lines int32 1 23.2k | content stringlengths 1 200k |
|---|---|---|---|---|
6d0c03e4a7619af21e076bed196609b298db463e4c5e7fc32fd27699237c65ba | TypeScript | 221 | 4 | import type { InjectionKey } from "vue";
/** True below a component that is already a live region, so nested content can skip its own role. */
export const liveRegionKey: InjectionKey<boolean> = Symbol("g-live-region");
|
5f88f19b95d71b732c16eff1a902ba4f8be752bdf30637517bb87cfacf3cce43 | TypeScript | 225 | 10 | export interface PublishedItem {
name: string;
model_class?: string;
owner?: string;
username?: string | null;
email_hash?: string;
author_deleted?: boolean;
tags?: string[];
title?: string;
}
|
1ef5ad65e2f5def66723b9d7b25328f5589db6b5f35c349fe76896660b42df88 | TypeScript | 231 | 9 | export {
type ColorVariant,
type ComponentColor,
type ComponentColorClassList,
type ComponentSize,
type ComponentSizeClassList,
type ComponentVariantClassList,
prefix,
} from "@galaxyproject/galaxy-ui";
|
cfe43ff38fc905d11cc4191cf3050d4542418f1305e73ff688972d7cca050777 | TypeScript | 240 | 9 | import { defineStore } from "pinia";
import { ref } from "vue";
export const useUploadStore = defineStore("upload", () => {
const percentage = ref<number>(0);
const status = ref<string>("");
return { percentage, status };
});
|
e63b20202931c6a3dacb0b7595a3821b5d75b4d4bdda183cbb8df1df76477b5e | TypeScript | 248 | 11 | import { buildQuickStartExample } from "./authoringHelpTypes";
export const NEW_TOOL_YAML = buildQuickStartExample();
export const CLEAR_TOOL_YAML = `class: GalaxyUserTool
name:
version: "0.1.0"
container:
shell_command:
inputs: []
outputs: []`;
|
1996497dfb296e07a22659aa5050cd85fcc6e4de81e897f694496274ae4a679b | TypeScript | 253 | 4 | import type { InjectionKey } from "vue";
/** Closes the enclosing dropdown menu; `restoreFocus` (default true) moves focus back to its toggle. */
export const dropdownHideKey: InjectionKey<(restoreFocus?: boolean) => void> = Symbol("g-dropdown-hide");
|
c0bbcd853347f8ae919ed3a4af5492cbca18600734ce4e86f12d52e2bb3f544d | TypeScript | 256 | 7 | import type { Step } from "@/stores/workflowStepStore";
const WorkflowInputs = ["data_input", "data_collection_input", "parameter_input"];
export function isWorkflowInput(stepType: Step["type"]): boolean {
return WorkflowInputs.includes(stepType);
}
|
e565b5770b6c7e89e5b616ac84b5aeb3a00037f131de7aec013f002569ee52c6 | TypeScript | 256 | 13 | export type {
FieldAlignment,
RowClickEvent,
RowIcon,
RowSelectEvent,
SortChangeEvent,
SortOrder,
TableAction,
TableClassValue,
TableEmptyState,
TableField,
TableItemClassMeta,
} from "@galaxyproject/galaxy-ui";
|
23048c054ae66835fc7e2f2871c7a8b9200907ac65ec4a217296007a000da21f | TypeScript | 258 | 12 | // Re-export from shared location
export type { ZoomLevel } from "@/utils/zoomLevels";
export {
getSnappedZoom,
getZoomInLevel,
getZoomOutLevel,
isMaxZoom,
isMinZoom,
maxZoom,
minZoom,
zoomLevels,
} from "@/utils/zoomLevels";
|
1b194adf02c20eba6941c673f7671b39329930cb68ab8b80a3365019cab1cef9 | TypeScript | 267 | 11 | /**
* Returns the path of the current or given URL.
*
* @param {string} [rawUrl=window.location.href]
* @returns {string}
*/
export function serverPath(rawUrl: string = window.location.href): string {
const url = new URL(rawUrl);
return url.pathname;
}
|
3f7f491af98ad347ddb4bcde3322340068a69250e5372d8da43ffd10d5fff29e | TypeScript | 271 | 11 | import { defineConfig } from "vite";
import react from "@vitejs/plugin-react";
import path from "path";
export default defineConfig({
plugins: [react()],
resolve: {
alias: { "@": path.resolve(__dirname, "./src") },
},
server: { port: 3000 },
});
|
d82b0d27a83aeb6b2ece4b9dc49fe90371a5e2aa2cd746bccb85a7fa01e12e4e | TypeScript | 278 | 6 | import type { DatasetStorageDetails } from "@/api";
import type { components } from "@/api/schema";
export type ConcreteObjectStoreModel = components["schemas"]["ConcreteObjectStoreModel"];
export type AnyStorageDescription = DatasetStorageDetails | ConcreteObjectStoreModel;
|
146b70d17bf4222a20da52c7b6733c57f1fd4e8e390b660eb77a08716d287b80 | TypeScript | 279 | 7 | // Wont be needed after migration to Vue 3
// https://github.com/leezng/vue-json-pretty/issues/57#issuecomment-750700424
declare module "vue-json-pretty" {
import { Component } from "vue/types/options";
const VueJsonPretty: Component;
export default VueJsonPretty;
}
|
b830978368f1b73e6c54c475304f17634af852659b91f706a2c044374224a74e | TypeScript | 279 | 4 | export { CleanableSummary } from "./CleanableSummary";
export type { CleanupCategory } from "./CleanupCategory";
export { type CleanableItem, type CleanupOperation, PaginationOptions, type SortableKey } from "./CleanupOperation";
export { CleanupResult } from "./CleanupResult";
|
4b20724baa0861e6bc2d0c4d81627cf7fa97f8e3a01728e98e7de329fc1bf0c3 | TypeScript | 284 | 11 | export interface MarkdownConfig {
content?: string;
errors?: Array<{ error?: string; line?: string }>;
generate_time?: string;
generate_version?: string;
id?: string;
markdown?: string;
model_class?: string;
title?: string;
update_time?: string;
}
|
af8c4bca32427978403211fc87e15f32e4446d333f486d1e461738b47bfa155a | TypeScript | 297 | 9 | /** One entry of GSelect's `options` prop. */
export interface SelectOption<T = unknown> {
/** Label shown for the option */
text: string;
/** Value bound to the select's v-model when the option is chosen */
value: T;
/** Disables this option only */
disabled?: boolean;
}
|
a4d5bc9360f1aa8c2500fec30d717b535a3922240f5a14c0ffbf2d212872bd5c | TypeScript | 299 | 9 | import { useToast } from "@galaxyproject/galaxy-ui";
export { type ToastOptions, type ToastVariant, useToast } from "@galaxyproject/galaxy-ui";
/**
* Direct export to simplify usage in Options Api component.
* Use 'useToast' for the Composition Api instead.
*/
export const Toast = useToast();
|
a7d9662404f01c792a8a5a1431c313cc05da253d0d330a46214abb7ad5b9cb88 | TypeScript | 305 | 8 | /** Lowercase dash-joined slug of `text`, or `fallback` when no usable character is left */
export function slugify(text: string, fallback: string): string {
const slug = text
.toLowerCase()
.replace(/[^a-z0-9]+/g, "-")
.replace(/^-+|-+$/g, "");
return slug || fallback;
}
|
d28cee6064ae79e2a375f9d0feadc99539561cd5005e870547460cf29f5b5100 | TypeScript | 306 | 11 | import { fetchApiJson } from "./client";
import { handleError } from "./errors";
export const fetcher = <T>(endpoint: string) => fetchApiJson<T>(endpoint);
export const swrConfig = {
onError: handleError,
dedupingInterval: 5000,
focusThrottleInterval: 30000,
revalidateOnFocus: false,
};
|
3e2f36b7f5a9f867dd3cbe9654e27e6b826629da9e60186035c6127dbf7191b4 | TypeScript | 323 | 6 | // DOMPurify does not produce reliable output under happy-dom, so unit tests
// get a pass-through spy: components can assert what they send to the
// sanitizer and that its result is what ends up in the DOM.
import { vi } from "vitest";
export const sanitizeHtml = vi.fn((html: string | null | undefined) => html ?? ""... |
a0255795f11f9df2665cd022d5a7dcc78f31757b46ad7f0d80aa17911569f063 | TypeScript | 324 | 10 | /** A promise whose settlement the test controls. */
export function deferred<T = unknown>() {
let resolve!: (value: T) => void;
let reject!: (reason: unknown) => void;
const promise = new Promise<T>((res, rej) => {
resolve = res;
reject = rej;
});
return { promise, resolve, reject }... |
cd18f5cf3b7a4d3a7674191f50f573e87487b454888b87e8c2354d1685fd9efc | TypeScript | 326 | 19 | export interface TrsSelection {
id: string;
label: string;
link_url: string;
doc: string;
}
export interface TrsToolVersion {
id: string;
name: string;
}
export interface TrsTool {
id: string;
name: string;
description: string;
organization: string;
versions: TrsToolVersion... |
f4f280ee655b404aef96740276ca3a5b319a8924d6a229ff66b626430c378a91 | TypeScript | 337 | 12 | export function generateId(): string {
return `msg-${Date.now()}-${Math.random().toString(36).substring(2, 11)}`;
}
export function scrollToBottom(container: HTMLElement | undefined): void {
if (container) {
container.scrollTo({
top: container.scrollHeight,
behavior: "auto",
... |
fd1b14a67d209b93692b974052c75c4cddbd1f18fdf4dc0be02c9733dcefbfa4 | TypeScript | 337 | 4 | // Own module, so Vue skips the runtime prop check: [String, null, Function] rejects elements and functions.
/** Element id, element, or getter such as `() => $refs.x` (a component resolves to its root element) */
// eslint-disable-next-line @typescript-eslint/no-explicit-any
export type PopoverTarget = string | Elemen... |
4e9eb55de6d831dbe1dfa8b5ba3174db7bcbd98815a646eaf92b97f17ae28a48 | TypeScript | 344 | 15 | import type { Ref } from "vue";
import { computed, unref } from "vue";
let idCounter = 0;
/**
* Returns a page-unique id with and optional reactive prefix
*/
export function useUid(prefix: string | Ref<string> = "") {
const id = idCounter;
idCounter += 1;
const uid = computed(() => `${unref(prefix)}${i... |
7516d5c599c5232c8e6fd2f9adec847fdc411953e909324aaa9aac507f5418e4 | TypeScript | 344 | 13 | import { computed, type Ref } from "vue";
import type { Instance } from "@/api/configTemplates";
export function useFiltering<T extends Instance>(allInstances: Ref<T[]>) {
const activeInstances = computed(() => {
return allInstances.value.filter((item: T) => !item.hidden);
});
return {
ac... |
69cb00fcaf20cd4c134ee87a8ba333d0c1e088e3045ef671af02dcabdb63f73e | TypeScript | 348 | 9 | import type { ExportParams } from "@/components/Common/models/exportRecordModel";
export type HistoryExportDestination = "download" | "remote-source" | "rdm-repository" | "zenodo-repository";
export interface HistoryExportData extends ExportParams {
destination: HistoryExportDestination;
remoteUri: string;
... |
63fc2bebde5c5ee272de70ddcc721c8ea998dff1486a0289877c34f5bbf47f2d | TypeScript | 354 | 12 | /**
* Converts a long tool ID to a short tool id.
* If the passed in ID is short already, returns it.
* @param longId long tool-id
* @returns short tool-id
*/
export function getShortToolId(longId: string): string {
const toolIdSlash = longId.split("/");
const shortId = toolIdSlash[toolIdSlash.length - 2];... |
28c9c21577105cb70bc5db630f7f512094fc5c3a73b65dcd3b38560126ef9da5 | TypeScript | 355 | 15 | import { computed } from "vue";
import { useConfig } from "./config";
export function useStorageLocationConfiguration() {
const { config } = useConfig();
const isOnlyPreference = computed(() => {
return !config.value || !config.value?.object_store_always_respect_user_selection;
});
return {
... |
c3940ee3c5530b745b2962668700d89ea8e3e12ef2ff0c68dd0fce10853cd326 | TypeScript | 371 | 13 | import type { BreadcrumbItem } from "@/components/Common";
/**
* Base breadcrumb for Upload-related views.
* Centralized to ensure consistent labeling (e.g. Beta status)
* across all upload methods and pages.
*/
export function getUploadRootBreadcrumb(to?: string): BreadcrumbItem {
return {
title: "Imp... |
2b3bbfbb229cc6263d37b2df428fdc10b0414ccaaf6e2f3487808c7af8930b4d | TypeScript | 374 | 19 | import type { IconDefinition } from "@fortawesome/fontawesome-svg-core";
import type { STATES } from "./states";
export type State = {
status: string;
text?: string;
icon?: IconDefinition;
spin?: boolean;
nonDb?: boolean;
};
export type States = {
[_key in keyof typeof STATES]: State;
};
exp... |
eb14f5be0e9909ac3de28c920e1af31542a01e6ef52bb2739b5c5fbe91563a78 | TypeScript | 374 | 11 | import { type MaybeRefOrGetter, toValue } from "@vueuse/core";
import { type Ref, watch } from "vue";
/** One-way sync source ref, computed or getter function to target ref */
export function useSync<T>(source: MaybeRefOrGetter<T>, target: Ref<T>) {
watch(
() => toValue(source),
(value) => (target.... |
d6dc6db6d0aab2f9ad0a87707cd85afca80f45a2406d781438e5598c1eefc38f | TypeScript | 376 | 13 | import { storeToRefs } from "pinia";
import { useUserStore } from "@/stores/userStore";
import { useHashedUserId as parentUseHashedUserId } from "./hashedUserId";
/**
* One way hashed ID of the current User
*/
export function useHashedUserId() {
const { currentUser: currentUserRef } = storeToRefs(useUserStore(... |
496121815bb905b530df359b26bb86cfce24eb6c79852b0169c422874fa76f7e | TypeScript | 385 | 14 | /**
* Parses a value to a boolean.
* Returns true for boolean `true` or the string `"true"` (case-insensitive).
* Returns false for everything else.
*/
export function parseBool(value: unknown): boolean {
if (typeof value === "boolean") {
return value;
}
if (typeof value === "string") {
... |
cc05eb694063d6074f3cfeb43d33f36b4f50b0872e6f9aa8ff2c5f0038e0a02d | TypeScript | 385 | 10 | /**
* Escapes all RegExp control characters from a string, so it can be matched literally
* @param string input string
* @returns string with all control characters escaped
*
* @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Regular_Expressions
*/
export function escapeRegExp(string: string) {
... |
fda24c87febf36660a9bfa1e1d632fc3855f12d9f549c955fa77b4cdb839e780 | TypeScript | 393 | 9 | // "vue" is aliased to @vue/compat at build time, and the compat build exports
// configureCompat. The real vue types declare it but don't export it. This file is
// a module (see the export below), so the block augments "vue" rather than
// replacing its types.
export {};
declare module "vue" {
export function co... |
225bace216277309f3e7292d1fc41cb28988185b51a9c764482c37dc45da65a7 | TypeScript | 399 | 11 | import { defineStore } from "pinia";
import { useScopePointerStore } from "./scopePointerStore";
export function defineScopedStore<ID extends string, S>(id: ID, setup: (scopeId: string) => S) {
return (scopeId: string) => {
const { scope } = useScopePointerStore();
return defineStore<`${ID}-${typ... |
492ef648e79821a6a7fd282749aace049acbeac224dc029de0e970dfc6ee369a | TypeScript | 402 | 18 | import { useRouter } from "vue-router";
export function buildInstanceRoutingComposable(index: string) {
return () => {
const router = useRouter();
async function goToIndex(query: Record<"message", string>) {
router.push({
path: index,
query: query,
... |
d8a01d7929b101e6f1b890a10dab38f6c46b903a2360b6f6267cfddfa205bb7f | TypeScript | 404 | 14 | import type { JobBaseModel } from "@/api/jobs";
import TEST_JOBS_JSON from "./json/jobs.json";
export const TEST_JOBS_BY_STATES = TEST_JOBS_JSON.reduce(
(acc: Record<string, JobBaseModel[]>, job) => {
if (!acc[job.state]) {
acc[job.state] = [];
}
acc[job.state]!.push(job as Job... |
3e7189a9b74c2d9f51dbd4becce1e40e498e3d199f6c2ce32c0e6785ee81c9e7 | TypeScript | 410 | 21 | export interface Citation {
raw: string;
cite: {
data: {
URL: string;
}[];
format: (
format: string,
options: {
format: string;
template: string;
lang: string;
},
) => string;
};
}... |
ab69bc598a12cc9b7293d917aea82bfe70aab1411634c6be63acf641493b58ae | TypeScript | 419 | 15 | import { computed, type Ref } from "vue";
export function useResolveElement(elementRef: Ref<unknown>) {
const resolvedRef = computed(() => {
const value = elementRef.value;
if (typeof value === "object" && value !== null && "$el" in value) {
return value.$el as HTMLElement;
} e... |
99df76e0b25a455765a3d7e9aa011e151d2cf4eb1bce45391d45815b434ced8c | TypeScript | 420 | 15 | /**
* Historically, this API was used to get the list of genomes that were available
* but now it is used to get the list of more generic "dbkeys".
*/
import { GalaxyApi } from "@/api";
import { rethrowSimple } from "@/utils/simple-error";
export async function getDbKeys() {
const { data, error } = await Galax... |
d3cd5581f40490770165899ac3b9726d19841b797aaffff97f9b9c8c1b9a2671 | TypeScript | 424 | 12 | /**
* Custom options for the monkeypatched router.push() method
* Used to control window manager behavior and force navigation
*/
export interface RouterPushOptions {
// Title for window manager frame
title?: string;
// Force reload (currently by adding timestamp to URL)
force?: boolean;
// Expli... |
e376ecd3d4da8b8fb35ad1067bf9818348cad0f4c673606fe68ce1c8993e2694 | TypeScript | 434 | 13 | import { toValue } from "@vueuse/core";
import { vi } from "vitest";
import { computed, ref } from "vue";
import type { useFilterObjectArray as UseFilterObjectArray } from "@/composables/filter";
vi.mock("@/composables/filter", () => ({
useFilterObjectArray,
}));
export const useFilterObjectArray = ((array) => {... |
f982da28fd29bd6687c16c98fd4a307928bd8e104bf854fa6e8c4694dc0fac16 | TypeScript | 435 | 20 | import { type Ref, watch } from "vue";
/**
* Emits an event whenever a value changes
* @param ref value to watch
* @param emit event emitter function
* @param name event to emit
*/
export function useEmit<Name extends string, T, F extends { (name: Name, arg: T): void }>(
ref: Ref<T>,
emit: F,
name: Na... |
239c5f042756a5aca30e64b3fe641dc946be98626132f36519fb19af30682b85 | TypeScript | 437 | 13 | import type { IconDefinition } from "@fortawesome/fontawesome-svg-core";
/**
* Shape FontAwesomeIcon requires of an icon that is not registered with
* FontAwesome -- consumers generate these from their own SVG sources.
*/
export interface CustomIconDefinition {
iconName: string;
prefix: string;
icon: [n... |
7e3830c45772915badd15be3ccef8e28e834a4b63aeba421b3f31d54436002ed | TypeScript | 439 | 18 | import { computed } from "vue";
import { useRoute } from "vue-router";
export function usePanels() {
const route = useRoute();
const showPanels = computed(() => {
const panels = route.query.hide_panels;
if (panels !== undefined && panels !== null && typeof panels === "string") {
re... |
60866517290a35f6bc44db2f7d67459d86e4959c74e12d09204bbdbd3b9a9ee5 | TypeScript | 440 | 14 | import { GalaxyApi } from "@/api";
import { rethrowSimple } from "@/utils/simple-error";
import { DatatypesMapperModel } from "./model";
export async function getDatatypesMapper(upload_only = true) {
const { data, error } = await GalaxyApi().GET("/api/datatypes/types_and_mapping", {
params: { query: { upl... |
f189d15611f23038b5ad4e26c8acada44dc2c31c8e4cf02d1210942f12e4acfc | TypeScript | 445 | 25 | import _l from "@/utils/localization";
export const NAME_FIELD = {
key: "name",
label: _l("Name"),
sortable: true,
};
export const DESCRIPTION_FIELD = {
key: "description",
label: _l("Description"),
sortable: true,
};
export const TYPE_FIELD = {
key: "type",
label: _l("Type"),
sor... |
81b4b71ec8babb70e395018d74d83d37901776a48434f3955fca3960150b9813 | TypeScript | 450 | 16 | /**
* Time-related constants to avoid magic numbers
*/
// Base time units
const SECONDS_PER_MINUTE = 60;
const MINUTES_PER_HOUR = 60;
const HOURS_PER_DAY = 24;
// Millisecond durations
const ONE_DAY_MS = 1000 * SECONDS_PER_MINUTE * MINUTES_PER_HOUR * HOURS_PER_DAY;
// Exported constants used across the app
export ... |
39d4e645cd974b2f30eea9262ab4f97b15dd3efbeb82ee00057ea350f2a06ff0 | TypeScript | 453 | 15 | /// <reference types="vite/client" />
interface ImportMetaEnv {
readonly VITE_API_URL: string;
readonly VITE_BASE_URL: string;
readonly VITE_USE_MOCK_DATA?: string;
readonly VITE_OIDC_PROFILE_URL?: string;
readonly VITE_MATOMO_URL?: string;
readonly VITE_MATOMO_SITE_ID?: string;
readonly VI... |
bf8f06d9722f54107309661064e132d6c307ebfcf08db6b0f1d80cd8473fafed | TypeScript | 455 | 19 | import { defineConfig } from "tsup";
export default defineConfig({
entry: ["src/index.ts"],
format: ["esm", "cjs"],
dts: true,
sourcemap: true,
clean: true,
treeshake: true,
minify: false,
target: "es2022",
esbuildOptions(options) {
options.external = [
...(optio... |
c719ef49182d5b5bcf9bc15fd16171b669857c82278e065e6c31dda296fe20b0 | TypeScript | 457 | 15 | import { GalaxyApi } from "@/api";
import type { UserFileSourceModel } from "@/api/fileSources";
const updateUrl = "/api/file_source_instances/{uuid}";
export async function hide(instance: UserFileSourceModel) {
const payload = { hidden: true };
const { data: fileSource } = await GalaxyApi().PUT(updateUrl, {
... |
9735c6a2947bdb18899ac7347c6b6dedac4f464cbfd8e4999049771adeab265f | TypeScript | 458 | 13 | /**
* Pushes a value to an array in an object, if the array exists. Else creates a new array containing value.
* @param object Object which contains array
* @param key Key which array is in
* @param value Value to push
*/
export function pushOrSet<T, K extends string | number | symbol>(object: { [_key in K]: Array... |
c2e8bc5e70a7436259e5c5d543c15b791e01dec84add2adf8c54e00503cdd0f3 | TypeScript | 459 | 16 | import { GalaxyApi } from "@/api";
import type { UserConcreteObjectStore } from "./types";
const updateUrl = "/api/object_store_instances/{uuid}";
export async function hide(instance: UserConcreteObjectStore) {
const payload = { hidden: true };
const { data: objectStore } = await GalaxyApi().PUT(updateUrl, {... |
ffe1d0b57d549a5a53321c98371b94ff10d60c93879786b2224bc1242ac88ddd | TypeScript | 465 | 17 | import yaml from "yaml";
import type { Plugin } from "vite";
export function yamlPlugin(): Plugin {
return {
name: "vite-plugin-yaml",
transform(code, id) {
if (id.endsWith(".yml") || id.endsWith(".yaml")) {
const data = yaml.parse(code);
return {
... |
665ff1211be7085d0a1d62a76d6d3f6b0b0f7c436cd9096c4ee92f72fc665bff | TypeScript | 471 | 17 | import { ref } from "vue";
// Opt in per file with `vi.mock("@/composables/upload/uploadDefaults")`.
export function useUploadDefaults() {
return {
effectiveExtensions: ref([]),
listDbKeys: ref([]),
configurationsReady: ref(true),
createItemDefaults: () => ({
extension: ... |
cf21e424395472f67a79580080abbad3398658c58a3bbb1c500f20411e854121 | TypeScript | 472 | 14 | import { ref } from "vue";
import type { useWorkflowStepStore } from "@/stores/workflowStepStore";
export function useUniqueLabelError(
workflowStateStore: ReturnType<typeof useWorkflowStepStore>,
label: string | null | undefined,
) {
const error = ref<string | null>(null);
if (label && workflowStateS... |
3e2a7889bee5fe7c5624eadb9c1154c55b19c55f749ddc282e48d74d12942281 | TypeScript | 473 | 19 | import type { Plugin } from "vite";
// Plugin to handle i18n! imports
export function i18nPlugin(): Plugin {
return {
name: "i18n-mock",
resolveId(id: string) {
if (id.startsWith("i18n!")) {
return "\0" + id;
}
},
load(id: string) {
... |
9cf0706671e0615baa8c49e5f9c608ebb0178228b61379a0056b150e50ccdb4c | TypeScript | 473 | 16 | import { addMonths, startOfDay, endOfDay } from "date-fns";
/**
* Returns a default date range for filtering data
* @param months Number of months to go back from today (defaults to 2)
* @returns DateRange object with from and to dates
*/
export const getDefaultDateRange = (
months: number = 2,
): { from: Date... |
4b825fa09402c9d3c2ecdd09b7a2cdabb4dacb61567cde251e03ec725afcd016 | TypeScript | 494 | 14 | import MarkdownIt from "markdown-it";
type SyntaxHighlighter = NonNullable<MarkdownIt.Options["highlight"]>;
export function markup(markup: string, adminConfigured: boolean, syntaxHighlighter?: SyntaxHighlighter): string | null {
let markupHtml;
const allowHtml = adminConfigured ? true : false;
if (markup... |
63e42d3a18cfca2f595b8723e1d336bed4b636ff438d6c34b42ad8b0899cafb6 | TypeScript | 497 | 22 | import { computed } from "vue";
export interface HasTitleProps {
title?: string;
disabledTitle?: string;
disabled?: boolean;
}
/**
* Picks the correct title based on the disabled state of a component
*/
export function useCurrentTitle(props: HasTitleProps) {
const currentTitle = computed(() => {
... |
965a7b5421892b7be1f307a087bbfa2cc21eacd4c90a63b4ec0b338957208809 | TypeScript | 497 | 14 | import { describe, expect, it } from "vitest";
import { slugify } from "./slug";
describe("slugify", () => {
it("lowercases, collapses non alphanumeric runs and trims dashes", () => {
expect(slugify(" My New Page!! ", "page")).toBe("my-new-page");
expect(slugify("RNA-seq 2026 — draft", "page")).t... |
1f36a28a4c64ee3efe1804bbc1877b97ec73cb283cffe5d6f0d05c07661efa86 | TypeScript | 498 | 13 | import type { InvocationExportPlugin } from "@/components/Workflow/Invocation/Export/Plugins";
export const DEFAULT_FILE_EXPORT_PLUGIN: InvocationExportPlugin = {
id: "default-file",
title: "Compressed File",
markdownDescription: `Export the invocation to a compressed File containing the invocation data in... |
e74e6785fa1b1c296f482d27053b894e008288409a1eaa9e800fa3a1fde607e9 | TypeScript | 503 | 22 | import type { CleanupOperation } from ".";
/**
* Defines a new category to display in the Storage Management Dashboard to
* to provide a set of cleanup operations to free-up some storage space.
*/
export interface CleanupCategory {
/**
* The ID of this category.
*/
id: string;
/**
* The ... |
b16e147247fb92474648d266defb8c8577faa6e77c4752a93bdec5fd833b12b4 | TypeScript | 505 | 12 | // TODO: Swap these awful relative paths to an alias
import DatatypesJson from "@tests/test-data/json/datatypes.json";
import DatatypesMappingJson from "@tests/test-data/json/datatypes.mapping.json";
import { type DatatypesCombinedMap, DatatypesMapperModel } from "./model";
export const typesAndMappingResponse: Datat... |
8cca6fb2f340235e04ec56069779a5c2ec1359d88de1140c94aee4fae4a22d32 | TypeScript | 506 | 18 | import { vi } from "vitest";
import { nextTick } from "vue";
import { DEFAULT_TOOLTIP_HOVER_DELAY_MS } from "@/utils/tooltipTiming";
export function advanceToJustBeforeTooltipHoverDelay(delayMs = DEFAULT_TOOLTIP_HOVER_DELAY_MS) {
vi.advanceTimersByTime(delayMs - 1);
}
export async function advanceTooltipHoverDel... |
751dc6f91f6d919bb1d9231d6deb80304c82337f140715bb418e03671a3637b8 | TypeScript | 507 | 16 | import { getAppRoot } from "@/onload/loadConfig";
/**
* Get the full URL path of the app
*
* @param path Path to append to the URL path
* @returns Full URL path of the app
*/
export function getFullAppUrl(path: string = ""): string {
const protocol = window.location.protocol;
const hostname = window.locat... |
93595ec608271a4d33c1cb3dd5fdb77aef8006213acaca0ad063e2339840cc2c | TypeScript | 517 | 17 | import { describe, expect, it } from "vitest";
import { getFullAppUrl } from "./utils";
describe("test app utils", () => {
describe("test getFullAppUrl", () => {
it("should return the full app url", () => {
const appUrl = getFullAppUrl();
expect(appUrl).toBe("http://localhost/");
... |
dff07a86707a6e283eb1ea163535d8bc1010a96f753f785ee106e42e75a2dbee | TypeScript | 517 | 19 | /// <reference types="vitest" />
/// <reference types="@testing-library/jest-dom" />
interface CustomMatchers<R = unknown> {
toBeLocalized(): R;
toBeLocalizationOf(str: string): R;
}
declare module "vitest" {
interface Assertion<T = any> extends CustomMatchers<T> {}
interface AsymmetricMatchersContain... |
c62abf4dd2f10e806404f50db1ff95369c167419e9fce93307d6c2839cf60d58 | TypeScript | 524 | 18 | import { storeToRefs } from "pinia";
import { computed } from "vue";
import { useObjectStoreStore } from "@/stores/objectStoreStore";
export function useSelectableObjectStores() {
const store = useObjectStoreStore();
const { selectableObjectStores } = storeToRefs(store);
const hasSelectableObjectStores =... |
ec2f486256beeafbb010aaa8104611215d7e00349321b8f475ac41272bcc0580 | TypeScript | 525 | 23 | import { computed, ref } from "vue";
const hosts = ref<string[]>([]);
export const activeToastHost = computed(() => hosts.value[hosts.value.length - 1]);
export function registerToastHost(host: string) {
const index = hosts.value.indexOf(host);
if (index !== -1) {
hosts.value.splice(index, 1);
}... |
03b56212f860b7be105a7d3eb4dee510e435a81deb02a631dedf17c93507fe5b | TypeScript | 531 | 12 | import draggable from "vuedraggable";
/**
* vuedraggable 4 is written for Vue 3 and calls its `item` slot with
* `{ element, index }`. Under @vue/compat MODE 2 a component with a render
* function gets its `$slots` wrapped in the Vue 2 style proxy, which calls every
* slot with no arguments, so the slot props arri... |
74247f0d2a936b7f9486b2221d9e62e9fc8ba472ecce1c7ea7c96f0cc5e3d4d6 | TypeScript | 531 | 22 | import axios from "axios";
import { getAppRoot } from "@/onload/loadConfig";
import { rethrowSimple } from "@/utils/simple-error";
export async function setAttributes(datasetId: string, settings: object, operation: string) {
const payload = {
dataset_id: datasetId,
operation: operation,
..... |
2ffbf0210bbed1e99178fca6089b2b4410a0b988216f6be1e46036ad4b72c45d | TypeScript | 535 | 20 | import { computed, ref } from "vue";
import { useUserStore } from "@/stores/userStore";
export function useCurrentTheme() {
const userStore = useUserStore();
const currentTheme = computed(() => userStore.currentTheme);
const settingTheme = ref(false);
async function setCurrentTheme(theme: string) {
... |
61054f043e2b1dd6465d8a15d67a4aca0bb81f6007616027f93bee8738ac9053 | TypeScript | 541 | 18 | import { type components, GalaxyApi } from "@/api";
import { rethrowSimple } from "@/utils/simple-error";
type TaggableItemClass = components["schemas"]["TaggableItemClass"];
export async function updateTags(itemId: string, itemClass: TaggableItemClass, itemTags?: string[]): Promise<void> {
const { error } = awai... |
3a5253b3d293a9042d5ef9cee3cc67326dbd4c43924c1e59756d9f85fb18c984 | TypeScript | 545 | 18 | import axios from "axios";
import { describe, expect, it, vi } from "vitest";
import { getAPIKey } from "./service";
vi.mock("axios");
describe("getAPIKey", () => {
it("returns an empty list when the user has no key", async () => {
// The page reads `result[0]`, so a user without a key needs a list, not ... |
8bbd22a6cb5482e9301eb6abbfa562ac07602e4691b49ad443120bef0bc5ca42 | TypeScript | 547 | 19 | import { computed, onMounted } from "vue";
import { useConfigStore } from "@/stores/configurationStore";
/* composable config wrapper */
export function useConfig() {
const store = useConfigStore();
const config = computed(() => store.config);
const isConfigLoaded = computed(() => store.isLoaded);
/... |
a92a2819b04356b0aa03262c455cd5729a8db716bbdee381885b905627b0630f | TypeScript | 551 | 20 | import { rethrowSimple } from "@/utils/simple-error";
import { GalaxyApi } from "./client";
export async function generateAIReport(workflowId: string, version?: number, instance?: boolean) {
const { data, error } = await GalaxyApi().GET("/api/chat/{workflow_id}/generate_report", {
params: {
pa... |
07c741899b8e1125fa1b4b1373f4bceb91e7fe4e02509721bb7d2bc6082fe360 | TypeScript | 557 | 30 | // TODO: stricter types
export type FormParameterValue = any;
export type FormParameterAttributes = {
[attribute: string]: any;
};
export type FormParameterTypes =
| "boolean"
| "hidden"
| "hidden_data"
| "baseurl"
| "integer"
| "float"
| "radio"
| "color"
| "directory_uri"
... |
43a0f6d1e73c78cceb3df529aaa0b2519e19153144310a5cef8c746800b01bac | TypeScript | 566 | 13 | // Vue 2.7 <-> AG Grid - legacy stuff
// see comments around "export default {" in PairedOrUnpairedListCollectionCreator
import CellDiscardComponent from "./common/CellDiscardComponent.vue";
import CellStatusComponent from "./common/CellStatusComponent.vue";
import PairedDatasetCellComponent from "./common/PairedDatase... |
05ce4d00e6636aae5cfaf233d0d51cf0cec3bc199ce36cd697efefffcb6cbc88 | TypeScript | 582 | 23 | import type { Ref } from "vue";
import { useUserLocalStorage } from "./userLocalStorage";
interface ToggleStateInterface {
toggled: Ref<boolean>;
toggle: () => void;
}
export function usePersistentToggle(uniqueId: string, initialValue = false): ToggleStateInterface {
const localStorageKey = `toggle-state... |
0bdc8611a87151f22055e9a52623a773754c60dc97cba7a8258a44342a4e1a6b | TypeScript | 583 | 11 | import type { PaletteContext, ScopedSection } from "./types";
/** A logged-in palette context with every optional feature off; `overrides` replace whole fields */
export function makeCtx(overrides: Partial<PaletteContext> = {}): PaletteContext {
return { canUseUnprivilegedTools: false, config: {}, isAnonymous: fal... |
603f6a7824127cc41ab65a0addd62e271cf2d114c1f4a26b7644a8ed57bb2121 | TypeScript | 596 | 15 | import * as vega from "vega";
import { bytesToString } from "@/utils/utils";
import type { DataValuePoint } from ".";
// Register bytesToString as a Vega expression function so axis labels can use it
(vega as any).expressionFunction("bytesToString", (value: number) => bytesToString(value));
export function bytesLab... |
bff1adb0d334454843d76eb9d55840400f8e3f53e4f863321e8448df9bf3ca53 | TypeScript | 603 | 25 | import { type MaybeRefOrGetter, resolveUnref } from "@vueuse/core";
import { ref } from "vue";
import { useAnimationFrameResizeObserver } from "./animationFrameResizeObserver";
export function useAnimationFrameSize(target: MaybeRefOrGetter<HTMLElement | null>) {
const width = ref(0);
const height = ref(0);
... |
4c398d5caf4132d84dba80b0826508a34048c7f78c8e176a0698333dba5f7829 | TypeScript | 616 | 26 | import { defineStore } from "pinia";
import { ref } from "vue";
/**
* TODO: delete me
*
* This entire store and any code associated with it is a horrible hack.
* It works around the Form Display Component not being reactive
* to outside changes by forcing a refresh via the `key` prop.
*
* This is a bad practice... |
4034ca1873c6834159768d0123745fdec259821b1587ab270bc7f165284be6ab | TypeScript | 617 | 18 | import { defineStore } from "pinia";
import type { DatasetTextContentDetails } from "@/api";
import { fetchDatasetTextContentDetails } from "@/api/datasets";
import { useKeyedCache } from "@/composables/keyedCache";
export const useDatasetTextContentStore = defineStore("datasetTextContentStore", () => {
const { s... |
b8f6113d410c0829b415dc07667ef6a9b0fc8e8b014909447b2c933d5fff454d | TypeScript | 621 | 17 | import { computed, type Ref } from "vue";
import type { HistoryContentsStats } from "@/api";
export function useHistoryContentStats(history: Ref<HistoryContentsStats>) {
const historySize = computed(() => history.value?.size ?? 0);
const numItemsActive = computed(() => history.value?.contents_active?.active ?... |
4d4ac28f9ed5846ca7fe3625f380439cc4f69ef5f859c1b4006774736ad92963 | TypeScript | 625 | 11 | /// <reference lib="dom" />
type SelectedValue = Node | Attr | string | number | boolean;
interface XPathSelect {
(expression: string, node?: Node): Array<SelectedValue>;
(expression: string, node: Node, single: true): SelectedValue | undefined;
}
export var select: XPathSelect;
export function select1... |
77e3aade0b5ed7efe10984c39351e0b559c6db4280a3b373380c92d87a9970c8 | TypeScript | 625 | 21 | import { describe, expect, it } from "vitest";
import { parse } from "yaml";
import { CLEAR_TOOL_YAML, NEW_TOOL_YAML } from "./customToolEditorDefaults";
import TOOL_SOURCE_SCHEMA from "./ToolSourceSchema.json";
describe("custom tool editor defaults", () => {
it("preloads the schema-derived Getting Started exampl... |
3d0962d9f10760a3e148b2c9fb736b67e53e8d844f6a70291c04fe27bc16cfb6 | TypeScript | 633 | 25 | import type { ActionSuggestion, AgentResponse } from "@/composables/agentActions";
export interface ChatMessage {
id: string;
role: "user" | "assistant";
content: string;
timestamp: Date;
agentType?: string;
confidence?: string;
feedback?: "up" | "down" | null;
agentResponse?: AgentResp... |
ebc9566fa2cd0bb253045dc744e49f6c53d53621d6c439e601c44c0b10db4100 | TypeScript | 637 | 18 | import { useCallback, useState } from "react";
/**
* Custom hook for managing modal open/close state
* Reduces boilerplate for modal state management
*
* @param defaultOpen - Initial open state (default: false)
* @returns Object with isOpen state and open/close/toggle functions
*/
export function useModal(defaul... |
3f19050c788dd0971fad431bef521e3b8a0f43b97db6b763c3ea4b7b0289ad95 | TypeScript | 640 | 17 | import { getLocalVue } from "@tests/vitest/helpers";
import { mount } from "@vue/test-utils";
import { describe, expect, it } from "vitest";
import InstallationActions from "./InstallationActions.vue";
describe("InstallationActions", () => {
it("names the busy button while an action is running", () => {
c... |
c3763848eca7d3ede0e6b1525e0d58ac6f747cadcb4d6962e4916489d2a315ef | TypeScript | 641 | 21 | import { defineConfig } from "vitest/config";
import { resolve } from "path";
export default defineConfig({
test: {
environment: "jsdom", // Use jsdom for browser-like environment
globals: true, // Makes expect and other test globals available without imports
include: ["src/**/*.test.ts"],
... |
a71fa1dbaa9a2e9a30dca4398f3b668129d37dcdf30de7d80d8669e1734352ee | TypeScript | 643 | 18 | import { computed } from "vue";
import { useConfig } from "@/composables/config";
import { useUserStore } from "@/stores/userStore";
/** Whether the current user can ask the admins to install tools: the request form rides on notifications. */
export function useCanRequestToolInstallation() {
const { config, isCon... |
acaaa19846ea8f529cbdfe912eed24f38819e2c0c0f8004b396caf63e18d36de | TypeScript | 646 | 22 | import type { RouteLocationRaw } from "vue-router";
import { Toast } from "@/composables/toast";
export function getRedirectOnImportPath(
response: { id?: string; message?: string; status?: string },
isRunFormRedirect = false,
): RouteLocationRaw {
if (isRunFormRedirect) {
return { path: "/workflo... |
a48f1364673985f00f34625991aa77a6cb1676d2e2fa2a613da57df99b66cd07 | TypeScript | 647 | 22 | export function selectAllText(element: HTMLElement) {
element.focus();
if (element instanceof HTMLTextAreaElement) {
element.select();
} else {
const range = document.createRange();
range.selectNodeContents(element);
window.getSelection()?.removeAllRanges();
window.g... |
8e7dbeb322b3ab5fe42844dd9a21d7e1f47667c94c5329c349d69501c99141bb | TypeScript | 654 | 44 | let idCounter = 0;
export class UndoRedoAction {
protected internalName?: string;
public id: number;
constructor() {
this.id = idCounter++;
}
get name(): string | undefined {
return this.internalName;
}
set name(name: string | undefined) {
this.internalName = name... |
7d410b6dcc8bbfb272ceb358f520f42244284c9830b56c26375b0868aa3c74a0 | TypeScript | 669 | 16 | import type { SelectOption } from "./selectMany";
export function filterOptions(options: SelectOption[], filter: string | RegExp, caseSensitive: boolean) {
let filteredSelectOptions;
if (filter instanceof RegExp) {
filteredSelectOptions = options.filter((option) => Boolean(option.label.match(filter)))... |
806794896aee0dd07169252fbb88c5ccbd30f30425fbbe5778f8c85da76523bd | TypeScript | 671 | 18 | export function stringify<T extends Record<string, unknown>>(contentObject: T): string {
function deepSortObject(obj: unknown): unknown {
if (typeof obj !== "object" || obj === null || Array.isArray(obj)) {
return obj;
}
return Object.keys(obj)
.sort()
.re... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.