-
Notifications
You must be signed in to change notification settings - Fork 958
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[D&D] Type Service Contributions #1402
Merged
ashwin-pc
merged 14 commits into
opensearch-project:feature/d-and-d
from
ashwin-pc:feature/viz-contributions
May 3, 2022
Merged
Changes from all commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
9b89ece
feat(Contributions): Simple working contributions
ashwin-pc bb74a6f
feat(Contributions): Add new field from dropbox
ashwin-pc 10a5d15
feat(Contributions): Working edit mode
ashwin-pc 56d38db
fix(Contributions): Fixes switching dropbox fields
ashwin-pc 9e2a8c6
chore: Updates license headers
ashwin-pc 876f979
feat(Contributions): Adds initial drag & drop validation
ashwin-pc 6d2b65e
feat(Dropbox): Allows multiple instances of the same field
ashwin-pc 2296b4d
feat(Dropbox): Working reorder fields
ashwin-pc 5de743c
feat(Contributions): Working container contributions
ashwin-pc fc8b587
chore: clean up exports
ashwin-pc f675277
test(Contribution): Adds unit test `mergeArrays`
ashwin-pc 8c1cb54
test(TypeService): Adds plugin unit tests
ashwin-pc 89c54ed
chore: remove redundant code
ashwin-pc 8809dce
test(Functional): Updates
ashwin-pc File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do we want to avoid making changes with pixels. could we use rem?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is the width of the side-panel. That unfortunately is not a good spot to use
rem
units which are more useful for fonts since we want the sizing to depend on the sizing of the parent element. This was changed to match the updated mocks.