这是indexloc提供的服务,不要输入任何密码
Skip to content
Merged

Develop #1445

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
f14e77b
implement secret manager popup
bofeiw Jun 26, 2023
a0c59e8
remove console logs
bofeiw Jun 26, 2023
31296ef
tablename first click error fixed
AnushDeokar Sep 13, 2023
e419480
Create a `Table Settings` section.
nithinrdy Sep 21, 2023
540373d
Create atom to fetch `defaultTableSettings` from.
nithinrdy Sep 21, 2023
03bbce2
Remove stray console.log and better variable naming
nithinrdy Sep 21, 2023
6e21feb
Group like imports
nithinrdy Sep 21, 2023
d3e89e6
feat: added tooltip to buttons
janvi01 Oct 2, 2023
204ed46
fix: added mui tooltip component
janvi01 Oct 2, 2023
9f52e09
Add Field Key input field to CSV import step 1, next to Column Select
nithinrdy Oct 3, 2023
8984f39
Disable next if fieldKeys are empty strings
nithinrdy Oct 3, 2023
c0b0488
Move save pop-ups out of the way, to the corner
nithinrdy Oct 4, 2023
65ba997
Merge pull request #1419 from nithinrdy/allow-for-disabling-save-popu…
shamsmosowi Oct 6, 2023
6850315
Merge pull request #1431 from nithinrdy/ability-to-edit-fieldKeys-whe…
shamsmosowi Oct 11, 2023
4ed7a89
add buildship authenticated trigger
bofeiw Oct 13, 2023
fe16570
fix buildship typo
bofeiw Oct 17, 2023
1646e99
add prefilled values for buildship extension
bofeiw Oct 18, 2023
90f2136
Bump tinymce from 5.10.7 to 5.10.8
dependabot[bot] Oct 19, 2023
80a4080
Retrieve clipboard data from the event instead
nithinrdy Oct 22, 2023
b30395f
update buildship trigger body config
bofeiw Oct 22, 2023
a249b3d
update buildship trigger context type
bofeiw Oct 22, 2023
7bedf8b
Add info snackbar for Firefox users
nithinrdy Oct 23, 2023
b85ec59
Merge pull request #1444 from nithinrdy/allow-for-pasting-in-firefox
shamsmosowi Oct 24, 2023
29f9e47
Merge pull request #1439 from rowyio/dependabot/npm_and_yarn/tinymce-…
shamsmosowi Oct 24, 2023
c65ada7
Merge pull request #1437 from rowyio/feat/buildship-authenticated-ext…
shamsmosowi Oct 24, 2023
3638cd2
Merge pull request #1322 from rowyio/feat/secret-management-popup
shamsmosowi Oct 25, 2023
093183e
Merge pull request #1412 from AnushDeokar/fix/tablename-textbox-ui-er…
shamsmosowi Oct 25, 2023
fd8df49
Merge pull request #1430 from janvi01/BtnTooltips
shamsmosowi Oct 25, 2023
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
7 changes: 7 additions & 0 deletions src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,12 @@ const SetupPage = lazy(() => import("@src/pages/SetupPage" /* webpackChunkName:
const Navigation = lazy(() => import("@src/layouts/Navigation" /* webpackChunkName: "Navigation" */));
// prettier-ignore
const TableSettingsDialog = lazy(() => import("@src/components/TableSettingsDialog" /* webpackChunkName: "TableSettingsDialog" */));
const ProjectSettingsDialog = lazy(
() =>
import(
"@src/components/ProjectSettingsDialog" /* webpackChunkName: "ProjectSettingsDialog" */
)
);

// prettier-ignore
const TablesPage = lazy(() => import("@src/pages/TablesPage" /* webpackChunkName: "TablesPage" */));
Expand Down Expand Up @@ -99,6 +105,7 @@ export default function App() {
<RequireAuth>
<Navigation>
<TableSettingsDialog />
<ProjectSettingsDialog />
</Navigation>
</RequireAuth>
}
Expand Down
20 changes: 20 additions & 0 deletions src/atoms/projectScope/ui.ts
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,26 @@ export const tableSettingsDialogAtom = atom(
}
);

