Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Activity list page allows staff and educators to see unpublished activities #1114

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

brrkrmn
Copy link
Collaborator

@brrkrmn brrkrmn commented Feb 22, 2024

Summary

With this PR, in the activity list page:

  • Creators can only see the published activities
  • Staff members and educators see a tab for published and unpublished activities
  • Educators see all published activities and see their own unpublished activities
  • Staff members see all published and all unpublished activities

Closes #1100

Changes

  • Activities returned from getUnPublishedActivities are stored in unPublishedActivities instead of 'all_activities'
  • Activities returned from 'getMyActivities' are stored in 'userActivities' instead of 'all_activities'

Screenshots

Creator view

Screenshot 2024-02-22 at 7 23 39 PM

Educator view

Screenshot 2024-02-22 at 7 24 59 PM Screenshot 2024-02-22 at 7 25 08 PM

Staff view

Screenshot 2024-02-22 at 7 25 55 PM Screenshot 2024-02-22 at 7 25 45 PM

Copy link

pre-commit checks failed ❌❌❌
make sure you have pre-commit set up locally (see the README.md for instructions).
If you have set up pre-commit locally, you may need to undo this commit and
run "pre-commit" locally to see what the errors are.

1 similar comment
Copy link

pre-commit checks failed ❌❌❌
make sure you have pre-commit set up locally (see the README.md for instructions).
If you have set up pre-commit locally, you may need to undo this commit and
run "pre-commit" locally to see what the errors are.

const commonClasses = makeStyles(DefaultStyles)();
const { t } = useTranslation();
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@brrkrmn can you check if we have t as part of the props passed to Activities? If we don't then something Is wrong and we should fix that (but not on this PR probably). However if t is in props then we should use it and not bother importing it again

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we have it in the props, changing the file now

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think there are other PRs where you made translation changes to. For can check for this in those too

Copy link

pre-commit checks failed ❌❌❌
make sure you have pre-commit set up locally (see the README.md for instructions).
If you have set up pre-commit locally, you may need to undo this commit and
run "pre-commit" locally to see what the errors are.

@NdibeRaymond
Copy link
Collaborator

NdibeRaymond commented Feb 26, 2024

@brrkrmn I think merging master into your commit is causing the pre-commit action to try running for changes that are not introduced by this PR (and failing). while this is undesirable and should be fixed by me, something we can do is squash the three commits in this PR (the two commits introduced by you and the merge commit) into just one commit and force push

@NdibeRaymond
Copy link
Collaborator

If you don't know how to squash commits I can do that but then you'd have to do some kind of force-pull or delete and recreate the branch from the PR

@NdibeRaymond
Copy link
Collaborator

NdibeRaymond commented Feb 26, 2024

@brrkrmn I think merging master into your commit is causing the pre-commit action to try running for changes that are not introduced by this PR (and failing). while this is undesirable and should be fixed by me, something we can do is squash the three commits in this PR (the two commits introduced by you and the merge commit) into just one commit and force push

just squashing will likely not work here. Let me look at it and recommend exactly how to do it

Copy link

pre-commit checks failed ❌❌❌
make sure you have pre-commit set up locally (see the README.md for instructions).
If you have set up pre-commit locally, you may need to undo this commit and
run "pre-commit" locally to see what the errors are.

@NdibeRaymond
Copy link
Collaborator

NdibeRaymond commented Feb 26, 2024

I rebased on master git rebase -i master and force pushed to get rid of the merge commit (now the only commits left are yours).
Next up is, you have to update your local branch with this one, undo the remaining two commits with git reset --soft HEAD~2, then git add . and git commit. You will see the pre-commit errors you need to fix when you do this

alternatively, you can look at the failing pre-commit errors here https://github.com/unstructuredstudio/zubhub/actions/runs/8048977770/job/21981429416?pr=1114 (open Run pre-commit/[email protected]).
I identify the files with the failing pre-commit errors, introduce a useless change to those files (like a newline somewhere) and try committing. you should see the full list of pre-commit errors. Fix them and commit and the errors here should go away too

Copy link

pre-commit checks failed ❌❌❌
make sure you have pre-commit set up locally (see the README.md for instructions).
If you have set up pre-commit locally, you may need to undo this commit and
run "pre-commit" locally to see what the errors are.

Copy link

All pre-commit checks passed ✅✅✅

brrkrmn and others added 5 commits July 17, 2024 03:25
* fix creator profile margin
* fix projects section margin
* fix wider project css issues
* fix eslint issues

Closes #1005
Signed-off-by: Ndibe Raymond Olisaemeka <[email protected]>

Co-authored-by: Ndibe Raymond Olisaemeka <[email protected]>
* create views and utils methods to recommend projects
* create api function to receive recommended projects in the frontend
* modify project filtering
* refactor recommend projects function

Issue: #1013

Signed-off-by: Ndibe Raymond Olisaemeka <[email protected]>
Co-authored-by: Ndibe Raymond Olisaemeka <[email protected]>
* style page and add login card
* fix misaligned login form in search results
* change styles for creator search
* implement no results found design
* make results one row
* made some major refactors

Issue: #802

Signed-off-by: Ndibe Raymond Olisaemeka <[email protected]>
Co-authored-by: Ndibe Raymond Olisaemeka <[email protected]>
* minor modifications to the admin model
* add admin models management to admin.py
* implement effective signals to handle
  admin models instances, addition,
  modification and deletion with proper
  cleanup

Issue: #1094

Signed-off-by: Ndibe Raymond Olisaemeka <[email protected]>
Co-authored-by: Ndibe Raymond Olisaemeka <[email protected]>
show unpublished activities for staff and educators
@NdibeRaymond
Copy link
Collaborator

@tuxology this has been rebased so we can focus on testing before merging to staging

Copy link

All pre-commit checks passed ✅✅✅

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

(activity): Activities List Page
3 participants