-
Notifications
You must be signed in to change notification settings - Fork 21
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
Improve node activities and add first draft for global activities #5747
Merged
Merged
Changes from all commits
Commits
Show all changes
37 commits
Select commit
Hold shift + click to select a range
6f86b6d
add global activities
pa-lem fa76749
Merge branch 'ple-acitivites' of github.com:opsmill/infrahub into ple…
pa-lem c06b727
Merge branch 'develop' of github.com:opsmill/infrahub into ple-global…
pa-lem e977f59
update style
pa-lem 5d1fc4e
switch to classic gql, add limit, refetch on object update
pa-lem c25441a
update reftech key
pa-lem d437a0e
retry activities query
pa-lem 728b903
Merge branch 'develop' of github.com:opsmill/infrahub into ple-global…
pa-lem ef201e3
prevent card grow
pa-lem 5cc0411
lint
pa-lem e700a9a
Merge branch 'develop' of github.com:opsmill/infrahub into ple-global…
pa-lem dc3a0c3
remove details page from router
pa-lem 7dba5ad
add empty state
pa-lem 61693c9
remove duplicates
pa-lem dfc1e7a
update query
pa-lem 5ce642d
use regular query
pa-lem a330a2b
add group events
pa-lem 132da8a
add pagination
pa-lem c0e7c51
update type
pa-lem b8ff623
add search
pa-lem 23e4a50
add search hook
pa-lem 1e6455b
update global filters
pa-lem 8502da1
Merge branch 'develop' of github.com:opsmill/infrahub into ple-global…
pa-lem c4882e1
fix on update
pa-lem dd22357
rename file
pa-lem e07cc16
destructure
pa-lem 9f3b626
lint
pa-lem 3c95578
types
pa-lem a0d94e7
update export
pa-lem 6e48b04
update destructuration
pa-lem 106546d
fix import
pa-lem e5be26a
Merge branch 'develop' into ple-global-activities
pa-lem 1e69b45
Merge branch 'develop' of github.com:opsmill/infrahub into ple-global…
pa-lem bc1f849
fix import
pa-lem a5de78f
Merge branch 'ple-global-activities' of github.com:opsmill/infrahub i…
pa-lem 3b31890
fix query
pa-lem 2505db1
fix query
pa-lem 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 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
65 changes: 65 additions & 0 deletions
65
frontend/app/src/entities/events/api/get-events-from-api.ts
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,65 @@ | ||
import graphqlClient from "@/shared/api/graphql/graphqlClientApollo"; | ||
import { gql } from "@apollo/client"; | ||
|
||
const EVENTS_QUERY = gql` | ||
query GET_ACTIVITIES($ids: [String!], $offset: Int, $limit: Int) { | ||
InfrahubEvent(related_node__ids: $ids, offset: $offset, limit: $limit) { | ||
count | ||
edges { | ||
node { | ||
id | ||
event | ||
branch | ||
occurred_at | ||
level | ||
account_id | ||
primary_node { | ||
id | ||
kind | ||
} | ||
__typename | ||
... on NodeMutatedEvent { | ||
attributes { | ||
action | ||
kind | ||
name | ||
value | ||
value_previous | ||
} | ||
payload | ||
} | ||
} | ||
} | ||
} | ||
} | ||
`; | ||
|
||
export function getEventsFromApi({ | ||
ids, | ||
offset, | ||
limit, | ||
search, | ||
branchName, | ||
atDate, | ||
}: { | ||
ids?: Array<string | undefined>; | ||
offset?: number; | ||
limit?: number; | ||
search?: string; | ||
branchName: string; | ||
atDate: Date | null; | ||
}) { | ||
return graphqlClient.query({ | ||
query: EVENTS_QUERY, | ||
variables: { | ||
ids, | ||
offset, | ||
limit, | ||
search, | ||
}, | ||
context: { | ||
branch: branchName, | ||
date: atDate, | ||
}, | ||
}); | ||
} |
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 was deleted.
Oops, something went wrong.
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 was deleted.
Oops, something went wrong.
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 |
---|---|---|
|
@@ -29,7 +29,7 @@ export type NodeEventType = NodeMutatedEvent & { | |
|
||
export type EventType = BranchEventType | NodeEventType; | ||
|
||
const EventDetails = ({ id, event, occurred_at, account_id, ...props }: EventType) => { | ||
export const EventDetails = ({ id, event, occurred_at, account_id, ...props }: EventType) => { | ||
return ( | ||
<div className="divide-y"> | ||
<PropertyRow | ||
|
@@ -57,7 +57,9 @@ export const Event = ({ __typename, ...props }: EventType) => { | |
|
||
<div className="flex flex-grow gap-3 p-2 rounded-md shadow-sm border bg-white"> | ||
<div className="flex flex-col gap-2 grow"> | ||
{__typename === NODE_MUTATED_EVENT && <NodeEvent {...props} />} | ||
{"attributes" in props && <NodeEvent {...props} />} | ||
|
||
{"attributes" in props && <EventAttributes attributes={props.attributes} />} | ||
Comment on lines
+60
to
+62
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. same condition |
||
|
||
{BRANCH_EVENTS.includes(__typename) && <BranchEvent {...props} />} | ||
|
||
|
17 changes: 17 additions & 0 deletions
17
frontend/app/src/entities/events/ui/global-branch-event.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,17 @@ | ||
import { EventNodeInterface } from "@/shared/api/graphql/generated/graphql"; | ||
import { Icon } from "@iconify-icon/react"; | ||
import { BRANCH_EVENTS_MAPPING } from "./branch-event"; | ||
|
||
export const BranchEvent = (props: EventNodeInterface) => { | ||
const { event, branch } = props; | ||
|
||
return ( | ||
<div className="flex items-center justify-between"> | ||
<div className="flex items-center gap-2 text-sm text-gray-500"> | ||
<Icon icon="mdi:source-branch" className="text-gray-400" /> | ||
|
||
{branch && BRANCH_EVENTS_MAPPING[event] && BRANCH_EVENTS_MAPPING[event](branch)} | ||
</div> | ||
</div> | ||
); | ||
}; |
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.
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.
ideally, it should be an infiniteQueryOptions