Skip to content

Commit

Permalink
feat: Pipeline UI alignment with models (#1289)
Browse files Browse the repository at this point in the history
Because

- The pipelines UI was outdated

This commit

- Updated the pipeline related UI in alignment with models

---------

Co-authored-by: EiffelFly <57251712+EiffelFly@users.noreply.github.com>
  • Loading branch information
orangecoloured and EiffelFly committed Jul 14, 2024
1 parent 50c30a3 commit 4bcdd1e
Show file tree
Hide file tree
Showing 103 changed files with 5,186 additions and 1,861 deletions.
4 changes: 2 additions & 2 deletions apps/console/integration-test/pages/pipeline-overview.page.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ export class PipelineOverviewPage {

constructor(page: Page, pipelineID: string) {
this.page = page;
this.pagePath = `/admin/pipelines/${pipelineID}`;
this.runButton = page.getByRole("button", { name: "Run" });
this.pagePath = `/admin/pipelines/${pipelineID}/playground`;
this.runButton = page.getByRole("button", { name: "Run", exact: true });
this.inputForm = page.locator(
"form[id='pipeline-details-page-trigger-pipeline-form']",
);
Expand Down
1 change: 1 addition & 0 deletions apps/console/next.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ module.exports = {
swcMinify: true,
reactStrictMode: true,
transpilePackages: [
'@mdxeditor/editor',
"@instill-ai/toolkit",
"@instill-ai/design-system",
"@instill-ai/design-tokens",
Expand Down
1 change: 1 addition & 0 deletions apps/console/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
"@instill-ai/prettier-config-cortex": "workspace:*",
"@instill-ai/toolkit": "workspace:*",
"@instill-ai/tsconfig": "workspace:*",
"instill-sdk": "workspace:*",
"@radix-ui/react-checkbox": "^1.0.3",
"@radix-ui/react-collapsible": "^1.0.2",
"@radix-ui/react-dialog": "^1.0.3",
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import { Metadata } from "next";
import { cookies } from "next/headers";
import { Pipeline } from "instill-sdk";

import { Nullable, Pipeline } from "@instill-ai/toolkit";
import { Nullable } from "@instill-ai/toolkit";
import {
fetchNamespacePipeline,
fetchNamespaceType,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ export function PipelineOverviewPageRender() {
<PageBase>
<AppTopbar namespaceSwitch={<NamespaceSwitch />} />
<PageBase.Container>
<PageBase.Content contentPadding="p-0">
<PageBase.Content contentPadding="p-8">
<ViewPipeline />
</PageBase.Content>
</PageBase.Container>
Expand Down
2 changes: 1 addition & 1 deletion apps/console/src/app/[entity]/pipelines/render.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ export const PipelinesViewPageRender = () => {
<PageBase>
<AppTopbar namespaceSwitch={<NamespaceSwitch />} />
<PageBase.Container>
<PageBase.Content contentPadding="!p-0">
<PageBase.Content contentPadding="p-8">
<ViewPipelines />
</PageBase.Content>
</PageBase.Container>
Expand Down
2 changes: 1 addition & 1 deletion apps/console/src/app/sitemap.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ export default async function sitemap(): Promise<MetadataRoute.Sitemap> {
sitemaps.push({
url: `${process.env.NEXT_PUBLIC_CONSOLE_BASE_URL || defaultBaseUrl}/${
pipeline.ownerName.split("/")[1]
}/pipelines/${pipeline.id}`,
}/pipelines/${pipeline.id}/playground`,
lastModified: new Date(),
changeFrequency: "daily",
priority: 1,
Expand Down
2 changes: 1 addition & 1 deletion packages/design-system/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@instill-ai/design-system",
"version": "0.72.1-rc.2",
"version": "0.72.1-rc.4",
"description": "Instill AI's design system",
"repository": "https://github.com/instill-ai/design-system.git",
"bugs": "https://github.com/instill-ai/design-system/issues",
Expand Down
28 changes: 28 additions & 0 deletions packages/design-system/src/new-ui/Icons/GitMerge.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
"use client";

import * as React from "react";

import { IconBase, IconBaseProps } from "./IconBase";

export const GitMerge = React.forwardRef<
SVGSVGElement,
Omit<IconBaseProps, "viewBox" | "children">
>((props, ref) => {
const { className, ...passThrough } = props;
return (
<IconBase
{...passThrough}
ref={ref}
viewBox="0 0 24 24"
className={className}
>
<path
d="M15 18C15 19.6569 16.3431 21 18 21C19.6569 21 21 19.6569 21 18C21 16.3431 19.6569 15 18 15C16.3431 15 15 16.3431 15 18ZM15 18C12.6131 18 10.3239 17.0518 8.63604 15.364C6.94821 13.6761 6 11.3869 6 9M6 9C7.65685 9 9 7.65685 9 6C9 4.34315 7.65685 3 6 3C4.34315 3 3 4.34315 3 6C3 7.65685 4.34315 9 6 9ZM6 9V21"
strokeWidth="2"
strokeLinecap="round"
strokeLinejoin="round"
/>
</IconBase>
);
});
GitMerge.displayName = "IconGitMerge";
28 changes: 28 additions & 0 deletions packages/design-system/src/new-ui/Icons/Zap.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
"use client";

import * as React from "react";

import { IconBase, IconBaseProps } from "./IconBase";

export const Zap = React.forwardRef<
SVGSVGElement,
Omit<IconBaseProps, "viewBox" | "children">
>((props, ref) => {
const { className, ...passThrough } = props;
return (
<IconBase
{...passThrough}
ref={ref}
viewBox="0 0 24 24"
className={className}
>
<path
d="M13 2L4.09344 12.6879C3.74463 13.1064 3.57023 13.3157 3.56756 13.4925C3.56524 13.6461 3.63372 13.7923 3.75324 13.8889C3.89073 14 4.16316 14 4.70802 14H12L11 22L19.9065 11.3121C20.2553 10.8936 20.4297 10.6843 20.4324 10.5075C20.4347 10.3539 20.3663 10.2077 20.2467 10.1111C20.1092 10 19.8368 10 19.292 10H12L13 2Z"
strokeWidth="2"
strokeLinecap="round"
strokeLinejoin="round"
/>
</IconBase>
);
});
Zap.displayName = "IconZap";
4 changes: 4 additions & 0 deletions packages/design-system/src/new-ui/Icons/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ import { FilePlus01 } from "./FilePlus01";
import { FilePlus02 } from "./FilePlus02";
import { FilterLines } from "./FilterLines";
import { Gear01 } from "./Gear01";
import { GitMerge } from "./GitMerge";
import { Globe01 } from "./Globe01";
import { HelpCircle } from "./HelpCircle";
import { Image01 } from "./Image01";
Expand Down Expand Up @@ -123,6 +124,7 @@ import { VideoRecorder } from "./VideoRecorder";
import { Visa } from "./Visa";
import { VisualQuestionAnswering } from "./VisualQuestionAnswering";
import { X } from "./X";
import { Zap } from "./Zap";

export const Icons = {
Activity,
Expand Down Expand Up @@ -183,6 +185,7 @@ export const Icons = {
FilePlus02,
FilterLines,
Gear01,
GitMerge,
Globe01,
HelpCircle,
IntersectSquare,
Expand Down Expand Up @@ -250,4 +253,5 @@ export const Icons = {
Visa,
VisualQuestionAnswering,
X,
Zap,
};
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ const ToggleGroupRoot = React.forwardRef<
<Toggles.Root
ref={ref}
className={cn(
"inline-flex flex-row space-x-px rounded bg-semantic-bg-line p-px",
"inline-flex flex-row space-x-px rounded bg-semantic-bg-line relative after:pointer-events-none after:content-[''] after:w-full after:h-full after:rounded-[inherit] after:border after:border-semantic-bg-line after:absolute after:top-0 after:left-0",
className,
)}
{...props}
Expand Down
2 changes: 1 addition & 1 deletion packages/sdk/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "instill-sdk",
"version": "0.1.0-rc.7",
"version": "0.1.0-rc.8",
"description": "Instill AI's Typescript SDK",
"repository": "https://github.com/instill-ai/typescript-sdk.git",
"bugs": "https://github.com/instill-ai/community/issues",
Expand Down
9 changes: 9 additions & 0 deletions packages/sdk/src/vdp/pipeline/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,10 @@ export type Pipeline = {
permission: Permission;
tags: string[];
stats: PipelineStats;
profileImage: string;
sourceUrl: string;
documentationUrl: string;
license: string;
};

export type PipelineSharing = {
Expand Down Expand Up @@ -256,6 +260,11 @@ export type UpdateNamespacePipelineRequest = {
sharing?: PipelineSharing;
metadata?: GeneralRecord;
readme?: string;
sourceUrl?: string;
documentationUrl?: string;
license?: string;
profileImage?: string;
tags?: string[];
};

export type UpdateNamespacePipelineResponse = {
Expand Down
3 changes: 2 additions & 1 deletion packages/toolkit/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@instill-ai/toolkit",
"version": "0.96.0-rc.15",
"version": "0.96.0-rc.17",
"description": "Instill AI's frontend toolkit",
"repository": "https://github.com/instill-ai/design-system.git",
"bugs": "https://github.com/instill-ai/design-system/issues",
Expand Down Expand Up @@ -96,6 +96,7 @@
"@hookform/resolvers": "^3.3.4",
"@instill-ai/design-system": "workspace:*",
"@instill-ai/design-tokens": "workspace:*",
"@mdxeditor/editor": "^3.7.0",
"@radix-ui/react-label": "^2.0.2",
"@radix-ui/react-progress": "^1.0.3",
"@radix-ui/react-slot": "^1.0.2",
Expand Down
11 changes: 4 additions & 7 deletions packages/toolkit/src/components/ClonePipelineDialog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import * as React from "react";
import { useRouter } from "next/navigation";
import { zodResolver } from "@hookform/resolvers/zod";
import { CreateNamespacePipelineRequest } from "instill-sdk";
import { CreateNamespacePipelineRequest, Pipeline } from "instill-sdk";
import { useForm } from "react-hook-form";
import * as z from "zod";

Expand All @@ -20,12 +20,9 @@ import {
useToast,
} from "@instill-ai/design-system";

import type { InstillStore, Nullable, PipelineSharing } from "../lib";
import { InstillErrors } from "../constant";
import {
InstillStore,
Nullable,
Pipeline,
PipelineSharing,
sendAmplitudeData,
toastInstillError,
useAmplitudeCtx,
Expand Down Expand Up @@ -175,7 +172,7 @@ export const ClonePipelineDialog = ({
}
}
updateNavigationNamespaceAnchor(() => namespace.id);
router.push(`/${data.namespaceId}/pipelines/${payload.id}`);
router.push(`/${data.namespaceId}/pipelines/${payload.id}/playground`);
} catch (error) {
console.log("error", error);

Expand Down Expand Up @@ -303,7 +300,7 @@ export const ClonePipelineDialog = ({
"NEXT_PUBLIC_CONSOLE_BASE_URL",
)}/${form.getValues(
"namespaceId",
)}/pipelines/${form.getValues("id")}`
)}/pipelines/${form.getValues("id")}/playground`
: null}
</span>
</p>
Expand Down
48 changes: 48 additions & 0 deletions packages/toolkit/src/components/EmptyView.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
import { cn, Icons } from "@instill-ai/design-system";

export type EmptyViewProps = {
iconName: keyof typeof Icons;
title: string;
description?: string;
className?: string;
};

export const EmptyView = ({
iconName,
title,
description,
className,
}: EmptyViewProps) => {
const Icon = Icons[iconName];

return (
<div
className={cn(
"h-full w-full flex items-center justify-center",
className,
)}
>
<div className="relative w-[513px] h-[480px]">
<img
src="/images/empty-placeholder.svg"
width={513}
height={480}
alt="Grid"
/>
<div className="flex items-center justify-center absolute top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2 rounded-sm border w-12 h-12 bg-semantic-fg-on-default border-semantic-bg-line shadow-[0_0_2_0_rgba(0,0,0,0.08)]">
<Icon className="h-6 w-6 stroke-semantic-fg-primary" />
</div>
<div className="absolute top-1/2 left-0 w-full mt-12 flex flex-col gap-y-2">
<p className="font-semibold text-xl text-semantic-fg-primary text-center">
{title}
</p>
{description ? (
<p className="text-semantic-fg-secondary text-center">
{description}
</p>
) : null}
</div>
</div>
</div>
);
};
18 changes: 18 additions & 0 deletions packages/toolkit/src/components/HeadExternalLink.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
export const HeadExternalLink = ({
children,
href,
}: {
children: React.ReactNode;
href: string;
}) => {
return (
<a
href={href}
target="_blank"
rel="noopener noreferrer"
className="flex flex-row items-center gap-x-1 border-b border-zinc-700 text-sm font-semibold text-semantic-bg-secondary-alt-primary"
>
{children}
</a>
);
};
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@ import cn from "clsx";

import type { Nullable, ResourceState } from "../lib";

export type StateLabelProps = {
export type ModelStateLabelProps = {
state?: Nullable<ResourceState>;
className?: string;
};

export const StateLabel = ({ state, className }: StateLabelProps) => {
export const ModelStateLabel = ({ state, className }: ModelStateLabelProps) => {
if (!state) {
return null;
}
Expand Down
Loading

0 comments on commit 4bcdd1e

Please sign in to comment.