forked from cerc-io/snowballtools-base
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:
committed by
Ashwin Phatak
co-authored by
neeraj
parent
c2b997a17b
commit
44310d4eb8
@@ -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);
|
||||
|
||||
|
||||
@@ -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
@@ -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"]
|
||||
}
|
||||
]
|
||||
|
||||
Reference in New Issue
Block a user