diff --git a/frontend/cypress/integration/projects/access.spec.ts b/frontend/cypress/integration/projects/access.spec.ts index dc6c541248e5..298c8042dbb0 100644 --- a/frontend/cypress/integration/projects/access.spec.ts +++ b/frontend/cypress/integration/projects/access.spec.ts @@ -120,7 +120,7 @@ describe('project-access', () => { cy.get(`[data-testid='CancelIcon']`).last().click(); cy.get(`[data-testid='${PA_ROLE_ID}']`).click(); - cy.contains('update feature toggles within a project').click({ + cy.contains('update feature flags within a project').click({ force: true, }); diff --git a/src/migrations/20240523093355-toggle-to-flag-rename.js b/src/migrations/20240523093355-toggle-to-flag-rename.js new file mode 100644 index 000000000000..dd784e3255f6 --- /dev/null +++ b/src/migrations/20240523093355-toggle-to-flag-rename.js @@ -0,0 +1,41 @@ +exports.up = function (db, cb) { + db.runSql(` + UPDATE permissions SET display_name = 'Create feature flags' WHERE permission = 'CREATE_FEATURE' AND type = 'project'; + UPDATE permissions SET display_name = 'Update feature flags' WHERE permission = 'UPDATE_FEATURE' AND type = 'project'; + UPDATE permissions SET display_name = 'Delete feature flags' WHERE permission = 'DELETE_FEATURE' AND type = 'project'; + UPDATE permissions SET display_name = 'Change feature flag project' WHERE permission = 'MOVE_FEATURE_TOGGLE' AND type = 'project'; + UPDATE permissions SET display_name = 'Enable/disable flags' WHERE permission = 'UPDATE_FEATURE_ENVIRONMENT' AND type = 'environment'; + `, cb); +}; + +exports.down = function (db, cb) { + db.runSql( + ` + UPDATE permissions + SET display_name = 'Create feature toggles' + WHERE permission = 'CREATE_FEATURE' + AND type = 'project'; + + UPDATE permissions + SET display_name = 'Update feature toggles' + WHERE permission = 'UPDATE_FEATURE' + AND type = 'project'; + + UPDATE permissions + SET display_name = 'Delete feature toggles' + WHERE permission = 'DELETE_FEATURE' + AND type = 'project'; + + UPDATE permissions + SET display_name = 'Change feature toggle project' + WHERE permission = 'MOVE_FEATURE_TOGGLE' + AND type = 'project'; + + UPDATE permissions + SET display_name = 'Enable/disable toggles' + WHERE permission = 'UPDATE_FEATURE_ENVIRONMENT' + AND type = 'environment'; + `, + cb, + ); +};