forked from opensearch-project/OpenSearch-Dashboards
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[D&D] Type Service Contributions (opensearch-project#1402)
* feat(Contributions): Simple working contributions Signed-off-by: Ashwin Pc <[email protected]> * feat(Contributions): Add new field from dropbox Signed-off-by: Ashwin Pc <[email protected]> * feat(Contributions): Working edit mode Signed-off-by: Ashwin Pc <[email protected]> * fix(Contributions): Fixes switching dropbox fields Signed-off-by: Ashwin Pc <[email protected]> * chore: Updates license headers Signed-off-by: Ashwin Pc <[email protected]> * feat(Contributions): Adds initial drag & drop validation Signed-off-by: Ashwin Pc <[email protected]> * feat(Dropbox): Allows multiple instances of the same field Signed-off-by: Ashwin Pc <[email protected]> * feat(Dropbox): Working reorder fields Signed-off-by: Ashwin Pc <[email protected]> * feat(Contributions): Working container contributions Signed-off-by: Ashwin Pc <[email protected]> * chore: clean up exports Signed-off-by: Ashwin Pc <[email protected]> * test(Contribution): Adds unit test `mergeArrays` Signed-off-by: Ashwin Pc <[email protected]> * test(TypeService): Adds plugin unit tests Signed-off-by: Ashwin Pc <[email protected]> * chore: remove redundant code Signed-off-by: Ashwin Pc <[email protected]> * test(Functional): Updates Chart types Signed-off-by: Ashwin Pc <[email protected]>
- Loading branch information
Showing
60 changed files
with
1,751 additions
and
343 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
File renamed without changes.
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
9 changes: 0 additions & 9 deletions
9
src/plugins/wizard/public/application/components/data_tab/config_panel.scss
This file was deleted.
Oops, something went wrong.
31 changes: 0 additions & 31 deletions
31
src/plugins/wizard/public/application/components/data_tab/config_panel.tsx
This file was deleted.
Oops, something went wrong.
23 changes: 0 additions & 23 deletions
23
src/plugins/wizard/public/application/components/data_tab/config_section.scss
This file was deleted.
Oops, something went wrong.
83 changes: 0 additions & 83 deletions
83
src/plugins/wizard/public/application/components/data_tab/config_section.tsx
This file was deleted.
Oops, something went wrong.
10 changes: 0 additions & 10 deletions
10
src/plugins/wizard/public/application/components/data_tab/field_selector.scss
This file was deleted.
Oops, something went wrong.
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 |
---|---|---|
@@ -1,4 +1,4 @@ | ||
@import "util"; | ||
@import "../util"; | ||
|
||
.wizSidenav { | ||
@include scrollNavParent(auto 1fr); | ||
|
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
12 changes: 12 additions & 0 deletions
12
src/plugins/wizard/public/application/contributions/constants.ts
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,12 @@ | ||
/* | ||
* Copyright OpenSearch Contributors | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
import { CommonItemTypes } from './containers/common/items'; | ||
import { DataTabItemTypes } from './containers/data_tab/items'; | ||
|
||
export const ItemTypes = { | ||
...CommonItemTypes, | ||
...DataTabItemTypes, | ||
}; |
9 changes: 9 additions & 0 deletions
9
src/plugins/wizard/public/application/contributions/containers/common/items/index.tsx
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,9 @@ | ||
/* | ||
* Copyright OpenSearch Contributors | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
export * from './types'; | ||
|
||
export { Select } from './select'; | ||
export { TextInput } from './text_input'; |
47 changes: 47 additions & 0 deletions
47
src/plugins/wizard/public/application/contributions/containers/common/items/select.tsx
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,47 @@ | ||
/* | ||
* Copyright OpenSearch Contributors | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
import React, { useMemo } from 'react'; | ||
import { EuiFormRow, EuiSuperSelect } from '@elastic/eui'; | ||
import { WizardServices } from 'src/plugins/wizard/public'; | ||
import { useOpenSearchDashboards } from '../../../../../../../opensearch_dashboards_react/public'; | ||
import { useTypedSelector } from '../../../../utils/state_management'; | ||
import { SelectContribution } from './types'; | ||
|
||
interface SelectProps extends Omit<SelectContribution<string>, 'type'> { | ||
value: string; | ||
} | ||
|
||
export const Select = ({ label, options, onChange, value, ...rest }: SelectProps) => { | ||
const rootState = useTypedSelector((state) => state); | ||
const { services } = useOpenSearchDashboards<WizardServices>(); | ||
const selectOptions = useMemo( | ||
() => (typeof options === 'function' ? options(rootState, services) : options), | ||
[options, rootState, services] | ||
); | ||
// const { isInvalid, errorMessage } = getFieldValidityAndErrorMessage(field); | ||
|
||
return ( | ||
<EuiFormRow | ||
label={label} | ||
// error={errorMessage} | ||
// isInvalid={isInvalid} | ||
fullWidth | ||
data-test-subj={rest['data-test-subj']} | ||
describedByIds={rest.idAria ? [rest.idAria] : undefined} | ||
> | ||
<EuiSuperSelect | ||
fullWidth | ||
onChange={(newValue) => { | ||
onChange?.(newValue); | ||
}} | ||
// isInvalid={isInvalid} | ||
valueOfSelected={value || ''} | ||
data-test-subj="select" | ||
options={selectOptions} | ||
/> | ||
</EuiFormRow> | ||
); | ||
}; |
37 changes: 37 additions & 0 deletions
37
src/plugins/wizard/public/application/contributions/containers/common/items/text_input.tsx
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,37 @@ | ||
/* | ||
* Copyright OpenSearch Contributors | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
import React from 'react'; | ||
import { EuiFormRow, EuiFieldText } from '@elastic/eui'; | ||
import { InputContribution } from './types'; | ||
|
||
interface InputProps extends Omit<InputContribution, 'type'> { | ||
value: string; | ||
} | ||
|
||
export const TextInput = ({ label, onChange, value, ...rest }: InputProps) => { | ||
// const { isInvalid, errorMessage } = getFieldValidityAndErrorMessage(field); | ||
|
||
return ( | ||
<EuiFormRow | ||
label={label} | ||
// error={errorMessage} | ||
// isInvalid={isInvalid} | ||
fullWidth | ||
data-test-subj={rest['data-test-subj']} | ||
describedByIds={rest.idAria ? [rest.idAria] : undefined} | ||
> | ||
<EuiFieldText | ||
fullWidth | ||
onChange={(event) => { | ||
onChange?.(event.target.value); | ||
}} | ||
// isInvalid={isInvalid} | ||
value={value || ''} | ||
data-test-subj="text_input" | ||
/> | ||
</EuiFormRow> | ||
); | ||
}; |
Oops, something went wrong.