-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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
[RAM] Use EuiDataGrid for the rules list #124428
Closed
+1,636
−7
Closed
Changes from all commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
8cf31c9
Initial conversion of basictable to datagrid
Zacqary 61ef5e3
Merge remote-tracking branch 'upstream/main' into 123860-alerts-datagrid
Zacqary 6a9b3b2
Merge remote-tracking branch 'upstream/main' into 123860-alerts-datagrid
Zacqary 03cb147
Merge remote-tracking branch 'upstream/main' into 123860-alerts-datagrid
Zacqary 1f81b54
Remove old code, clean up tags column
Zacqary 6c02083
Control initial widths by percentage
Zacqary 8aee7e8
Disable multifield sort
Zacqary eca760b
Enable column visibility changes
Zacqary c58454b
Typecheck cleanup
Zacqary f8e9530
Move datagrid to feature flag
Zacqary 20bd16a
Merge branch 'main' into 123860-alerts-datagrid
kibanamachine 1c38926
Defaults rulesListDatagrid experimental flag to on
gmmorris a5cc9ea
Merge remote-tracking branch 'upstream/main' into 123860-alerts-datagrid
Zacqary 85dd2c0
Merge branch '123860-alerts-datagrid' of https://github.com/Zacqary/k…
Zacqary 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
52 changes: 52 additions & 0 deletions
52
x-pack/plugins/triggers_actions_ui/common/experimental_features.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,52 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License | ||
* 2.0; you may not use this file except in compliance with the Elastic License | ||
* 2.0. | ||
*/ | ||
|
||
export type ExperimentalFeatures = typeof allowedExperimentalValues; | ||
|
||
/** | ||
* A list of allowed values that can be used in `xpack.triggersActionsUi.enableExperimental`. | ||
* This object is then used to validate and parse the value entered. | ||
*/ | ||
export const allowedExperimentalValues = Object.freeze({ | ||
rulesListDatagrid: true, | ||
}); | ||
|
||
type ExperimentalConfigKeys = Array<keyof ExperimentalFeatures>; | ||
type Mutable<T> = { -readonly [P in keyof T]: T[P] }; | ||
|
||
const TriggersActionsUIInvalidExperimentalValue = class extends Error {}; | ||
const allowedKeys = Object.keys(allowedExperimentalValues) as Readonly<ExperimentalConfigKeys>; | ||
|
||
/** | ||
* Parses the string value used in `xpack.triggersActionsUi.enableExperimental` kibana configuration, | ||
* which should be a string of values delimited by a comma (`,`) | ||
* | ||
* @param configValue | ||
* @throws TriggersActionsUIInvalidExperimentalValue | ||
*/ | ||
export const parseExperimentalConfigValue = (configValue: string[]): ExperimentalFeatures => { | ||
const enabledFeatures: Mutable<Partial<ExperimentalFeatures>> = {}; | ||
|
||
for (const value of configValue) { | ||
if (!isValidExperimentalValue(value)) { | ||
throw new TriggersActionsUIInvalidExperimentalValue(`[${value}] is not valid.`); | ||
} | ||
|
||
enabledFeatures[value as keyof ExperimentalFeatures] = true; | ||
} | ||
|
||
return { | ||
...allowedExperimentalValues, | ||
...enabledFeatures, | ||
}; | ||
}; | ||
|
||
export const isValidExperimentalValue = (value: string): boolean => { | ||
return allowedKeys.includes(value as keyof ExperimentalFeatures); | ||
}; | ||
|
||
export const getExperimentalAllowedValues = (): string[] => [...allowedKeys]; |
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,10 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License | ||
* 2.0; you may not use this file except in compliance with the Elastic License | ||
* 2.0. | ||
*/ | ||
|
||
export interface TriggersActionsUiConfigType { | ||
enableExperimental: string[]; | ||
} |
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
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.
Tiny nit, especially knowing this is a POC, but just mentioning the pixel value. Is this necessary? Perhaps down the road we can determine how we want the various cells to render and apply font sizing there as opposed to overwriting the eui class?