-
Notifications
You must be signed in to change notification settings - Fork 65
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
Dashboard page #184
base: develop
Are you sure you want to change the base?
Dashboard page #184
Conversation
Codecov Report
❗ Your organization is not using the GitHub App Integration. As a result you may experience degraded service beginning May 15th. Please install the Github App Integration for your organization. Read more. @@ Coverage Diff @@
## develop #184 +/- ##
===========================================
- Coverage 79.39% 77.80% -1.60%
===========================================
Files 31 31
Lines 830 847 +17
Branches 276 279 +3
===========================================
Hits 659 659
- Misses 168 185 +17
Partials 3 3
Flags with carried forward coverage won't be shown. Click here to find out more.
|
@@ -18,14 +18,16 @@ import { | |||
useNotification, | |||
} from '@strapi/helper-plugin'; | |||
|
|||
import ComingSoonPage from '../ComingSoonPage'; | |||
//import ComingSoonPage from '../ComingSoonPage'; |
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.
left over?
|
||
|
||
|
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.
Too much spacing left
|
||
console.log(result) | ||
|
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.
left over
console.log(result); | ||
|
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.
left over
@@ -81,12 +81,12 @@ const Details = ({ config }) => { | |||
parseRegExp(config.regex.uid).flags | |||
); | |||
|
|||
const { | |||
const { |
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.
redundant spacing
</Table> | ||
|
||
) : ( | ||
<EmptyStateLayout content={emptyLayout[emptyContent]} /> | ||
)} | ||
</PanelLayout> | ||
</> | ||
)} | ||
</Layout> | ||
) : | ||
<NoAcccessPage />; | ||
|
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.
Redundant empty lines left
|
||
|
||
|
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.
Same
push(getUrl(`discover/${id}`)); | ||
}; | ||
|
||
const isLoading = isLoadingForData || isFetching; |
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.
const isLoading = isLoadingForData || isFetching; | |
const isLoading = isLoadingForData || isFetching || isLoadingForPermissions; |
To make compound flag, well, compound and in one place.
* feat: custom fields on server-side * feat: graphql for custom comments field
* feat: author entity props blocking * feat: integration with settings page
* fix: [CU-862j5xat0] drilldown fail * feat: enable sidebar on details view * refactor: reworks
…tion types should allow comments when no enabled collection types are set. (#214)
Bumps [@adobe/css-tools](https://github.com/adobe/css-tools) from 4.2.0 to 4.3.1. - [Changelog](https://github.com/adobe/css-tools/blob/main/History.md) - [Commits](https://github.com/adobe/css-tools/commits) --- updated-dependencies: - dependency-name: "@adobe/css-tools" dependency-type: indirect ... Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
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.
I cannot display comments, neither on dashboard, nor discover. Also, error on toast is translate key, not string with error message ;/
|
||
position: absolute; | ||
right: -30%; | ||
top: -30%; | ||
right: -20%; | ||
top: -20%; | ||
|
||
border-radius: 50%; | ||
|
||
background: transparent; |
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.
unnecessary empty spaces
)} | ||
/> | ||
)} | ||
{!isAdminComment && (<> |
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.
would You consider extracting this fragment to separate component? Also, my recommendation is to chop this component to smaller parts, which will make it more readable
@@ -30,7 +30,7 @@ export const CustomLinkIconButton = styled(CustomIconButton)` | |||
`; | |||
|
|||
export const MainButtons = styled(IconButtonGroup)` | |||
margin-left: ${({ theme }:ThemeInterface) => theme.spaces[4]}; | |||
|
|||
`; | |||
|
|||
export const MoreButton = styled(IconButton)` |
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.
component not used
useFocusWhenNavigate(); | ||
|
||
const {push} = useHistory(); | ||
const {notifyStatus} = useNotifyAT(); | ||
const {trackUsage} = useTracking(); | ||
const trackUsageRef = useRef(trackUsage); | ||
const toggleNotification = useNotification(); | ||
const [{query: queryParams}] = useQueryParams(); | ||
const _q = queryParams?._q || ''; | ||
|
||
const viewPermissions = useMemo( | ||
() => ({ | ||
access: pluginPermissions.access, | ||
moderate: pluginPermissions.moderate, | ||
accessReports: pluginPermissions.reports, | ||
reviewReports: pluginPermissions.reportsReview, | ||
}), | ||
[], | ||
); | ||
|
||
const { | ||
isLoading: isLoadingForPermissions, | ||
allowedActions: { | ||
canAccess, | ||
canModerate, | ||
canAccessReports, | ||
canReviewReports, | ||
}, | ||
} = useRBAC(viewPermissions); |
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.
code repetition - would You consider to extract this to separate file?
const [storedReports, setStoredReports] = useState([]); | ||
const [selectedReports, setSelectedReports] = useState([]); | ||
|
||
useFocusWhenNavigate(); | ||
|
||
const { push } = useHistory(); | ||
const { notifyStatus } = useNotifyAT(); | ||
const { trackUsage } = useTracking(); | ||
const trackUsageRef = useRef(trackUsage); | ||
const toggleNotification = useNotification(); | ||
const [{ query: queryParams }] = useQueryParams(); | ||
const _q = queryParams?._q || ""; | ||
const queryClient = useQueryClient(); | ||
const { lockApp, unlockApp } = useOverlayBlocker(); |
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.
code repetition - would You consider to extract this to separate file?
const onError = (err) => { | ||
handleAPIError(err, toggleNotification); | ||
}; | ||
|
||
const onSelectionChange = (selection) => setSelectedReports(selection); | ||
|
||
const handleItemSelectionChange = (selection, value) => { | ||
if (isArray(selection)) { | ||
onSelectionChange(value ? selection : []); | ||
} else { | ||
onSelectionChange( | ||
[...selectedReports, selection].filter( | ||
(item) => value || selection !== item, | ||
), | ||
); | ||
} | ||
}; | ||
|
||
const areAllItemsSelected = () => | ||
!isEmpty(selectedReports) | ||
? selectedReports.length === storedReports.length | ||
: false; | ||
|
||
const isItemSelected = (id) => selectedReports.includes(id); | ||
|
||
const hasAnySelectedReports = selectedReports.length > 0; | ||
|
||
const onValueChange = useCallback( | ||
(value) => { | ||
handleItemSelectionChange( | ||
storedReports.map((_) => _.id), | ||
value, | ||
); | ||
}, | ||
[storedReports], | ||
); | ||
|
||
const resolveReportMutation = useMutation(resolveReport, { | ||
onSuccess: onSuccess(), | ||
onError, | ||
refetchActive: false, | ||
}); | ||
|
||
const resolveMultipleReportsMutation = useMutation(resolveMultipleReports, { | ||
onSuccess: onSuccess(), | ||
onError, | ||
refetchActive: false, | ||
}); | ||
|
||
const handleClickResolveSelected = async () => { | ||
if (canReviewReports) { | ||
lockApp(); | ||
const items = await resolveMultipleReportsMutation.mutateAsync( | ||
selectedReports, | ||
); | ||
if (!isEmpty(items)) { | ||
const updatedReports = storedReports.map((_) => ({ | ||
..._, | ||
resolved: selectedReports.includes(_.id) ? true : _.resolved, | ||
})); | ||
setStoredReports(updatedReports); | ||
setSelectedReports([], false); | ||
} | ||
} | ||
}; | ||
|
||
const isLoading = isLoadingForData || isFetching; | ||
const { total } = pagination; |
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.
another repetition - it would be better to place it somewhere else and reuse it
|
||
|
||
|
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.
please do not leave more than 1 empty line of space
@@ -26,6 +26,9 @@ import { IconButtonGroupStyled } from "../../../../components/IconButton/styles" | |||
import DiscussionThreadItemReviewAction from "../../../../components/DiscussionThreadItemReviewAction"; | |||
import UserAvatar from "../../../../components/Avatar"; | |||
|
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.
unnecessary empty space
|
||
|
||
const { |
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.
please leave just one line of space
@@ -289,6 +289,7 @@ const controllers: IControllerAdmin = { | |||
} | |||
}, | |||
|
|||
|
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.
unnecessary empty line
Ticket
Dashboard Page
Summary
to do:
show how many unread comments u have,
fix page display in navbar,
clean code