diff --git a/datahub-web-react/src/app/entity/dataset/DatasetEntity.tsx b/datahub-web-react/src/app/entity/dataset/DatasetEntity.tsx
index 63aa50ebbd4db7..ac545c69cb3aab 100644
--- a/datahub-web-react/src/app/entity/dataset/DatasetEntity.tsx
+++ b/datahub-web-react/src/app/entity/dataset/DatasetEntity.tsx
@@ -34,7 +34,7 @@ import { getDataProduct } from '../shared/utils';
import AccessManagement from '../shared/tabs/Dataset/AccessManagement/AccessManagement';
import { matchedFieldPathsRenderer } from '../../search/matches/matchedFieldPathsRenderer';
import { getLastUpdatedMs } from './shared/utils';
-import { IncidentTab } from '../../entity/shared/tabs/Incident/IncidentTab';
+import { IncidentTab } from '../shared/tabs/Incident/IncidentTab';
const SUBTYPES = {
VIEW: 'view',
diff --git a/datahub-web-react/src/app/entity/shared/tabs/Incident/IncidentTab.tsx b/datahub-web-react/src/app/entity/shared/tabs/Incident/IncidentTab.tsx
index 3ae4c804547d82..47627068ad4ce5 100644
--- a/datahub-web-react/src/app/entity/shared/tabs/Incident/IncidentTab.tsx
+++ b/datahub-web-react/src/app/entity/shared/tabs/Incident/IncidentTab.tsx
@@ -118,7 +118,7 @@ export const IncidentTab = () => {
emptyText: (
diff --git a/datahub-web-react/src/app/entity/shared/tabs/Incident/components/AddIncidentModal.tsx b/datahub-web-react/src/app/entity/shared/tabs/Incident/components/AddIncidentModal.tsx
index 42a87a57ab6bfe..bb83f0f9ddaf76 100644
--- a/datahub-web-react/src/app/entity/shared/tabs/Incident/components/AddIncidentModal.tsx
+++ b/datahub-web-react/src/app/entity/shared/tabs/Incident/components/AddIncidentModal.tsx
@@ -1,8 +1,9 @@
import React, { useState } from 'react';
import { message, Modal, Button, Form, Input, Typography, Select } from 'antd';
import { useApolloClient } from '@apollo/client';
+import TextArea from 'antd/lib/input/TextArea';
import analytics, { EventType, EntityActionType } from '../../../../../analytics';
-import { useEntityData, useRefetch } from '../../../EntityContext';
+import { useEntityData } from '../../../EntityContext';
import { EntityType, IncidentSourceType, IncidentState, IncidentType } from '../../../../../../types.generated';
import { INCIDENT_DISPLAY_TYPES, PAGE_SIZE, addActiveIncidentToCache } from '../incidentUtils';
import { useRaiseIncidentMutation } from '../../../../../../graphql/mutations.generated';
@@ -29,6 +30,7 @@ export const AddIncidentModal = ({ visible, onClose, refetch }: AddIncidentProps
const handleClose = () => {
form.resetFields();
setIsOtherTypeSelected(false);
+ setSelectedIncidentType(IncidentType.Operational);
onClose?.();
};
@@ -147,7 +149,7 @@ export const AddIncidentModal = ({ visible, onClose, refetch }: AddIncidentProps
},
]}
>
-
+
)}
-
+
-
+
diff --git a/datahub-web-react/src/app/entity/shared/tabs/Incident/components/IncidentListItem.tsx b/datahub-web-react/src/app/entity/shared/tabs/Incident/components/IncidentListItem.tsx
index c1efc42c5571d7..4cfd8e68b0971e 100644
--- a/datahub-web-react/src/app/entity/shared/tabs/Incident/components/IncidentListItem.tsx
+++ b/datahub-web-react/src/app/entity/shared/tabs/Incident/components/IncidentListItem.tsx
@@ -3,7 +3,6 @@ import styled from 'styled-components';
import { Button, Dropdown, List, Menu, message, Popover, Tag, Tooltip, Typography } from 'antd';
import { CheckCircleFilled, CheckOutlined, MoreOutlined, WarningFilled } from '@ant-design/icons';
import { Link } from 'react-router-dom';
-import { useApolloClient } from '@apollo/client';
import { EntityType, IncidentState, IncidentType } from '../../../../../../types.generated';
import { FAILURE_COLOR_HEX, getNameFromType, SUCCESS_COLOR_HEX } from '../incidentUtils';
import { useGetUserQuery } from '../../../../../../graphql/user.generated';
@@ -145,8 +144,6 @@ export default function IncidentListItem({ incident, refetch }: Props) {
const [updateIncidentStatusMutation] = useUpdateIncidentStatusMutation();
const [isResolvedModalVisible, setIsResolvedModalVisible] = useState(false);
- const client = useApolloClient();
-
// Fetching the most recent actor's data.
const { data: createdActor } = useGetUserQuery({
variables: { urn: incident.created.actor, groupsCount: 0 },
diff --git a/datahub-web-react/src/app/entity/shared/tabs/Incident/components/IncidentSummary.tsx b/datahub-web-react/src/app/entity/shared/tabs/Incident/components/IncidentSummary.tsx
index f530a3916d37b2..deea514aa6a4c1 100644
--- a/datahub-web-react/src/app/entity/shared/tabs/Incident/components/IncidentSummary.tsx
+++ b/datahub-web-react/src/app/entity/shared/tabs/Incident/components/IncidentSummary.tsx
@@ -3,7 +3,7 @@ import { CheckCircleFilled, WarningFilled, StopOutlined } from '@ant-design/icon
import { Typography } from 'antd';
import styled from 'styled-components';
import { ANTD_GRAY } from '../../../constants';
-import { SUCCESS_COLOR_HEX, FAILURE_COLOR_HEX, PAGE_SIZE } from '../incidentUtils';
+import { SUCCESS_COLOR_HEX, FAILURE_COLOR_HEX } from '../incidentUtils';
const SummaryHeader = styled.div`
width: 100%;
diff --git a/datahub-web-react/src/app/entity/shared/tabs/Incident/incidentUtils.ts b/datahub-web-react/src/app/entity/shared/tabs/Incident/incidentUtils.ts
index 6f621bb813c6fa..d7826bdc8907a1 100644
--- a/datahub-web-react/src/app/entity/shared/tabs/Incident/incidentUtils.ts
+++ b/datahub-web-react/src/app/entity/shared/tabs/Incident/incidentUtils.ts
@@ -1,6 +1,6 @@
import { GetEntityIncidentsDocument } from '../../../../../graphql/incident.generated';
-import { IncidentType, IncidentState, Incident, EntityType } from '../../../../../types.generated';
+import { IncidentType, IncidentState, Incident } from '../../../../../types.generated';
export const PAGE_SIZE = 100;
@@ -57,14 +57,6 @@ export const addOrUpdateIncidentInList = (existingIncidents, newIncidents) => {
return didUpdate ? updatedIncidents : [newIncidents, ...existingIncidents];
};
-/**
- * Add raised incident to cache
- */
-export const addActiveIncidentToCache = (client, urn, incident, pageSize) => {
- // Add to active and overall list
- updateListIncidentsCache(client, urn, incident, pageSize);
-};
-
/**
* Add an entry to the ListIncident cache.
*/
@@ -136,3 +128,11 @@ export const getIncidentsStatusSummary = (incidents: Array) => {
});
return summary;
};
+
+/**
+ * Add raised incident to cache
+ */
+export const addActiveIncidentToCache = (client, urn, incident, pageSize) => {
+ // Add to active and overall list
+ updateListIncidentsCache(client, urn, incident, pageSize);
+};
diff --git a/datahub-web-react/src/app/lineage/LineageEntityNode.tsx b/datahub-web-react/src/app/lineage/LineageEntityNode.tsx
index 9b6475b648ca18..d9f7d8c2c69de4 100644
--- a/datahub-web-react/src/app/lineage/LineageEntityNode.tsx
+++ b/datahub-web-react/src/app/lineage/LineageEntityNode.tsx
@@ -371,7 +371,7 @@ export default function LineageEntityNode({
health={health as any}
baseUrl={baseUrl as any}
fontSize={20}
- tooltipPlacement="left"
+ tooltipPlacement="top"
/>
)}
diff --git a/metadata-io/src/test/java/com/linkedin/metadata/service/IncidentInfoArgumentMatcher.java b/metadata-io/src/test/java/com/linkedin/metadata/service/IncidentInfoArgumentMatcher.java
new file mode 100644
index 00000000000000..1f2d3362abfdf1
--- /dev/null
+++ b/metadata-io/src/test/java/com/linkedin/metadata/service/IncidentInfoArgumentMatcher.java
@@ -0,0 +1,77 @@
+package com.linkedin.metadata.service;
+
+import com.linkedin.data.template.GetMode;
+import com.linkedin.incident.IncidentInfo;
+import com.linkedin.metadata.utils.GenericRecordUtils;
+import com.linkedin.mxe.GenericAspect;
+import com.linkedin.mxe.MetadataChangeProposal;
+import org.mockito.ArgumentMatcher;
+
+public class IncidentInfoArgumentMatcher implements ArgumentMatcher {
+
+ private MetadataChangeProposal left;
+
+ public IncidentInfoArgumentMatcher(MetadataChangeProposal left) {
+ this.left = left;
+ }
+
+ @Override
+ public boolean matches(MetadataChangeProposal right) {
+ return left.getEntityType().equals(right.getEntityType())
+ && left.getAspectName().equals(right.getAspectName())
+ && left.getChangeType().equals(right.getChangeType())
+ && incidentInfoMatches(left.getAspect(), right.getAspect());
+ }
+
+ private boolean incidentInfoMatches(GenericAspect left, GenericAspect right) {
+ IncidentInfo leftProps =
+ GenericRecordUtils.deserializeAspect(
+ left.getValue(), "application/json", IncidentInfo.class);
+
+ IncidentInfo rightProps =
+ GenericRecordUtils.deserializeAspect(
+ right.getValue(), "application/json", IncidentInfo.class);
+
+ // Verify optional fields.
+ if (leftProps.hasTitle()) {
+ if (!leftProps.getTitle().equals(rightProps.getTitle())) {
+ return false;
+ }
+ }
+
+ if (leftProps.hasDescription()) {
+ if (!leftProps.getDescription().equals(rightProps.getDescription())) {
+ return false;
+ }
+ }
+
+ if (leftProps.hasPriority()) {
+ if (!leftProps.getPriority().equals(rightProps.getPriority())) {
+ return false;
+ }
+ }
+
+ if (leftProps.hasCustomType()) {
+ if (!leftProps.getCustomType().equals(rightProps.getCustomType())) {
+ return false;
+ }
+ }
+
+ if (leftProps.hasSource()) {
+ if (!leftProps.getSource().equals(rightProps.getSource())) {
+ return false;
+ }
+ }
+
+ // Verify required fields.
+ return leftProps.getType().equals(rightProps.getType())
+ && leftProps.getEntities(GetMode.NULL).equals(rightProps.getEntities(GetMode.NULL))
+ && leftProps.getStatus().getState().equals(rightProps.getStatus().getState())
+ && leftProps
+ .getStatus()
+ .getLastUpdated()
+ .getActor()
+ .equals(rightProps.getStatus().getLastUpdated().getActor())
+ && leftProps.getCreated().getActor().equals(rightProps.getCreated().getActor());
+ }
+}
diff --git a/metadata-io/src/test/java/com/linkedin/metadata/service/IncidentServiceTest.java b/metadata-io/src/test/java/com/linkedin/metadata/service/IncidentServiceTest.java
index 2f3abbeb8435eb..fcdc4731600e06 100644
--- a/metadata-io/src/test/java/com/linkedin/metadata/service/IncidentServiceTest.java
+++ b/metadata-io/src/test/java/com/linkedin/metadata/service/IncidentServiceTest.java
@@ -116,7 +116,7 @@ private void testRaiseIncidentRequiredFields() throws Exception {
final IncidentService service =
new IncidentService(mockClient, Mockito.mock(Authentication.class));
service.raiseIncident(
- IncidentType.FRESHNESS,
+ IncidentType.OPERATIONAL,
null,
null,
null,
@@ -128,7 +128,7 @@ private void testRaiseIncidentRequiredFields() throws Exception {
final IncidentInfo expectedInfo =
new IncidentInfo()
- .setType(IncidentType.FRESHNESS)
+ .setType(IncidentType.OPERATIONAL)
.setEntities(new UrnArray(ImmutableList.of(TEST_DATASET_URN)))
.setStatus(
new IncidentStatus()
@@ -152,19 +152,19 @@ private void testRaiseIncidentAllFields() throws Exception {
final IncidentService service =
new IncidentService(mockClient, Mockito.mock(Authentication.class));
service.raiseIncident(
- IncidentType.FRESHNESS,
+ IncidentType.OPERATIONAL,
"custom type",
2,
"title",
"description",
ImmutableList.of(TEST_DATASET_URN),
- new IncidentSource().setType(IncidentSourceType.ASSERTION_FAILURE),
+ new IncidentSource().setType(IncidentSourceType.MANUAL),
UrnUtils.getUrn(SYSTEM_ACTOR),
"message");
final IncidentInfo expectedInfo =
new IncidentInfo()
- .setType(IncidentType.FRESHNESS)
+ .setType(IncidentType.OPERATIONAL)
.setCustomType("custom type")
.setPriority(2)
.setTitle("title")
@@ -175,7 +175,7 @@ private void testRaiseIncidentAllFields() throws Exception {
.setState(IncidentState.ACTIVE)
.setLastUpdated(new AuditStamp().setTime(0L).setActor(TEST_USER_URN))
.setMessage("message"))
- .setSource(new IncidentSource().setType(IncidentSourceType.ASSERTION_FAILURE))
+ .setSource(new IncidentSource().setType(IncidentSourceType.MANUAL))
.setCreated(new AuditStamp().setTime(0L).setActor(TEST_USER_URN));
Mockito.verify(mockClient, Mockito.times(1))
@@ -299,7 +299,7 @@ private static EntityClient createMockEntityClient() throws Exception {
private static IncidentInfo mockIncidentInfo() throws Exception {
return new IncidentInfo()
- .setType(IncidentType.FRESHNESS)
+ .setType(IncidentType.OPERATIONAL)
.setEntities(new UrnArray(ImmutableList.of(TEST_DATASET_URN)))
.setStatus(
new IncidentStatus()