export type ProjectSettingsDialogTab =
| "general"
| "rowy-run"
| "services"
| "secrets";
export type ProjectSettingsDialogState = {
open: boolean;
tab: ProjectSettingsDialogTab;
};
export const projectSettingsDialogAtom = atom(
{ open: false, tab: "secrets" } as ProjectSettingsDialogState,
(_, set, update?: Partial<ProjectSettingsDialogState>) => {
set(projectSettingsDialogAtom, {
open: true,
tab: "secrets",
...update,
});
}
);

/**
* Store the current ID of the table being edited in tableSettingsDialog
* to derive tableSettingsDialogSchemaAtom
Expand Down
6 changes: 6 additions & 0 deletions src/atoms/projectScope/user.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,12 @@ export const themeOverriddenAtom = atomWithStorage(
false
);

/** User's default table settings (affecting saving and popup behavior) */
export const defaultTableSettingsAtom = atom((get) => {
const userSettings = get(userSettingsAtom);
return userSettings.defaultTableSettings;
});

/** Customized base theme based on project and user settings */
export const customizedThemesAtom = atom((get) => {
const publicSettings = get(publicSettingsAtom);
Expand Down
11 changes: 11 additions & 0 deletions src/components/CodeEditor/extensions.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -128,4 +128,15 @@ type PushNotificationRequest = {
type PushNotificationBody = (
context: ExtensionContext
) => Message | Message[] | Promise<Message | Message[]>;

type TaskBody = (context: ExtensionContext) => Promise<any>;

type BuildshipAuthenticatedTriggerBody = (
context: ExtensionContext
) => Promise<{
buildshipConfig: {
projectId: string;
workflowId: string;
};
body: string;
}>;
282 changes: 282 additions & 0 deletions src/components/ProjectSettingsDialog/ProjectSettingsDialog.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,282 @@
import React from "react";
import { useAtom } from "jotai";
import {
projectScope,
projectSettingsDialogAtom,
ProjectSettingsDialogTab,
rowyRunAtom,
secretNamesAtom,
updateSecretNamesAtom,
} from "@src/atoms/projectScope";
import Modal from "@src/components/Modal";
import { Box, Button, Paper, Tab, Tooltip, Typography } from "@mui/material";
import { TabContext, TabPanel, TabList } from "@mui/lab";
import DeleteOutlineIcon from "@mui/icons-material/DeleteOutline";
import EditIcon from "@mui/icons-material/Edit";
import SecretDetailsModal from "./SecretDetailsModal";
import { runRoutes } from "@src/constants/runRoutes";

export default function ProjectSettingsDialog() {
const [{ open, tab }, setProjectSettingsDialog] = useAtom(
projectSettingsDialogAtom,
projectScope
);
const [secretNames] = useAtom(secretNamesAtom, projectScope);
const [secretDetailsModal, setSecretDetailsModal] = React.useState<{
open: boolean;
loading?: boolean;
mode?: "add" | "edit" | "delete";
secretName?: string;
error?: string;
}>({
open: false,
});
const [rowyRun] = useAtom(rowyRunAtom, projectScope);
const [updateSecretNames] = useAtom(updateSecretNamesAtom, projectScope);

if (!open) return null;

const handleClose = () => {
setProjectSettingsDialog({ open: false });
};

const handleTabChange = (
event: React.SyntheticEvent,
newTab: ProjectSettingsDialogTab
) => {
setProjectSettingsDialog({ tab: newTab });
};

console.log(secretDetailsModal);

return (
<>
<Modal
onClose={handleClose}
open={open}
maxWidth="sm"
fullWidth
title={"Project settings"}
sx={{
".MuiDialogContent-root": {
display: "flex",
flexDirection: "column",
height: "100%",
},
}}
children={
<>
<TabContext value={tab}>
<Box
sx={{
borderBottom: 1,
borderColor: "divider",
}}
>
<TabList value={tab} onChange={handleTabChange}>
<Tab label="Secret keys" value={"secrets"} />
</TabList>
</Box>
<TabPanel
value={tab}
sx={{
overflowY: "scroll",
}}
>
<Paper elevation={1} variant={"outlined"}>
<Box
sx={{
display: "flex",
justifyContent: "space-between",
alignItems: "center",
padding: 3,
}}
>
<Typography variant="h6" sx={{ fontWeight: "bold" }}>
Secrets
</Typography>
<Button
variant="contained"
color="primary"
onClick={() => {
setSecretDetailsModal({
open: true,
mode: "add",
});
}}
>
Add secret key
</Button>
</Box>
{secretNames.secretNames?.map((secretName) => (
<Box
key={secretName}
sx={{
display: "flex",
justifyContent: "space-between",
alignItems: "center",
padding: 3,
borderTop: 1,
borderColor: "divider",
}}
>
<Typography variant="body2" color="text.secondary">
{secretName}
</Typography>
<Box>
<Tooltip title={"Edit"}>
<Button
variant="outlined"
color="primary"
style={{
minWidth: "40px",
paddingLeft: 0,
paddingRight: 0,
marginRight: "8px",
}}
onClick={() => {
setSecretDetailsModal({
open: true,
mode: "edit",
secretName,
});
}}
>
<EditIcon color={"secondary"} />
</Button>
</Tooltip>
<Tooltip title={"Delete"}>
<Button
variant="outlined"
color="primary"
style={{
minWidth: "40px",
paddingLeft: 0,
paddingRight: 0,
}}
onClick={() => {
console.log("setting", {
open: true,
mode: "delete",
secretName,
});
setSecretDetailsModal({
open: true,
mode: "delete",
secretName,
});
}}
>
<DeleteOutlineIcon color={"secondary"} />
</Button>
</Tooltip>
</Box>
</Box>
))}
</Paper>
</TabPanel>
</TabContext>
</>
}
/>
<SecretDetailsModal
open={secretDetailsModal.open}
mode={secretDetailsModal.mode}
error={secretDetailsModal.error}
loading={secretDetailsModal.loading}
secretName={secretDetailsModal.secretName}
handleClose={() => {
setSecretDetailsModal({ ...secretDetailsModal, open: false });
}}
handleAdd={async (newSecretName, secretValue) => {
setSecretDetailsModal({
...secretDetailsModal,
loading: true,
});
try {
await rowyRun({
route: runRoutes.addSecret,
body: {
name: newSecretName,
value: secretValue,
},
});
setSecretDetailsModal({
...secretDetailsModal,
open: false,
loading: false,
});
// update secret name causes an unknown modal-related bug, to be fixed
// updateSecretNames?.();
} catch (error: any) {
console.error(error);
setSecretDetailsModal({
...secretDetailsModal,
error: error.message,
});
}
}}
handleEdit={async (secretName, secretValue) => {
setSecretDetailsModal({
...secretDetailsModal,
loading: true,
});
try {
await rowyRun({
route: runRoutes.editSecret,
body: {
name: secretName,
value: secretValue,
},
});
setSecretDetailsModal({
...secretDetailsModal,
open: false,
loading: false,
});
// update secret name causes an unknown modal-related bug, to be fixed
// updateSecretNames?.();
} catch (error: any) {
console.error(error);
setSecretDetailsModal({
...secretDetailsModal,
error: error.message,
});
}
}}
handleDelete={async (secretName) => {
setSecretDetailsModal({
...secretDetailsModal,
loading: true,
});
try {
await rowyRun({
route: runRoutes.deleteSecret,
body: {
name: secretName,
},
});
console.log("Setting", {
...secretDetailsModal,
open: false,
loading: false,
});
setSecretDetailsModal({
...secretDetailsModal,
open: false,
loading: false,
});
// update secret name causes an unknown modal-related bug, to be fixed
// updateSecretNames?.();
} catch (error: any) {
console.error(error);
setSecretDetailsModal({
...secretDetailsModal,
error: error.message,
});
}
}}
/>
</>
);
}
Loading