diff --git a/.github/workflows/cypress-workflow.yml b/.github/workflows/cypress-workflow.yml index 5e594ce0c..a727f7b1e 100644 --- a/.github/workflows/cypress-workflow.yml +++ b/.github/workflows/cypress-workflow.yml @@ -80,13 +80,13 @@ jobs: wait-on: 'http://localhost:5601' browser: chrome # Screenshots are only captured on failure, will change this once we do visual regression tests - - uses: actions/upload-artifact@v1 + - uses: actions/upload-artifact@v3 if: failure() with: name: cypress-screenshots path: OpenSearch-Dashboards/plugins/index-management-dashboards-plugin/cypress/screenshots # Test run video was always captured, so this action uses "always()" condition - - uses: actions/upload-artifact@v1 + - uses: actions/upload-artifact@v3 if: always() with: name: cypress-videos diff --git a/public/pages/CreateIndexTemplate/containers/CreateIndexTemplate/__snapshots__/CreateIndexTemplate.test.tsx.snap b/public/pages/CreateIndexTemplate/containers/CreateIndexTemplate/__snapshots__/CreateIndexTemplate.test.tsx.snap index 18faee626..874d94be4 100644 --- a/public/pages/CreateIndexTemplate/containers/CreateIndexTemplate/__snapshots__/CreateIndexTemplate.test.tsx.snap +++ b/public/pages/CreateIndexTemplate/containers/CreateIndexTemplate/__snapshots__/CreateIndexTemplate.test.tsx.snap @@ -211,7 +211,7 @@ exports[` spec render template pages 1`] = `
) => ))} - + ) : null} {subCompontentProps.readonly ? null : ( diff --git a/public/pages/IndexDetail/containers/IndexDetail/IndexDetail.tsx b/public/pages/IndexDetail/containers/IndexDetail/IndexDetail.tsx index ed90332b8..722d54f9d 100644 --- a/public/pages/IndexDetail/containers/IndexDetail/IndexDetail.tsx +++ b/public/pages/IndexDetail/containers/IndexDetail/IndexDetail.tsx @@ -150,7 +150,7 @@ export default function IndexDetail(props: IndexDetailModalProps) { mode: IndicesUpdateMode.settings, content: ( <> - +

Index settings

@@ -168,7 +168,7 @@ export default function IndexDetail(props: IndexDetailModalProps) { mode: IndicesUpdateMode.mappings, content: ( <> - +

Index mappings

@@ -206,7 +206,7 @@ export default function IndexDetail(props: IndexDetailModalProps) { mode: IndicesUpdateMode.alias, content: ( <> - +

Index alias

diff --git a/public/pages/Indices/components/IndexControls/IndexControls.tsx b/public/pages/Indices/components/IndexControls/IndexControls.tsx index d4b177221..b6e429f48 100644 --- a/public/pages/Indices/components/IndexControls/IndexControls.tsx +++ b/public/pages/Indices/components/IndexControls/IndexControls.tsx @@ -15,6 +15,7 @@ import { EuiSearchBar, EuiCompressedSwitch, EuiButtonEmpty, + EuiToolTip, } from "@elastic/eui"; import { DataStream, ManagedCatIndex } from "../../../../../server/models/interfaces"; import IndicesActions from "../../containers/IndicesActions"; @@ -96,7 +97,9 @@ export default class IndexControls extends Component - + + + {
- + Manage channels - <> - {noPermission ? ( - - - {" "} -

Error loading Notification settings

{" "} -
- } - body={ - - {" "} -

You do not have permissions to view Notification settings. Contact your administrator to request permissions.

-
- } - /> -
- ) : ( - - {submitClicked && allErrors.length ? ( - -
    - {allErrors.reduce((total, [key, errors]) => { - const pattern = /^dataSource\.(\d+)\.(\w+)$/; - const matchResult = key.match(pattern); - if (matchResult) { - const index = matchResult[1]; - const itemField = matchResult[2]; - const notificationItem = (field.getValues().dataSource || [])[parseInt(index, 10)]; - const errorMessagePrefix = `${notificationItem.title} — ${ - FieldMapLabel[itemField as keyof typeof FieldMapLabel] - }: `; - return [ - ...total, - ...(errors || []).map((item) => ( -
  • - {errorMessagePrefix} - {item} -
  • - )), - ]; - } + {noPermission ? ( + + {" "} +

    Error loading Notification settings

    {" "} + + } + body={ + + {" "} +

    You do not have permissions to view Notification settings. Contact your administrator to request permissions.

    +
    + } + /> + ) : ( + <> + {submitClicked && allErrors.length ? ( + +
      + {allErrors.reduce((total, [key, errors]) => { + const pattern = /^dataSource\.(\d+)\.(\w+)$/; + const matchResult = key.match(pattern); + if (matchResult) { + const index = matchResult[1]; + const itemField = matchResult[2]; + const notificationItem = (field.getValues().dataSource || [])[parseInt(index, 10)]; + const errorMessagePrefix = `${notificationItem.title} — ${FieldMapLabel[itemField as keyof typeof FieldMapLabel]}: `; + return [ + ...total, + ...(errors || []).map((item) => ( +
    • + {errorMessagePrefix} + {item} +
    • + )), + ]; + } - return total; - }, [] as ReactChild[])} -
    -
    - ) : null} - - {(values.dataSource || []).map((record) => { - const { value, onChange, ...others } = field.registerField({ - name: ["dataSource", `${record.index}`, FieldEnum.channels], - rules: [ - { - validator(rule, value) { - const values = field.getValues(); - const item = values.dataSource?.[record.index]; - if (item?.[FieldEnum.failure] || item?.[FieldEnum.success]) { - if (!value || !value.length) { - return Promise.reject(VALIDATE_ERROR_FOR_CHANNELS); - } + return total; + }, [] as ReactChild[])} +
+
+ ) : null} + + {(values.dataSource || []).map((record) => { + const { value, onChange, ...others } = field.registerField({ + name: ["dataSource", `${record.index}`, FieldEnum.channels], + rules: [ + { + validator(rule, value) { + const values = field.getValues(); + const item = values.dataSource?.[record.index]; + if (item?.[FieldEnum.failure] || item?.[FieldEnum.success]) { + if (!value || !value.length) { + return Promise.reject(VALIDATE_ERROR_FOR_CHANNELS); } + } - return Promise.resolve(""); - }, + return Promise.resolve(""); }, - ], - }); - return ( - - - {" "} -

{record.title}

{" "} -
-
- } - helpText={ActionTypeMapDescription[getKeyByValue(ActionTypeMapTitle, record.title) as ActionType]} - direction="hoz" - key={record.action_name} - > - <> - - - - - - - - - - - {field.getValue(["dataSource", `${record.index}`, FieldEnum.failure]) || - field.getValue(["dataSource", `${record.index}`, FieldEnum.success]) ? ( - <> - - - - - - ) : null} - - - ); - })} - - - )} - + }, + ], + }); + return ( + + + {" "} +

{record.title}

{" "} +
+
+ } + helpText={ActionTypeMapDescription[getKeyByValue(ActionTypeMapTitle, record.title) as ActionType]} + direction="hoz" + key={record.action_name} + > + <> + + + + + + + + + + + {field.getValue(["dataSource", `${record.index}`, FieldEnum.failure]) || + field.getValue(["dataSource", `${record.index}`, FieldEnum.success]) ? ( + <> + + + + + + ) : null} + + + ); + })} + + + )} = ({ const renderCancel = useCallback( () => ( - + Cancel ), @@ -51,7 +49,6 @@ const UnsavedChangesButtons: React.FC = ({ onClick={onClick} isLoading={loading} disabled={loading} - iconType="check" color="primary" fill > @@ -62,27 +59,28 @@ const UnsavedChangesButtons: React.FC = ({ ); return ( - - <> + + {formErrorsCount ? ( - {" "} - {formErrorsCount} form errors{" "} + {formErrorsCount} form errors ) : null} {unsavedCount && !formErrorsCount ? ( - {" "} - {unsavedCount} unsaved changes{" "} + {unsavedCount} unsaved changes ) : null} - - {renderCancel()} - {renderConfirm()} + + + + {renderCancel()} + {renderConfirm()} + ); }; diff --git a/public/pages/Indices/containers/Indices/Indices.tsx b/public/pages/Indices/containers/Indices/Indices.tsx index e5c302aad..2e094b057 100644 --- a/public/pages/Indices/containers/Indices/Indices.tsx +++ b/public/pages/Indices/containers/Indices/Indices.tsx @@ -300,7 +300,6 @@ export class Indices extends MDSEnabledComponent { run: this.toggleNotificationModal, testId: "notificationSettingsButton", controlType: "button", - color: "secondary", } as TopNavControlButtonData, { id: "Create index", diff --git a/public/pages/ManagedIndices/components/ManagedIndexControls/ManagedIndexControls.tsx b/public/pages/ManagedIndices/components/ManagedIndexControls/ManagedIndexControls.tsx index 02a694f77..8ece22607 100644 --- a/public/pages/ManagedIndices/components/ManagedIndexControls/ManagedIndexControls.tsx +++ b/public/pages/ManagedIndices/components/ManagedIndexControls/ManagedIndexControls.tsx @@ -14,6 +14,7 @@ import { EuiButtonIcon, EuiButtonEmpty, EuiSpacer, + EuiToolTip, } from "@elastic/eui"; import { DataStream } from "../../../../../server/models/interfaces"; import { getUISettings } from "../../../../services/Services"; @@ -43,7 +44,7 @@ export default class ManagedIndexControls extends Component - + + + {Actions} diff --git a/public/pages/ManagedIndices/containers/ManagedIndices/ManagedIndices.tsx b/public/pages/ManagedIndices/containers/ManagedIndices/ManagedIndices.tsx index 1c52b62e9..3a182621d 100644 --- a/public/pages/ManagedIndices/containers/ManagedIndices/ManagedIndices.tsx +++ b/public/pages/ManagedIndices/containers/ManagedIndices/ManagedIndices.tsx @@ -121,7 +121,6 @@ export class ManagedIndices extends MDSEnabledComponent {index}, }, { @@ -130,7 +129,6 @@ export class ManagedIndices extends MDSEnabledComponent dataStream || DEFAULT_EMPTY_DATA, }, { @@ -139,7 +137,6 @@ export class ManagedIndices extends MDSEnabledComponent state || DEFAULT_EMPTY_DATA, }, @@ -156,7 +152,6 @@ export class ManagedIndices extends MDSEnabledComponent ( {(action || DEFAULT_EMPTY_DATA).split("_").join(" ")} @@ -168,7 +163,6 @@ export class ManagedIndices extends MDSEnabledComponent ( {({ onShow }) => ( @@ -184,7 +178,6 @@ export class ManagedIndices extends MDSEnabledComponent { const { managedIndexMetaData } = item; if (!managedIndexMetaData) return "Initializing"; diff --git a/public/pages/ManagedIndices/containers/ManagedIndices/__snapshots__/ManagedIndices.test.tsx.snap b/public/pages/ManagedIndices/containers/ManagedIndices/__snapshots__/ManagedIndices.test.tsx.snap index c16dbbe06..cb8426d69 100644 --- a/public/pages/ManagedIndices/containers/ManagedIndices/__snapshots__/ManagedIndices.test.tsx.snap +++ b/public/pages/ManagedIndices/containers/ManagedIndices/__snapshots__/ManagedIndices.test.tsx.snap @@ -348,7 +348,6 @@ exports[` spec renders the component 1`] = ` data-test-subj="tableHeaderCell_index_0" role="columnheader" scope="col" - style="width: 150px;" >