-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #165 from kloudlite/design
Design
- Loading branch information
Showing
13 changed files
with
542 additions
and
125 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
32 changes: 32 additions & 0 deletions
32
src/apps/console/components/extended-filled-tab-with-container.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
import { ReactNode } from 'react'; | ||
import ExtendedFilledTab, { IExtendedFilledTab } from './extended-filled-tab'; | ||
|
||
interface IExtendedFilledTabWithContainer extends IExtendedFilledTab { | ||
children?: ReactNode; | ||
} | ||
const ExtendedFilledTabWithContainer = ({ | ||
children, | ||
items, | ||
value, | ||
size, | ||
onChange, | ||
}: IExtendedFilledTabWithContainer) => { | ||
return ( | ||
<div className="flex flex-col rounded border border-border-default bg-surface-basic-default shadow-button overflow-hidden"> | ||
<div | ||
className="py-xl px-3xl flex flex-row | ||
items-center bg-surface-basic-subdued" | ||
> | ||
<ExtendedFilledTab | ||
items={items} | ||
value={value} | ||
size={size} | ||
onChange={onChange} | ||
/> | ||
</div> | ||
<div className="p-3xl">{children}</div> | ||
</div> | ||
); | ||
}; | ||
|
||
export default ExtendedFilledTabWithContainer; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
109 changes: 109 additions & 0 deletions
109
src/apps/console/page-components/app/app-build-integration.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,109 @@ | ||
import { useOutletContext } from '@remix-run/react'; | ||
import { Checkbox } from '~/components/atoms/checkbox'; | ||
import { TextArea, TextInput } from '~/components/atoms/input'; | ||
import Git from '~/console/components/git'; | ||
import KeyValuePair from '~/console/components/key-value-pair'; | ||
import { IGIT_PROVIDERS } from '~/console/hooks/use-git'; | ||
import { IAppContext } from '~/console/routes/_main+/$account+/$project+/env+/$environment+/app+/$app+/_layout'; | ||
import { dummyEvent } from '~/root/lib/client/hooks/use-form'; | ||
|
||
const AppBuildIntegration = ({ | ||
values, | ||
errors, | ||
handleChange, | ||
}: { | ||
values: Record<string, any>; | ||
errors: Record<string, any>; | ||
handleChange: (key: string) => (e: { target: { value: any } }) => void; | ||
}) => { | ||
const { logins, loginUrls } = useOutletContext<IAppContext>(); | ||
|
||
return ( | ||
<div className="flex flex-col gap-3xl"> | ||
<Git | ||
logins={logins} | ||
loginUrls={loginUrls} | ||
error={errors?.source} | ||
onChange={(git) => { | ||
handleChange('source')( | ||
dummyEvent({ | ||
branch: git.branch, | ||
repository: git.repo, | ||
provider: git.provider, | ||
}) | ||
); | ||
}} | ||
value={{ | ||
branch: values.source.branch, | ||
repo: values.source.repository, | ||
provider: (values.source.provider as IGIT_PROVIDERS) || 'github', | ||
}} | ||
/> | ||
|
||
<Checkbox | ||
label="Advance options" | ||
checked={values.advanceOptions} | ||
onChange={(check) => { | ||
handleChange('advanceOptions')(dummyEvent(!!check)); | ||
}} | ||
/> | ||
{values.advanceOptions && ( | ||
<div className="flex flex-col gap-3xl"> | ||
<KeyValuePair | ||
size="lg" | ||
label="Build args" | ||
value={Object.entries(values.buildArgs || {}).map( | ||
([key, value]) => ({ key, value }) | ||
)} | ||
onChange={(_, items) => { | ||
handleChange('buildArgs')(dummyEvent(items)); | ||
}} | ||
error={!!errors.buildArgs} | ||
message={errors.buildArgs} | ||
/> | ||
<KeyValuePair | ||
size="lg" | ||
label="Build contexts" | ||
value={Object.entries(values.buildContexts || {}).map( | ||
([key, value]) => ({ key, value }) | ||
)} | ||
onChange={(_, items) => { | ||
handleChange('buildContexts')(dummyEvent(items)); | ||
}} | ||
error={!!errors.buildContexts} | ||
message={errors.buildContexts} | ||
/> | ||
<TextInput | ||
size="lg" | ||
placeholder="Enter context dir" | ||
label="Context dir" | ||
value={values.contextDir} | ||
onChange={handleChange('contextDir')} | ||
/> | ||
<TextInput | ||
size="lg" | ||
placeholder="Enter docker file path" | ||
label="Docker file path" | ||
value={values.dockerfilePath} | ||
onChange={handleChange('dockerfilePath')} | ||
/> | ||
<TextArea | ||
placeholder="Enter docker file content" | ||
label="Docker file content" | ||
value={values.dockerfileContent} | ||
onChange={handleChange('dockerfileContent')} | ||
resize={false} | ||
rows="6" | ||
/> | ||
{/* <BuildPlatforms */} | ||
{/* onChange={(data) => { */} | ||
{/* console.log(data); */} | ||
{/* }} */} | ||
{/* /> */} | ||
</div> | ||
)} | ||
</div> | ||
); | ||
}; | ||
|
||
export default AppBuildIntegration; |
Oops, something went wrong.