Skip to content

Commit e2a7675

Browse files
committedFeb 29, 2024
make activity creation available for educators
1 parent 9f575f7 commit e2a7675

File tree

6 files changed

+147
-159
lines changed

6 files changed

+147
-159
lines changed
 

‎.github/workflows/build_deploy_frontend.yml

+3-3
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,8 @@ jobs:
3737

3838
- uses: unstructuredstudio/zubhub/.github/actions/scp_action@master
3939
with:
40-
host: ${{ vars.DO_BACKEND_HOST }}
41-
username: ${{ vars.DO_BACKEND_USERNAME }}
40+
host: ${{ vars.DO_FRONTEND_HOST }}
41+
username: ${{ vars.DO_FRONTEND_USERNAME }}
4242
key: ${{ secrets.DO_SSHKEY }}
4343
source: "."
4444
target: "/home/zubhub-frontend/zubhub"
@@ -65,7 +65,7 @@ jobs:
6565
script: |
6666
6767
docker system prune -a -f
68-
68+
6969
volumes=$(docker volume ls -q)
7070
# Loop through the volumes
7171
while IFS= read -r volume; do

‎zubhub_frontend/zubhub/package-lock.json

+1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎zubhub_frontend/zubhub/package.json

+1
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
"axios": "^1.5.1",
1919
"caniuse-lite": "^1.0.30001543",
2020
"classnames": "^2.2.6",
21+
"clsx": "^2.1.0",
2122
"compressorjs": "^1.0.7",
2223
"dayjs": "^1.11.10",
2324
"formik": "^2.2.5",

‎zubhub_frontend/zubhub/public/locales/en/translation.json

+3-2
Original file line numberDiff line numberDiff line change
@@ -649,7 +649,7 @@
649649
},
650650
"activityLog": {
651651
"activity": "Activity Log",
652-
"addActivityLog": "Seems like there isn't any activity on your account yet! Get involved to see activity logs!"
652+
"addActivityLog": "Seems like there isn't any activity on your account yet! Get involved to see activity logs!"
653653
},
654654
"team": "Team",
655655
"createteam": "Create Team",
@@ -949,6 +949,7 @@
949949
"primary": "Create Activity",
950950
"edit": "Update Activity"
951951
},
952+
"unauthorized": "You have to be an educator to create activities",
952953
"inputs": {
953954
"title": {
954955
"label": "Name your Activity",
@@ -1191,4 +1192,4 @@
11911192
"buttonLabel": "Get Started"
11921193
}
11931194
}
1194-
}
1195+
}
Original file line numberDiff line numberDiff line change
@@ -1,45 +1,43 @@
11
import { GiNotebook } from 'react-icons/gi';
2-
import { TEAM_ENABLED } from '../../utils.js';
32
import { RiLogoutBoxRFill, RiTeamFill } from 'react-icons/ri';
43
import {
5-
Bookmark,
6-
Dashboard,
7-
EmojiObjects,
8-
ExpandMore,
9-
FeaturedPlayList,
10-
Person,
11-
PostAddOutlined,
12-
Publish,
13-
Settings,
4+
Bookmark,
5+
Dashboard,
6+
EmojiObjects,
7+
FeaturedPlayList,
8+
Person,
9+
PostAddOutlined,
10+
Publish,
1411
} from '@mui/icons-material';
12+
import { TEAM_ENABLED } from '../../utils.js';
1513

16-
export const links = ({ draftCount, myProjectCount, auth, t }) => [
17-
{ label: t('pageWrapper.sidebar.projects'), link: '/', icon: Dashboard },
18-
{ label: t('pageWrapper.sidebar.profile'), link: '/profile', icon: Person, reactIcon: true, requireAuth: true },
19-
{ label: t('pageWrapper.sidebar.createProject'), link: '/projects/create', icon: EmojiObjects },
20-
...(auth?.tags.includes('staff')
21-
? [{ label: t('pageWrapper.sidebar.createActivity'), link: '/activities/create', icon: PostAddOutlined }]
22-
: []),
23-
{
24-
label: `${t('pageWrapper.sidebar.myDrafts')}`,
25-
link: `/creators/${auth?.username}/drafts`,
26-
icon: GiNotebook,
27-
requireAuth: true,
28-
customButton: true,
29-
},
30-
{
31-
label: `${t('pageWrapper.sidebar.myProjects')}`,
32-
link: `/creators/${auth?.username}/projects`,
33-
icon: Publish,
34-
requireAuth: true,
35-
customButton: true,
36-
},
37-
{ label: t('pageWrapper.sidebar.bookmarks'), link: '/projects/saved', icon: Bookmark, requireAuth: true },
38-
...(TEAM_ENABLED ? [{ label: t('pageWrapper.sidebar.teams'), link: '/teams/all', icon: RiTeamFill }] : []),
39-
{ label: t('pageWrapper.sidebar.expoloreActivities'), link: 'https://kriti.unstructured.studio/', target: '_blank', icon: FeaturedPlayList },
14+
export const links = ({ auth, t }) => [
15+
{ label: t('pageWrapper.sidebar.projects'), link: '/', icon: Dashboard },
16+
{ label: t('pageWrapper.sidebar.profile'), link: '/profile', icon: Person, reactIcon: true, requireAuth: true },
17+
{ label: t('pageWrapper.sidebar.createProject'), link: '/projects/create', icon: EmojiObjects },
18+
...(auth?.tags.includes('staff') || auth?.tags.includes('educator')
19+
? [{ label: t('pageWrapper.sidebar.createActivity'), link: '/activities/create', icon: PostAddOutlined }]
20+
: []),
21+
{
22+
label: `${t('pageWrapper.sidebar.myDrafts')}`,
23+
link: `/creators/${auth?.username}/drafts`,
24+
icon: GiNotebook,
25+
requireAuth: true,
26+
customButton: true,
27+
},
28+
{
29+
label: `${t('pageWrapper.sidebar.myProjects')}`,
30+
link: `/creators/${auth?.username}/projects`,
31+
icon: Publish,
32+
requireAuth: true,
33+
customButton: true,
34+
},
35+
{ label: t('pageWrapper.sidebar.bookmarks'), link: '/projects/saved', icon: Bookmark, requireAuth: true },
36+
...(TEAM_ENABLED ? [{ label: t('pageWrapper.sidebar.teams'), link: '/teams/all', icon: RiTeamFill }] : []),
37+
{ label: t('pageWrapper.sidebar.expoloreActivities'), link: '/activities', icon: FeaturedPlayList },
4038
];
4139

4240
export const bottomLinks = ({ t }) => [
43-
// { label: t('pageWrapper.sidebar.settings'), link: '/settings', icon: Settings, requireAuth: true },
44-
{ label: t('pageWrapper.sidebar.logout'), action: 'logout', icon: RiLogoutBoxRFill, red: true, requireAuth: true },
45-
];
41+
// { label: t('pageWrapper.sidebar.settings'), link: '/settings', icon: Settings, requireAuth: true },
42+
{ label: t('pageWrapper.sidebar.logout'), action: 'logout', icon: RiLogoutBoxRFill, red: true, requireAuth: true },
43+
];

0 commit comments

Comments
 (0)