wazuh-dashboard-plugins
wazuh-dashboard-plugins copied to clipboard
Use platform editor component instead of our own
Describe the solution you'd like
Evaluate if we can reuse the platform editor instead of our own as an editor component.
Additional context
This will allow us to use less dependencies.
Related issues
- [x] #4816
- [ ] #3659
- [x] #3504
Currently, opensearch/oui
in the ouiCodeEditor
component is using Ace
, and they are going to deprecate the component, while opensearch dashboard
can use Monaco
as an option, but they have version 0.17.1
and Monaco
is already on version 0.36.1
.
They have this issue to update Monaco in 2.7.0
And in OUI they have this issue that from what I understand is not a priority for them, the code editor component.
I have been testing the Monaco implementation offered by Opensearch, but I can't get the formatting right.
Monaco
EuiCodeEditor
Looking at the opensearch code, I saw that they still have the Ace
plugin, but they deprecated it and suggest you to use Monaco
.
And I also saw that you intend to add more information about Monaco.
I have seen that the custom version of monaco offered in opensearch uses react-monaco-editor in addition to monaco-editor, and I created a new project to see how it works and by default the same thing happens to me, it does not look with styles, so I am testing to see what configuration would be the most appropriate for the project.
Reviewing the implementation of Moncaco that offers OSD I saw that it does not give much variety of languages, maybe it is because of the version that uses that is 0.17.1 and goes by the 0.36.1, or maybe in its modifications only let see those languages.
I created this issue in the OpenSerach Dashboards repository, and they replied that you have to add the file with the language you want to add.
I was testing, and we would have to first integrate the language and then make the change from the current editor to the one that OpenSearch Dashboard tested.
I share the file with the one I managed to make it look similar, but it needs to be finished.
These problems
This will allow us to use less dependencies.
is related to the codemirror
. This editor is used in the API Console.
For this case, and due to the syntax and behavior being similar to the Console
, we could review the implementation and see how is built the editor.