-
Notifications
You must be signed in to change notification settings - Fork 236
feat: New admin setting for hiding user pages #10708
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
Open
arvid-e
wants to merge
36
commits into
master
Choose a base branch
from
feat/175627-admin-can-hide-user-pages
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+331
−84
Open
Changes from all commits
Commits
Show all changes
36 commits
Select commit
Hold shift + click to select a range
dc781a0
Define new user page visibility setting in config definitions
arvid-e 2e2c179
Add hide user page setting to general setting api
arvid-e 5578871
Rename user page visibility setting
arvid-e 9d144bc
Add user page visibility setting to general admin settings
arvid-e 1a89579
Add user page visibility setting to general security settings update …
arvid-e 2447c16
Create react component for user page visibility settings
arvid-e 09bfcf2
Change setting variable name
arvid-e 39d39ce
Update setting description
arvid-e 1bf5d67
Write translations for user page visibility setting
arvid-e 9af79e1
fix ja_JP/admin.json
yuki-takei a591dbe
Change name of page visibility boolean
arvid-e 3fb5d84
Change to backend solution
arvid-e aee1fe5
Move user page hiding implementation to PageListingService
arvid-e 376a801
Hide user content form lsx command
arvid-e f4cfa84
Add reminder
arvid-e 3927130
Change to correct config name
arvid-e 4f79de2
Update listPages to take user page hiding setting
arvid-e 3c562dc
Update test to work with changes to listPages
arvid-e eece6e4
Include configManager mock in test
arvid-e 9603929
Use list of excluded paths to not be usable using lsx
arvid-e 7adb254
Change test to work with crowi argument
arvid-e 2e2ef01
Update test to take new pageService method into account
arvid-e a785441
Create tests for empty and providede excludedPaths
arvid-e 5c312c3
Hide user content from general users in recent changes tab
arvid-e 45735ce
Show pages that happen to start with user but are not user pages
arvid-e aabc628
Hide user pages in recent changes for admin also
arvid-e ec37787
Fix missed conflict handling
arvid-e 6070841
Handle query being undefined
arvid-e 03d105e
Format code
arvid-e 04ac8e6
Fix list pages test problem
arvid-e efb23f5
Throw 400 if pagepath is undefined
arvid-e 8b809dc
Format code
arvid-e 5b41279
Format code
arvid-e dbb3828
Set text description in user page setting more safely
arvid-e 8eb58b1
Remove redundant null check for pagePath
arvid-e 8fa90b2
Throw 400 if pagepath is empty string
arvid-e File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
46 changes: 46 additions & 0 deletions
46
apps/app/src/client/components/Admin/Security/SecuritySetting/UserPageVisibilitySettings.tsx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,46 @@ | ||
| /* eslint-disable react/no-danger */ | ||
| import type React from 'react'; | ||
|
|
||
| import type AdminGeneralSecurityContainer from '~/client/services/AdminGeneralSecurityContainer'; | ||
|
|
||
| type Props = { | ||
| adminGeneralSecurityContainer: AdminGeneralSecurityContainer; | ||
| t: (key: string) => string; | ||
| }; | ||
|
|
||
| export const UserPageVisibilitySettings: React.FC<Props> = ({ | ||
| adminGeneralSecurityContainer, | ||
| t, | ||
| }) => { | ||
| return ( | ||
| <> | ||
| <h4 className="mb-3"> | ||
| {t('security_settings.user_page_visibility.user_page_visibility')} | ||
| </h4> | ||
| <div className="row mb-4"> | ||
| <div className="col-md-10 offset-md-2"> | ||
| <div className="form-check form-switch form-check-success"> | ||
| <input | ||
| type="checkbox" | ||
| className="form-check-input" | ||
| id="is-user-pages-visible" | ||
| checked={adminGeneralSecurityContainer.state.isHidingUserPages} | ||
| onChange={() => { | ||
| adminGeneralSecurityContainer.changeUserPageVisibility(); | ||
| }} | ||
| /> | ||
| <label | ||
| className="form-label form-check-label" | ||
| htmlFor="is-user-pages-visible" | ||
| > | ||
| {t('security_settings.user_page_visibility.hide_user_pages')} | ||
| </label> | ||
| </div> | ||
| <p className="form-text text-muted small mt-2"> | ||
| {t('security_settings.user_page_visibility.desc')} | ||
| </p> | ||
| </div> | ||
| </div> | ||
| </> | ||
| ); | ||
| }; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.