Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Type
Enhancement
Description
This PR introduces a new
visibility
field for projects, with possible values of 'PUBLIC', 'INTERNAL', and 'PRIVATE'. The main changes include:visibility
field.visibility
of each project.createProject
resolver to accept avisibility
field in the input and include it when creating a new project in the database.ProjectVisibility
enum to the GraphQL schema and including avisibility
field in theProject
andCreateProjectInput
types.visibility
column in theprojects
table.Project
model to include avisibility
field, with a default value of 'internal' and a validation to ensure the value is one of 'PRIVATE', 'INTERNAL', or 'PUBLIC'.PR changes walkthrough
7 files
gql.ts
frontend/gql/__generated__/gql.ts
The GraphQL queries and mutations related to projects have
been updated to include the new
visibility
field. TheProjectFields
andProjectOnlyFields
fragments nowinclude
visibility
. TheCreateProject
mutation andGetProjects
query now use theProjectOnlyFields
fragment.
gql-queries-mutations.ts
frontend/gql/gql-queries-mutations.ts
The
PROJECT_FIELDS
andPROJECT_ONLY_FIELDS
constantshave been updated to include the
visibility
field. TheCREATE_PROJECT_MUTATION
andGET_PROJECTS
queries now usethe
ProjectOnlyFields
fragment.index.tsx
frontend/components/ProjectList/index.tsx
The project list now includes a column for
visibility
. Thecols
constant and the project list rendering have beenupdated to include this new column.
resolvers.js
backend/src/resolvers.js
The
createProject
resolver now accepts avisibility
field in the input, with a default value of 'INTERNAL'. The
visibility
field is included when creating a new projectin the database.
type-defs.js
backend/src/type-defs.js
A new
ProjectVisibility
enum has been added to the GraphQLschema, with possible values of 'PUBLIC', 'INTERNAL', and
'PRIVATE'. The
Project
andCreateProjectInput
types nowinclude a
visibility
field of typeProjectVisibility
.20231223000001-add-project-visibility.js
backend/src/db/migrations/20231223000001-add-project-visibility.js
A new database migration has been added to include a
visibility
column in theprojects
table.project.js
backend/src/db/models/project.js
The
Project
model now includes avisibility
field, witha default value of 'internal' and a validation to ensure the
value is one of 'PRIVATE', 'INTERNAL', or 'PUBLIC'.