-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: enable compound indices in profiles and configuration of hosts i…
…n the inventory using string address fix: enable compound indices and configuration of string based hosts fix: refactor condition in profiles form fix: in ProfileConversion._backend2ui_map for empty patterns filed return empty list instead of None fix: refactor varBinds form
- Loading branch information
1 parent
fea03d5
commit 30f6d90
Showing
14 changed files
with
397 additions
and
507 deletions.
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
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
59 changes: 59 additions & 0 deletions
59
frontend/packages/manager/src/components/profiles/Condition.jsx
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,59 @@ | ||
import React, {useState, useRef, useCallback, useContext, useEffect} from 'react'; | ||
import { createDOMID } from '@splunk/ui-utils/id'; | ||
import ProfileContext from "../../store/profile-contxt"; | ||
import {StyledControlGroup} from "../../styles/inventory/InventoryStyle"; | ||
import Select from "@splunk/react-ui/Select"; | ||
import Text from "@splunk/react-ui/Text"; | ||
import P from "@splunk/react-ui/Paragraph"; | ||
import FieldPatterns from "./FieldPatterns"; | ||
import {validationGroup, validationMessage} from "../../styles/ValidationStyles"; | ||
import ProfilesValidationContxt from "../../store/profiles-validation-contxt"; | ||
|
||
function Condition(props){ | ||
const ProfCtx = useContext(ProfileContext); | ||
const ValCtx = useContext(ProfilesValidationContxt); | ||
|
||
const handleFieldChange = useCallback((e, { value: val }) => { | ||
ProfCtx.setConditionField(val); | ||
}, []); | ||
|
||
const handleChange = useCallback((e, { value: val }) => { | ||
ProfCtx.setCondition(val); | ||
}, []); | ||
|
||
return( | ||
<div> | ||
<StyledControlGroup label="Condition" | ||
labelFor="customized-select-after"> | ||
<Select value={ProfCtx.condition} onChange={handleChange} filter> | ||
<Select.Option label="None" value="None"/> | ||
<Select.Option label="base" value="base"/> | ||
<Select.Option label="field" value="field"/> | ||
<Select.Option label="walk" value="walk"/> | ||
<Select.Option label="conditional" value="conditional"/> | ||
</Select> | ||
</StyledControlGroup> | ||
{ | ||
ProfCtx.condition === 'field' ? ( | ||
<div> | ||
<StyledControlGroup label="field"> | ||
<div style={validationGroup}> | ||
<Text value={ProfCtx.conditionField} onChange={handleFieldChange} error={((ValCtx.conditionFieldErrors) ? true : false)}/> | ||
{((ValCtx.conditionFieldErrors) ? ValCtx.conditionFieldErrors.map((el) => | ||
<P key={createDOMID()} style={validationMessage}>{el}</P>) : <P/>)} | ||
</div> | ||
</StyledControlGroup> | ||
<StyledControlGroup label="patterns"> | ||
<FieldPatterns newSubmit={props.newSubmit}/> | ||
</StyledControlGroup> | ||
</div>) : null | ||
} | ||
|
||
{ProfCtx.condition === 'conditional' ? ( | ||
<div /> | ||
) : null} | ||
</div> | ||
) | ||
} | ||
|
||
export default Condition; |
75 changes: 0 additions & 75 deletions
75
frontend/packages/manager/src/components/profiles/Conditions.jsx
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.