-
Notifications
You must be signed in to change notification settings - Fork 13.7k
feat: App Logs Export #36403
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
feat: App Logs Export #36403
Changes from 11 commits
Commits
Show all changes
17 commits
Select commit
Hold shift + click to select a range
b3972ff
feat: App Logs Export
MartinSchoeler a16de3f
feat: export logs endpoint
d-gubert 2697dda
feat: Implement exporting to files
MartinSchoeler 62ff581
test: update snapshots
MartinSchoeler 76c3536
fix: Accessibility errors
MartinSchoeler 1184ae8
test: modal snapshot test
MartinSchoeler 1830749
test: snaps again
MartinSchoeler 5fb9a31
chore: TS
MartinSchoeler 5d5dfe9
review: fix reviews
MartinSchoeler 439af6e
review: Modal usage
MartinSchoeler e40ae8e
chore: snapshot
MartinSchoeler 774463f
Update .changeset/serious-apricots-compare.md
d-gubert 14ef9bf
qa-finding: Amount field validation
MartinSchoeler c960a03
qa-finding: close modal and max value
MartinSchoeler d44f275
Merge branch 'develop' into feat/apps-log-export-button
d-gubert 1fc58d1
Merge branch 'develop' into feat/apps-log-export-button
kodiakhq[bot] 355f359
chore: snapshot
MartinSchoeler 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,7 @@ | ||
| --- | ||
| '@rocket.chat/rest-typings': minor | ||
| '@rocket.chat/apps-engine': minor | ||
| '@rocket.chat/meteor': minor | ||
| --- | ||
|
|
||
| Adds an endpoint to export apps logs as files | ||
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
1 change: 0 additions & 1 deletion
1
...lient/views/marketplace/AppDetailsPage/tabs/AppLogs/Filters/AppLogsFilterCompact.spec.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
1 change: 0 additions & 1 deletion
1
...views/marketplace/AppDetailsPage/tabs/AppLogs/Filters/AppLogsFilterContextualBar.spec.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
1 change: 0 additions & 1 deletion
1
...ient/views/marketplace/AppDetailsPage/tabs/AppLogs/Filters/AppLogsFilterExpanded.spec.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
26 changes: 26 additions & 0 deletions
26
...nt/views/marketplace/AppDetailsPage/tabs/AppLogs/Filters/AppsLogsFilterOptionsCompact.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,26 @@ | ||
| import { Box, Icon, Menu } from '@rocket.chat/fuselage'; | ||
| import { useTranslation } from 'react-i18next'; | ||
|
|
||
| type CompactFilterOptionsProps = { | ||
| handleExportLogs: () => void; | ||
| isLoading: boolean; | ||
| }; | ||
|
|
||
| const CompactFilterOptions = ({ handleExportLogs, ...props }: CompactFilterOptionsProps) => { | ||
| const { t } = useTranslation(); | ||
|
|
||
| const menuOptions = { | ||
| exportLogs: { | ||
| label: ( | ||
| <Box> | ||
| <Icon name='circle-arrow-down' size='x16' marginInlineEnd={4} /> | ||
| {t('Export')} | ||
| </Box> | ||
| ), | ||
| action: handleExportLogs, | ||
| }, | ||
| }; | ||
| return <Menu title={t('Options')} small={false} alignSelf='flex-end' options={menuOptions} {...props} />; | ||
| }; | ||
|
|
||
| export default CompactFilterOptions; |
1 change: 0 additions & 1 deletion
1
...eteor/client/views/marketplace/AppDetailsPage/tabs/AppLogs/Filters/DateTimeModal.spec.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
23 changes: 23 additions & 0 deletions
23
...eor/client/views/marketplace/AppDetailsPage/tabs/AppLogs/Filters/ExportLogsModal.spec.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,23 @@ | ||
| import { mockAppRoot } from '@rocket.chat/mock-providers'; | ||
| import { composeStories } from '@storybook/react'; | ||
| import { render } from '@testing-library/react'; | ||
| import { axe } from 'jest-axe'; | ||
|
|
||
| import * as stories from './ExportLogsModal.stories'; | ||
|
|
||
| const testCases = Object.values(composeStories(stories)).map((Story) => [Story.storyName || 'Story', Story]); | ||
|
|
||
| test.each(testCases)(`renders without crashing`, async (_storyname, Story) => { | ||
| const view = render(<Story />, { | ||
| wrapper: mockAppRoot().build(), | ||
| }); | ||
| expect(view.baseElement).toMatchSnapshot(); | ||
| }); | ||
|
|
||
| test.each(testCases)('Should have no a11y violations', async (_storyname, Story) => { | ||
| const { container } = render(<Story />, { wrapper: mockAppRoot().build() }); | ||
|
|
||
| const results = await axe(container); | ||
|
|
||
| expect(results).toHaveNoViolations(); | ||
| }); |
39 changes: 39 additions & 0 deletions
39
.../client/views/marketplace/AppDetailsPage/tabs/AppLogs/Filters/ExportLogsModal.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,39 @@ | ||
| import { Box } from '@rocket.chat/fuselage'; | ||
| import { mockAppRoot } from '@rocket.chat/mock-providers'; | ||
| import { action } from '@storybook/addon-actions'; | ||
| import type { Meta, StoryFn } from '@storybook/react'; | ||
| import type { ComponentProps } from 'react'; | ||
| import { FormProvider, useForm } from 'react-hook-form'; | ||
|
|
||
| import { ExportLogsModal } from './ExportLogsModal'; | ||
|
|
||
| export default { | ||
| title: 'Marketplace/AppDetailsPage/AppLogs/Filters/ExportLogsModal', | ||
| component: ExportLogsModal, | ||
| args: { | ||
| onClose: action('onClose'), | ||
| filterValues: { | ||
| severity: 'all', | ||
| event: '', | ||
| startDate: '', | ||
| endDate: '', | ||
| }, | ||
| }, | ||
| decorators: [ | ||
| mockAppRoot().buildStoryDecorator(), | ||
| (fn) => { | ||
| const methods = useForm({}); | ||
|
|
||
| return ( | ||
| <FormProvider {...methods}> | ||
| <Box p={16}>{fn()}</Box> | ||
| </FormProvider> | ||
| ); | ||
| }, | ||
| ], | ||
| parameters: { | ||
| layout: 'fullscreen', | ||
| }, | ||
| } satisfies Meta<typeof ExportLogsModal>; | ||
|
|
||
| export const Default: StoryFn<ComponentProps<typeof ExportLogsModal>> = (args) => <ExportLogsModal {...args} />; |
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.