-
Notifications
You must be signed in to change notification settings - Fork 626
[MISC] Show alert with execution-logs link on workflow run #1997
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 all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
2dbd073
[FIX] Show alert with execution-logs link when a workflow is run
chandrasekharan-zipstack caa9b4a
[FIX] Generic back navigation from execution logs; drop duplicate bac…
chandrasekharan-zipstack 82a4e8c
[FIX] Coerce UUID/datetime to JSON-safe primitives before Socket.IO emit
chandrasekharan-zipstack b693b8f
Merge branch 'main' into fix/workflow-run-alert
chandrasekharan-zipstack 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
31 changes: 31 additions & 0 deletions
31
frontend/src/components/notification/NotificationIdLine.jsx
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,31 @@ | ||
| import { Typography } from "antd"; | ||
| import PropTypes from "prop-types"; | ||
|
|
||
| function NotificationIdLine({ label, value, stacked = false }) { | ||
| if (!value) { | ||
| return null; | ||
| } | ||
| const className = stacked | ||
| ? "notification-id-line notification-id-line--stacked" | ||
| : "notification-id-line"; | ||
| return ( | ||
| <div className={className}> | ||
| <Typography.Text type="secondary">{label}:</Typography.Text> | ||
| <Typography.Text | ||
| code | ||
| copyable={{ text: value }} | ||
| className="notification-id-line__value" | ||
| > | ||
| {value} | ||
| </Typography.Text> | ||
| </div> | ||
| ); | ||
| } | ||
|
|
||
| NotificationIdLine.propTypes = { | ||
| label: PropTypes.string.isRequired, | ||
| value: PropTypes.string, | ||
| stacked: PropTypes.bool, | ||
| }; | ||
|
|
||
| export { NotificationIdLine }; |
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,41 @@ | ||
| import { useCallback } from "react"; | ||
| import { useLocation, useNavigate } from "react-router-dom"; | ||
|
|
||
| /* | ||
| Generic back-navigation for pages reached from multiple callsites. | ||
|
|
||
| Priority: | ||
| 1. location.state.from — explicit hint from the linking page (also | ||
| reinjects scrollToCardId / backRouteState so list pages can restore | ||
| scroll position on return). | ||
| 2. navigate(-1) — SPA history exists; pop one entry. Covers | ||
| callsites that didn't set state (e.g. markdown links in alerts). | ||
| 3. fallbackPath — deep link / refresh with no history. | ||
| */ | ||
| function useBackNavigation(fallbackPath, fallbackState = null) { | ||
| const navigate = useNavigate(); | ||
| const location = useLocation(); | ||
|
|
||
| return useCallback(() => { | ||
| const explicitFrom = location.state?.from; | ||
| if (explicitFrom) { | ||
| const restoredState = location.state?.scrollToCardId | ||
| ? { | ||
| scrollToCardId: location.state.scrollToCardId, | ||
| cardExpanded: location.state.cardExpanded, | ||
| } | ||
| : location.state?.backRouteState || null; | ||
| navigate(explicitFrom, { state: restoredState }); | ||
| return; | ||
| } | ||
| if (location.key !== "default") { | ||
| navigate(-1); | ||
| return; | ||
| } | ||
| if (fallbackPath) { | ||
| navigate(fallbackPath, { state: fallbackState }); | ||
| } | ||
| }, [location.key, location.state, navigate, fallbackPath, fallbackState]); | ||
| } | ||
|
|
||
| export { useBackNavigation }; |
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
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.