Skip to content

Conversation

@aryan-bhokare
Copy link
Contributor

@aryan-bhokare aryan-bhokare commented Mar 17, 2024

closes #3958 #4161

Proposed changes

Work done:

  1. Modification of db schema.
  2. Addition of new API GetProjectOwners.
  3. Modifications of SendInvitation API.
  4. Modifications of LeaveProject API.
  5. Added new API UpdateMemberRole.
  6. Added new API DeleteProject.

Types of changes

What types of changes does your code introduce to Litmus? Put an x in the boxes that apply

  • New feature (non-breaking change which adds functionality)
  • Bugfix (non-breaking change which fixes an issue)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation Update (if none of the other choices applies)

Checklist

Put an x in the boxes that apply. You can also fill these out after creating the PR. If you're unsure about any of them, don't hesitate to ask. We're here to help! This is simply a reminder of what we are going to look for before merging your code.

  • I have read the CONTRIBUTING doc
  • I have signed the commit for DCO to be passed.
  • Lint and unit tests pass locally with my changes
  • I have added tests that prove my fix is effective or that my feature works (if appropriate)
  • I have added necessary documentation (if appropriate)

Dependency

  • Please add the links to the dependent PR need to be merged before this (if any).

Special notes for your reviewer:

Signed-off-by: aryan <aryan1bhokare@gmail.com>
Signed-off-by: aryan <aryan1bhokare@gmail.com>
@aryan-bhokare aryan-bhokare force-pushed the multiple-project-owner-backend branch from 974ff44 to 962175b Compare March 17, 2024 07:10
Signed-off-by: aryan <aryan1bhokare@gmail.com>
@aryan-bhokare aryan-bhokare force-pushed the multiple-project-owner-backend branch from d43d147 to 0c8528e Compare March 17, 2024 08:23
var project struct {
Members []*entities.Member `bson:"members"`
}
err := r.Collection.FindOne(context.TODO(), filter).Decode(&project)

Check failure

Code scanning / CodeQL

Database query built from user-controlled sources

This query depends on a [user-provided value](1).
dependabot bot and others added 5 commits March 23, 2024 11:42
…itmuschaos#4527)

Bumps [golang.org/x/crypto](https://github.com/golang/crypto) from 0.18.0 to 0.21.0.
- [Commits](golang/crypto@v0.18.0...v0.21.0)

---
updated-dependencies:
- dependency-name: golang.org/x/crypto
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
)

