Skip to content

Commit

Permalink
feat: no removal when item accepted.
Browse files Browse the repository at this point in the history
  • Loading branch information
gdethier committed Nov 23, 2023
1 parent d2bc753 commit b479058
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 b479058

Please sign in to comment.