-
-
Notifications
You must be signed in to change notification settings - Fork 362
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
Add Explorer component to render resource indexes #514
Conversation
I was planning to achieve the same. I have something bigger in mind though: rewriting whole frontend from scratch with new React API because looking at the code from 3 years ago, makes me feel bad a bit. Of course, it'll take some time to do that but this could be a good start. Also I wanted to let you know that I'm going to start doing it sooner or later so maybe it's a good idea not to make big investments in the current code. |
That's something nice to look forward to.. 👍 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This pr is so satisfying. Great job 🎉
|
||
render() { | ||
const { items, type, newBtnLabel, search, params } = this.props; | ||
const typeLabel = type === 'datafiles' ? 'data files' : type; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We could create a constant for this later to get type labels;
const TYPE_LABELS = {
"datafiles": "data files",
"pages": "pages",
..
}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awesome idea!! 👍
The front end for routes
/pages
,/drafts
and/data
are virtually identical except for the resource data, yet each component implements the same logic leading to repeated code.We can extract all the repeated logic into a new React component, currently named
Explorer
.Note: Currently not useful to refactoring the front end for posts and other documents.