The easy-to-use open source Business Intelligence and Embedded Analytics tool that lets everyone work with data :bar_chart:
TypeScript analyticsbibusiness-intelligencebusinessintelligenceclojuredashboarddatadata-analysisdata-visualizationdatabasemetabasemysqlpostgrespostgresqlreportingslacksql-editorvisualization
UXW-2534+UXW-2527 Globally rename "Top folder" to "SQL snippets" in snippet collections + Remove the library option when dealing with collections in the snippet picker (#66787)
Brad Anderson789ee55ef875
diff --git a/docs/permissions/snippets.md b/docs/permissions/snippets.mdindex 11a81f4521a..80a80f30026 100644--- a/docs/permissions/snippets.md+++ b/docs/permissions/snippets.md@@ -16,7 +16,7 @@ Folder permissions should not be considered a security feature, but instead a feFolders work similarly to a file system. You can add snippets to folders, and put folders inside of other folders. You can nest as many folders as your Metabase instance can handle or the laws of physics allow (whichever yields first).-The **Top folder** is the snippet sidebar's default folder. It is the root folder that contains all folders and snippets.+**SQL snippets** is the snippet sidebar's default folder. It is the root folder that contains all folders and snippets.### Creating a new Snippet folder@@ -36,7 +36,7 @@ On [some plans](https://www.metabase.com/pricing/), when creating a Snippet, you-The default location is the **Top folder**, which is the root folder for all snippets and folders. You can add a snippet to a folder at any time (or relocate a snippet to another folder, provided you have Edit permission to both folders).+The default location is **SQL snippets**, which is the root folder for all snippets and folders. You can add a snippet to a folder at any time (or relocate a snippet to another folder, provided you have Edit permission to both folders).Note that snippet names must be unique; folders do not affect this requirement.@@ -48,7 +48,7 @@ Administrators (and only administrators) can set snippet visibility and editabilAdministrators can set the permissions on a folder by clicking on the ellipsis (**...**) next to a folder, and selecting **Change permissions**.-You can additionally change the currently selected folder by mousing over to the top of the Snippets sidebar, clicking on the ellipsis (**...**) to the left of the **+**, and selecting **Change permissions**. When at the **Top folder**, selecting the **...** at the top of the sidebar will give Administrators the option to set permissions for all snippets, folders, and sub-folders.+You can additionally change the currently selected folder by mousing over to the top of the Snippets sidebar, clicking on the ellipsis (**...**) to the left of the **+**, and selecting **Change permissions**. When at the **SQL snippets** root, selecting the **...** at the top of the sidebar will give Administrators the option to set permissions for all snippets, folders, and sub-folders.When changing permissions on a folder that has sub-folders, you have an option to extend those permissions to that folder's sub-folders by toggling the **Also change sub-folders** setting.diff --git a/e2e/test/scenarios/native/snippets.cy.spec.js b/e2e/test/scenarios/native/snippets.cy.spec.jsindex 649046df084..3ad27d62b93 100644--- a/e2e/test/scenarios/native/snippets.cy.spec.js+++ b/e2e/test/scenarios/native/snippets.cy.spec.js@@ -283,7 +283,7 @@ describe("scenarios > question > snippets (EE)", () => {});// eslint-disable-next-line no-unscoped-text-selectors -- deprecated usage- H.modal().within(() => cy.findByText("Top folder").click());+ H.modal().within(() => cy.findByText("SQL snippets").click());H.entityPickerModal().within(() => {cy.findByText("my favorite snippets").click();cy.findByText("Select").click();diff --git a/enterprise/frontend/src/metabase-enterprise/snippets/components/SnippetCollectionFormModal.unit.spec.tsx b/enterprise/frontend/src/metabase-enterprise/snippets/components/SnippetCollectionFormModal.unit.spec.tsxindex 4c817b5a16b..21d74e14299 100644--- a/enterprise/frontend/src/metabase-enterprise/snippets/components/SnippetCollectionFormModal.unit.spec.tsx+++ b/enterprise/frontend/src/metabase-enterprise/snippets/components/SnippetCollectionFormModal.unit.spec.tsx@@ -14,7 +14,7 @@ import SnippetCollectionFormModal from "./SnippetCollectionFormModal";const TOP_SNIPPETS_FOLDER = {id: "root",- name: "Top folder",+ name: "SQL snippets",can_write: true,};diff --git a/frontend/src/metabase/common/components/Pickers/CollectionPicker/hooks.ts b/frontend/src/metabase/common/components/Pickers/CollectionPicker/hooks.tsindex 7c1cca09af3..3018bd8b03c 100644--- a/frontend/src/metabase/common/components/Pickers/CollectionPicker/hooks.ts+++ b/frontend/src/metabase/common/components/Pickers/CollectionPicker/hooks.ts@@ -77,7 +77,11 @@ export const useRootCollectionPickerItems = (const items = useMemo(() => {const collectionItems: CollectionPickerItem[] = [];- if (options.showLibrary && libraryCollection) {+ if (+ options.showLibrary &&+ libraryCollection &&+ options.namespace !== "snippets"+ ) {collectionItems.push({...libraryCollection,model: "collection",@@ -106,7 +110,7 @@ export const useRootCollectionPickerItems = (location: "/",name:options.namespace === "snippets"- ? t`Top folder`+ ? t`SQL snippets`: rootCollection.name,});} else if (rootCollectionError) {diff --git a/frontend/src/metabase/common/components/SnippetCollectionName.tsx b/frontend/src/metabase/common/components/SnippetCollectionName.tsxindex f719de83c41..327dc9e82e6 100644--- a/frontend/src/metabase/common/components/SnippetCollectionName.tsx+++ b/frontend/src/metabase/common/components/SnippetCollectionName.tsx@@ -6,7 +6,7 @@ import type { CollectionId } from "metabase-types/api";function SnippetCollectionName({ id }: { id: CollectionId }) {if (isRootCollection({ id })) {- return <span>{t`Top folder`}</span>;+ return <span>{t`SQL snippets`}</span>;}if (!Number.isSafeInteger(id)) {return null;diff --git a/frontend/src/metabase/query_builder/components/template_tags/SnippetFormModal/SnippetFormModal.unit.spec.tsx b/frontend/src/metabase/query_builder/components/template_tags/SnippetFormModal/SnippetFormModal.unit.spec.tsxindex a8c9c1fafba..23154b810fc 100644--- a/frontend/src/metabase/query_builder/components/template_tags/SnippetFormModal/SnippetFormModal.unit.spec.tsx+++ b/frontend/src/metabase/query_builder/components/template_tags/SnippetFormModal/SnippetFormModal.unit.spec.tsx@@ -17,7 +17,7 @@ import { SnippetFormModal } from "./SnippetFormModal";const TOP_SNIPPETS_FOLDER = {id: "root",- name: "Top folder",+ name: "SQL snippets",can_write: true,};diff --git a/src/metabase/collections/models/collection/root.clj b/src/metabase/collections/models/collection/root.cljindex bb5c507a722..90ac9c93c71 100644--- a/src/metabase/collections/models/collection/root.clj+++ b/src/metabase/collections/models/collection/root.clj@@ -55,7 +55,7 @@[collection-namespace](m/assoc-some root-collection:name (case (keyword collection-namespace)- :snippets (tru "Top folder")+ :snippets (tru "SQL snippets")(tru "Our analytics")):namespace collection-namespace:is_personal false