Skip to content

Commit

Permalink
chore: remove datasets feature flag check (#623)
Browse files Browse the repository at this point in the history
  • Loading branch information
cheikhgwane authored Jun 21, 2024
1 parent 846c5bf commit de064f3
Show file tree
Hide file tree
Showing 2 changed files with 74 additions and 9 deletions.
68 changes: 68 additions & 0 deletions src/workspaces/__tests__/__snapshots__/workspaces.test.tsx.snap
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,40 @@ exports[`Workspaces renders the workspace page 1`] = `
</span>
</div>
</a>
<a
class="text-md group relative flex items-center gap-3 px-2 py-2 font-medium text-gray-300 hover:bg-gray-700 hover:text-white justify-center "
href="/workspaces/test/datasets"
rel="noopener noreferrer"
>
<div
class="absolute inset-y-0 left-0 w-1 bg-pink-500 transition-opacity opacity-0"
/>
<svg
aria-hidden="true"
class="h-7 w-7"
data-slot="icon"
fill="none"
stroke="currentColor"
stroke-width="1.5"
viewBox="0 0 24 24"
xmlns="http://www.w3.org/2000/svg"
>
<path
d="M16.5 8.25V6a2.25 2.25 0 0 0-2.25-2.25H6A2.25 2.25 0 0 0 3.75 6v8.25A2.25 2.25 0 0 0 6 16.5h2.25m8.25-8.25H18a2.25 2.25 0 0 1 2.25 2.25V18A2.25 2.25 0 0 1 18 20.25h-7.5A2.25 2.25 0 0 1 8.25 18v-1.5m8.25-8.25h-6a2.25 2.25 0 0 0-2.25 2.25v6"
stroke-linecap="round"
stroke-linejoin="round"
/>
</svg>
<div
class="absolute inset-y-0 left-full ml-1.5 hidden h-full items-center text-xs opacity-0 transition-opacity group-hover:flex group-hover:opacity-100"
>
<span
class="inline-flex items-center truncate whitespace-nowrap rounded-md border font-medium px-2 py-0.5 text-xs border-gray-500 border-opacity-10 bg-gray-800 "
>
Datasets
</span>
</div>
</a>
<a
class="text-md group relative flex items-center gap-3 px-2 py-2 font-medium text-gray-300 hover:bg-gray-700 hover:text-white justify-center "
href="/workspaces/test/connections"
Expand Down Expand Up @@ -496,6 +530,40 @@ exports[`Workspaces shows the jupyterhub entry when user have the launchNotebook
</span>
</div>
</a>
<a
class="text-md group relative flex items-center gap-3 px-2 py-2 font-medium text-gray-300 hover:bg-gray-700 hover:text-white justify-center "
href="/workspaces/a303ff37-644b-4080-83d9-a42bd2712f63/datasets"
rel="noopener noreferrer"
>
<div
class="absolute inset-y-0 left-0 w-1 bg-pink-500 transition-opacity opacity-0"
/>
<svg
aria-hidden="true"
class="h-7 w-7"
data-slot="icon"
fill="none"
stroke="currentColor"
stroke-width="1.5"
viewBox="0 0 24 24"
xmlns="http://www.w3.org/2000/svg"
>
<path
d="M16.5 8.25V6a2.25 2.25 0 0 0-2.25-2.25H6A2.25 2.25 0 0 0 3.75 6v8.25A2.25 2.25 0 0 0 6 16.5h2.25m8.25-8.25H18a2.25 2.25 0 0 1 2.25 2.25V18A2.25 2.25 0 0 1 18 20.25h-7.5A2.25 2.25 0 0 1 8.25 18v-1.5m8.25-8.25h-6a2.25 2.25 0 0 0-2.25 2.25v6"
stroke-linecap="round"
stroke-linejoin="round"
/>
</svg>
<div
class="absolute inset-y-0 left-full ml-1.5 hidden h-full items-center text-xs opacity-0 transition-opacity group-hover:flex group-hover:opacity-100"
>
<span
class="inline-flex items-center truncate whitespace-nowrap rounded-md border font-medium px-2 py-0.5 text-xs border-gray-500 border-opacity-10 bg-gray-800 "
>
Datasets
</span>
</div>
</a>
<a
class="text-md group relative flex items-center gap-3 px-2 py-2 font-medium text-gray-300 hover:bg-gray-700 hover:text-white justify-center "
href="/workspaces/a303ff37-644b-4080-83d9-a42bd2712f63/connections"
Expand Down
15 changes: 6 additions & 9 deletions src/workspaces/layouts/WorkspaceLayout/Sidebar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,6 @@ const Sidebar = (props: SidebarProps) => {
const { t } = useTranslation();
const { isSidebarOpen, setSidebarOpen } = useContext(LayoutContext);

const [hasDatasetsEnabled] = useFeature("datasets");
const { slug } = workspace;

return (
Expand Down Expand Up @@ -114,14 +113,12 @@ const Sidebar = (props: SidebarProps) => {
label={t("Database")}
compact={!isSidebarOpen}
/>
{hasDatasetsEnabled && (
<NavItem
href={`/workspaces/${encodeURIComponent(slug)}/datasets`}
Icon={Square2StackIcon}
label={t("Datasets")}
compact={!isSidebarOpen}
/>
)}
<NavItem
href={`/workspaces/${encodeURIComponent(slug)}/datasets`}
Icon={Square2StackIcon}
label={t("Datasets")}
compact={!isSidebarOpen}
/>
<NavItem
href={`/workspaces/${encodeURIComponent(slug)}/connections`}
Icon={SwatchIcon}
Expand Down

0 comments on commit de064f3

Please sign in to comment.