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

Created new admin interface #2014

Draft
wants to merge 8 commits into
base: dev/31-taconite
Choose a base branch
from

Conversation

maufcost
Copy link
Contributor

@maufcost maufcost commented Jun 29, 2022

WIP
Fixes #2010

@maufcost
Copy link
Contributor Author

maufcost commented Aug 2, 2022

A little sneak peek at the new admin interface:

Screen Shot 2022-08-02 at 10 14 45

I believe this will pretty much be a project on its own wherein we will be adding more and more functionalities.

A quick documentation on some of the files involved in creating a new obo page (hopefully, if someone ever needs to create a new page, this will save them some time):

  • The stats and admin pages are inside obojobo-repository, so most probably, most new pages - if we ever need more - will be located there too.
  • obojobo-repository/shared/components: contains the actual React components - and their respective styles - representing the new page (e.g. admin.jsx or stats.jsx).
  • obojobo-repository/shared/actions: contains the Redux actions for a component/page (e.g. admin-actions.js contains the actions for the admin.jsx component/page). These actions are ways of abstracting API calls (removing those calls from being made directly inside a component - more about them below).
  • obojobo-repository/shared/components/*-hoc.js: *-hoc.js files are responsible for getting those Redux actions and injecting them on their respective components. So, for example, admin-hoc.js gets the admin actions from admin-actions.js and injects them on admin.jsx.
  • obojobo-repository/server/routes/api.js: contains the server routes that will be called by a certain suite of actions. For example, there are routes within .../api.js that will be called by actions inside admin-actions.js. Now, what do these routes do once they are called? They execute specific functions in models representing obo objects (e.g. admin_interface, collection, draft_summary, etc)
  • obojobo-repository/server/models/(...): As an example, I have created an AdminInterface model that will be responsible for having functions, such as addUserPermission, removeUserPermission, etc. Finally, these are the functions that will execute the SQL queries.

Overall, in the new admin page's context, the flow of information will go as:

  1. admin.jsx (the actual React component) executes a function that was injected by admin-hoc.js
  2. These functions injected by admin-hoc.js are gotten from admin-actions.js
  3. admin-actions.js in turn call the routes on api.js
  4. api.js uses the respective AdminInterface functions depending on the command executed (e.g. give user x permission a).

@FrenjaminBanklin FrenjaminBanklin changed the base branch from dev/28-jadeite to dev/29-sodalite August 26, 2022 20:13
@FrenjaminBanklin FrenjaminBanklin changed the base branch from dev/29-sodalite to dev/31-taconite March 20, 2023 17:21
…user search instead of a dropdown with all possible users. Made necessary backend and frontend adjustments to correctly differentiate between role-based implicit permissions and explicit permissions. Added/updated unit tests.
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.

2 participants