Skip to content

chore(site): remove workspace schedule machine #10583

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 5 commits into from
Nov 8, 2023
Merged
Changes from 1 commit
Commits
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
Next Next commit
Move template data and a few errors to the page
  • Loading branch information
BrunoQuaresma committed Nov 8, 2023
commit d09c4f8f12a5d0ec4ba17d2b3aec5ec95f592d10
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ import {
import { ErrorAlert } from "components/Alert/ErrorAlert";
import { useQuery, useQueryClient } from "react-query";
import { checkAuthorization } from "api/queries/authCheck";
import { templateByName } from "api/queries/templates";

const permissionsToCheck = (workspace: TypesGen.Workspace) =>
({
Expand All @@ -45,18 +46,16 @@ export const WorkspaceSchedulePage: FC = () => {
const workspaceName = params.workspace;
const queryClient = useQueryClient();
const workspace = useWorkspaceSettings();
const { data: permissions } = useQuery(
const { data: permissions, error: checkPermissionsError } = useQuery(
checkAuthorization({ checks: permissionsToCheck(workspace) }),
);
const { data: template, error: getTemplateError } = useQuery(
templateByName(workspace.organization_id, workspace.template_name),
);
const [scheduleState, scheduleSend] = useMachine(workspaceSchedule, {
context: { workspace },
});
const {
checkPermissionsError,
submitScheduleError,
getTemplateError,
template,
} = scheduleState.context;
const { submitScheduleError } = scheduleState.context;

if (!username || !workspaceName) {
return <Navigate to="/workspaces" />;
Expand Down