Skip to content
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

[Feature] Expressions example plugin #1438

Merged
merged 8 commits into from
Apr 20, 2022

Conversation

ashwin-pc
Copy link
Member

Description

We have a few example plugins that demonstrate how to use the various OpenSearch Dashboards features like UIActions, Embeddables, etc. This add to that list by creating an example plugin for expressions. It has 3 basic example for the main 3 features for embeddables, a playground to explore expressions and finally an explorer to explore and discover all the registered expression functions

expressions.example.mp4

Issues Resolved

Check List

  • New functionality includes testing.
    • All tests pass
      • yarn test:jest
      • yarn test:jest_integration
      • yarn test:ftr
  • New functionality has been documented.
  • Commits are signed per the DCO using --signoff

Signed-off-by: Ashwin Pc <ashwinpc@amazon.com>
Signed-off-by: Ashwin Pc <ashwinpc@amazon.com>
Signed-off-by: Ashwin Pc <ashwinpc@amazon.com>
Signed-off-by: Ashwin Pc <ashwinpc@amazon.com>
Signed-off-by: Ashwin Pc <ashwinpc@amazon.com>
Signed-off-by: Ashwin Pc <ashwinpc@amazon.com>
Signed-off-by: Ashwin Pc <ashwinpc@amazon.com>
@ashwin-pc ashwin-pc requested a review from a team as a code owner April 9, 2022 03:17
"paths": {
"expressionsExample": "."
},
"translations": ["translations/ja-JP.json"]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: probably can remove this. i know this scaffolded on generation

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wasn't sure if we were going to use these files for the localization that we are reintroducing. Figured if we were, its easier to start from this boilerplate, and if not we can just nuke this and all other .i18nrc.json files

kavilla
kavilla previously approved these changes Apr 11, 2022
Copy link
Member

@kavilla kavilla left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome!! TY so much. Given that it is an example and not an end user functionality I think most follow-ups can be handle subsequently.

In the developer docs to run and access examples, or specifically to access this example?

@ashwin-pc
Copy link
Member Author

@kavilla I'll add to the expression plugin's readme in a followup PR because i dont have all the details i want to add in it yet. As for how to run example plugins, we already have these instructions in the Example plugin folder's readme. I will update this readme too in that followup PR.

Signed-off-by: Ashwin Pc <ashwinpc@amazon.com>
@ashwin-pc
Copy link
Member Author

While the initial PR only made changes to the examples directory, this revision makes 3 changes to the expressions plugin itself. 2 of those changes are w.r.t ReactExpressionRenderer which is current not used anywhere application and safe to include for 2.0. The other change is to uiState. This was a bug and prevented the uiState from initializing correctly when used outside the context of Visualize. It should also not be an issue for 2.0, but i can remove that if necessary so that this is included in the release.

