Skip to content

The easy-to-use open source Business Intelligence and Embedded Analytics tool that lets everyone work with data :bar_chart:

808 B
Raw Blame
import { msgid, ngettext } from "ttag";

import type { Collection, CollectionType } from "metabase-types/api";

import { getAccessibleCollection } from "../../utils";

export function getArchiveLibraryCollectionsMessage(count: number): string {
  return ngettext(
    msgid`Archiving this collection will also unpublish the tables inside it (and any tables that depend on them) and archive any other child items.`,
    `Archiving these collections will also unpublish the tables inside them (and any tables that depend on them) and archive any other child items.`,
    count,
  );
}

export function getWritableCollection(
  rootCollection: Collection,
  type: CollectionType,
) {
  const collection = getAccessibleCollection(rootCollection, type);
  return collection?.can_write ? collection : undefined;
}