8000 Migrate admin pages to React by lightnet328 · Pull Request #423 · crowi/crowi · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

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

Merged
merged 23 commits into from
Aug 18, 2019
Merged

Migrate admin pages to React #423

merged 23 commits into from
Aug 18, 2019

Conversation

lightnet328
Copy link
Member
@lightnet328 lightnet328 commented Feb 21, 2019

Overview

There is no major change in appearance or feature, and admin pages were migrated to React.

Changes

  • Migrated admin pages to React
  • Introduced partial SPA
    • Installed react-router
    • Make transitions within admin pages on one page
    • Remove swig templates & codes that are no longer used
  • Partial translation
  • Replacement text with the key for translation

Depends on

#420

@lightnet328 lightnet328 requested a review from sotarok February 21, 2019 06:33
@lightnet328 lightnet328 force-pushed the refactor/react-admin-pages branch from cab052c to 98b1a55 Compare February 21, 2019 06:33
@sotarok sotarok temporarily deployed to crowi-dev-pr-423 February 21, 2019 06:33 Inactive
@sotarok sotarok added this to the v1.8.0 milestone Jul 2, 2019
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
@lightnet328 lightnet328 changed the base branch from dev/v1.8 to master August 6, 2019 16:28
@lightnet328 lightnet328 mentioned this pull request Aug 6, 2019
79 tasks
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
@lightnet328 lightnet328 force-pushed the refactor/react-admin-pages branch from 7f05093 to 3599e46 Compare August 6, 2019 18:36
@sotarok sotarok temporarily deployed to crowi-dev-pr-423 August 6, 2019 18:36 Inactive
@sotarok sotarok temporarily deployed to crowi-dev-pr-423 August 6, 2019 18:36 Inactive
@sotarok sotarok temporarily deployed to crowi-dev-pr-423 August 6, 2019 18:42 Inactive
@sotarok sotarok temporarily deployed to crowi-dev-pr-423 August 6, 2019 19:04 Inactive
@lightnet328 lightnet328 force-pushed the refactor/react-admin-pages branch from 6881f57 to 53c631f Compare August 6, 2019 19:09
@sotarok sotarok temporarily deployed to crowi-dev-pr-423 August 6, 2019 19:09 Inactive
@codecov
Copy link
codecov bot commented Aug 6, 2019

Codecov Report

Merging #423 into master will increase coverage by 0.11%.
The diff coverage is 51.48%.

Impacted file tree graph

@@            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
Impacted Files Coverage Δ
lib/form/admin/app.ts 100% <ø> (ø) ⬆️
lib/crowi/index.ts 68.38% <ø> (ø) ⬆️
lib/routes/api/admin.ts 100% <100%> (ø) ⬆️
lib/routes/admin.ts 100% <100%> (ø) ⬆️
lib/controllers/admin.ts 16.46% <31.94%> (+0.95%) ⬆️
lib/service/config.ts 91.42% <0%> (-5.72%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update e319c24...489f678. Read the comment docs.

@@ -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'
Copy link
Member

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)
Copy link
Member

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の名前
Copy link
Member

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?

Copy link
Member Author

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)
}
Copy link
Member

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?

Copy link
Member Author

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.

< 6DAF turbo-frame id="review-thread-or-comment-id-192095807" target="_top">
@sotarok
Copy link
Member
sotarok commented Aug 12, 2019

@lightnet328 Can you resolve the conflict?

@sotarok
Copy link
Member
sotarok commented Aug 12, 2019

And the build failed.

@sotarok sotarok requested a deployment to crowi-dev-pr-423 August 18, 2019 15:43 Abandoned
@sotarok sotarok temporarily deployed to crowi-dev-pr-423 August 18, 2019 15:44 Inactive
@sotarok sotarok merged commit 8e960ba into master Aug 18, 2019
@sotarok sotarok deleted the refactor/react-admin-pages branch August 18, 2019 16:08
@lightnet328 lightnet328 mentioned this pull request Aug 18, 2019
sotarok added a commit that referenced this pull request Jun 12, 2025
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
0