Add and refresh environment variables in project settings tab (#37)

* Create and use add environment variables gql client method

* Implement get environment variables method

* Display fetched environment variables

* Refactor create environment variables submit handler

* Use environment variables type from gql-client

* Add fixtures for project member

---------

Co-authored-by: neeraj <neeraj.rtly@gmail.com>
This commit is contained in:
2024-02-01 11:37:57 +05:30
committed by Ashwin Phatak
co-authored by neeraj
parent c2b997a17b
commit 44310d4eb8
12 changed files with 191 additions and 61 deletions
+10
View File
@@ -58,6 +58,16 @@ export const createResolvers = async (db: Database): Promise<any> => {
return deployments;
},
environmentVariables: async (_: any, { projectId }: { projectId: string }) => {
const dbEnvironmentVariables = await db.getEnvironmentVariablesByProjectId(projectId);
const environmentVariables = dbEnvironmentVariables.map(dbEnvironmentVariable => {
return environmentVariableToGqlType(dbEnvironmentVariable);
});
return environmentVariables;
},
projectMembers: async (_: any, { projectId }: { projectId: string }) => {
const dbProjectMembers = await db.getProjectMembersByProjectId(projectId);
+1
View File
@@ -116,6 +116,7 @@ type Query {
organizations: [Organization!]
projects: [Project!]
deployments(projectId: String!): [Deployment!]
environmentVariables(projectId: String!): [EnvironmentVariable!]
projectMembers(projectId: String!): [ProjectMember!]
searchProjects(searchText: String!): [Project!]
}
+36 -1
View File
@@ -2,11 +2,46 @@
{
"memberIndex": 1,
"projectIndex": 0,
"permissions": ["View", "Edit"]
"permissions": ["View"]
},
{
"memberIndex": 2,
"projectIndex": 0,
"permissions": ["View", "Edit"]
},
{
"memberIndex": 2,
"projectIndex": 1,
"permissions": ["View"]
},
{
"memberIndex": 0,
"projectIndex": 2,
"permissions": ["View"]
},
{
"memberIndex": 1,
"projectIndex": 2,
"permissions": ["View", "Edit"]
},
{
"memberIndex": 0,
"projectIndex": 3,
"permissions": ["View"]
},
{
"memberIndex": 2,
"projectIndex": 3,
"permissions": ["View", "Edit"]
},
{
"memberIndex": 1,
"projectIndex": 4,
"permissions": ["View"]
},
{
"memberIndex": 2,
"projectIndex": 4,
"permissions": ["View", "Edit"]
}
]