Bumps [follow-redirects](https://github.com/follow-redirects/follow-redirects) from 1.15.5 to 1.15.6.
- [Release notes](https://github.com/follow-redirects/follow-redirects/releases)
- [Commits](follow-redirects/follow-redirects@v1.15.5...v1.15.6)

---
updated-dependencies:
- dependency-name: follow-redirects
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Bumps [github.com/golang/protobuf](https://github.com/golang/protobuf) from 1.5.3 to 1.5.4.
- [Release notes](https://github.com/golang/protobuf/releases)
- [Commits](golang/protobuf@v1.5.3...v1.5.4)

---
updated-dependencies:
- dependency-name: github.com/golang/protobuf
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Raj Das <mail.rajdas@gmail.com>
This modification unables to send invite with the role as owner.

Signed-off-by: aryan <aryan1bhokare@gmail.com>
This modification checks if the User is the last owner of the project and if not User can leave the project.

Signed-off-by: aryan <aryan1bhokare@gmail.com>
return nil
}

// GetAggregateProjects takes a mongo pipeline to retrieve the project details from the database

Check failure

Code scanning / CodeQL

Database query built from user-controlled sources

This query depends on a [user-provided value](1).
Allows Owner to be able to leave the project.

Signed-off-by: aryan <aryan1bhokare@gmail.com>
This API is used for updating role of the member in the project.

Signed-off-by: aryan <aryan1bhokare@gmail.com>
@aryan-bhokare aryan-bhokare force-pushed the multiple-project-owner-backend branch from 112e819 to 77bcd91 Compare March 24, 2024 07:06
func GetActiveProjectOwners(service services.ApplicationService) gin.HandlerFunc {
return func(c *gin.Context) {
projectID := c.Param("project_id")
// state := c.Param("state")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can remove if not required

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure

version "1.15.5"
resolved "https://registry.yarnpkg.com/follow-redirects/-/follow-redirects-1.15.5.tgz#54d4d6d062c0fa7d9d17feb008461550e3ba8020"
integrity sha512-vSFWUON1B+yAw1VN4xMfxgn5fTUiaOzAJCKBwIIgT/+7CuGy9+r+5gITvP62j3RmaD5Ph65UaERdOSRGUzZtgw==
version "1.15.6"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why is this change required?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It happened automatically. I am unable to understand I was thinking about starting new from the commit before the bumps

Copy link
Contributor Author

@aryan-bhokare aryan-bhokare Apr 6, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

these changes were included in the main litmus repo I will remove it from the pr.

Signed-off-by: aryan <aryan1bhokare@gmail.com>
Signed-off-by: aryan <aryan1bhokare@gmail.com>
return
}

if member.Role == nil || *member.Role == entities.RoleOwner {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why are we checking member.Role == nil

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

because if we don't, it gives a runtime error attempting to access or deference nil pointer

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

2024/04/09 14:28:53 [Recovery] 2024/04/09 - 14:28:53 panic recovered:
runtime error: invalid memory address or nil pointer dereference
/usr/local/go/src/runtime/panic.go:261 (0x4556d7)
	panicmem: panic(memoryError)
/usr/local/go/src/runtime/signal_unix.go:881 (0x4556a5)
	sigpanic: panicmem()
/home/aryan/Desktop/dev2/lfx/litmus/chaoscenter/authentication/api/handlers/rest/project_handler.go:595 (0xc540df)
	ProjectRouter.LeaveProject.func16: if *member.Role == entities.RoleOwner {
/home/aryan/go/pkg/mod/github.com/gin-gonic/gin@v1.9.1/context.go:174 (0xc1972a)
	(*Context).Next: c.handlers[c.index](c)
/home/aryan/Desktop/dev2/lfx/litmus/chaoscenter/authentication/api/middleware/jwt_middlware.go:33 (0xc5824e)
	ProjectRouter.JwtMiddleware.func1: c.Next()
/home/aryan/go/pkg/mod/github.com/gin-gonic/gin@v1.9.1/context.go:174 (0xc1972a)
	(*Context).Next: c.handlers[c.index](c)
/home/aryan/Desktop/dev2/lfx/litmus/chaoscenter/authentication/api/middleware/jwt_middlware.go:33 (0xc5b54e)
	UserRouter.JwtMiddleware.func3: c.Next()
/home/aryan/go/pkg/mod/github.com/gin-gonic/gin@v1.9.1/context.go:174 (0xc26619)
	(*Context).Next: c.handlers[c.index](c)
/home/aryan/go/pkg/mod/github.com/gin-gonic/gin@v1.9.1/recovery.go:102 (0xc26607)
	CustomRecoveryWithWriter.func1: c.Next()
/home/aryan/go/pkg/mod/github.com/gin-gonic/gin@v1.9.1/context.go:174 (0xc2575c)
	(*Context).Next: c.handlers[c.index](c)
/home/aryan/go/pkg/mod/github.com/gin-gonic/gin@v1.9.1/logger.go:240 (0xc25743)
	LoggerWithConfig.func1: c.Next()
/home/aryan/go/pkg/mod/github.com/gin-gonic/gin@v1.9.1/context.go:174 (0xc24c4d)
	(*Context).Next: c.handlers[c.index](c)
/home/aryan/go/pkg/mod/github.com/gin-gonic/gin@v1.9.1/gin.go:620 (0xc248dc)
	(*Engine).handleHTTPRequest: c.Next()
/home/aryan/go/pkg/mod/github.com/gin-gonic/gin@v1.9.1/gin.go:576 (0xc24411)
	(*Engine).ServeHTTP: engine.handleHTTPRequest(c)
/usr/local/go/src/net/http/server.go:3137 (0x800ced)
	serverHandler.ServeHTTP: handler.ServeHTTP(rw, req)
/usr/local/go/src/net/http/server.go:2039 (0x7fbfc7)
	(*conn).serve: serverHandler{c.server}.ServeHTTP(w, w.req)
/usr/local/go/src/runtime/asm_amd64.s:1695 (0x472c20)
	goexit: BYTE	$0x90	// NOP


}

err = service.UpdateMemberRole(member.ProjectID, member.UserID, member.Role)
if err != nil {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should also add one more check for a case: There is only 1 owner and that owner is trying update their role to viewer/editor. In this case there will be no project owner. 🤔

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sure I'll do that

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How about a check to not allow the logged in user to change their own project roles. This will cover all the conditions. Please check on feasibility of this approach and race conditions if any

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes that would be better. cc: @aryan-bhokare

@Saranya-jena Saranya-jena changed the base branch from master to multiple-owner-support April 9, 2024 06:25
@Saranya-jena Saranya-jena added the LFX-MENTORSHIP Linux Foundation Mentor ship Issue label Apr 9, 2024
aryan-bhokare and others added 3 commits April 9, 2024 13:27
Owner can delete project with help of this API.

Signed-off-by: aryan <aryan1bhokare@gmail.com>
Signed-off-by: aryan <aryan1bhokare@gmail.com>
…kend

Signed-off-by: Aryan Bhokare <92683836+aryan-bhokare@users.noreply.github.com>
@aryan-bhokare aryan-bhokare marked this pull request as ready for review April 9, 2024 08:26
Signed-off-by: aryan <aryan1bhokare@gmail.com>
// @Router /delete_project [post]
//
// DeleteProject is used to delete a project.
func DeleteProject (service services.ApplicationService) gin.HandlerFunc {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All the resources related to the deleted project should also be deleted. This change can go in a different PR

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lets do that in different pr.

User cannot change role of their own, so that it will avoid edge cases like
1. User is the last owner of the project.
2. User accidentally losing owner access to the projects.

Signed-off-by: aryan <aryan1bhokare@gmail.com>
Signed-off-by: aryan <aryan1bhokare@gmail.com>
@aryan-bhokare aryan-bhokare force-pushed the multiple-project-owner-backend branch from 93808b1 to fef4c59 Compare April 11, 2024 06:25
Signed-off-by: aryan <aryan1bhokare@gmail.com>
@aryan-bhokare aryan-bhokare force-pushed the multiple-project-owner-backend branch from fef4c59 to 4a10fe3 Compare April 11, 2024 06:28
Signed-off-by: aryan <aryan1bhokare@gmail.com>
@aryan-bhokare aryan-bhokare force-pushed the multiple-project-owner-backend branch from a954d11 to 33dec51 Compare April 11, 2024 10:19
Copy link
Contributor

@Saranya-jena Saranya-jena left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks good to me 🚀

Copy link
Contributor

@SarthakJain26 SarthakJain26 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me 🚀 , great work

@aryan-bhokare
Copy link
Contributor Author

Looks good to me 🚀 , great work

Thank you 🚀

@Saranya-jena Saranya-jena merged commit 0e51dbf into litmuschaos:multiple-owner-support Apr 12, 2024
Saranya-jena added a commit that referenced this pull request Jul 22, 2024
* Modified db schema of Owner.

Signed-off-by: aryan <aryan1bhokare@gmail.com>

* Added new API GetProjectOwners.

Signed-off-by: aryan <aryan1bhokare@gmail.com>

* fix: return type error.

Signed-off-by: aryan <aryan1bhokare@gmail.com>

* chore(deps): Bump golang.org/x/crypto in /chaoscenter/authentication (#4527)

Bumps [golang.org/x/crypto](https://github.com/golang/crypto) from 0.18.0 to 0.21.0.
- [Commits](golang/crypto@v0.18.0...v0.21.0)

---
updated-dependencies:
- dependency-name: golang.org/x/crypto
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* chore(deps): Bump follow-redirects in /chaoscenter/web (#4529)

Bumps [follow-redirects](https://github.com/follow-redirects/follow-redirects) from 1.15.5 to 1.15.6.
- [Release notes](https://github.com/follow-redirects/follow-redirects/releases)
- [Commits](follow-redirects/follow-redirects@v1.15.5...v1.15.6)

---
updated-dependencies:
- dependency-name: follow-redirects
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* chore(deps): Bump github.com/golang/protobuf (#4493)

Bumps [github.com/golang/protobuf](https://github.com/golang/protobuf) from 1.5.3 to 1.5.4.
- [Release notes](https://github.com/golang/protobuf/releases)
- [Commits](golang/protobuf@v1.5.3...v1.5.4)

---
updated-dependencies:
- dependency-name: github.com/golang/protobuf
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Raj Das <mail.rajdas@gmail.com>

* Modified SendInvitation API.

This modification unables to send invite with the role as owner.

Signed-off-by: aryan <aryan1bhokare@gmail.com>

* Modified LeaveProject API.

This modification checks if the User is the last owner of the project and if not User can leave the project.

Signed-off-by: aryan <aryan1bhokare@gmail.com>

* RBAC modification `LeaveProject`.

Allows Owner to be able to leave the project.

Signed-off-by: aryan <aryan1bhokare@gmail.com>

* Added `UpdateMemberRole` API.

This API is used for updating role of the member in the project.

Signed-off-by: aryan <aryan1bhokare@gmail.com>

* Fixed some syntax errors.

Signed-off-by: aryan <aryan1bhokare@gmail.com>

* Updated roles for owner.

Signed-off-by: aryan <aryan1bhokare@gmail.com>

* Added new API `DeleteProject`.
Owner can delete project with help of this API.

Signed-off-by: aryan <aryan1bhokare@gmail.com>

* Added mocks.

Signed-off-by: aryan <aryan1bhokare@gmail.com>

* modified go.sum

Signed-off-by: aryan <aryan1bhokare@gmail.com>

* Added condition `UpdateMemberRole`.

User cannot change role of their own, so that it will avoid edge cases like
1. User is the last owner of the project.
2. User accidentally losing owner access to the projects.

Signed-off-by: aryan <aryan1bhokare@gmail.com>

* made suggested changes.

Signed-off-by: aryan <aryan1bhokare@gmail.com>

* Changed DeleteProject endpoint to have url parameter.

Signed-off-by: aryan <aryan1bhokare@gmail.com>

* Minor fixes.

Signed-off-by: aryan <aryan1bhokare@gmail.com>

* [WIP] : Multiple project owner backend. (#4536)

* Modified db schema of Owner.

Signed-off-by: aryan <aryan1bhokare@gmail.com>

* Added new API GetProjectOwners.

Signed-off-by: aryan <aryan1bhokare@gmail.com>

* fix: return type error.

Signed-off-by: aryan <aryan1bhokare@gmail.com>

* chore(deps): Bump golang.org/x/crypto in /chaoscenter/authentication (#4527)

Bumps [golang.org/x/crypto](https://github.com/golang/crypto) from 0.18.0 to 0.21.0.
- [Commits](golang/crypto@v0.18.0...v0.21.0)

---
updated-dependencies:
- dependency-name: golang.org/x/crypto
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* chore(deps): Bump follow-redirects in /chaoscenter/web (#4529)

Bumps [follow-redirects](https://github.com/follow-redirects/follow-redirects) from 1.15.5 to 1.15.6.
- [Release notes](https://github.com/follow-redirects/follow-redirects/releases)
- [Commits](follow-redirects/follow-redirects@v1.15.5...v1.15.6)

---
updated-dependencies:
- dependency-name: follow-redirects
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* chore(deps): Bump github.com/golang/protobuf (#4493)

Bumps [github.com/golang/protobuf](https://github.com/golang/protobuf) from 1.5.3 to 1.5.4.
- [Release notes](https://github.com/golang/protobuf/releases)
- [Commits](golang/protobuf@v1.5.3...v1.5.4)

---
updated-dependencies:
- dependency-name: github.com/golang/protobuf
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Raj Das <mail.rajdas@gmail.com>

* Modified SendInvitation API.

This modification unables to send invite with the role as owner.

Signed-off-by: aryan <aryan1bhokare@gmail.com>

* Modified LeaveProject API.

This modification checks if the User is the last owner of the project and if not User can leave the project.

Signed-off-by: aryan <aryan1bhokare@gmail.com>

* RBAC modification `LeaveProject`.

Allows Owner to be able to leave the project.

Signed-off-by: aryan <aryan1bhokare@gmail.com>

* Added `UpdateMemberRole` API.

This API is used for updating role of the member in the project.

Signed-off-by: aryan <aryan1bhokare@gmail.com>

* Fixed some syntax errors.

Signed-off-by: aryan <aryan1bhokare@gmail.com>

* Updated roles for owner.

Signed-off-by: aryan <aryan1bhokare@gmail.com>

* Added new API `DeleteProject`.
Owner can delete project with help of this API.

Signed-off-by: aryan <aryan1bhokare@gmail.com>

* Added mocks.

Signed-off-by: aryan <aryan1bhokare@gmail.com>

* modified go.sum

Signed-off-by: aryan <aryan1bhokare@gmail.com>

* Added condition `UpdateMemberRole`.

User cannot change role of their own, so that it will avoid edge cases like
1. User is the last owner of the project.
2. User accidentally losing owner access to the projects.

Signed-off-by: aryan <aryan1bhokare@gmail.com>

* made suggested changes.

Signed-off-by: aryan <aryan1bhokare@gmail.com>

* Changed DeleteProject endpoint to have url parameter.

Signed-off-by: aryan <aryan1bhokare@gmail.com>

* Minor fixes.

Signed-off-by: aryan <aryan1bhokare@gmail.com>

---------

Signed-off-by: aryan <aryan1bhokare@gmail.com>
Signed-off-by: dependabot[bot] <support@github.com>
Signed-off-by: Aryan Bhokare <92683836+aryan-bhokare@users.noreply.github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Raj Das <mail.rajdas@gmail.com>

* Added new route .

Signed-off-by: aryan <aryan1bhokare@gmail.com>

* Added `CreateProject` modal.

Added a modal CreateProject with it's controller and views.

Signed-off-by: aryan <aryan1bhokare@gmail.com>

* Some changes in `CreateProjectView`.

Signed-off-by: aryan <aryan1bhokare@gmail.com>

* Added `ProjectDashboardCardMenu`.

Signed-off-by: aryan <aryan1bhokare@gmail.com>

* Added `ProjectDashboardCard`.

Signed-off-by: aryan <aryan1bhokare@gmail.com>

* Added `DeleteProject` API mutations.

Signed-off-by: aryan <aryan1bhokare@gmail.com>

* Added `ProjectDashboard`.

Signed-off-by: aryan <aryan1bhokare@gmail.com>

* Added image and strings.

Signed-off-by: aryan <aryan1bhokare@gmail.com>

* Modified `project entities`.

Added new fields in `Project` struct.
Added fields for filters, pagination, and some constants.
Modified `CreateProjectInput`.

Signed-off-by: aryan <aryan1bhokare@gmail.com>

* [Backend] Modification in Backend for the UI.

Added Filters and pagination in Backend.
Modified API's and added a pipeline for the aggregation of results.

Signed-off-by: aryan <aryan1bhokare@gmail.com>

* Added `project_util` for validation of input request.

Signed-off-by: aryan <aryan1bhokare@gmail.com>

* Indent Fixes

Signed-off-by: aryan <aryan1bhokare@gmail.com>

* Modification for Frontend Hook of `CreateProject` API.

Signed-off-by: aryan <aryan1bhokare@gmail.com>

* Modified `ListProject` Query frontend hook.

Signed-off-by: aryan <aryan1bhokare@gmail.com>

* Removed string constants and some minor changes.

Signed-off-by: aryan <aryan1bhokare@gmail.com>

* Added Project Filters.

Signed-off-by: aryan <aryan1bhokare@gmail.com>

* Added pagination and filter subheader in Dashboard.

Signed-off-by: aryan <aryan1bhokare@gmail.com>

* modified auth-api swagger file.

Signed-off-by: aryan <aryan1bhokare@gmail.com>

* Added tags section in create-project modal.

Signed-off-by: aryan <aryan1bhokare@gmail.com>

* Changes due to modification of API and addition of new strings

Signed-off-by: aryan <aryan1bhokare@gmail.com>

* minor changes and resolved some errors.

Signed-off-by: aryan <aryan1bhokare@gmail.com>

* Added routing when clicked on the card.

Signed-off-by: aryan <aryan1bhokare@gmail.com>

* Modifications in backend tests as per API updates.

Signed-off-by: aryan <aryan1bhokare@gmail.com>

* Fix: NoProjects Element and NoFilteredProject Results element.

Signed-off-by: aryan <aryan1bhokare@gmail.com>

* Added scroll for the project list.

Signed-off-by: aryan <aryan1bhokare@gmail.com>

* Some changes in UI w.r.t Multiple Project Owner Feature.

Signed-off-by: aryan <aryan1bhokare@gmail.com>

* Made search text type insensitive.

Signed-off-by: aryan <aryan1bhokare@gmail.com>

* Update chaoscenter/web/src/controllers/ProjectDashboard/ProjectFilters.tsx

Co-authored-by: Hrishav <hrishav.kumar@harness.io>
Signed-off-by: Aryan Bhokare <92683836+aryan-bhokare@users.noreply.github.com>

* requested changes.

Signed-off-by: aryan <aryan1bhokare@gmail.com>

* removed unnecessary handle function

Signed-off-by: aryan <aryan1bhokare@gmail.com>

* requested backend changes and small fixes

Signed-off-by: aryan <aryan1bhokare@gmail.com>

* Changed folder structure.

Signed-off-by: aryan <aryan1bhokare@gmail.com>

* requested changes.

Signed-off-by: aryan <aryan1bhokare@gmail.com>

* fixed import orders

Signed-off-by: aryan <aryan1bhokare@gmail.com>

* fixing RoleEditor to RoleExecuter

Signed-off-by: aryan <aryan1bhokare@gmail.com>

* removed redundant deleteprojectinput

Signed-off-by: aryan <aryan1bhokare@gmail.com>

* fixed bug caused in merging

Signed-off-by: aryan <aryan1bhokare@gmail.com>

* fixed bug caused in merging

Signed-off-by: aryan <aryan1bhokare@gmail.com>

* removed duplicate struct

Signed-off-by: aryan <aryan1bhokare@gmail.com>

* Fix: frontend chaoshub test

Signed-off-by: aryan <aryan1bhokare@gmail.com>

* fix: tag rendering issue in project dashboard

Signed-off-by: aryan <aryan1bhokare@gmail.com>

* fix: Less user details in createProject

Signed-off-by: aryan <aryan1bhokare@gmail.com>

* fix: import orders

Signed-off-by: aryan <aryan1bhokare@gmail.com>

---------

Signed-off-by: aryan <aryan1bhokare@gmail.com>
Signed-off-by: dependabot[bot] <support@github.com>
Signed-off-by: Aryan Bhokare <92683836+aryan-bhokare@users.noreply.github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Raj Das <mail.rajdas@gmail.com>
Co-authored-by: Hrishav <hrishav.kumar@harness.io>
Co-authored-by: Saranya Jena <saranya.jena@harness.io>
andoriyaprashant pushed a commit to andoriyaprashant/litmus that referenced this pull request Sep 7, 2024
* Modified db schema of Owner.

Signed-off-by: aryan <aryan1bhokare@gmail.com>

* Added new API GetProjectOwners.

Signed-off-by: aryan <aryan1bhokare@gmail.com>

* fix: return type error.

Signed-off-by: aryan <aryan1bhokare@gmail.com>

* chore(deps): Bump golang.org/x/crypto in /chaoscenter/authentication (litmuschaos#4527)

Bumps [golang.org/x/crypto](https://github.com/golang/crypto) from 0.18.0 to 0.21.0.
- [Commits](golang/crypto@v0.18.0...v0.21.0)

---
updated-dependencies:
- dependency-name: golang.org/x/crypto
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* chore(deps): Bump follow-redirects in /chaoscenter/web (litmuschaos#4529)

Bumps [follow-redirects](https://github.com/follow-redirects/follow-redirects) from 1.15.5 to 1.15.6.
- [Release notes](https://github.com/follow-redirects/follow-redirects/releases)
- [Commits](follow-redirects/follow-redirects@v1.15.5...v1.15.6)

---
updated-dependencies:
- dependency-name: follow-redirects
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* chore(deps): Bump github.com/golang/protobuf (litmuschaos#4493)

Bumps [github.com/golang/protobuf](https://github.com/golang/protobuf) from 1.5.3 to 1.5.4.
- [Release notes](https://github.com/golang/protobuf/releases)
- [Commits](golang/protobuf@v1.5.3...v1.5.4)

---
updated-dependencies:
- dependency-name: github.com/golang/protobuf
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Raj Das <mail.rajdas@gmail.com>

* Modified SendInvitation API.

This modification unables to send invite with the role as owner.

Signed-off-by: aryan <aryan1bhokare@gmail.com>

* Modified LeaveProject API.

This modification checks if the User is the last owner of the project and if not User can leave the project.

Signed-off-by: aryan <aryan1bhokare@gmail.com>

* RBAC modification `LeaveProject`.

Allows Owner to be able to leave the project.

Signed-off-by: aryan <aryan1bhokare@gmail.com>

* Added `UpdateMemberRole` API.

This API is used for updating role of the member in the project.

Signed-off-by: aryan <aryan1bhokare@gmail.com>

* Fixed some syntax errors.

Signed-off-by: aryan <aryan1bhokare@gmail.com>

* Updated roles for owner.

Signed-off-by: aryan <aryan1bhokare@gmail.com>

* Added new API `DeleteProject`.
Owner can delete project with help of this API.

Signed-off-by: aryan <aryan1bhokare@gmail.com>

* Added mocks.

Signed-off-by: aryan <aryan1bhokare@gmail.com>

* modified go.sum

Signed-off-by: aryan <aryan1bhokare@gmail.com>

* Added condition `UpdateMemberRole`.

User cannot change role of their own, so that it will avoid edge cases like
1. User is the last owner of the project.
2. User accidentally losing owner access to the projects.

Signed-off-by: aryan <aryan1bhokare@gmail.com>

* made suggested changes.

Signed-off-by: aryan <aryan1bhokare@gmail.com>

* Changed DeleteProject endpoint to have url parameter.

Signed-off-by: aryan <aryan1bhokare@gmail.com>

* Minor fixes.

Signed-off-by: aryan <aryan1bhokare@gmail.com>

* [WIP] : Multiple project owner backend. (litmuschaos#4536)

* Modified db schema of Owner.

Signed-off-by: aryan <aryan1bhokare@gmail.com>

* Added new API GetProjectOwners.

Signed-off-by: aryan <aryan1bhokare@gmail.com>

* fix: return type error.

Signed-off-by: aryan <aryan1bhokare@gmail.com>

* chore(deps): Bump golang.org/x/crypto in /chaoscenter/authentication (litmuschaos#4527)

Bumps [golang.org/x/crypto](https://github.com/golang/crypto) from 0.18.0 to 0.21.0.
- [Commits](golang/crypto@v0.18.0...v0.21.0)

---
updated-dependencies:
- dependency-name: golang.org/x/crypto
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* chore(deps): Bump follow-redirects in /chaoscenter/web (litmuschaos#4529)

Bumps [follow-redirects](https://github.com/follow-redirects/follow-redirects) from 1.15.5 to 1.15.6.
- [Release notes](https://github.com/follow-redirects/follow-redirects/releases)
- [Commits](follow-redirects/follow-redirects@v1.15.5...v1.15.6)

---
updated-dependencies:
- dependency-name: follow-redirects
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* chore(deps): Bump github.com/golang/protobuf (litmuschaos#4493)

Bumps [github.com/golang/protobuf](https://github.com/golang/protobuf) from 1.5.3 to 1.5.4.
- [Release notes](https://github.com/golang/protobuf/releases)
- [Commits](golang/protobuf@v1.5.3...v1.5.4)

---
updated-dependencies:
- dependency-name: github.com/golang/protobuf
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Raj Das <mail.rajdas@gmail.com>

* Modified SendInvitation API.

This modification unables to send invite with the role as owner.

Signed-off-by: aryan <aryan1bhokare@gmail.com>

* Modified LeaveProject API.

This modification checks if the User is the last owner of the project and if not User can leave the project.

Signed-off-by: aryan <aryan1bhokare@gmail.com>

* RBAC modification `LeaveProject`.

Allows Owner to be able to leave the project.

Signed-off-by: aryan <aryan1bhokare@gmail.com>

* Added `UpdateMemberRole` API.

This API is used for updating role of the member in the project.

Signed-off-by: aryan <aryan1bhokare@gmail.com>

* Fixed some syntax errors.

Signed-off-by: aryan <aryan1bhokare@gmail.com>

* Updated roles for owner.

Signed-off-by: aryan <aryan1bhokare@gmail.com>

* Added new API `DeleteProject`.
Owner can delete project with help of this API.

Signed-off-by: aryan <aryan1bhokare@gmail.com>

* Added mocks.

Signed-off-by: aryan <aryan1bhokare@gmail.com>

* modified go.sum

Signed-off-by: aryan <aryan1bhokare@gmail.com>

* Added condition `UpdateMemberRole`.

User cannot change role of their own, so that it will avoid edge cases like
1. User is the last owner of the project.
2. User accidentally losing owner access to the projects.

Signed-off-by: aryan <aryan1bhokare@gmail.com>

* made suggested changes.

Signed-off-by: aryan <aryan1bhokare@gmail.com>

* Changed DeleteProject endpoint to have url parameter.

Signed-off-by: aryan <aryan1bhokare@gmail.com>

* Minor fixes.

Signed-off-by: aryan <aryan1bhokare@gmail.com>

---------

Signed-off-by: aryan <aryan1bhokare@gmail.com>
Signed-off-by: dependabot[bot] <support@github.com>
Signed-off-by: Aryan Bhokare <92683836+aryan-bhokare@users.noreply.github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Raj Das <mail.rajdas@gmail.com>

* Added new route .

Signed-off-by: aryan <aryan1bhokare@gmail.com>

* Added `CreateProject` modal.

Added a modal CreateProject with it's controller and views.

Signed-off-by: aryan <aryan1bhokare@gmail.com>

* Some changes in `CreateProjectView`.

Signed-off-by: aryan <aryan1bhokare@gmail.com>

* Added `ProjectDashboardCardMenu`.

Signed-off-by: aryan <aryan1bhokare@gmail.com>

* Added `ProjectDashboardCard`.

Signed-off-by: aryan <aryan1bhokare@gmail.com>

* Added `DeleteProject` API mutations.

Signed-off-by: aryan <aryan1bhokare@gmail.com>

* Added `ProjectDashboard`.

Signed-off-by: aryan <aryan1bhokare@gmail.com>

* Added image and strings.

Signed-off-by: aryan <aryan1bhokare@gmail.com>

* Modified `project entities`.

Added new fields in `Project` struct.
Added fields for filters, pagination, and some constants.
Modified `CreateProjectInput`.

Signed-off-by: aryan <aryan1bhokare@gmail.com>

* [Backend] Modification in Backend for the UI.

Added Filters and pagination in Backend.
Modified API's and added a pipeline for the aggregation of results.

Signed-off-by: aryan <aryan1bhokare@gmail.com>

* Added `project_util` for validation of input request.

Signed-off-by: aryan <aryan1bhokare@gmail.com>

* Indent Fixes

Signed-off-by: aryan <aryan1bhokare@gmail.com>

* Modification for Frontend Hook of `CreateProject` API.

Signed-off-by: aryan <aryan1bhokare@gmail.com>

* Modified `ListProject` Query frontend hook.

Signed-off-by: aryan <aryan1bhokare@gmail.com>

* Removed string constants and some minor changes.

Signed-off-by: aryan <aryan1bhokare@gmail.com>

* Added Project Filters.

Signed-off-by: aryan <aryan1bhokare@gmail.com>

* Added pagination and filter subheader in Dashboard.

Signed-off-by: aryan <aryan1bhokare@gmail.com>

* modified auth-api swagger file.

Signed-off-by: aryan <aryan1bhokare@gmail.com>

* Added tags section in create-project modal.

Signed-off-by: aryan <aryan1bhokare@gmail.com>

* Changes due to modification of API and addition of new strings

Signed-off-by: aryan <aryan1bhokare@gmail.com>

* minor changes and resolved some errors.

Signed-off-by: aryan <aryan1bhokare@gmail.com>

* Added routing when clicked on the card.

Signed-off-by: aryan <aryan1bhokare@gmail.com>

* Modifications in backend tests as per API updates.

Signed-off-by: aryan <aryan1bhokare@gmail.com>

* Fix: NoProjects Element and NoFilteredProject Results element.

Signed-off-by: aryan <aryan1bhokare@gmail.com>

* Added scroll for the project list.

Signed-off-by: aryan <aryan1bhokare@gmail.com>

* Some changes in UI w.r.t Multiple Project Owner Feature.

Signed-off-by: aryan <aryan1bhokare@gmail.com>

* Made search text type insensitive.

Signed-off-by: aryan <aryan1bhokare@gmail.com>

* Update chaoscenter/web/src/controllers/ProjectDashboard/ProjectFilters.tsx

Co-authored-by: Hrishav <hrishav.kumar@harness.io>
Signed-off-by: Aryan Bhokare <92683836+aryan-bhokare@users.noreply.github.com>

* requested changes.

Signed-off-by: aryan <aryan1bhokare@gmail.com>

* removed unnecessary handle function

Signed-off-by: aryan <aryan1bhokare@gmail.com>

* requested backend changes and small fixes

Signed-off-by: aryan <aryan1bhokare@gmail.com>

* Changed folder structure.

Signed-off-by: aryan <aryan1bhokare@gmail.com>

* requested changes.

Signed-off-by: aryan <aryan1bhokare@gmail.com>

* fixed import orders

Signed-off-by: aryan <aryan1bhokare@gmail.com>

* fixing RoleEditor to RoleExecuter

Signed-off-by: aryan <aryan1bhokare@gmail.com>

* removed redundant deleteprojectinput

Signed-off-by: aryan <aryan1bhokare@gmail.com>

* fixed bug caused in merging

Signed-off-by: aryan <aryan1bhokare@gmail.com>

* fixed bug caused in merging

Signed-off-by: aryan <aryan1bhokare@gmail.com>

* removed duplicate struct

Signed-off-by: aryan <aryan1bhokare@gmail.com>

* Fix: frontend chaoshub test

Signed-off-by: aryan <aryan1bhokare@gmail.com>

* fix: tag rendering issue in project dashboard

Signed-off-by: aryan <aryan1bhokare@gmail.com>

* fix: Less user details in createProject

Signed-off-by: aryan <aryan1bhokare@gmail.com>

* fix: import orders

Signed-off-by: aryan <aryan1bhokare@gmail.com>

---------

Signed-off-by: aryan <aryan1bhokare@gmail.com>
Signed-off-by: dependabot[bot] <support@github.com>
Signed-off-by: Aryan Bhokare <92683836+aryan-bhokare@users.noreply.github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Raj Das <mail.rajdas@gmail.com>
Co-authored-by: Hrishav <hrishav.kumar@harness.io>
Co-authored-by: Saranya Jena <saranya.jena@harness.io>
Signed-off-by: andoriyaprashant <prashantandoriya@gmail.com>
andoriyaprashant pushed a commit to andoriyaprashant/litmus that referenced this pull request Sep 7, 2024
* Modified db schema of Owner.

Signed-off-by: aryan <aryan1bhokare@gmail.com>

* Added new API GetProjectOwners.

Signed-off-by: aryan <aryan1bhokare@gmail.com>

* fix: return type error.

Signed-off-by: aryan <aryan1bhokare@gmail.com>

* chore(deps): Bump golang.org/x/crypto in /chaoscenter/authentication (litmuschaos#4527)

Bumps [golang.org/x/crypto](https://github.com/golang/crypto) from 0.18.0 to 0.21.0.
- [Commits](golang/crypto@v0.18.0...v0.21.0)

---
updated-dependencies:
- dependency-name: golang.org/x/crypto
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* chore(deps): Bump follow-redirects in /chaoscenter/web (litmuschaos#4529)

Bumps [follow-redirects](https://github.com/follow-redirects/follow-redirects) from 1.15.5 to 1.15.6.
- [Release notes](https://github.com/follow-redirects/follow-redirects/releases)
- [Commits](follow-redirects/follow-redirects@v1.15.5...v1.15.6)

---
updated-dependencies:
- dependency-name: follow-redirects
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* chore(deps): Bump github.com/golang/protobuf (litmuschaos#4493)

Bumps [github.com/golang/protobuf](https://github.com/golang/protobuf) from 1.5.3 to 1.5.4.
- [Release notes](https://github.com/golang/protobuf/releases)
- [Commits](golang/protobuf@v1.5.3...v1.5.4)

---
updated-dependencies:
- dependency-name: github.com/golang/protobuf
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Raj Das <mail.rajdas@gmail.com>

* Modified SendInvitation API.

This modification unables to send invite with the role as owner.

Signed-off-by: aryan <aryan1bhokare@gmail.com>

* Modified LeaveProject API.

This modification checks if the User is the last owner of the project and if not User can leave the project.

Signed-off-by: aryan <aryan1bhokare@gmail.com>

* RBAC modification `LeaveProject`.

Allows Owner to be able to leave the project.

Signed-off-by: aryan <aryan1bhokare@gmail.com>

* Added `UpdateMemberRole` API.

This API is used for updating role of the member in the project.

Signed-off-by: aryan <aryan1bhokare@gmail.com>

* Fixed some syntax errors.

Signed-off-by: aryan <aryan1bhokare@gmail.com>

* Updated roles for owner.

Signed-off-by: aryan <aryan1bhokare@gmail.com>

* Added new API `DeleteProject`.
Owner can delete project with help of this API.

Signed-off-by: aryan <aryan1bhokare@gmail.com>

* Added mocks.

Signed-off-by: aryan <aryan1bhokare@gmail.com>

* modified go.sum

Signed-off-by: aryan <aryan1bhokare@gmail.com>

* Added condition `UpdateMemberRole`.

User cannot change role of their own, so that it will avoid edge cases like
1. User is the last owner of the project.
2. User accidentally losing owner access to the projects.

Signed-off-by: aryan <aryan1bhokare@gmail.com>

* made suggested changes.

Signed-off-by: aryan <aryan1bhokare@gmail.com>

* Changed DeleteProject endpoint to have url parameter.

Signed-off-by: aryan <aryan1bhokare@gmail.com>

* Minor fixes.

Signed-off-by: aryan <aryan1bhokare@gmail.com>

* [WIP] : Multiple project owner backend. (litmuschaos#4536)

* Modified db schema of Owner.

Signed-off-by: aryan <aryan1bhokare@gmail.com>

* Added new API GetProjectOwners.

Signed-off-by: aryan <aryan1bhokare@gmail.com>

* fix: return type error.

Signed-off-by: aryan <aryan1bhokare@gmail.com>

* chore(deps): Bump golang.org/x/crypto in /chaoscenter/authentication (litmuschaos#4527)

Bumps [golang.org/x/crypto](https://github.com/golang/crypto) from 0.18.0 to 0.21.0.
- [Commits](golang/crypto@v0.18.0...v0.21.0)

---
updated-dependencies:
- dependency-name: golang.org/x/crypto
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* chore(deps): Bump follow-redirects in /chaoscenter/web (litmuschaos#4529)

Bumps [follow-redirects](https://github.com/follow-redirects/follow-redirects) from 1.15.5 to 1.15.6.
- [Release notes](https://github.com/follow-redirects/follow-redirects/releases)
- [Commits](follow-redirects/follow-redirects@v1.15.5...v1.15.6)

---
updated-dependencies:
- dependency-name: follow-redirects
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* chore(deps): Bump github.com/golang/protobuf (litmuschaos#4493)

Bumps [github.com/golang/protobuf](https://github.com/golang/protobuf) from 1.5.3 to 1.5.4.
- [Release notes](https://github.com/golang/protobuf/releases)
- [Commits](golang/protobuf@v1.5.3...v1.5.4)

---
updated-dependencies:
- dependency-name: github.com/golang/protobuf
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Raj Das <mail.rajdas@gmail.com>

* Modified SendInvitation API.

This modification unables to send invite with the role as owner.

Signed-off-by: aryan <aryan1bhokare@gmail.com>

* Modified LeaveProject API.

This modification checks if the User is the last owner of the project and if not User can leave the project.

Signed-off-by: aryan <aryan1bhokare@gmail.com>

* RBAC modification `LeaveProject`.

Allows Owner to be able to leave the project.

Signed-off-by: aryan <aryan1bhokare@gmail.com>

* Added `UpdateMemberRole` API.

This API is used for updating role of the member in the project.

Signed-off-by: aryan <aryan1bhokare@gmail.com>

* Fixed some syntax errors.

Signed-off-by: aryan <aryan1bhokare@gmail.com>

* Updated roles for owner.

Signed-off-by: aryan <aryan1bhokare@gmail.com>

* Added new API `DeleteProject`.
Owner can delete project with help of this API.

Signed-off-by: aryan <aryan1bhokare@gmail.com>

* Added mocks.

Signed-off-by: aryan <aryan1bhokare@gmail.com>

* modified go.sum

Signed-off-by: aryan <aryan1bhokare@gmail.com>

* Added condition `UpdateMemberRole`.

User cannot change role of their own, so that it will avoid edge cases like
1. User is the last owner of the project.
2. User accidentally losing owner access to the projects.

Signed-off-by: aryan <aryan1bhokare@gmail.com>

* made suggested changes.

Signed-off-by: aryan <aryan1bhokare@gmail.com>

* Changed DeleteProject endpoint to have url parameter.

Signed-off-by: aryan <aryan1bhokare@gmail.com>

* Minor fixes.

Signed-off-by: aryan <aryan1bhokare@gmail.com>

---------

Signed-off-by: aryan <aryan1bhokare@gmail.com>
Signed-off-by: dependabot[bot] <support@github.com>
Signed-off-by: Aryan Bhokare <92683836+aryan-bhokare@users.noreply.github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Raj Das <mail.rajdas@gmail.com>

* Added new route .

Signed-off-by: aryan <aryan1bhokare@gmail.com>

* Added `CreateProject` modal.

Added a modal CreateProject with it's controller and views.

Signed-off-by: aryan <aryan1bhokare@gmail.com>

* Some changes in `CreateProjectView`.

Signed-off-by: aryan <aryan1bhokare@gmail.com>

* Added `ProjectDashboardCardMenu`.

Signed-off-by: aryan <aryan1bhokare@gmail.com>

* Added `ProjectDashboardCard`.

Signed-off-by: aryan <aryan1bhokare@gmail.com>

* Added `DeleteProject` API mutations.

Signed-off-by: aryan <aryan1bhokare@gmail.com>

* Added `ProjectDashboard`.

Signed-off-by: aryan <aryan1bhokare@gmail.com>

* Added image and strings.

Signed-off-by: aryan <aryan1bhokare@gmail.com>

* Modified `project entities`.

Added new fields in `Project` struct.
Added fields for filters, pagination, and some constants.
Modified `CreateProjectInput`.

Signed-off-by: aryan <aryan1bhokare@gmail.com>

* [Backend] Modification in Backend for the UI.

Added Filters and pagination in Backend.
Modified API's and added a pipeline for the aggregation of results.

Signed-off-by: aryan <aryan1bhokare@gmail.com>

* Added `project_util` for validation of input request.

Signed-off-by: aryan <aryan1bhokare@gmail.com>

* Indent Fixes

Signed-off-by: aryan <aryan1bhokare@gmail.com>

* Modification for Frontend Hook of `CreateProject` API.

Signed-off-by: aryan <aryan1bhokare@gmail.com>

* Modified `ListProject` Query frontend hook.

Signed-off-by: aryan <aryan1bhokare@gmail.com>

* Removed string constants and some minor changes.

Signed-off-by: aryan <aryan1bhokare@gmail.com>

* Added Project Filters.

Signed-off-by: aryan <aryan1bhokare@gmail.com>

* Added pagination and filter subheader in Dashboard.

Signed-off-by: aryan <aryan1bhokare@gmail.com>

* modified auth-api swagger file.

Signed-off-by: aryan <aryan1bhokare@gmail.com>

* Added tags section in create-project modal.

Signed-off-by: aryan <aryan1bhokare@gmail.com>

* Changes due to modification of API and addition of new strings

Signed-off-by: aryan <aryan1bhokare@gmail.com>

* minor changes and resolved some errors.

Signed-off-by: aryan <aryan1bhokare@gmail.com>

* Added routing when clicked on the card.

Signed-off-by: aryan <aryan1bhokare@gmail.com>

* Modifications in backend tests as per API updates.

Signed-off-by: aryan <aryan1bhokare@gmail.com>

* Fix: NoProjects Element and NoFilteredProject Results element.

Signed-off-by: aryan <aryan1bhokare@gmail.com>

* Added scroll for the project list.

Signed-off-by: aryan <aryan1bhokare@gmail.com>

* Some changes in UI w.r.t Multiple Project Owner Feature.

Signed-off-by: aryan <aryan1bhokare@gmail.com>

* Made search text type insensitive.

Signed-off-by: aryan <aryan1bhokare@gmail.com>

* Update chaoscenter/web/src/controllers/ProjectDashboard/ProjectFilters.tsx

Co-authored-by: Hrishav <hrishav.kumar@harness.io>
Signed-off-by: Aryan Bhokare <92683836+aryan-bhokare@users.noreply.github.com>

* requested changes.

Signed-off-by: aryan <aryan1bhokare@gmail.com>

* removed unnecessary handle function

Signed-off-by: aryan <aryan1bhokare@gmail.com>

* requested backend changes and small fixes

Signed-off-by: aryan <aryan1bhokare@gmail.com>

* Changed folder structure.

Signed-off-by: aryan <aryan1bhokare@gmail.com>

* requested changes.

Signed-off-by: aryan <aryan1bhokare@gmail.com>

* fixed import orders

Signed-off-by: aryan <aryan1bhokare@gmail.com>

* fixing RoleEditor to RoleExecuter

Signed-off-by: aryan <aryan1bhokare@gmail.com>

* removed redundant deleteprojectinput

Signed-off-by: aryan <aryan1bhokare@gmail.com>

* fixed bug caused in merging

Signed-off-by: aryan <aryan1bhokare@gmail.com>

* fixed bug caused in merging

Signed-off-by: aryan <aryan1bhokare@gmail.com>

* removed duplicate struct

Signed-off-by: aryan <aryan1bhokare@gmail.com>

* Fix: frontend chaoshub test

Signed-off-by: aryan <aryan1bhokare@gmail.com>

* fix: tag rendering issue in project dashboard

Signed-off-by: aryan <aryan1bhokare@gmail.com>

* fix: Less user details in createProject

Signed-off-by: aryan <aryan1bhokare@gmail.com>

* fix: import orders

Signed-off-by: aryan <aryan1bhokare@gmail.com>

---------

Signed-off-by: aryan <aryan1bhokare@gmail.com>
Signed-off-by: dependabot[bot] <support@github.com>
Signed-off-by: Aryan Bhokare <92683836+aryan-bhokare@users.noreply.github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Raj Das <mail.rajdas@gmail.com>
Co-authored-by: Hrishav <hrishav.kumar@harness.io>
Co-authored-by: Saranya Jena <saranya.jena@harness.io>
Signed-off-by: andoriyaprashant <prashantandoriya@gmail.com>
sagnik3788 pushed a commit to sagnik3788/litmus that referenced this pull request Oct 5, 2024
* Modified db schema of Owner.

Signed-off-by: aryan <aryan1bhokare@gmail.com>

* Added new API GetProjectOwners.

Signed-off-by: aryan <aryan1bhokare@gmail.com>

* fix: return type error.

Signed-off-by: aryan <aryan1bhokare@gmail.com>

* chore(deps): Bump golang.org/x/crypto in /chaoscenter/authentication (litmuschaos#4527)

Bumps [golang.org/x/crypto](https://github.com/golang/crypto) from 0.18.0 to 0.21.0.
- [Commits](golang/crypto@v0.18.0...v0.21.0)

---
updated-dependencies:
- dependency-name: golang.org/x/crypto
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* chore(deps): Bump follow-redirects in /chaoscenter/web (litmuschaos#4529)

Bumps [follow-redirects](https://github.com/follow-redirects/follow-redirects) from 1.15.5 to 1.15.6.
- [Release notes](https://github.com/follow-redirects/follow-redirects/releases)
- [Commits](follow-redirects/follow-redirects@v1.15.5...v1.15.6)

---
updated-dependencies:
- dependency-name: follow-redirects
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* chore(deps): Bump github.com/golang/protobuf (litmuschaos#4493)

Bumps [github.com/golang/protobuf](https://github.com/golang/protobuf) from 1.5.3 to 1.5.4.
- [Release notes](https://github.com/golang/protobuf/releases)
- [Commits](golang/protobuf@v1.5.3...v1.5.4)

---
updated-dependencies:
- dependency-name: github.com/golang/protobuf
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Raj Das <mail.rajdas@gmail.com>

* Modified SendInvitation API.

This modification unables to send invite with the role as owner.

Signed-off-by: aryan <aryan1bhokare@gmail.com>

* Modified LeaveProject API.

This modification checks if the User is the last owner of the project and if not User can leave the project.

Signed-off-by: aryan <aryan1bhokare@gmail.com>

* RBAC modification `LeaveProject`.

Allows Owner to be able to leave the project.

Signed-off-by: aryan <aryan1bhokare@gmail.com>

* Added `UpdateMemberRole` API.

This API is used for updating role of the member in the project.

Signed-off-by: aryan <aryan1bhokare@gmail.com>

* Fixed some syntax errors.

Signed-off-by: aryan <aryan1bhokare@gmail.com>

* Updated roles for owner.

Signed-off-by: aryan <aryan1bhokare@gmail.com>

* Added new API `DeleteProject`.
Owner can delete project with help of this API.

Signed-off-by: aryan <aryan1bhokare@gmail.com>

* Added mocks.

Signed-off-by: aryan <aryan1bhokare@gmail.com>

* modified go.sum

Signed-off-by: aryan <aryan1bhokare@gmail.com>

* Added condition `UpdateMemberRole`.

User cannot change role of their own, so that it will avoid edge cases like
1. User is the last owner of the project.
2. User accidentally losing owner access to the projects.

Signed-off-by: aryan <aryan1bhokare@gmail.com>

* made suggested changes.

Signed-off-by: aryan <aryan1bhokare@gmail.com>

* Changed DeleteProject endpoint to have url parameter.

Signed-off-by: aryan <aryan1bhokare@gmail.com>

* Minor fixes.

Signed-off-by: aryan <aryan1bhokare@gmail.com>

* [WIP] : Multiple project owner backend. (litmuschaos#4536)

* Modified db schema of Owner.

Signed-off-by: aryan <aryan1bhokare@gmail.com>

* Added new API GetProjectOwners.

Signed-off-by: aryan <aryan1bhokare@gmail.com>

* fix: return type error.

Signed-off-by: aryan <aryan1bhokare@gmail.com>

* chore(deps): Bump golang.org/x/crypto in /chaoscenter/authentication (litmuschaos#4527)

Bumps [golang.org/x/crypto](https://github.com/golang/crypto) from 0.18.0 to 0.21.0.
- [Commits](golang/crypto@v0.18.0...v0.21.0)

---
updated-dependencies:
- dependency-name: golang.org/x/crypto
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* chore(deps): Bump follow-redirects in /chaoscenter/web (litmuschaos#4529)

Bumps [follow-redirects](https://github.com/follow-redirects/follow-redirects) from 1.15.5 to 1.15.6.
- [Release notes](https://github.com/follow-redirects/follow-redirects/releases)
- [Commits](follow-redirects/follow-redirects@v1.15.5...v1.15.6)

---
updated-dependencies:
- dependency-name: follow-redirects
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* chore(deps): Bump github.com/golang/protobuf (litmuschaos#4493)

Bumps [github.com/golang/protobuf](https://github.com/golang/protobuf) from 1.5.3 to 1.5.4.
- [Release notes](https://github.com/golang/protobuf/releases)
- [Commits](golang/protobuf@v1.5.3...v1.5.4)

---
updated-dependencies:
- dependency-name: github.com/golang/protobuf
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Raj Das <mail.rajdas@gmail.com>

* Modified SendInvitation API.

This modification unables to send invite with the role as owner.

Signed-off-by: aryan <aryan1bhokare@gmail.com>

* Modified LeaveProject API.

This modification checks if the User is the last owner of the project and if not User can leave the project.

Signed-off-by: aryan <aryan1bhokare@gmail.com>

* RBAC modification `LeaveProject`.

Allows Owner to be able to leave the project.

Signed-off-by: aryan <aryan1bhokare@gmail.com>

* Added `UpdateMemberRole` API.

This API is used for updating role of the member in the project.

Signed-off-by: aryan <aryan1bhokare@gmail.com>

* Fixed some syntax errors.

Signed-off-by: aryan <aryan1bhokare@gmail.com>

* Updated roles for owner.

Signed-off-by: aryan <aryan1bhokare@gmail.com>

* Added new API `DeleteProject`.
Owner can delete project with help of this API.

Signed-off-by: aryan <aryan1bhokare@gmail.com>

* Added mocks.

Signed-off-by: aryan <aryan1bhokare@gmail.com>

* modified go.sum

Signed-off-by: aryan <aryan1bhokare@gmail.com>

* Added condition `UpdateMemberRole`.

User cannot change role of their own, so that it will avoid edge cases like
1. User is the last owner of the project.
2. User accidentally losing owner access to the projects.

Signed-off-by: aryan <aryan1bhokare@gmail.com>

* made suggested changes.

Signed-off-by: aryan <aryan1bhokare@gmail.com>

* Changed DeleteProject endpoint to have url parameter.

Signed-off-by: aryan <aryan1bhokare@gmail.com>

* Minor fixes.

Signed-off-by: aryan <aryan1bhokare@gmail.com>

---------

Signed-off-by: aryan <aryan1bhokare@gmail.com>
Signed-off-by: dependabot[bot] <support@github.com>
Signed-off-by: Aryan Bhokare <92683836+aryan-bhokare@users.noreply.github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Raj Das <mail.rajdas@gmail.com>

* Added new route .

Signed-off-by: aryan <aryan1bhokare@gmail.com>

* Added `CreateProject` modal.

Added a modal CreateProject with it's controller and views.

Signed-off-by: aryan <aryan1bhokare@gmail.com>

* Some changes in `CreateProjectView`.

Signed-off-by: aryan <aryan1bhokare@gmail.com>

* Added `ProjectDashboardCardMenu`.

Signed-off-by: aryan <aryan1bhokare@gmail.com>

* Added `ProjectDashboardCard`.

Signed-off-by: aryan <aryan1bhokare@gmail.com>

* Added `DeleteProject` API mutations.

Signed-off-by: aryan <aryan1bhokare@gmail.com>

* Added `ProjectDashboard`.

Signed-off-by: aryan <aryan1bhokare@gmail.com>

* Added image and strings.

Signed-off-by: aryan <aryan1bhokare@gmail.com>

* Modified `project entities`.

Added new fields in `Project` struct.
Added fields for filters, pagination, and some constants.
Modified `CreateProjectInput`.

Signed-off-by: aryan <aryan1bhokare@gmail.com>

* [Backend] Modification in Backend for the UI.

Added Filters and pagination in Backend.
Modified API's and added a pipeline for the aggregation of results.

Signed-off-by: aryan <aryan1bhokare@gmail.com>

* Added `project_util` for validation of input request.

Signed-off-by: aryan <aryan1bhokare@gmail.com>

* Indent Fixes

Signed-off-by: aryan <aryan1bhokare@gmail.com>

* Modification for Frontend Hook of `CreateProject` API.

Signed-off-by: aryan <aryan1bhokare@gmail.com>

* Modified `ListProject` Query frontend hook.

Signed-off-by: aryan <aryan1bhokare@gmail.com>

* Removed string constants and some minor changes.

Signed-off-by: aryan <aryan1bhokare@gmail.com>

* Added Project Filters.

Signed-off-by: aryan <aryan1bhokare@gmail.com>

* Added pagination and filter subheader in Dashboard.

Signed-off-by: aryan <aryan1bhokare@gmail.com>

* modified auth-api swagger file.

Signed-off-by: aryan <aryan1bhokare@gmail.com>

* Added tags section in create-project modal.

Signed-off-by: aryan <aryan1bhokare@gmail.com>

* Changes due to modification of API and addition of new strings

Signed-off-by: aryan <aryan1bhokare@gmail.com>

* minor changes and resolved some errors.

Signed-off-by: aryan <aryan1bhokare@gmail.com>

* Added routing when clicked on the card.

Signed-off-by: aryan <aryan1bhokare@gmail.com>

* Modifications in backend tests as per API updates.

Signed-off-by: aryan <aryan1bhokare@gmail.com>

* Fix: NoProjects Element and NoFilteredProject Results element.

Signed-off-by: aryan <aryan1bhokare@gmail.com>

* Added scroll for the project list.

Signed-off-by: aryan <aryan1bhokare@gmail.com>

* Some changes in UI w.r.t Multiple Project Owner Feature.

Signed-off-by: aryan <aryan1bhokare@gmail.com>

* Made search text type insensitive.

Signed-off-by: aryan <aryan1bhokare@gmail.com>

* Update chaoscenter/web/src/controllers/ProjectDashboard/ProjectFilters.tsx

Co-authored-by: Hrishav <hrishav.kumar@harness.io>
Signed-off-by: Aryan Bhokare <92683836+aryan-bhokare@users.noreply.github.com>

* requested changes.

Signed-off-by: aryan <aryan1bhokare@gmail.com>

* removed unnecessary handle function

Signed-off-by: aryan <aryan1bhokare@gmail.com>

* requested backend changes and small fixes

Signed-off-by: aryan <aryan1bhokare@gmail.com>

* Changed folder structure.

Signed-off-by: aryan <aryan1bhokare@gmail.com>

* requested changes.

Signed-off-by: aryan <aryan1bhokare@gmail.com>

* fixed import orders

Signed-off-by: aryan <aryan1bhokare@gmail.com>

* fixing RoleEditor to RoleExecuter

Signed-off-by: aryan <aryan1bhokare@gmail.com>

* removed redundant deleteprojectinput

Signed-off-by: aryan <aryan1bhokare@gmail.com>

* fixed bug caused in merging

Signed-off-by: aryan <aryan1bhokare@gmail.com>

* fixed bug caused in merging

Signed-off-by: aryan <aryan1bhokare@gmail.com>

* removed duplicate struct

Signed-off-by: aryan <aryan1bhokare@gmail.com>

* Fix: frontend chaoshub test

Signed-off-by: aryan <aryan1bhokare@gmail.com>

* fix: tag rendering issue in project dashboard

Signed-off-by: aryan <aryan1bhokare@gmail.com>

* fix: Less user details in createProject

Signed-off-by: aryan <aryan1bhokare@gmail.com>

* fix: import orders

Signed-off-by: aryan <aryan1bhokare@gmail.com>

---------

Signed-off-by: aryan <aryan1bhokare@gmail.com>
Signed-off-by: dependabot[bot] <support@github.com>
Signed-off-by: Aryan Bhokare <92683836+aryan-bhokare@users.noreply.github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Raj Das <mail.rajdas@gmail.com>
Co-authored-by: Hrishav <hrishav.kumar@harness.io>
Co-authored-by: Saranya Jena <saranya.jena@harness.io>
Signed-off-by: sagnik3788 <116512372+sagnik3788@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

LFX-MENTORSHIP Linux Foundation Mentor ship Issue

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support multiple project owners

3 participants