-
-
Notifications
You must be signed in to change notification settings - Fork 115
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): Added screen for CREATE NEW PROJECT #540
feat(platform): Added screen for CREATE NEW PROJECT #540
Conversation
PR Reviewer Guide 🔍Here are some key observations to aid the review process:
|
PR Code Suggestions ✨Explore these optional code suggestions:
|
2a42ae8
to
2ef4bb4
Compare
2ef4bb4
to
0ac46f2
Compare
updatedAt: data.updatedAt, | ||
storePrivateKey: data.storePrivateKey, | ||
isDisabled: data.isDisabled, | ||
accessLevel: data.accessLevel as "GLOBAL" | "INTERNAL" | "PRIVATE", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Access level is already inferred as these types.
@@ -53,16 +53,16 @@ export default function Index(): JSX.Element { | |||
environments: [ | |||
{ | |||
name: '', | |||
description: '', | |||
isDefault: false | |||
projectId: Date.now().toString(), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can just set it to ''. Either ways, this won't be sent to the backend
apps/platform/src/types/index.ts
Outdated
@@ -42,8 +42,12 @@ export const zProject = z.object({ | |||
|
|||
export const zEnvironment = z.object({ | |||
name: z.string(), | |||
description: z.string().nullable(), | |||
isDefault: z.boolean().optional() | |||
projectId: z.string(), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do not use these. We already have type definitions set in the schema
package.
…olean state to keep the track of dialog box
@@ -37,19 +38,40 @@ import { | |||
DialogTrigger | |||
} from './dialog' | |||
import { Button } from './button' | |||
import { WorkspaceSchema } from '@keyshade/schema/schemas' | |||
|
|||
interface WorkspaceResponse { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The response object already have the pagination type included. I would highly recommend you to go through the entire schema package once to understand the types.
|
||
const { success, data } = zWorkspace.array().safeParse(workspaceData) | ||
const workspaceData: WorkspaceResponse = | ||
await apiClient.get<WorkspaceResponse>('/workspace') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You shouldnt be using direct calls. We have the controllers defined in api-client
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You shouldnt be using direct calls. We have the controllers defined in
api-client
This was done intentionally, @kriptonian1 was with me. There were some issues from the api
side on getting the currentWorkspace
. That's why this was done, just to make sure that the flow atleast works.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, but do keep a TODO: in here to change it later on.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, but do keep a TODO: in here to change it later on.
sure
@rajdip-b if it's working then merge it let's not focus too much on quality |
I'm focussing on the consistency of things. That's why i've kept it on the hold till the |
@poswalsameer can you fix the conflicts? Also, i think the type defs are the only thing remaining. once you get that done we can quickly merge this one. its taking a while i must say |
Fixed the conflicts, for the only change remaining I had a talk with @kriptonian1 about the same, he suggested to merge the changes since there are some issues in that file, so yeah apart from that everything is done from my side. |
@poswalsameer linting is failing with some GC error. This never happened before. Can you try running this locally and see if the error persists? Also, please update the lockfile. |
Sure, I guess it's happening because of some log statement still remaining in the codefile, let me remove them. Also, can you help me with lockfile, like which things need to be updated there? |
Delete the pnpm lock file and run pnpm i. that should fix it. |
cbfbcd3
to
08a2221
Compare
## [2.8.0](v2.7.0...v2.8.0) (2024-12-03) ### 🚀 Features * **api:** Add workspace removal notification email template ([#476](#476)) ([40b754f](40b754f)) * **cli:** Store `metrics_enabled` key in profile config ([#536](#536)) ([9283b22](9283b22)) * **package, api, cli:** Add api-key schemas and types; Fix schema inconsistencies; Minor fix for CLI build errors ([#557](#557)) ([126d024](126d024)) * **platform:** Added screen for CREATE NEW PROJECT ([#540](#540)) ([b644633](b644633)) * **platform:** Updated the empty state of dashboard ([#522](#522)) ([28739d9](28739d9)) * **schema, api-client:** Migrate auth types to @keyshade/schema ([#532](#532)) ([d880098](d880098)) * **schema, api-client:** Migrate event schemas and types to @keyshade/schema ([#546](#546)) ([a3267de](a3267de)) * **schema, api-client:** Migrate integration schemas and types to @keyshade/schema ([#547](#547)) ([08868c3](08868c3)) * **schema, api-client:** Migrate project schemas and environment schemas along with their types to @keyshade/schema ([#538](#538)) ([c468af0](c468af0)) * **schema, api-client:** Migrate [secure] types and schemas to @keyshade/schema ([#539](#539)) ([bc3100b](bc3100b)) * **schema, api-client:** Migrate user types and schemas to @keyshade/schema ([#535](#535)) ([c24695e](c24695e)) * **schema, api-client:** Migrate variable schemas and types to @keyshade/schema ([#545](#545)) ([0ee8f9a](0ee8f9a)) * **schema, api-client:** Migrate workspace-membership schemas and types to @keyshade/schema ([#569](#569)) ([4398969](4398969)) * **schema, api-client:** Migrate workspace-role schemas and types to @keyshade/schema ([#568](#568)) ([9efbf2d](9efbf2d)) * **schema:** Add User type inference from UserSchema ([#574](#574)) ([84c1db5](84c1db5)) ### 🐛 Bug Fixes * **api:** Incorrect oauth redirect url ([58d96e5](58d96e5)) * **platform:** Resolve loading SVG blocking input field interaction ([#571](#571)) ([30f4f65](30f4f65)) ### 📚 Documentation * Add pictures to Bruno setup ([#541](#541)) ([210c0fd](210c0fd)) * Migrate to Bruno ([#525](#525)) ([1793d92](1793d92)) ### 🔧 Miscellaneous Chores * **ci:** Add script to validate schema package ([59e4280](59e4280)) * Fixed codecov client version ([a998ae4](a998ae4)) * **package:** Fixed tests and did housekeeping ([#544](#544)) ([40008e3](40008e3)) * Update test coverage settings ([5b27e32](5b27e32)) * Update Turbo to 2.3.1 ([#564](#564)) ([3a63823](3a63823)) * **web:** Update dockerfile ([10d9cc5](10d9cc5)) ### 🔨 Code Refactoring * **api-client, schema:** Add workspace's schemas and types in @keyshade/schema ([#520](#520)) ([7c8ee5d](7c8ee5d))
Co-authored-by: rajdip-b <[email protected]>
## [2.8.0](keyshade-xyz/keyshade@v2.7.0...v2.8.0) (2024-12-03) ### 🚀 Features * **api:** Add workspace removal notification email template ([keyshade-xyz#476](keyshade-xyz#476)) ([40b754f](keyshade-xyz@40b754f)) * **cli:** Store `metrics_enabled` key in profile config ([keyshade-xyz#536](keyshade-xyz#536)) ([9283b22](keyshade-xyz@9283b22)) * **package, api, cli:** Add api-key schemas and types; Fix schema inconsistencies; Minor fix for CLI build errors ([keyshade-xyz#557](keyshade-xyz#557)) ([126d024](keyshade-xyz@126d024)) * **platform:** Added screen for CREATE NEW PROJECT ([keyshade-xyz#540](keyshade-xyz#540)) ([b644633](keyshade-xyz@b644633)) * **platform:** Updated the empty state of dashboard ([keyshade-xyz#522](keyshade-xyz#522)) ([28739d9](keyshade-xyz@28739d9)) * **schema, api-client:** Migrate auth types to @keyshade/schema ([keyshade-xyz#532](keyshade-xyz#532)) ([d880098](keyshade-xyz@d880098)) * **schema, api-client:** Migrate event schemas and types to @keyshade/schema ([keyshade-xyz#546](keyshade-xyz#546)) ([a3267de](keyshade-xyz@a3267de)) * **schema, api-client:** Migrate integration schemas and types to @keyshade/schema ([keyshade-xyz#547](keyshade-xyz#547)) ([08868c3](keyshade-xyz@08868c3)) * **schema, api-client:** Migrate project schemas and environment schemas along with their types to @keyshade/schema ([keyshade-xyz#538](keyshade-xyz#538)) ([c468af0](keyshade-xyz@c468af0)) * **schema, api-client:** Migrate [secure] types and schemas to @keyshade/schema ([keyshade-xyz#539](keyshade-xyz#539)) ([bc3100b](keyshade-xyz@bc3100b)) * **schema, api-client:** Migrate user types and schemas to @keyshade/schema ([keyshade-xyz#535](keyshade-xyz#535)) ([c24695e](keyshade-xyz@c24695e)) * **schema, api-client:** Migrate variable schemas and types to @keyshade/schema ([keyshade-xyz#545](keyshade-xyz#545)) ([0ee8f9a](keyshade-xyz@0ee8f9a)) * **schema, api-client:** Migrate workspace-membership schemas and types to @keyshade/schema ([keyshade-xyz#569](keyshade-xyz#569)) ([4398969](keyshade-xyz@4398969)) * **schema, api-client:** Migrate workspace-role schemas and types to @keyshade/schema ([keyshade-xyz#568](keyshade-xyz#568)) ([9efbf2d](keyshade-xyz@9efbf2d)) * **schema:** Add User type inference from UserSchema ([keyshade-xyz#574](keyshade-xyz#574)) ([84c1db5](keyshade-xyz@84c1db5)) ### 🐛 Bug Fixes * **api:** Incorrect oauth redirect url ([58d96e5](keyshade-xyz@58d96e5)) * **platform:** Resolve loading SVG blocking input field interaction ([keyshade-xyz#571](keyshade-xyz#571)) ([30f4f65](keyshade-xyz@30f4f65)) ### 📚 Documentation * Add pictures to Bruno setup ([keyshade-xyz#541](keyshade-xyz#541)) ([210c0fd](keyshade-xyz@210c0fd)) * Migrate to Bruno ([keyshade-xyz#525](keyshade-xyz#525)) ([1793d92](keyshade-xyz@1793d92)) ### 🔧 Miscellaneous Chores * **ci:** Add script to validate schema package ([59e4280](keyshade-xyz@59e4280)) * Fixed codecov client version ([a998ae4](keyshade-xyz@a998ae4)) * **package:** Fixed tests and did housekeeping ([keyshade-xyz#544](keyshade-xyz#544)) ([40008e3](keyshade-xyz@40008e3)) * Update test coverage settings ([5b27e32](keyshade-xyz@5b27e32)) * Update Turbo to 2.3.1 ([keyshade-xyz#564](keyshade-xyz#564)) ([3a63823](keyshade-xyz@3a63823)) * **web:** Update dockerfile ([10d9cc5](keyshade-xyz@10d9cc5)) ### 🔨 Code Refactoring * **api-client, schema:** Add workspace's schemas and types in @keyshade/schema ([keyshade-xyz#520](keyshade-xyz#520)) ([7c8ee5d](keyshade-xyz@7c8ee5d))
User description
Description
Added screen for
Create New Project
by creating the UI and adding all the required functions to create a new project on button click.Fixes #244
Dependencies
No dependencies.
Mentions
@rajdip-b @kriptonian1
Screenshots of relevant screens
Developer's checklist
If changes are made in the code:
Documentation Update
PR Type
Enhancement, Dependencies
Description
accessLevel
for projects.@radix-ui/react-select
as a new dependency to support the select component.Changes walkthrough 📝
page.tsx
Implement "Create New Project" Feature in Dashboard
apps/platform/src/app/(main)/page.tsx
select.tsx
Add Select Component Using Radix UI
apps/platform/src/components/ui/select.tsx
index.ts
Update Type Definitions for Project Creation
apps/platform/src/types/index.ts
accessLevel
toNewProject
type.package.json
Add Radix UI Select Dependency
apps/platform/package.json
@radix-ui/react-select
dependency.pnpm-lock.yaml
Update Lockfile for New Dependencies
pnpm-lock.yaml
tsconfig.json
Update TypeScript Configuration
apps/platform/tsconfig.json