-
Notifications
You must be signed in to change notification settings - Fork 1k
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
Add modal to select index template on index creation #19381
base: indexsetTemplates
Are you sure you want to change the base?
Conversation
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.
Tested and looks good.
I added some comments inline, a part from that it's good to go.
|
||
type Props = { | ||
showSelectTemplateModal: boolean, | ||
setShowSelectTemplateModal: (boolean) => void |
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.
Can we name the function parameter here?
@@ -15,16 +15,36 @@ | |||
* <http://www.mongodb.com/licensing/server-side-public-license>. | |||
*/ | |||
|
|||
import * as React from 'react'; | |||
import React, { useMemo } from 'react'; |
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.
import React, { useMemo } from 'react'; | |
import * as React from 'react'; | |
import { useMemo } from 'react'; |
* along with this program. If not, see | ||
* <http://www.mongodb.com/licensing/server-side-public-license>. | ||
*/ | ||
import React, { useEffect } from 'react'; |
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.
import React, { useEffect } from 'react'; | |
import * as React from 'react'; | |
import { useEffect } from 'react'; |
@@ -102,7 +102,7 @@ const StyledTooltip = styled(Tooltip)(({ value }) => css` | |||
position: absolute; | |||
top: 0; | |||
|
|||
${value > 12 | |||
${value > 20 |
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.
We should move this value to a constant since we reuse it in many places.
pageSize: 3, | ||
query: 'built_in:true', | ||
sort: sort, | ||
}, { enabled: true }, |
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.
We can add the default value enabled = true
to useTemplates
, so we add the param only when we want to disable it.
@@ -74,66 +83,98 @@ const formatRefreshInterval = (intervalInMs : number) => { | |||
|
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.
Description
/jpd Graylog2/graylog-plugin-enterprise#7363
This PR implements a modal to select an index set template on index set creation.
Besides that the PR also changes the following which should be tested as well:
Replace
defaultChecked
withchecked
in<FormikInput>
With the templates updating the form we need controlled Checkboxes, thus we need to use
checked
instead ofdefaultChecked
Preselecting the first repository in warm tier repository select
Motivation and Context
Part of: #19075
How Has This Been Tested?
Please make sure to test in the following environments:
You can create built_in templates by creating a normal template on
/system/indices/templates/create
and simply changingbuilt_in
totrue
in theindex_set_templates
table in your mongodbScreenshots (if appropriate):
Based on the mockup in #index-templates Slack channel and discussions with @tellistone
Types of changes
Checklist: