-
Notifications
You must be signed in to change notification settings - Fork 169
Migrate admin pages to React #423
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
Conversation
cab052c
to
98b1a55
Compare
Conflicts: client/app.js client/app.tsx client/components/Admin/AdminRebuildSearch.js client/components/Admin/AdminRebuildSearch.tsx client/components/Admin/Search/AdminRebuildSearch.js client/components/Admin/Share/AccessLog.js client/components/Admin/Share/AccessLog.tsx client/components/Admin/Share/AdminShare.js client/components/Admin/Share/AdminShare.tsx client/components/Admin/Share/ShareList.js client/components/Admin/Share/ShareList.tsx client/components/ExternalShare/AccessLogModal.js client/components/ExternalShare/AccessLogModal.tsx client/components/ExternalShare/DeleteConfirmModal.js client/components/ExternalShare/DeleteConfirmModal.tsx client/components/ExternalShare/SecretKeywordForm/SecretKeywordFormContainer.js client/components/ExternalShare/SecretKeywordForm/SecretKeywordFormContainer.tsx client/components/ExternalShare/SettingModal.js client/components/ExternalShare/SettingModal.tsx client/components/ExternalShare/ShareBox.js client/components/ExternalShare/ShareBox.tsx client/components/ExternalShare/ShareBoxContent.js client/components/ExternalShare/ShareBoxContent.tsx client/components/HeaderSearchBox/SearchSuggest.js client/components/HeaderSearchBox/SearchSuggest.tsx client/components/Notification/WatchButton.js client/components/Notification/WatchButton.tsx client/components/RenameTree/RenameTree.js client/components/RenameTree/RenameTree.tsx client/components/SearchPage/SearchToolbar.js client/components/SearchPage/SearchToolbar.tsx client/components/SearchPage/SearchTypeNav/SearchTypeDropdown.js client/components/SearchPage/SearchTypeNav/SearchTypeDropdown.tsx client/crowi-admin.js client/crowi-admin.ts lib/routes/admin.js lib/routes/index.js lib/views/admin/app.html lib/views/admin/notification.html lib/views/admin/users.html lib/views/admin/widget/menu.html package-lock.json package.json resource/css/crowi.scss tools/webpack.client.js
Conflicts: lib/controllers/admin.js lib/controllers/admin.ts lib/form/admin/app.js lib/views/admin/backlink.html lib/views/admin/search.html lib/views/admin/share.html lib/views/admin/widget/menu.html lib/views/layout/admin.html package-lock.json views/admin/backlink.html views/admin/search.html views/admin/share.html views/admin/widget/menu.html views/layout/admin.html
7f05093
to
3599e46
Compare
6881f57
to
53c631f
Compare
Codecov Report
@@ Coverage Diff @@
## master #423 +/- ##
==========================================
+ Coverage 35.21% 35.33% +0.11%
==========================================
Files 112 112
Lines 4543 4531 -12
Branches 700 698 -2
==========================================
+ Hits 1600 1601 +1
+ Misses 2316 2306 -10
+ Partials 627 624 -3
Continue to review full report at Codecov.
|
@@ -24,7 +24,7 @@ import NotificationPage from 'components/NotificationPage' | |||
import HeaderNotification from 'components/HeaderNotification' | |||
import WatchButton from 'components/Notification/WatchButton' | |||
import AdminShare from 'components/Admin/Share/AdminShare' | |||
import AdminRebuildSearch from 'components/Admin/AdminRebuildSearch' | |||
import AdminPage from 'components/Admin/AdminPage' |
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.
How about standardize components directory structure as below?
components/{RootComponent}
components/{RootComponent}/{SubComponent}
If admin pages:
components/Admin/{RootComponent}
components/Admin/{RootComponent}/{SubComponent}
router.post('/admin/user/:id/activate', csrf, Admin.api.user.activate) | ||
router.post('/admin/user/:id/suspend', csrf, Admin.api.user.suspend) | ||
router.post('/admin/users.resetPassword', csrf, Admin.api.user.resetPassword) | ||
router.post('/admin/users.updateEmail', csrf, Admin.api.user.updateEmail) |
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.
📝 There are originally mixed /admin/xxx.xxx
styled API and /admin/xxx/yyy
styled API ... we have to standardize the rule. But anyway, at this moment, it is okay. Refactor later.
@@ -223,8 +226,113 @@ search: | |||
results: '{{value}} results' | |||
|
|||
admin: | |||
app: | |||
legend: App Settings | |||
title: Wikiの名前 |
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.
❓ In this PR, you didn't update those Japanese phrases? Do you mean we update this later?
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.
There are too many sentences to translate, so I think PR should be separated.
const fetchSearchConfig = async () => { | ||
const { searchConfigured: isConfigured = false } = await crowi.apiGet('/admin') | ||
setSearchConfigured(isConfigured) | ||
} |
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.
❓ Just let me know you call fetchSearchConfig
and fetchSettings
together in Promise.all through one useEffect
, is it for managing loading status? To manage whether all content fetched, you call these methods in the one userEffect()
instead of calling userEffect()
here or any other reasons?
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.
Maybe, It is for managing the loading status.
@lightnet328 Can you resolve the conflict? |
And the build failed. |
Overview
There is no major change in appearance or feature, and admin pages were migrated to React.
Changes
react-router
Depends on
#420