From f9dda1b046989eef2b78c794c31c75e5b9697007 Mon Sep 17 00:00:00 2001 From: Ashar Fuadi Date: Sat, 16 Dec 2023 15:32:58 +0700 Subject: [PATCH] fix(client): supervisors without mgmt permission should not see new announcement button (#562) --- .../ContestAnnouncementsPage/ContestAnnouncementsPage.jsx | 4 ++-- .../ContestAnnouncementsPage.test.jsx | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/judgels-client/src/routes/contests/contests/single/announcements/ContestAnnouncementsPage/ContestAnnouncementsPage.jsx b/judgels-client/src/routes/contests/contests/single/announcements/ContestAnnouncementsPage/ContestAnnouncementsPage.jsx index c66221341..ff76fb3a3 100644 --- a/judgels-client/src/routes/contests/contests/single/announcements/ContestAnnouncementsPage/ContestAnnouncementsPage.jsx +++ b/judgels-client/src/routes/contests/contests/single/announcements/ContestAnnouncementsPage/ContestAnnouncementsPage.jsx @@ -109,7 +109,7 @@ class ContestAnnouncementsPage extends Component { if (!response) { return null; } - if (!response.config.canSupervise) { + if (!response.config.canManage) { return null; } @@ -123,7 +123,7 @@ class ContestAnnouncementsPage extends Component { if (!response) { return null; } - if (!response.config.canSupervise) { + if (!response.config.canManage) { return null; } diff --git a/judgels-client/src/routes/contests/contests/single/announcements/ContestAnnouncementsPage/ContestAnnouncementsPage.test.jsx b/judgels-client/src/routes/contests/contests/single/announcements/ContestAnnouncementsPage/ContestAnnouncementsPage.test.jsx index 5c79937be..e1c9df203 100644 --- a/judgels-client/src/routes/contests/contests/single/announcements/ContestAnnouncementsPage/ContestAnnouncementsPage.test.jsx +++ b/judgels-client/src/routes/contests/contests/single/announcements/ContestAnnouncementsPage/ContestAnnouncementsPage.test.jsx @@ -56,9 +56,9 @@ describe('ContestAnnouncementsPage', () => { announcements = []; }); - describe('when not canSupervise', () => { + describe('when not canManage', () => { beforeEach(async () => { - canSupervise = false; + canManage = false; await render(); }); @@ -67,9 +67,9 @@ describe('ContestAnnouncementsPage', () => { }); }); - describe('when canSupervise', () => { + describe('when canManage', () => { beforeEach(async () => { - canSupervise = true; + canManage = true; await render(); });