Skip to content

Commit

Permalink
Merge pull request #534 from logion-network/feature/cannot-remove-acc…
Browse files Browse the repository at this point in the history
…epted

No removal when item accepted
  • Loading branch information
gdethier authored Nov 23, 2023
2 parents d2bc753 + b479058 commit 70855e4
Show file tree
Hide file tree
Showing 5 changed files with 71 additions and 1,177 deletions.
4 changes: 2 additions & 2 deletions src/loc/CustomItemActions.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ function tests(itemFactory: (status: ItemStatus, submitter: ValidAccountId) => I
renderAndExpectMatchWith(itemFactory("REVIEW_PENDING", REQUESTER), undefined);
});

it("can be published or deleted by requester when approved", () => {
it("can be published by requester when approved", () => {
asRequester();
givenOpenLoc();
renderAndExpectMatchWith(itemFactory("REVIEW_ACCEPTED", REQUESTER), "Requester");
Expand Down Expand Up @@ -72,7 +72,7 @@ function tests(itemFactory: (status: ItemStatus, submitter: ValidAccountId) => I
renderAndExpectMatchWith(itemFactory("DRAFT", ISSUER), "VerifiedIssuer");
});

it("can be published or deleted by requester when approved and submitted by issuer", () => {
it("can be published by requester when approved and submitted by issuer", () => {
asIssuer();
givenOpenLoc();
renderAndExpectMatchWith(itemFactory("REVIEW_ACCEPTED", ISSUER), "Requester");
Expand Down
2 changes: 1 addition & 1 deletion src/loc/LocItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -425,7 +425,7 @@ export function useDeleteLinkCallback(mutateLocState: (mutator: (current: LocReq
export function canDelete(account: ValidAccountId | undefined, item: LocItem, viewer: Viewer, loc: LocData): boolean {
return item.submitter?.address === account?.address && item.submitter?.type === account?.type
&& (loc.status === "DRAFT" || loc.status === "OPEN")
&& (item.status === "DRAFT" || (item.status === "REVIEW_ACCEPTED" && item.submitter?.type === "Polkadot") || item.status === "REVIEW_REJECTED");
&& (item.status === "DRAFT" || item.status === "REVIEW_REJECTED");
}

export function canAdd(viewer: Viewer, loc: LocData) {
Expand Down
4 changes: 2 additions & 2 deletions src/loc/TemplateItemActions.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ function tests(itemFactory: (status: ItemStatus | undefined, submitter: ValidAcc
renderAndExpectMatchWith(itemFactory("REVIEW_PENDING", REQUESTER), undefined);
});

it("can be published or cleared by requester when approved", () => {
it("can be published by requester when approved", () => {
asRequester();
givenOpenLoc();
renderAndExpectMatchWith(itemFactory("REVIEW_ACCEPTED", REQUESTER), "Requester");
Expand Down Expand Up @@ -79,7 +79,7 @@ function tests(itemFactory: (status: ItemStatus | undefined, submitter: ValidAcc
renderAndExpectMatchWith(itemFactory("DRAFT", ISSUER), "VerifiedIssuer");
});

it("can be published or cleared by requester when approved and submitted by issuer", () => {
it("can be published by requester when approved and submitted by issuer", () => {
asIssuer();
givenOpenLoc();
renderAndExpectMatchWith(itemFactory("REVIEW_ACCEPTED", ISSUER), "Requester");
Expand Down
Loading

0 comments on commit 70855e4

Please sign in to comment.