Skip to content

Commit

Permalink
[FEATURE] Create detector \ Refactor and move field mapping to first …
Browse files Browse the repository at this point in the history
…the page of create detector feature opensearch-project#495

Signed-off-by: Jovan Cvetkovic <jovanca.cvetkovic@gmail.com>
  • Loading branch information
jovancacvetkovic committed Apr 3, 2023
1 parent 25e736d commit 9997e3b
Show file tree
Hide file tree
Showing 6 changed files with 4 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ export class ReviewAndCreate extends React.Component<ReviewAndCreateProps, Revie
};

setConfigureFieldMappingStep = () => {
this.props.setDetectorCreationStep(DetectorCreationStep.CONFIGURE_FIELD_MAPPING);
this.props.setDetectorCreationStep(DetectorCreationStep.DEFINE_DETECTOR);
};

setConfigureAlertsStep = () => {
Expand Down
1 change: 0 additions & 1 deletion public/pages/CreateDetector/containers/CreateDetector.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,6 @@ export default class CreateDetector extends Component<CreateDetectorProps, Creat
fieldMappings: [],
stepDataValid: {
[DetectorCreationStep.DEFINE_DETECTOR]: false,
['CONFIGURE_FIELD_MAPPING']: true,
[DetectorCreationStep.CONFIGURE_ALERTS]: false,
[DetectorCreationStep.REVIEW_CREATE]: false,
},
Expand Down
1 change: 0 additions & 1 deletion public/pages/CreateDetector/models/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ export interface ReviewAndCreateData {

export interface DetectorDataByStep {
[DetectorCreationStep.DEFINE_DETECTOR]: DefineDetectorData;
['CONFIGURE_FIELD_MAPPING']: ConfigureFieldMappingData;
[DetectorCreationStep.CONFIGURE_ALERTS]: ConfigureAlertsData;
[DetectorCreationStep.REVIEW_CREATE]: ReviewAndCreateData;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ export interface FieldMappingsViewProps {
existingMappings?: FieldMapping[];
editFieldMappings: () => void;
notifications: NotificationsStart;
isEditable: boolean;
isEditable?: boolean;
}

const columns: EuiBasicTableColumn<FieldMappingsTableItem>[] = [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ export interface AlertTriggersViewProps {
detector: Detector;
editAlertTriggers: () => void;
notifications: NotificationsStart;
isEditable: boolean;
isEditable?: boolean;
}

export const AlertTriggersView: React.FC<AlertTriggersViewProps> = ({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
import React from 'react';
import { DetectorBasicDetailsView } from '../../components/DetectorBasicDetailsView/DetectorBasicDetailsView';
import { DetectorRulesView } from '../../components/DetectorRulesView/DetectorRulesView';
import { EuiSpacer } from '@elastic/eui';
import { RuleItem } from '../../../CreateDetector/components/DefineDetector/components/DetectionRules/types/interfaces';
import { NotificationsStart } from 'opensearch-dashboards/public';
import { Detector } from '../../../../../types';
Expand All @@ -20,7 +19,7 @@ export interface DetectorDetailsViewProps {
dashboardId?: string;
editBasicDetails: () => void;
editDetectorRules: (enabledRules: RuleItem[], allRuleItems: RuleItem[]) => void;
isEditable: boolean;
isEditable?: boolean;
}

export interface DetectorDetailsViewState {}
Expand Down

0 comments on commit 9997e3b

Please sign in to comment.