From 1971f4f6e408c24db3de7890cfbbcc420809c5f6 Mon Sep 17 00:00:00 2001 From: Varun Choudhary <68095256+Varun-Choudhary@users.noreply.github.com> Date: Tue, 28 Feb 2023 15:27:46 +0530 Subject: [PATCH] console: allow users to remove event trigger auto clean-up configuration PR-URL: https://github.com/hasura/graphql-engine-mono/pull/8036 Co-authored-by: Sooraj <8408875+soorajshankar@users.noreply.github.com> GitOrigin-RevId: da8df15ac3591a0fd5dfce8e0be26690479ef066 --- .../console-ce/src/css/legacy-boostrap.css | 8 +- .../console-ee/src/css/legacy-boostrap.css | 8 +- .../Common/Layout/ExpandableEditor/Editor.js | 4 +- .../Services/Events/EventTriggers/Add/Add.tsx | 8 +- .../EventTriggers/Common/AutoCleanupForm.tsx | 341 ++++++++++++------ .../Events/EventTriggers/Modify/Modify.tsx | 192 +++++----- .../Services/Events/EventTriggers/state.ts | 8 - .../lib/components/Services/Events/Router.tsx | 4 +- .../InputSetionWithoutForm/InputSection.tsx | 13 +- 9 files changed, 355 insertions(+), 231 deletions(-) diff --git a/frontend/apps/console-ce/src/css/legacy-boostrap.css b/frontend/apps/console-ce/src/css/legacy-boostrap.css index bac87936615..94c5a8692c7 100644 --- a/frontend/apps/console-ce/src/css/legacy-boostrap.css +++ b/frontend/apps/console-ce/src/css/legacy-boostrap.css @@ -152,10 +152,14 @@ input[type='submit'] { cursor: pointer; } -button[disabled], +/* +This button style was overriding all disabled buttons in console, +which was not allowing the `cursor-not-allowed` class to take effect +*/ +/* button[disabled], html input[disabled] { cursor: default; -} +} */ button::-moz-focus-inner, input::-moz-focus-inner { diff --git a/frontend/apps/console-ee/src/css/legacy-boostrap.css b/frontend/apps/console-ee/src/css/legacy-boostrap.css index 54965d7817f..5abfbf6a19c 100644 --- a/frontend/apps/console-ee/src/css/legacy-boostrap.css +++ b/frontend/apps/console-ee/src/css/legacy-boostrap.css @@ -152,10 +152,14 @@ input[type='submit'] { cursor: pointer; } -button[disabled], +/* +This button style was overriding all disabled buttons in console, +which was not allowing the `cursor-not-allowed` class to take effect +*/ +/* button[disabled], html input[disabled] { cursor: default; -} +} */ button::-moz-focus-inner, input::-moz-focus-inner { diff --git a/frontend/libs/console/legacy-ce/src/lib/components/Common/Layout/ExpandableEditor/Editor.js b/frontend/libs/console/legacy-ce/src/lib/components/Common/Layout/ExpandableEditor/Editor.js index 13b48233ced..62034bad611 100644 --- a/frontend/libs/console/legacy-ce/src/lib/components/Common/Layout/ExpandableEditor/Editor.js +++ b/frontend/libs/console/legacy-ce/src/lib/components/Common/Layout/ExpandableEditor/Editor.js @@ -67,7 +67,7 @@ class Editor extends React.Component { const saveWithToggle = () => saveFunc(this.toggleEditor); return ( + - - - - )} - + + )} + + diff --git a/frontend/libs/console/legacy-ce/src/lib/components/Services/Events/EventTriggers/state.ts b/frontend/libs/console/legacy-ce/src/lib/components/Services/Events/EventTriggers/state.ts index a3556393672..0c62a9e38f3 100644 --- a/frontend/libs/console/legacy-ce/src/lib/components/Services/Events/EventTriggers/state.ts +++ b/frontend/libs/console/legacy-ce/src/lib/components/Services/Events/EventTriggers/state.ts @@ -56,14 +56,6 @@ export const defaultState: LocalEventTriggerState = { headers: [defaultHeader], source: '', isAllColumnChecked: true, - cleanupConfig: { - schedule: '0 0 * * *', - batch_size: 10000, - clear_older_than: 168, - timeout: 60, - clean_invocation_logs: false, - paused: true, - }, }; export const parseServerETDefinition = ( diff --git a/frontend/libs/console/legacy-ce/src/lib/components/Services/Events/Router.tsx b/frontend/libs/console/legacy-ce/src/lib/components/Services/Events/Router.tsx index 6be2f087e3a..0f1dca760f1 100644 --- a/frontend/libs/console/legacy-ce/src/lib/components/Services/Events/Router.tsx +++ b/frontend/libs/console/legacy-ce/src/lib/components/Services/Events/Router.tsx @@ -64,7 +64,9 @@ const triggerRoutes = ( ( + + )} /> void; placeholder: string; tooltip: string; + disabled?: boolean; + required?: boolean; }) => { - const { label, value, onChange, placeholder, tooltip } = props; + const { label, value, onChange, placeholder, tooltip, disabled, required } = + props; return (
);