Skip to content

chore(site): remove template version editor xservice #10490

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 24 commits into from
Nov 3, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Fix storybook
  • Loading branch information
BrunoQuaresma committed Nov 2, 2023
commit 353f32522fb6f3c42b810bd5f5a73e2be2a177f7
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,9 @@ type Story = StoryObj<typeof TemplateVersionEditor>;

export const Example: Story = {};

export const Logs = {
export const Logs: Story = {
args: {
defaultTab: "logs",
buildLogs: MockWorkspaceBuildLogs,
templateVersion: {
...MockTemplateVersion,
Expand All @@ -46,6 +47,7 @@ export const Logs = {

export const Resources: Story = {
args: {
defaultTab: "resources",
buildLogs: MockWorkspaceBuildLogs,
resources: [
MockWorkspaceResource,
Expand All @@ -58,8 +60,9 @@ export const Resources: Story = {
},
};

export const ManyLogs = {
export const WithError = {
args: {
defaultTab: "logs",
templateVersion: {
...MockTemplateVersion,
job: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ import AlertTitle from "@mui/material/AlertTitle";
import { DashboardFullPage } from "components/Dashboard/DashboardLayout";
import { type Interpolation, type Theme, useTheme } from "@emotion/react";

type Tab = "logs" | "resources" | undefined; // Undefined is to hide the tab
export interface TemplateVersionEditorProps {
template: Template;
templateVersion: TemplateVersion;
Expand All @@ -70,6 +71,7 @@ export interface TemplateVersionEditorProps {
missingVariables?: TemplateVersionVariable[];
onSubmitMissingVariableValues: (values: VariableValue[]) => void;
onCancelSubmitMissingVariableValues: () => void;
defaultTab?: Tab;
}

const topbarHeight = 80;
Expand Down Expand Up @@ -107,11 +109,10 @@ export const TemplateVersionEditor: FC<TemplateVersionEditorProps> = ({
missingVariables,
onSubmitMissingVariableValues,
onCancelSubmitMissingVariableValues,
defaultTab,
}) => {
const theme = useTheme();
const [selectedTab, setSelectedTab] = useState<
"logs" | "resources" | undefined // Undefined is to hide the tab
>();
const [selectedTab, setSelectedTab] = useState<Tab>(defaultTab);
const [fileTree, setFileTree] = useState(defaultFileTree);
const [createFileOpen, setCreateFileOpen] = useState(false);
const [deleteFileOpen, setDeleteFileOpen] = useState<string>();
Expand Down