root: true,
extends: ['@elastic/eslint-config-kibana', 'plugin:@elastic/eui/recommended'],
rules: {
'@osd/eslint/require-license-header': 'off',
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

don't we require license header for example code?

Copy link
Member Author

@ashwin-pc ashwin-pc Apr 20, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

None of the example files currently have license headers and our linter does not catch them either. Not sure why the examples were skipped, but i can add them to this and the other examples in a followup PR once i confirm the reason.

"navigation",
"expressions",
"developerExamples",
"opensearchDashboardsReact"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not used?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I didn't understand your comment @zengyan-amazon. These plugins are used in the expressions-example plugin. Hence marked as required dependencies.

Comment on lines 10 to 18
.expExpressionRenderer__expression {
display: flex;
flex-direction: column;
width: 100%;
height: 100%;
overflow: auto;
position: relative;
flex: 1 1 100%;
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will this scss change impact the style of UI components in other places?

Copy link
Member Author

@ashwin-pc ashwin-pc Apr 20, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No they will not. These styles only affect ReactExpressionRenderer which is currently not used anywhere in the application and is only used in the example plugin and in ReactExpressionRenderer unit tests.

@ashwin-pc ashwin-pc merged commit b7ca138 into opensearch-project:main Apr 20, 2022
pjfitzgibbons pushed a commit to pjfitzgibbons/OpenSearch-Dashboards that referenced this pull request Aug 10, 2022
* feat(Expressions): Initial demo plugin

Signed-off-by: Ashwin Pc <ashwinpc@amazon.com>

* feat(Expressions): Adds handlers tab

Signed-off-by: Ashwin Pc <ashwinpc@amazon.com>

* feat(Expressions): Adds playground tab

Signed-off-by: Ashwin Pc <ashwinpc@amazon.com>

* chore: Better expression playground messaging

Signed-off-by: Ashwin Pc <ashwinpc@amazon.com>

* feat(Expressions): Adds expression explorer

Signed-off-by: Ashwin Pc <ashwinpc@amazon.com>

* feat(Expressions): A better explorer

Signed-off-by: Ashwin Pc <ashwinpc@amazon.com>

* fix(Expressions): Fix basic demo abort error

Signed-off-by: Ashwin Pc <ashwinpc@amazon.com>

* Updates readme and fixes rendering visualizations

Signed-off-by: Ashwin Pc <ashwinpc@amazon.com>
opensearch-trigger-bot bot pushed a commit that referenced this pull request Oct 18, 2022
* feat(Expressions): Initial demo plugin

Signed-off-by: Ashwin Pc <ashwinpc@amazon.com>

* feat(Expressions): Adds handlers tab

Signed-off-by: Ashwin Pc <ashwinpc@amazon.com>

* feat(Expressions): Adds playground tab

Signed-off-by: Ashwin Pc <ashwinpc@amazon.com>

* chore: Better expression playground messaging

Signed-off-by: Ashwin Pc <ashwinpc@amazon.com>

* feat(Expressions): Adds expression explorer

Signed-off-by: Ashwin Pc <ashwinpc@amazon.com>

* feat(Expressions): A better explorer

Signed-off-by: Ashwin Pc <ashwinpc@amazon.com>

* fix(Expressions): Fix basic demo abort error

Signed-off-by: Ashwin Pc <ashwinpc@amazon.com>

* Updates readme and fixes rendering visualizations

Signed-off-by: Ashwin Pc <ashwinpc@amazon.com>
(cherry picked from commit b7ca138)
joshuarrrr pushed a commit that referenced this pull request Oct 19, 2022
* feat(Expressions): Initial demo plugin

Signed-off-by: Ashwin Pc <ashwinpc@amazon.com>

* feat(Expressions): Adds handlers tab

Signed-off-by: Ashwin Pc <ashwinpc@amazon.com>

* feat(Expressions): Adds playground tab

Signed-off-by: Ashwin Pc <ashwinpc@amazon.com>

* chore: Better expression playground messaging

Signed-off-by: Ashwin Pc <ashwinpc@amazon.com>

* feat(Expressions): Adds expression explorer

Signed-off-by: Ashwin Pc <ashwinpc@amazon.com>

* feat(Expressions): A better explorer

Signed-off-by: Ashwin Pc <ashwinpc@amazon.com>

* fix(Expressions): Fix basic demo abort error

Signed-off-by: Ashwin Pc <ashwinpc@amazon.com>

* Updates readme and fixes rendering visualizations

Signed-off-by: Ashwin Pc <ashwinpc@amazon.com>
(cherry picked from commit b7ca138)

Co-authored-by: Ashwin P Chandran <ashwinpc@amazon.com>
@joshuarrrr joshuarrrr added the v2.4.0 'Issues and PRs related to version v2.4.0' label Apr 5, 2023
@ashwin-pc ashwin-pc added the docs Improvements or additions to documentation label Apr 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport 2.x docs Improvements or additions to documentation v2.4.0 'Issues and PRs related to version v2.4.0'
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants