-
Notifications
You must be signed in to change notification settings - Fork 22
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: add permissions & voting power per roles per features #1443
Merged
n0izn0iz
merged 142 commits into
main
from
dev/mikaelvallenet/feat/add-permission-in-roles-based-dao
Dec 20, 2024
Merged
Changes from 137 commits
Commits
Show all changes
142 commits
Select commit
Hold shift + click to select a range
e56ac5b
test: e2e test to create dao creation flow
MikaelVallenet 6860ec0
wip: e2e test to create dao creation flow
MikaelVallenet c04bea2
wip: e2e test handle filling all steps in dao creation form
MikaelVallenet 59680d9
wip: e2e test handle filling all steps in dao creation form
MikaelVallenet d3f01e3
Merge branch 'main' into e2e-test-dao-creation-gno
MikaelVallenet 83d31c8
wip: e2e test handle filling all steps in dao creation form
MikaelVallenet f5a55e2
wip: e2e test handle filling all steps in dao creation form
MikaelVallenet a020752
fix: remove unused std from gno dao realm generation
MikaelVallenet 7c60018
feat: add adena mock deploy pkg function
MikaelVallenet e4f4b20
fix: finish e2e test organization creation flow on gno
MikaelVallenet 21567e5
chore: refactor project structure by moving all e2e test files into g…
MikaelVallenet 9b8a071
style: run eslint
MikaelVallenet 03f1e7c
revert: useless modification on e2e test
MikaelVallenet cdc95c3
fix: delete useless pkg comment
MikaelVallenet c0eb78c
fix: run lint on networks files
MikaelVallenet 2ec5b9e
Merge branch 'main' into e2e-test-dao-creation-gno
MikaelVallenet c3516ce
fix: delete useless console.log
MikaelVallenet dcd664e
feat: use enum to handle adena type message value
MikaelVallenet 55176c8
fix: delete mint & burn tori token for common dao
MikaelVallenet ca2b6f1
Merge branch 'main' into e2e-test-dao-creation-gno
n0izn0iz b0cf985
fix(dao): remove modboard related code
MikaelVallenet 5093189
Merge branch 'e2e-test-dao-creation-gno' of github.com:TERITORI/terit…
MikaelVallenet c3899dd
Merge branch 'main' into e2e-test-dao-creation-gno
MikaelVallenet ff5bca0
fix(gnovm): remove leftover of tori import
MikaelVallenet 5caf06f
feat: add a call to members JSON
MikaelVallenet ed52b3f
feat: add a call to members JSON
MikaelVallenet 0fa0a0a
fix: remove tori admin handler
MikaelVallenet 4e08f27
chore: run eslint
MikaelVallenet fce1b40
fix: add a TODO to fix later the groupId
MikaelVallenet ca673e0
fix: remove groupId
MikaelVallenet 8be6a98
fix: keep only e2e related code
MikaelVallenet 010420e
fix: keep only e2e related code
MikaelVallenet d9cd564
Merge branch 'main' into e2e-test-dao-creation-gno
MikaelVallenet c6801b3
fix(gno-daos): create proposal for post with DAO
MikaelVallenet 3d27a0c
feat(dao): fix org on gno to post on social feed
MikaelVallenet 49bce88
feat(dao): fix org on gno to post on social feed
MikaelVallenet e15b6b6
feat(dao): fix not enough funds by using user wallet instead of contr…
MikaelVallenet 2885aa9
misc(dao): remove console log statements
MikaelVallenet ce5aac9
fix(dao): vote value
MikaelVallenet 7f0de1c
chore: lint
MikaelVallenet 4954bb8
chore: gno lint
MikaelVallenet 95633d4
chore: gno lint
MikaelVallenet 7eedca8
chore: gno lint
MikaelVallenet 9b2d5ba
fix: replace function by usage of lodash lib
MikaelVallenet 03d2edb
fix: check dao have enough money
MikaelVallenet ec11c14
fix: look for balance of DAO not of user
MikaelVallenet 2088df2
fix: remove double wait on tx causing infinite waiting time
MikaelVallenet 53793c3
fix: parse user & network
MikaelVallenet 117295a
fix: simplify ternary operation
MikaelVallenet e6547dd
Merge branch 'main' into dev/mikaelvallenet/fix/organization-posting-…
MikaelVallenet fec6e90
Merge branch 'main' into dev/mikaelvallenet/feat/register-dao-to-prof…
MikaelVallenet d368965
feat(gno/dao): regiser dao conf to profile realm
MikaelVallenet 30f69f6
chore: rename poster to author
MikaelVallenet 3dee11a
Merge branch 'main' into dev/mikaelvallenet/fix/organization-posting-…
MikaelVallenet 656b087
Merge branch 'dev/mikaelvallenet/fix/organization-posting-post' into …
MikaelVallenet cb0c544
fix(gno/dao): display dao members
MikaelVallenet 513d6c3
fix(gno/dao): merge main
MikaelVallenet ee26a23
Merge branch 'dev/mikaelvallenet/feat/register-dao-to-profile-realm' …
MikaelVallenet 2efbcf5
fix(gno/dao): delete fakeRoles
MikaelVallenet 52e1f49
fix(gno/dao): run linter
MikaelVallenet ad36970
feat(gno/dao): add dao_roles_group
MikaelVallenet 0055bda
feat(gno/dao): add dao_roles_group
MikaelVallenet 6a15018
feat(gno/dao): implement role manager into daos realms
MikaelVallenet 9852985
tests(gno/dao): add roles module in test dao core
MikaelVallenet 7686f09
tests(gno/dao): add roles modules info
MikaelVallenet 9cc37d6
feat(gno/dao): add dao_roles_group into network objects
MikaelVallenet e92bc8f
chore(gno/dao): generate networks.json
MikaelVallenet 629a6d1
feat(gno/dao): add dao roles group into generated dao code
MikaelVallenet ec2e57f
feat(gno/dao): add dao_roles_group into network objects
MikaelVallenet 3efeae5
feat(gno/dao): add example of role creation & assignment in dao_core
MikaelVallenet 901146d
feat(gno/dao): add form section to add new role into dao
MikaelVallenet 8d21e7d
feat(gno/dao): add review collapsable row for roles settings definition
MikaelVallenet 3904387
fix(gno/dao): handle unregister field value when delete role or member
MikaelVallenet ccbf26c
fix(gno/dao): add field to assign roles to users
MikaelVallenet e928bbb
fix(gno/dao): add role & assignment to deployment contract
MikaelVallenet d8c1b8c
feat(gno/dao): retrive roles from members of the DAO
MikaelVallenet 206021a
feat(gno/dao): display roles of DAO members
MikaelVallenet d957c11
chore: merge w/ main
MikaelVallenet 4131ab2
fix: e2e test
MikaelVallenet b755fef
feat: merge main
MikaelVallenet 438d0fb
tests: fix gno dao tests
MikaelVallenet 4c81982
chore: run linter on e2e tests
MikaelVallenet 841ef7e
feat: refactor organizations and slit each flow
MikaelVallenet c5317f1
Update packages/screens/Organizations/components/CreateDAOSection.tsx
MikaelVallenet a77163b
fix: add flex property create dao animation
MikaelVallenet 5fddbc0
Merge branch 'dev/mikaelvallenet/feat/push-role-manager-into-dao' of …
MikaelVallenet ca3b5c1
fix: refactor gno e2e tests
MikaelVallenet 607cebe
fix: remove roles e2e test since it's not production ready
MikaelVallenet b549bbc
chore: run lint
MikaelVallenet 0ccbc60
fix: reset unlocked steps on structure change
MikaelVallenet c0e7c6a
test: fix e2e tests
MikaelVallenet 4284bef
test: fix e2e tests
MikaelVallenet ce2571f
chore: regenerate networks.json
MikaelVallenet 21012de
fix(org): remove unused ReviewInformationSection component
MikaelVallenet 7695414
fix(org): remove duplicate register to realm profile
MikaelVallenet 637d03a
style: remove stylesheet.create from evertwhere in the orgs screens &…
MikaelVallenet 7eeb6ba
fix(org): fix split bug & add split member in two kind for roles & me…
MikaelVallenet 4acc804
fix(org): fix deploy roles based dao without any roles
MikaelVallenet 3d5061b
fix(org/upp): remove roles text if user card does not have any roles
MikaelVallenet b3de18d
Merge branch 'main' into dev/mikaelvallenet/feat/push-role-manager-in…
n0izn0iz 5480428
feat: add token based dao
MikaelVallenet 0add3e8
fix: import
MikaelVallenet 9ea0010
chore: lint
MikaelVallenet 928814e
chore: lint
MikaelVallenet 1f77d9a
Merge branch 'main' into dev/mikaelvallenet/feat/push-role-manager-in…
MikaelVallenet 9f9df32
fix: e2e test
MikaelVallenet 4c659fc
feat: add new p roles based voting module that implement voting modul…
MikaelVallenet 15f7b06
feat: create new roles dao based realm that use the new roles voting …
MikaelVallenet d8ae713
chore: rename role method
MikaelVallenet bda1fbe
feat: merge main
MikaelVallenet 553a5f3
feat: wip
MikaelVallenet fa9b4df
feat: handle features selections
MikaelVallenet bb49a9e
feat: rename features to resources & reset checkbox on each opening o…
MikaelVallenet b4227b4
feat: add generation of dao for roles based org
MikaelVallenet f54ec40
Merge branch 'main' into dev/mikaelvallenet/feat/add-permission-in-ro…
MikaelVallenet 33f75ac
feat: add parsing json permissions & resources
MikaelVallenet f81dbee
feat: adapt gno contracts to handle power per resources
MikaelVallenet 71ae5d2
fix: adapt function call to retrieve member dao power
MikaelVallenet d1d6bac
fix: dao include members without roles
MikaelVallenet 1736092
feat: adapt voting behavior
MikaelVallenet 1ea963d
feat: change resources to display a feature name but linked it to mes…
MikaelVallenet 4b9ffb5
feat: update contract to use term resource instead of permission
MikaelVallenet 33f205a
test(gno/orgs): fix new gno tests
MikaelVallenet 0002c3f
tests: add test in voting_role_dao_group
MikaelVallenet ff64ce5
tests: add two examples of dao_realm
MikaelVallenet 1aaec57
chore: lint & gnomod tidy
MikaelVallenet 1c070da
feat: add fake resources in dao_roles_realm example
MikaelVallenet d4c8d9e
chore: remove console.log
MikaelVallenet 7bd29bd
Merge branch 'main' into dev/mikaelvallenet/feat/add-permission-in-ro…
MikaelVallenet 0fb1c57
chore: refactor create role modal
MikaelVallenet 10d39a7
feat: add roles tables
MikaelVallenet c99266d
fix: change features by resources
MikaelVallenet 91b110f
fix: add spacing
MikaelVallenet e254883
chore: refactor checkbox
MikaelVallenet a56c5dd
Merge branch 'main' into dev/mikaelvallenet/feat/add-permission-in-ro…
MikaelVallenet 07da799
chore: run lint & fix tsc
MikaelVallenet b84bab3
chore: generate networks.json
MikaelVallenet 54f8050
chore: merge main
MikaelVallenet 254e77b
fix: remove require in gno.mod
MikaelVallenet 7fc6145
fix: remove require in gno.mod
MikaelVallenet d8a8542
fix: remove require in gno.mod
MikaelVallenet 5d04978
chore: gno mod tidy
n0izn0iz File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
module gno.land/p/teritori/dao_roles_voting_group | ||
|
||
require ( | ||
gno.land/p/demo/json v0.0.0-latest | ||
gno.land/p/demo/testutils v0.0.0-latest | ||
gno.land/p/teritori/dao_interfaces v0.0.0-latest | ||
gno.land/p/teritori/dao_roles_group v0.0.0-latest | ||
gno.land/p/teritori/havl v0.0.0-latest | ||
gno.land/p/teritori/jsonutil v0.0.0-latest | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
package dao_roles_voting_group | ||
|
||
import ( | ||
"gno.land/p/demo/json" | ||
"gno.land/p/teritori/dao_interfaces" | ||
) | ||
|
||
const updateMembersType = "gno.land/p/teritori/dao_voting_group.UpdateMembers" | ||
|
||
type UpdateMembersExecutableMessage []Member | ||
|
||
var _ dao_interfaces.ExecutableMessage = (*UpdateMembersExecutableMessage)(nil) | ||
|
||
func (m *UpdateMembersExecutableMessage) FromJSON(ast *json.Node) { | ||
changes := ast.MustArray() | ||
*m = make([]Member, len(changes)) | ||
for i, change := range changes { | ||
(*m)[i].FromJSON(change) | ||
} | ||
} | ||
|
||
func (m *UpdateMembersExecutableMessage) ToJSON() *json.Node { | ||
changes := make([]*json.Node, len(*m)) | ||
for i, change := range *m { | ||
changes[i] = change.ToJSON() | ||
} | ||
|
||
return json.ArrayNode("", changes) | ||
} | ||
|
||
func (m *UpdateMembersExecutableMessage) String() string { | ||
return m.ToJSON().String() | ||
} | ||
|
||
func (m *UpdateMembersExecutableMessage) Type() string { | ||
return updateMembersType | ||
} | ||
|
||
type updateMembersHandler struct { | ||
vg *RolesVotingGroup | ||
} | ||
|
||
var _ dao_interfaces.MessageHandler = (*updateMembersHandler)(nil) | ||
|
||
func (h *updateMembersHandler) Type() string { | ||
return updateMembersType | ||
} | ||
|
||
func (h *updateMembersHandler) Execute(msg dao_interfaces.ExecutableMessage) { | ||
m, ok := msg.(*UpdateMembersExecutableMessage) | ||
if !ok { | ||
panic("unexpected message type") | ||
} | ||
|
||
for _, change := range *m { | ||
h.vg.SetMemberPower(change.Address, change.Power) | ||
} | ||
} | ||
|
||
func (h *updateMembersHandler) Instantiate() dao_interfaces.ExecutableMessage { | ||
return &UpdateMembersExecutableMessage{} | ||
} |
Oops, something went wrong.
Oops, something went wrong.
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.
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.
I think we should remove the role manager from the core interfaces and implem, is there a real need to have it there?
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.
to inform ppl, we decided to do this improvement in a next PR