Skip to content

Commit

Permalink
Merge pull request #119 from kloudlite/refactoring/show-env-details
Browse files Browse the repository at this point in the history
note added for public and private environmets
  • Loading branch information
abdheshnayak authored Mar 5, 2024
2 parents 37680b9 + c687db4 commit d8d3284
Show file tree
Hide file tree
Showing 3 changed files with 54 additions and 88 deletions.
48 changes: 18 additions & 30 deletions src/apps/console/page-components/new-scope.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import Yup from '~/root/lib/server/helpers/yup';
import { handleError } from '~/root/lib/utils/common';
import { Switch } from '~/components/atoms/switch';
import { Checkbox } from '~/components/atoms/checkbox';
import { InfoLabel } from '~/console/components/commons';
import Banner from '~/components/molecule/banner';
import { IDialog } from '../components/types.d';
import { useConsoleApi } from '../server/gql/api-provider';
import { DIALOG_TYPE } from '../utils/commons';
Expand Down Expand Up @@ -149,35 +149,23 @@ const HandleScope = ({ show, setShow }: IDialog<IEnvironment | null>) => {
nameErrorLabel="isNameError"
isUpdate={show?.type !== DIALOG_TYPE.ADD}
/>
<div className="flex flex-row items-center gap-lg">
<Checkbox
label="Public"
checked={values.environmentRoutingMode}
onChange={(val) => {
handleChange('environmentRoutingMode')(dummyEvent(val));
}}
/>
<InfoLabel
info={
<div className="flex flex-col gap-2xl">
<div>
<div className="bodyMd-medium">Public</div>
<p>
Public environments will expose services to the public
internet.
</p>
</div>
<div>
<div className="bodyMd-medium">Private</div>
<p>
Private environments will be accessible when Kloudlite
VPN is active.
</p>
</div>
</div>
}
/>
</div>
<Checkbox
label="Public"
checked={values.environmentRoutingMode}
onChange={(val) => {
handleChange('environmentRoutingMode')(dummyEvent(val));
}}
/>
<Banner
type="info"
body={
<span>
Public environments will expose services to the public
internet. Private environments will be accessible when
Kloudlite VPN is active.
</span>
}
/>
</div>
</Popup.Content>
<Popup.Footer>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import { useReload } from '~/root/lib/client/helpers/reloader';
import Wrapper from '~/console/components/wrapper';
import { Checkbox } from '~/components/atoms/checkbox';
import { InfoLabel } from '~/console/components/commons';
import Banner from '~/components/molecule/banner';
import { IEnvironmentContext } from '../../_layout';

const EnvironmentSettingsGeneral = () => {
Expand Down Expand Up @@ -129,35 +130,23 @@ const EnvironmentSettingsGeneral = () => {
value={values.displayName}
onChange={handleChange('displayName')}
/>
<div className="flex flex-row items-center gap-lg">
<Checkbox
label="Public"
checked={values.environmentRoutingMode}
onChange={(checked) => {
handleChange('environmentRoutingMode')(dummyEvent(checked));
}}
/>
<InfoLabel
info={
<div className="flex flex-col gap-2xl">
<div>
<div className="bodyMd-medium">Public</div>
<p>
Public environments will expose services to the public
internet.
</p>
</div>
<div>
<div className="bodyMd-medium">Private</div>
<p>
Private environments will be accessible when Kloudlite VPN
is active.
</p>
</div>
</div>
}
/>
</div>
<Checkbox
label="Public"
checked={values.environmentRoutingMode}
onChange={(checked) => {
handleChange('environmentRoutingMode')(dummyEvent(checked));
}}
/>
<Banner
type="info"
body={
<span>
Public environments will expose services to the public internet.
Private environments will be accessible when Kloudlite VPN is
active.
</span>
}
/>
<div className="flex flex-row items-center gap-3xl">
<div className="flex-1">
<TextInput
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import useForm, { dummyEvent } from '~/root/lib/client/hooks/use-form';
import Yup from '~/root/lib/server/helpers/yup';
import { handleError } from '~/root/lib/utils/common';
import { InfoLabel } from '~/console/components/commons';
import Banner from '~/components/molecule/banner';

type IDialog = IDialogBase<ExtractNodeType<IEnvironments>>;

Expand Down Expand Up @@ -87,35 +88,23 @@ const Root = (props: IDialog) => {
handleChange={handleChange}
nameErrorLabel="isNameError"
/>
<div className="flex flex-row items-center gap-lg">
<Checkbox
label="Public"
checked={values.environmentRoutingMode}
onChange={(val) => {
handleChange('environmentRoutingMode')(dummyEvent(val));
}}
/>
<InfoLabel
info={
<div className="flex flex-col gap-2xl">
<div>
<div className="bodyMd-medium">Public</div>
<p>
Public environments will expose services to the public
internet.
</p>
</div>
<div>
<div className="bodyMd-medium">Private</div>
<p>
Private environments will be accessible when Kloudlite VPN
is active.
</p>
</div>
</div>
}
/>
</div>
<Checkbox
label="Public"
checked={values.environmentRoutingMode}
onChange={(val) => {
handleChange('environmentRoutingMode')(dummyEvent(val));
}}
/>
<Banner
type="info"
body={
<span>
Public environments will expose services to the public internet.
Private environments will be accessible when Kloudlite VPN is
active.
</span>
}
/>
</div>
</Popup.Content>
<Popup.Footer>
Expand Down

0 comments on commit d8d3284

Please sign in to comment.