{children}
-
- {content}
-
+
+
+
+ {content}
+
+
);
diff --git a/frontend/app/src/config/constants.tsx b/frontend/app/src/config/constants.tsx
index 47db553400..ccfe68dec8 100644
--- a/frontend/app/src/config/constants.tsx
+++ b/frontend/app/src/config/constants.tsx
@@ -38,8 +38,6 @@ export const PROPOSED_CHANGES_ARTIFACT_THREAD_OBJECT = "CoreArtifactThread";
export const ARTIFACT_OBJECT = "CoreArtifact";
-export const INFRAHUB_TASK = "InfrahubTask";
-
export const GRAPHQL_QUERY_OBJECT = "CoreGraphQLQuery";
export const PROPOSED_CHANGES_THREAD_COMMENT_OBJECT = "CoreThreadComment";
@@ -54,8 +52,6 @@ export const SCHEMA_ENUM_ADD = "SchemaEnumAdd";
export const SCHEMA_ENUM_REMOVE = "SchemaEnumRemove";
-export const GROUP_OBJECT = "CoreGroup";
-
export const NUMBER_POOL_OBJECT = "CoreNumberPool";
export const TASK_OBJECT = "InfrahubTask";
diff --git a/frontend/app/src/decorators/withSchemaContext.tsx b/frontend/app/src/decorators/withSchemaContext.tsx
index 2c1386d90b..03c7fb71cf 100644
--- a/frontend/app/src/decorators/withSchemaContext.tsx
+++ b/frontend/app/src/decorators/withSchemaContext.tsx
@@ -84,7 +84,12 @@ export const withSchemaContext = (AppComponent: any) => (props: any) => {
...profiles.map((s) => s.label),
];
const schemaKindNameTuples = R.zip(schemaKinds, schemaNames);
- const schemaKindNameMap = R.fromPairs(schemaKindNameTuples);
+ const schemaKindNameMap = {
+ ...R.fromPairs(schemaKindNameTuples),
+ SchemaAttribute: "Attribute",
+ SchemaRelationship: "Relationship",
+ SchemaNode: "Node",
+ };
const schemaLabels = [...schema.map((s) => s.label), ...generics.map((s) => s.label)];
const schemaKindLabelTuples = R.zip(schemaKinds, schemaLabels);
diff --git a/frontend/app/src/graphql/graphqlClientApollo.tsx b/frontend/app/src/graphql/graphqlClientApollo.tsx
index 78b8c8c162..36d20cf96b 100644
--- a/frontend/app/src/graphql/graphqlClientApollo.tsx
+++ b/frontend/app/src/graphql/graphqlClientApollo.tsx
@@ -125,11 +125,17 @@ export const errorLink = onError(({ graphQLErrors, operation, forward }) => {
});
}
default:
- if (graphQLError.message) {
- toast(
, {
- toastId: "alert-error",
- });
+ const { processErrorMessage } = operation.getContext();
+
+ if (!graphQLError.message) return;
+
+ if (processErrorMessage) {
+ return processErrorMessage(graphQLError.message);
}
+
+ toast(
, {
+ toastId: "alert-error",
+ });
}
}
}
diff --git a/frontend/app/src/graphql/queries/proposed-changes/getProposedChanges.ts b/frontend/app/src/graphql/queries/proposed-changes/getProposedChanges.ts
index 57a9b97025..4207668ed2 100644
--- a/frontend/app/src/graphql/queries/proposed-changes/getProposedChanges.ts
+++ b/frontend/app/src/graphql/queries/proposed-changes/getProposedChanges.ts
@@ -1,8 +1,8 @@
import { gql } from "@apollo/client";
export const GET_PROPOSED_CHANGES = gql`
- query GET_PROPOSED_CHANGES($state: String, $search: String) {
- CoreProposedChange(state__value: $state, any__value: $search, partial_match: true) {
+ query GET_PROPOSED_CHANGES($statesVisible: [String], $statesHidden: [String], $search: String) {
+ CoreProposedChange(state__values: $statesVisible, any__value: $search, partial_match: true) {
count
edges {
node {
@@ -58,11 +58,24 @@ export const GET_PROPOSED_CHANGES = gql`
}
validations {
count
+ edges {
+ node {
+ conclusion {
+ value
+ }
+ }
+ }
}
}
__typename
}
__typename
}
+ CoreProposedChangeVisible: CoreProposedChange(state__values: $statesVisible) {
+ count
+ }
+ CoreProposedChangeHidden: CoreProposedChange(state__values: $statesHidden) {
+ count
+ }
}
`;
diff --git a/frontend/app/src/graphql/queries/proposed-changes/getProposedChangesDetails.ts b/frontend/app/src/graphql/queries/proposed-changes/getProposedChangesDetails.ts
index 884b4d7f1a..57e936e83e 100644
--- a/frontend/app/src/graphql/queries/proposed-changes/getProposedChangesDetails.ts
+++ b/frontend/app/src/graphql/queries/proposed-changes/getProposedChangesDetails.ts
@@ -84,6 +84,7 @@ export const GET_PROPOSED_CHANGE_DETAILS = gql`
}
description {
value
+ updated_at
}
source_branch {
value
diff --git a/frontend/app/src/graphql/queries/proposed-changes/getProposedChangesDiffSummary.ts b/frontend/app/src/graphql/queries/proposed-changes/getProposedChangesDiffSummary.ts
index c416cf7763..21ef69a0c8 100644
--- a/frontend/app/src/graphql/queries/proposed-changes/getProposedChangesDiffSummary.ts
+++ b/frontend/app/src/graphql/queries/proposed-changes/getProposedChangesDiffSummary.ts
@@ -1,8 +1,8 @@
import { gql } from "@apollo/client";
export const getProposedChangesDiffSummary = gql`
- query GET_PROPOSED_CHANGES_DIFF_SUMMARY($branch: String, $filters: DiffTreeQueryFilters) {
- DiffTreeSummary(branch: $branch, filters: $filters) {
+ query GET_PROPOSED_CHANGES_DIFF_SUMMARY($branch: String) {
+ DiffTreeSummary(branch: $branch) {
num_added
num_updated
num_removed
diff --git a/frontend/app/src/graphql/queries/proposed-changes/getProposedChangesDiffTree.ts b/frontend/app/src/graphql/queries/proposed-changes/getProposedChangesDiffTree.ts
index 6acd44d6c4..589f29145b 100644
--- a/frontend/app/src/graphql/queries/proposed-changes/getProposedChangesDiffTree.ts
+++ b/frontend/app/src/graphql/queries/proposed-changes/getProposedChangesDiffTree.ts
@@ -2,18 +2,21 @@ import { gql } from "@apollo/client";
export const getProposedChangesDiffTree = gql`
query GET_PROPOSED_CHANGES_DIFF_TREE($branch: String, $filters: DiffTreeQueryFilters) {
- DiffTree(branch: $branch, filters: $filters, include_parents: false) {
+ DiffTree(branch: $branch, filters: $filters, include_parents: true) {
nodes {
uuid
relationships {
label
status
contains_conflict
+ cardinality
elements {
conflict {
+ base_branch_label
base_branch_action
base_branch_changed_at
base_branch_value
+ diff_branch_label
diff_branch_action
diff_branch_changed_at
diff_branch_value
@@ -25,9 +28,11 @@ export const getProposedChangesDiffTree = gql`
peer_id
properties {
conflict {
+ base_branch_label
base_branch_action
base_branch_changed_at
base_branch_value
+ diff_branch_label
diff_branch_action
diff_branch_changed_at
diff_branch_value
@@ -50,9 +55,11 @@ export const getProposedChangesDiffTree = gql`
path_identifier
}
conflict {
+ base_branch_label
base_branch_action
base_branch_changed_at
diff_branch_action
+ diff_branch_label
base_branch_value
diff_branch_changed_at
diff_branch_value
@@ -63,11 +70,25 @@ export const getProposedChangesDiffTree = gql`
contains_conflict
last_changed_at
name
+ conflict {
+ base_branch_label
+ base_branch_action
+ base_branch_changed_at
+ base_branch_value
+ diff_branch_label
+ diff_branch_action
+ diff_branch_changed_at
+ diff_branch_value
+ selected_branch
+ uuid
+ }
properties {
conflict {
+ base_branch_label
base_branch_action
base_branch_changed_at
base_branch_value
+ diff_branch_label
diff_branch_action
diff_branch_changed_at
diff_branch_value
diff --git a/frontend/app/src/hooks/usePermission.ts b/frontend/app/src/hooks/usePermission.ts
index fb36e37563..f2377a6fa3 100644
--- a/frontend/app/src/hooks/usePermission.ts
+++ b/frontend/app/src/hooks/usePermission.ts
@@ -2,11 +2,13 @@ import { QSP } from "@/config/qsp";
import { DateTimeParam, useQueryParam } from "use-query-params";
import { useAuth } from "./useAuth";
+type Permission = {
+ allow: boolean;
+ message: string | null;
+};
interface UsePermission {
- write: {
- allow: boolean;
- message: string | null;
- };
+ isAdmin: Permission;
+ write: Permission;
}
export const usePermission = (): UsePermission => {
@@ -15,19 +17,33 @@ export const usePermission = (): UsePermission => {
const isViewingPastData = !!qspDate;
- if (!isAuthenticated || isViewingPastData) {
+ if (isViewingPastData) {
return {
+ isAdmin: {
+ allow: false,
+ message: "Can't edit data from the past.",
+ },
write: {
allow: false,
- message: isAuthenticated ? "Can't edit data from the past." : "Login required.",
+ message: "Can't edit data from the past.",
},
};
}
return {
+ isAdmin: {
+ allow: !!permissions?.isAdmin,
+ message:
+ (!isAuthenticated && "Login required.") ||
+ (!permissions?.isAdmin && "Admin permission required.") ||
+ null,
+ },
write: {
- allow: permissions?.write ?? false,
- message: null,
+ allow: !!permissions?.write,
+ message:
+ (!isAuthenticated && "Login required.") ||
+ (!permissions?.write && "Write permission required.") ||
+ null,
},
};
};
diff --git a/frontend/app/src/hooks/useQuery.ts b/frontend/app/src/hooks/useQuery.ts
index 3ba374f2c7..8f1a123eb0 100644
--- a/frontend/app/src/hooks/useQuery.ts
+++ b/frontend/app/src/hooks/useQuery.ts
@@ -14,6 +14,7 @@ import usePagination from "./usePagination";
interface Options extends OperationVariables {
branch?: string;
+ context?: Record
void)>;
}
const useQuery: typeof useApolloQuery = (QUERY, options?: Options) => {
@@ -30,6 +31,7 @@ const useQuery: typeof useApolloQuery = (QUERY, options?: Options) => {
},
context: {
uri: CONFIG.GRAPHQL_URL(options?.branch || branch?.name, date),
+ ...options?.context,
},
});
};
diff --git a/frontend/app/src/images/icons/proposed-change-checks-failure.svg b/frontend/app/src/images/icons/proposed-change-checks-failure.svg
new file mode 100644
index 0000000000..6192940919
--- /dev/null
+++ b/frontend/app/src/images/icons/proposed-change-checks-failure.svg
@@ -0,0 +1,6 @@
+
diff --git a/frontend/app/src/images/icons/proposed-change-checks-success.svg b/frontend/app/src/images/icons/proposed-change-checks-success.svg
new file mode 100644
index 0000000000..6200cf0529
--- /dev/null
+++ b/frontend/app/src/images/icons/proposed-change-checks-success.svg
@@ -0,0 +1,6 @@
+
diff --git a/frontend/app/src/images/icons/proposed-change-checks-unknown.svg b/frontend/app/src/images/icons/proposed-change-checks-unknown.svg
new file mode 100644
index 0000000000..2e1f295090
--- /dev/null
+++ b/frontend/app/src/images/icons/proposed-change-checks-unknown.svg
@@ -0,0 +1,6 @@
+
diff --git a/frontend/app/src/pages/branches/details.tsx b/frontend/app/src/pages/branches/details.tsx
index 204d9712a5..702c2b8a8e 100644
--- a/frontend/app/src/pages/branches/details.tsx
+++ b/frontend/app/src/pages/branches/details.tsx
@@ -127,6 +127,7 @@ const BranchContent = ({ branchName }: { branchName: string }) => {
case DIFF_TABS.SCHEMA: {
return (
{
case DIFF_TABS.DATA: {
return (
);
default: {
- return (
-
- );
+ return ;
}
}
};
export function Component() {
const { proposedChangeId } = useParams();
+ const { schema } = useSchema(PROPOSED_CHANGES_OBJECT);
const { loading, networkStatus, error, data, client } = useQuery(GET_PROPOSED_CHANGE_DETAILS, {
notifyOnNetworkStatusChange: true,
@@ -179,9 +176,43 @@ export function Component() {
{proposedChangesData.display_label}
}
+ description={
+