[Composable templates] Table to list templates#67282
[Composable templates] Table to list templates#67282sebelga merged 20 commits intoelastic:masterfrom
Conversation
|
Pinging @elastic/es-ui (Team:Elasticsearch UI) |
191e9e4 to
c4f7aa6
Compare
|
@elasticmachine merge upstream |
alisonelizabeth
left a comment
There was a problem hiding this comment.
Great work @sebelga!
Tested locally. Everything worked as expected.
I left a few comments in the code. I also had a few other general comments/questions:
- With the introduction of component templates, I wonder if we should change the UI and API routes from
templatestoindex_templates? - Since we have two tables now, what do you think about changing the default page size to
10instead of20? I didn't test it, but I imagine if you had 20 composable templates, you would have to scroll to see the legacy templates. - It felt a little weird to me having one filter to view composable templates and system templates, since the system filter applies to both tables, whereas selecting composable hides or removes the one table. I'd be interested to see if design has any feedback on this though.
x-pack/plugins/index_management/server/routes/api/templates/register_create_route.ts
Outdated
Show resolved
Hide resolved
|
|
||
| return ( | ||
| <> | ||
| <EuiBadge color={getColor(mappings)}>M</EuiBadge> |
There was a problem hiding this comment.
What do you think about adding a tooltip to these, so it's a little more clear what each one represents?
| @@ -5,60 +5,34 @@ | |||
| */ | |||
There was a problem hiding this comment.
What do you think about adding tests for the serialization functions here?
There was a problem hiding this comment.
I prefer to have it covered by integration. In this case the API integration tests. They actually caught a few errors in these handlers when I updated them and helped me to fix them.
|
|
||
| jest.mock('ui/new_platform'); | ||
|
|
||
| // jest.mock('@elastic/eui', () => ({ |
There was a problem hiding this comment.
can this be removed?
| defaultMessage: 'Aliases', | ||
| field: 'hasMappings', | ||
| name: i18n.translate('xpack.idxMgmt.templateList.table.overridesColumnTitle', { | ||
| defaultMessage: 'Overrides', |
There was a problem hiding this comment.
[nit] Is "Overrides" the right term to use here? As we are just checking whether mappings/settings/aliases exist, it may or may not be an override (if I understand correctly).
There was a problem hiding this comment.
Good point, I added it as a feedback to go back to in #68056
| @@ -0,0 +1,295 @@ | |||
| /* | |||
There was a problem hiding this comment.
I'm assuming this file was just moved into the legacy_templates directory, so only did a light review here.
| @@ -0,0 +1,327 @@ | |||
| /* | |||
There was a problem hiding this comment.
I'm assuming this file was just moved into the legacy_templates directory, so only did a light review here.
| export const getTemplateEditLink = (name: string, isLegacy?: boolean) => { | ||
| return encodeURI( | ||
| `${BASE_PATH}edit_template/${encodeURIComponent(encodeURIComponent(name))}?v=${formatVersion}` | ||
| `${BASE_PATH}edit_template/${encodeURIComponent(encodeURIComponent(name))}?legacy=${isLegacy}` |
There was a problem hiding this comment.
Since legacy is marked as optional, should this be something like:
isLegacy ? `?legacy=${isLegacy}` : ''
There was a problem hiding this comment.
It would be a cleaner URL yes, but the logic would be the same as we would get
?legacy=undefined
So checking for
const isLegacy = queryParam.legacy === 'true'; would give false.
There was a problem hiding this comment.
I made the change to this:
?legacy=${isLegacy === true}`…gister_create_route.ts Co-authored-by: Alison Goryachev <alisonmllr20@gmail.com>
|
Thanks for the review @alisonelizabeth !
Good point, I will update the endpoints. For the rest of your concerns, I think it would be better to not block this PR on these decisions as they might not be relevant later. I created this issue #68056 to keep track of your feedback and revisit it later. Is that OK for you? |
|
I made the changes you recomended @alisonelizabeth , can you have another look? thanks! |
alisonelizabeth
left a comment
There was a problem hiding this comment.
Thanks for making those changes @sebelga!
I noticed a small regression with spacing of the badges. Can you take a look? Otherwise, LGTM. Going to approve to not block you.
|
Thanks for the review @alisonelizabeth and finding the regression. I made the fix. Will merge as soon as CI gets green 🤞 |
💚 Build SucceededHistory
To update your PR or re-run it, just comment with: |
|
Looks like this PR has a backport PR but it still hasn't been merged. Please merge it ASAP to keep the branches relatively in sync. |
Co-authored-by: Alison Goryachev <alisonmllr20@gmail.com> Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com> Co-authored-by: spalger <spalger@users.noreply.github.com>


This PR adds the client and server code change to support listing composable index templates in a table on top of the legacy index template.
They are no actions on the table items (view, delete, edit, clone), we can simply view the list of index templates V2.
How to test