-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implement Stream details page (#19342)
* add api to get all connected piplines for a stream id * Add stream details page - add Stream pipeline list * update StreamDetailsPage * add alignActionsLeft to Section * add stream dataWarehouse - update design * fix StreamResource.java * add Mantine Text component * update StreamOverview - add TitleCell - hide description - update styles * Update stream details - fix linter error * fix linter * fix StreamOverview test * fix linters * fix linter * fix review * fix description * disable details button for not editable stream --------- Co-authored-by: Maxwell Anipah <maxwell.anipah@graylog.com> Co-authored-by: Maxwell <98284293+kodjo-anipah@users.noreply.github.com>
- Loading branch information
1 parent
70e82da
commit f8a8a1b
Showing
25 changed files
with
883 additions
and
30 deletions.
There are no files selected for viewing
This file contains 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 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 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 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,29 @@ | ||
/* | ||
* Copyright (C) 2020 Graylog, Inc. | ||
* | ||
* This program is free software: you can redistribute it and/or modify | ||
* it under the terms of the Server Side Public License, version 1, | ||
* as published by MongoDB, Inc. | ||
* | ||
* This program is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* Server Side Public License for more details. | ||
* | ||
* You should have received a copy of the Server Side Public License | ||
* along with this program. If not, see | ||
* <http://www.mongodb.com/licensing/server-side-public-license>. | ||
*/ | ||
import * as React from 'react'; | ||
import type { TextProps } from '@mantine/core'; | ||
import { Text as MantineText } from '@mantine/core'; | ||
|
||
type Props = { | ||
children: string, | ||
} & TextProps; | ||
|
||
const Text = ({ ...props }: Props) => ( | ||
<MantineText {...props} /> | ||
); | ||
|
||
export default Text; |
This file contains 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
86 changes: 86 additions & 0 deletions
86
graylog2-web-interface/src/components/streamrules/CreateStreamRuleButton.tsx
This file contains 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,86 @@ | ||
/* | ||
* Copyright (C) 2020 Graylog, Inc. | ||
* | ||
* This program is free software: you can redistribute it and/or modify | ||
* it under the terms of the Server Side Public License, version 1, | ||
* as published by MongoDB, Inc. | ||
* | ||
* This program is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* Server Side Public License for more details. | ||
* | ||
* You should have received a copy of the Server Side Public License | ||
* along with this program. If not, see | ||
* <http://www.mongodb.com/licensing/server-side-public-license>. | ||
*/ | ||
import * as React from 'react'; | ||
import { useCallback, useState } from 'react'; | ||
import { useQueryClient } from '@tanstack/react-query'; | ||
import PropTypes from 'prop-types'; | ||
|
||
import { Button } from 'components/bootstrap'; | ||
import type { BsSize } from 'components/bootstrap/types'; | ||
import type { StyleProps } from 'components/bootstrap/Button'; | ||
import type { StreamRule } from 'stores/streams/StreamsStore'; | ||
import { StreamRulesStore } from 'stores/streams/StreamRulesStore'; | ||
import UserNotification from 'util/UserNotification'; | ||
|
||
import StreamRuleModal from './StreamRuleModal'; | ||
|
||
type Props = { | ||
bsSize?: BsSize, | ||
bsStyle?: StyleProps, | ||
buttonText?: string, | ||
className?: string, | ||
streamId: string, | ||
} | ||
|
||
const CreateStreamRuleButton = ({ bsSize, bsStyle, buttonText, className, streamId }: Props) => { | ||
const [showCreateModal, setShowCreateModal] = useState(false); | ||
const queryClient = useQueryClient(); | ||
const toggleCreateModal = useCallback(() => setShowCreateModal((cur) => !cur), []); | ||
|
||
const onSaveStreamRule = useCallback((_streamRuleId: string, streamRule: StreamRule) => StreamRulesStore.create(streamId, streamRule, () => { | ||
UserNotification.success('Stream rule was created successfully.', 'Success'); | ||
queryClient.invalidateQueries(['stream', streamId]); | ||
}), [streamId, queryClient]); | ||
|
||
return ( | ||
<> | ||
<Button bsSize={bsSize} | ||
bsStyle={bsStyle} | ||
className={className} | ||
onClick={toggleCreateModal}> | ||
{buttonText} | ||
</Button> | ||
{showCreateModal && ( | ||
<StreamRuleModal onClose={toggleCreateModal} | ||
title="New Stream Rule" | ||
submitButtonText="Create Rule" | ||
submitLoadingText="Creating Rule..." | ||
onSubmit={onSaveStreamRule} /> | ||
|
||
)} | ||
{} | ||
</> | ||
); | ||
}; | ||
|
||
CreateStreamRuleButton.propTypes = { | ||
buttonText: PropTypes.string, | ||
bsStyle: PropTypes.string, | ||
bsSize: PropTypes.string, | ||
className: PropTypes.string, | ||
streamId: PropTypes.string, | ||
}; | ||
|
||
CreateStreamRuleButton.defaultProps = { | ||
buttonText: 'Create Rule', | ||
bsSize: undefined, | ||
bsStyle: undefined, | ||
className: undefined, | ||
streamId: undefined, | ||
}; | ||
|
||
export default CreateStreamRuleButton; |
Oops, something went wrong.