Skip to content

Commit

Permalink
make activity creation available for educators
Browse files Browse the repository at this point in the history
  • Loading branch information
brrkrmn committed Feb 29, 2024
1 parent 9f575f7 commit e2a7675
Show file tree
Hide file tree
Showing 6 changed files with 147 additions and 159 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/build_deploy_frontend.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@ jobs:

- uses: unstructuredstudio/zubhub/.github/actions/scp_action@master
with:
host: ${{ vars.DO_BACKEND_HOST }}
username: ${{ vars.DO_BACKEND_USERNAME }}
host: ${{ vars.DO_FRONTEND_HOST }}
username: ${{ vars.DO_FRONTEND_USERNAME }}
key: ${{ secrets.DO_SSHKEY }}
source: "."
target: "/home/zubhub-frontend/zubhub"
Expand All @@ -65,7 +65,7 @@ jobs:
script: |
docker system prune -a -f
volumes=$(docker volume ls -q)
# Loop through the volumes
while IFS= read -r volume; do
Expand Down
1 change: 1 addition & 0 deletions zubhub_frontend/zubhub/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions zubhub_frontend/zubhub/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
"axios": "^1.5.1",
"caniuse-lite": "^1.0.30001543",
"classnames": "^2.2.6",
"clsx": "^2.1.0",
"compressorjs": "^1.0.7",
"dayjs": "^1.11.10",
"formik": "^2.2.5",
Expand Down
5 changes: 3 additions & 2 deletions zubhub_frontend/zubhub/public/locales/en/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -649,7 +649,7 @@
},
"activityLog": {
"activity": "Activity Log",
"addActivityLog": "Seems like there isn't any activity on your account yet! Get involved to see activity logs!"
"addActivityLog": "Seems like there isn't any activity on your account yet! Get involved to see activity logs!"
},
"team": "Team",
"createteam": "Create Team",
Expand Down Expand Up @@ -949,6 +949,7 @@
"primary": "Create Activity",
"edit": "Update Activity"
},
"unauthorized": "You have to be an educator to create activities",
"inputs": {
"title": {
"label": "Name your Activity",
Expand Down Expand Up @@ -1191,4 +1192,4 @@
"buttonLabel": "Get Started"
}
}
}
}
72 changes: 35 additions & 37 deletions zubhub_frontend/zubhub/src/components/Sidenav/data.js
Original file line number Diff line number Diff line change
@@ -1,45 +1,43 @@
import { GiNotebook } from 'react-icons/gi';
import { TEAM_ENABLED } from '../../utils.js';
import { RiLogoutBoxRFill, RiTeamFill } from 'react-icons/ri';
import {
Bookmark,
Dashboard,
EmojiObjects,
ExpandMore,
FeaturedPlayList,
Person,
PostAddOutlined,
Publish,
Settings,
Bookmark,
Dashboard,
EmojiObjects,
FeaturedPlayList,
Person,
PostAddOutlined,
Publish,
} from '@mui/icons-material';
import { TEAM_ENABLED } from '../../utils.js';

export const links = ({ draftCount, myProjectCount, auth, t }) => [
{ label: t('pageWrapper.sidebar.projects'), link: '/', icon: Dashboard },
{ label: t('pageWrapper.sidebar.profile'), link: '/profile', icon: Person, reactIcon: true, requireAuth: true },
{ label: t('pageWrapper.sidebar.createProject'), link: '/projects/create', icon: EmojiObjects },
...(auth?.tags.includes('staff')
? [{ label: t('pageWrapper.sidebar.createActivity'), link: '/activities/create', icon: PostAddOutlined }]
: []),
{
label: `${t('pageWrapper.sidebar.myDrafts')}`,
link: `/creators/${auth?.username}/drafts`,
icon: GiNotebook,
requireAuth: true,
customButton: true,
},
{
label: `${t('pageWrapper.sidebar.myProjects')}`,
link: `/creators/${auth?.username}/projects`,
icon: Publish,
requireAuth: true,
customButton: true,
},
{ label: t('pageWrapper.sidebar.bookmarks'), link: '/projects/saved', icon: Bookmark, requireAuth: true },
...(TEAM_ENABLED ? [{ label: t('pageWrapper.sidebar.teams'), link: '/teams/all', icon: RiTeamFill }] : []),
{ label: t('pageWrapper.sidebar.expoloreActivities'), link: 'https://kriti.unstructured.studio/', target: '_blank', icon: FeaturedPlayList },
export const links = ({ auth, t }) => [
{ label: t('pageWrapper.sidebar.projects'), link: '/', icon: Dashboard },
{ label: t('pageWrapper.sidebar.profile'), link: '/profile', icon: Person, reactIcon: true, requireAuth: true },
{ label: t('pageWrapper.sidebar.createProject'), link: '/projects/create', icon: EmojiObjects },
...(auth?.tags.includes('staff') || auth?.tags.includes('educator')
? [{ label: t('pageWrapper.sidebar.createActivity'), link: '/activities/create', icon: PostAddOutlined }]
: []),
{
label: `${t('pageWrapper.sidebar.myDrafts')}`,
link: `/creators/${auth?.username}/drafts`,
icon: GiNotebook,
requireAuth: true,
customButton: true,
},
{
label: `${t('pageWrapper.sidebar.myProjects')}`,
link: `/creators/${auth?.username}/projects`,
icon: Publish,
requireAuth: true,
customButton: true,
},
{ label: t('pageWrapper.sidebar.bookmarks'), link: '/projects/saved', icon: Bookmark, requireAuth: true },
...(TEAM_ENABLED ? [{ label: t('pageWrapper.sidebar.teams'), link: '/teams/all', icon: RiTeamFill }] : []),
{ label: t('pageWrapper.sidebar.expoloreActivities'), link: '/activities', icon: FeaturedPlayList },
];

export const bottomLinks = ({ t }) => [
// { label: t('pageWrapper.sidebar.settings'), link: '/settings', icon: Settings, requireAuth: true },
{ label: t('pageWrapper.sidebar.logout'), action: 'logout', icon: RiLogoutBoxRFill, red: true, requireAuth: true },
];
// { label: t('pageWrapper.sidebar.settings'), link: '/settings', icon: Settings, requireAuth: true },
{ label: t('pageWrapper.sidebar.logout'), action: 'logout', icon: RiLogoutBoxRFill, red: true, requireAuth: true },
];
Loading

0 comments on commit e2a7675

Please sign in to comment.