Repository navigation
fix: add disable ttl table action #3938
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
Changes from 2 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,23 @@ | ||
| import {enableTTLTemplate, manageTTLTemplate} from '../schemaQueryTemplates'; | ||
|
|
||
| describe('schemaQueryTemplates', () => { | ||
| describe('enableTTLTemplate', () => { | ||
| test('does not suggest disabling TTL with a zero interval', () => { | ||
| const template = enableTTLTemplate({path: '/local/table', relativePath: 'table'}); | ||
|
|
||
| expect(template).toContain('ALTER TABLE `table` SET'); | ||
| expect(template).toContain('TTL = Interval("PT24H")'); | ||
| expect(template).not.toContain('To disable TTL'); | ||
| expect(template).not.toContain('PT0S'); | ||
| }); | ||
| }); | ||
|
|
||
| describe('manageTTLTemplate', () => { | ||
| test('resets TTL for the selected table', () => { | ||
| const template = manageTTLTemplate({path: '/local/table', relativePath: 'table'}); | ||
|
|
||
| expect(template).toContain('https://ydb.tech/docs/en/yql/reference/recipes/ttl'); | ||
| expect(template).toContain('ALTER TABLE `table` RESET (TTL);'); | ||
| }); | ||
| }); | ||
| }); |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -49,6 +49,7 @@ import { | |
| dropTopicTemplate, | ||
| dropTransferTemplate, | ||
| dropViewTemplate, | ||
| enableTTLTemplate, | ||
| manageAutoPartitioningTemplate, | ||
| manageReadReplicasTemplate, | ||
| manageTTLTemplate, | ||
|
|
@@ -192,7 +193,8 @@ const bindActions = ( | |
| manageReadReplicasTemplate, | ||
| stripEllipsis(i18n('actions.manageReadReplicas')), | ||
| ), | ||
| manageTTL: inputQuery(manageTTLTemplate, stripEllipsis(i18n('actions.manageTTL'))), | ||
| enableTTL: inputQuery(enableTTLTemplate, stripEllipsis(i18n('actions.enableTTL'))), | ||
| manageTTL: inputQuery(manageTTLTemplate, stripEllipsis(i18n('actions.disableTTL'))), | ||
| selectQuery: inputQuery(selectQueryTemplate, stripEllipsis(i18n('actions.selectQuery'))), | ||
| showCreateTable: inputQuery( | ||
| showCreateTableTemplate, | ||
|
|
@@ -344,8 +346,12 @@ export const getActions = | |
| text: i18n('actions.manageReadReplicas'), | ||
| action: actions.manageReadReplicas, | ||
| }; | ||
| const enableTTLItem = { | ||
| text: i18n('actions.enableTTL'), | ||
| action: actions.enableTTL, | ||
| }; | ||
| const manageTTLItem = { | ||
| text: i18n('actions.manageTTL'), | ||
| text: i18n('actions.disableTTL'), | ||
| action: actions.manageTTL, | ||
| }; | ||
|
|
||
|
|
@@ -355,12 +361,13 @@ export const getActions = | |
| manageColumnsItem, | ||
| manageAutoPartitioningItem, | ||
| manageReadReplicasItem, | ||
| enableTTLItem, | ||
| manageTTLItem, | ||
| ], | ||
| }; | ||
| const alterColumnTableGroupItem = { | ||
| text: i18n('actions.alterTable'), | ||
| items: [manageColumnsItem, manageAutoPartitioningItem, manageTTLItem], | ||
| items: [manageColumnsItem, manageAutoPartitioningItem, enableTTLItem], | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Removing Useful? React with 👍 / 👎. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Column-table actions now omit Useful? React with 👍 / 👎.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @copilot add disable action here
Raubzeug marked this conversation as resolved.
|
||
| }; | ||
|
|
||
| let DB_SET: ActionsSet = [[copyItem, connectToDBItem], createEntitiesSet]; | ||
|
|
||
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.
The column-table
Alter tablemenu now only exposesenableTTLItem, while the new disable template (manageTTLTemplate) is not reachable there. This means users working with column-oriented tables can no longer disable TTL from the built-in schema actions (the previousmanageTTLaction was removed from this group), which is a functional regression in the UI workflow for existing TTL-enabled column tables.Useful? React with 👍 / 👎.