Skip to content
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

feat(platform): Edit existing variables in a project #602

Open
wants to merge 17 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
17 commits
Select commit Hold shift + click to select a range
0a17ad1
feat: added feature to show all the existing variables inside a project
poswalsameer Dec 16, 2024
1882f33
Delete t.success('User details updated successfully')
poswalsameer Dec 19, 2024
675f6e4
Delete t updateSelf = useCallback(async () => {
poswalsameer Dec 19, 2024
73d0888
Delete erDetails(userData)
poswalsameer Dec 19, 2024
4c4e96e
refactored the code for adding new variables to a project
poswalsameer Dec 20, 2024
5a01926
fix: conditionally render project creation button based on project state
kriptonian1 Dec 21, 2024
64c0d84
fix: cast response as ClientResponse type for better type safety
kriptonian1 Dec 21, 2024
e790934
feat: add reusable Textarea component with customizable styles
kriptonian1 Dec 21, 2024
606fc20
feat: replace Input components with Textarea for improved user experi…
kriptonian1 Dec 21, 2024
25733f2
fix: improve type safety and error handling in variable addition
kriptonian1 Dec 21, 2024
316aff8
converted the variable name to UPPERCASE
poswalsameer Dec 21, 2024
663e28c
reverted back to lowercase name for variables
poswalsameer Dec 21, 2024
80a80a2
feat: add toster for success an error and modifed the dialog element
kriptonian1 Dec 21, 2024
b4f07a6
modified the code and removed unneccessary logs
poswalsameer Dec 23, 2024
31f4084
feat: added feature for deleting a variable from a project
poswalsameer Dec 29, 2024
e16e169
feat: edit existing variables in a project
poswalsameer Dec 31, 2024
9903c8d
added tooltip and modified the edit dialog component to show the curr…
poswalsameer Jan 3, 2025
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
3 changes: 3 additions & 0 deletions apps/platform/public/svg/shared/Error.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions apps/platform/public/svg/shared/Vector.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
10 changes: 9 additions & 1 deletion apps/platform/public/svg/shared/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ import SettingsSVG from './settings.svg'
import ThreeDotOptionSVG from './3dotOption.svg'
import AddSVG from './add.svg'
import LoadingSVG from './loading.svg'
import MessageSVG from './message.svg'
import VectorSVG from './vector.svg'
import ErrorSVG from './Error.svg'
import TrashSVG from './trash.svg'

export {
DropdownSVG,
Expand All @@ -17,5 +21,9 @@ export {
SettingsSVG,
ThreeDotOptionSVG,
AddSVG,
LoadingSVG
LoadingSVG,
MessageSVG,
VectorSVG,
ErrorSVG,
TrashSVG,
}
3 changes: 3 additions & 0 deletions apps/platform/public/svg/shared/message.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 6 additions & 0 deletions apps/platform/public/svg/shared/trash.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
37 changes: 25 additions & 12 deletions apps/platform/src/app/(main)/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ import {
DialogTrigger
} from '@/components/ui/dialog'
import ControllerInstance from '@/lib/controller-instance'
import { Textarea } from '@/components/ui/textarea'

export default function Index(): JSX.Element {
const [isSheetOpen, setIsSheetOpen] = useState<boolean>(false)
Expand Down Expand Up @@ -144,10 +145,12 @@ export default function Index(): JSX.Element {

<Dialog onOpenChange={setIsDialogOpen} open={isDialogOpen}>
<DialogTrigger>
<Button onClick={toggleDialog}>
{' '}
<AddSVG /> Create a new Project
</Button>
{isProjectEmpty ? null : (
<Button onClick={toggleDialog}>
{' '}
<AddSVG /> Create a new Project
</Button>
)}
</DialogTrigger>
<DialogContent className="h-[39.5rem] w-[28.625rem] rounded-[12px] border bg-[#1E1E1F] ">
<div className="flex h-[3.125rem] w-[25.625rem] flex-col items-start justify-center">
Expand Down Expand Up @@ -190,8 +193,8 @@ export default function Index(): JSX.Element {
>
Description
</Label>
<Input
className="col-span-3 h-[5.625rem] w-[20rem] gap-[0.25rem]"
<Textarea
className="col-span-3 h-[5.625rem] w-[20rem] resize-none gap-[0.25rem]"
id="name"
onChange={(e) => {
setNewProjectData((prev) => ({
Expand All @@ -217,7 +220,10 @@ export default function Index(): JSX.Element {
onChange={(e) => {
setNewProjectData((prev) => ({
...prev,
envName: e.target.value
environments: (prev.environments || []).map(
(env, index) =>
index === 0 ? { ...env, name: e.target.value } : env
)
}))
}}
placeholder="Your project default environment name"
Expand All @@ -232,13 +238,18 @@ export default function Index(): JSX.Element {
>
Env. Description
</Label>
<Input
className="col-span-3 h-[4.875rem] w-[20rem] "
<Textarea
className="col-span-3 h-[4.875rem] w-[20rem] resize-none"
id="envDescription"
onChange={(e) => {
setNewProjectData((prev) => ({
...prev,
envDescription: e.target.value
environments: (prev.environments || []).map(
(env, index) =>
index === 0
? { ...env, description: e.target.value }
: env
)
}))
}}
placeholder="Detailed description about your environment"
Expand All @@ -265,7 +276,7 @@ export default function Index(): JSX.Element {
}))
}}
>
<SelectTrigger className=" h-[2.25rem] w-[20rem] rounded-[0.375rem] border-[0.013rem] border-white/10 focus:border-[#3b82f6]">
<SelectTrigger className=" h-[2.25rem] w-[20rem] rounded-[0.375rem] border-[0.013rem] border-white/10 bg-white/5 focus:border-[#3b82f6]">
<SelectValue />
</SelectTrigger>
<SelectContent className="border-[0.013rem] border-white/10 bg-neutral-800 text-white ">
Expand Down Expand Up @@ -334,7 +345,9 @@ export default function Index(): JSX.Element {
<div>
Create a file and start setting up your environment and secret keys
</div>
<Button variant="secondary">Create project</Button>
<Button onClick={toggleDialog} variant="secondary">
Create project
</Button>
</div>
)}

Expand Down
Loading
Loading