-
Notifications
You must be signed in to change notification settings - Fork 13.4k
feat: [FE] New App Logs Filters #36288
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
Changes from 23 commits
Commits
Show all changes
26 commits
Select commit
Hold shift + click to select a range
510e427
feat: New App Logs Filters
MartinSchoeler 5b3c248
chore: Translations
MartinSchoeler 3408780
chore: change values
MartinSchoeler 86ec758
chore: touchup components
MartinSchoeler cc8c67e
test: add unit tests
MartinSchoeler 7fa0f87
test: Contextual Bar tests
MartinSchoeler ba36d2e
chore: touchup tests
MartinSchoeler b1091e0
Extract custom hook
tassoevan 55b2cc0
Rearrange stories
tassoevan 4f3fb23
Remove extra fragment
tassoevan 510f34f
chore: :)
MartinSchoeler 921463a
qa-finding: Fix issue when selecting dates with no time
MartinSchoeler 4d9e44c
qa-finding: Add proper Noresults and GenericError to list
MartinSchoeler 3473ea1
qa-finding: Fix crash on empty result
MartinSchoeler 590a1f5
qa-finding: fix missing margin
MartinSchoeler 9a94d95
qa-finding: Filter order
MartinSchoeler 652db66
qa-finding: Retain previous value when opening modal
MartinSchoeler 30ddce0
Use form types
tassoevan 8d6eb2f
Update snapshots
tassoevan ac2b28a
Create curvy-dancers-try.md
MartinSchoeler 86b8bec
fix: timezone offset
MartinSchoeler 24b8aed
chore: suppress ts errors on unmerged endpoints
MartinSchoeler 96eb04f
chore: debounce text
MartinSchoeler 36e2916
Update .changeset/curvy-dancers-try.md
MartinSchoeler 1e802b9
Merge branch 'develop' into feat/apps-log-page
MartinSchoeler 28ab74e
Merge branch 'develop' into feat/apps-log-page
tassoevan 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| --- | ||
| "@rocket.chat/meteor": patch | ||
| --- | ||
|
|
||
| Adds a new filter to the Logs tab of the App Details page. | ||
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
54 changes: 44 additions & 10 deletions
54
apps/meteor/client/views/marketplace/AppDetailsPage/tabs/AppLogs/AppLogs.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
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
36 changes: 36 additions & 0 deletions
36
...or/client/views/marketplace/AppDetailsPage/tabs/AppLogs/Filters/AppLogsFilter.stories.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,36 @@ | ||
| import { Box } from '@rocket.chat/fuselage'; | ||
| import { mockAppRoot } from '@rocket.chat/mock-providers'; | ||
| import type { Meta } from '@storybook/react'; | ||
| import { FormProvider } from 'react-hook-form'; | ||
|
|
||
| import { AppLogsFilter } from './AppLogsFilter'; | ||
| import { useAppLogsFilterForm } from '../useAppLogsFilterForm'; | ||
|
|
||
| export default { | ||
| title: 'Marketplace/AppDetailsPage/AppLogs/Filters/AppLogsFilter', | ||
| component: AppLogsFilter, | ||
| args: {}, | ||
| decorators: [ | ||
| mockAppRoot() | ||
| // @ts-expect-error The endpoint is to be merged in https://github.com/RocketChat/Rocket.Chat/pull/36245 | ||
| .withEndpoint('GET', '/apps/logs/instanceIds', () => ({ | ||
| success: true, | ||
| instanceIds: ['instance-1', 'instance-2', 'instance-3'], | ||
| })) | ||
| .buildStoryDecorator(), | ||
| (fn) => { | ||
| const methods = useAppLogsFilterForm(); | ||
|
|
||
| return ( | ||
| <FormProvider {...methods}> | ||
| <Box p={16}>{fn()}</Box> | ||
| </FormProvider> | ||
| ); | ||
| }, | ||
| ], | ||
| parameters: { | ||
| layout: 'fullscreen', | ||
| }, | ||
| } satisfies Meta<typeof AppLogsFilter>; | ||
|
|
||
| export const Default = () => <AppLogsFilter />; |
80 changes: 80 additions & 0 deletions
80
apps/meteor/client/views/marketplace/AppDetailsPage/tabs/AppLogs/Filters/AppLogsFilter.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,80 @@ | ||
| import { Box, Button, Icon, Label, Palette, TextInput } from '@rocket.chat/fuselage'; | ||
| import { useRouter } from '@rocket.chat/ui-contexts'; | ||
| import { Controller } from 'react-hook-form'; | ||
| import { useTranslation } from 'react-i18next'; | ||
|
|
||
| import { InstanceFilterSelect } from './InstanceFilterSelect'; | ||
| import { SeverityFilterSelect } from './SeverityFilterSelect'; | ||
| import { TimeFilterSelect } from './TimeFilterSelect'; | ||
| import { useCompactMode } from '../../../useCompactMode'; | ||
| import { useAppLogsFilterFormContext } from '../useAppLogsFilterForm'; | ||
|
|
||
| export const AppLogsFilter = () => { | ||
| const { t } = useTranslation(); | ||
|
|
||
| const { control } = useAppLogsFilterFormContext(); | ||
|
|
||
| const router = useRouter(); | ||
|
|
||
| const openContextualBar = () => { | ||
| router.navigate( | ||
| { | ||
| name: 'marketplace', | ||
| params: { ...router.getRouteParameters(), contextualBar: 'filter-logs' }, | ||
| }, | ||
| { replace: true }, | ||
| ); | ||
| }; | ||
|
|
||
| const compactMode = useCompactMode(); | ||
|
|
||
| return ( | ||
| <Box display='flex' flexDirection='row' width='full' flexWrap='wrap' alignContent='flex-end'> | ||
| <Box display='flex' flexDirection='column' mie={10} flexGrow={1}> | ||
| <Label htmlFor='eventFilter'>{t('Event')}</Label> | ||
| <Controller | ||
| control={control} | ||
| name='event' | ||
| render={({ field }) => ( | ||
| <TextInput | ||
| addon={<Icon color={Palette.text['font-secondary-info']} name='magnifier' size={20} />} | ||
| id='eventFilter' | ||
| {...field} | ||
| /> | ||
| )} | ||
| /> | ||
| </Box> | ||
| {!compactMode && ( | ||
| <Box display='flex' flexDirection='column' mie={10} flexGrow={1}> | ||
| <Label id='timeFilterLabel' htmlFor='timeFilter'> | ||
| {t('Time')} | ||
| </Label> | ||
| <TimeFilterSelect id='timeFilter' aria-labelledby='timeFilterLabel' /> | ||
| </Box> | ||
| )} | ||
| {!compactMode && ( | ||
| <Box display='flex' flexDirection='column' mie={10} flexGrow={1}> | ||
| <Label id='instanceFilterLabel' htmlFor='instanceFilter'> | ||
| {t('Instance')} | ||
| </Label> | ||
| <Controller | ||
| control={control} | ||
| name='instance' | ||
| render={({ field }) => <InstanceFilterSelect aria-labelledby='instanceFilterLabel' id='instanceFilter' {...field} />} | ||
| /> | ||
| </Box> | ||
| )} | ||
| {!compactMode && ( | ||
| <Box display='flex' flexDirection='column' mie={10} flexGrow={1}> | ||
| <Label>{t('Severity')}</Label> | ||
| <Controller control={control} name='severity' render={({ field }) => <SeverityFilterSelect id='severityFilter' {...field} />} /> | ||
| </Box> | ||
| )} | ||
| {compactMode && ( | ||
| <Button alignSelf='flex-end' icon='customize' secondary mie={10} onClick={() => openContextualBar()}> | ||
| {t('Filters')} | ||
| </Button> | ||
| )} | ||
| </Box> | ||
| ); | ||
| }; |
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.