bookstore_api's People
bookstore_api's Issues
will be deleted
Hello there 👋
This pull request works on part of the requirements in this issue. I tried to stick as much as possible to the provided design guidelines.
The specific tasks implemented in this pull request include:
-
1️⃣ Setup of the Rails Admin gem to the project which provides a dashboard. The dashboard allows a community admin to create, edit, and delete records. and Learning materials (and other resources as well in the project.). The following sub-sections show the process of creating, editing, and deleting a learning material.
a. Creating a learning material record from the Rails Admin dashboard
b. Updating a learning material record from the Rails Admin dashboard
c. Deleting a learning material record from the Rails Admin dashboard -
2️⃣ Authorisation has been implemented using the cancancan gem which makes sure that only a community admin with the role "organization_admin" can access the dashboard and make any necessary changes.
-
3️⃣ Updated the routes including the /admin and /learning_materials routes to allow access to the new features
-
4️⃣ Created a
learning_materials/index.html.erb
view which holds the markup for the new learning page. The view is designed using TailwindCSS and is mobile responsive as well.
Other changes made that were not part of the core requirements:
-
1️⃣ In the
stylesheets/mailgun_mails.css
file, I noticed that there are repetitions of some color codes. I therefore made some CSS variables to reduce these many repetitions. -
2️⃣ Added Rspec and Capybara for some integration tests.
How to test the changes made:
-
1️⃣ To best the new learning materials page, navigate to this page
http://127.0.0.1:3000/learning_materials
vor optionally click on any link that has "Learning Materials```. -
2️⃣ To navigate to the admin dashboard:
a. Ensure that you have an admin account. You can create an account and edit it in the dashboard under "users". Make sure that the account role isorganization_admin
. To do this you might need to first disable lines 45-49 in theconfig/initializers/rails_admin.rb
file. Then un comment it afterward to test other bits of the changes made.
b. Once you have an account that has the organization admin role, you can now navigate tohttp://127.0.0.1:3000/admin
after you have successfully authenticated yourself.
Features not yet implemented in this pull request:
Having a look at the provided design guidelines, the feature for "searching" to filter the available learning materials has not yet been implemented. This could be implemented as a feature improvement of the existing code.
Slight bug known which does not affect the working of the feature implemented:
When you access the learning materials resource, you will notice two "thumbnails". One as an input box and one as an image upload. This is caused because:
- I have the thumbnails column as a string (which shows the input form for text in the rails admin dashboard).
- In the learning materials model, I have the
has_one_attached
association which creates an Active Record attachment which creates the other thumbnail.
Therefore when creating the learning materials from the admin dashboard you can safely ignore the one that shows as an image upload. I would appreciate suggestions to make the thumbnail show as one and not two in the admin dashboard.
Thank you for taking the time to check out my PR 🙏
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.