diff --git a/packages/app/src/cli/services/admin-link/extension-to-toml.test.ts b/packages/app/src/cli/services/admin-link/extension-to-toml.test.ts index 5e4dfab74f..e9dde53e4e 100644 --- a/packages/app/src/cli/services/admin-link/extension-to-toml.test.ts +++ b/packages/app/src/cli/services/admin-link/extension-to-toml.test.ts @@ -20,7 +20,7 @@ describe('extension-to-toml', () => { type: 'app_link', draftVersion: { context: 'COLLECTIONS#SHOW', - config: '{"text":"admin link label","url":"https://google.es"}', + config: '{"text":"Admin link label","url":"https://google.es"}', }, } @@ -30,11 +30,10 @@ describe('extension-to-toml', () => { // Then expect(got).toEqual(`[[extensions]] type = "admin_link" -name = "Admin link title" +name = "Admin link label" handle = "admin-link-title" [[extensions.targeting]] - text = "admin link label" url = "https://google.es" target = "admin.collection-details.action.link" `) @@ -56,7 +55,7 @@ handle = "admin-link-title" type: 'bulk_action', draftVersion: { context: 'PRODUCTS#ACTION', - config: '{"text":"bulk action label","url":"https://google.es/action/product?product_id=123#hash"}', + config: '{"text":"Bulk action label","url":"https://google.es/action/product?product_id=123#hash"}', }, } @@ -66,11 +65,10 @@ handle = "admin-link-title" // Then expect(got).toEqual(`[[extensions]] type = "admin_link" -name = "Bulk action title" +name = "Bulk action label" handle = "bulk-action-title" [[extensions.targeting]] - text = "bulk action label" url = "app://action/product?product_id=123#hash" target = "admin.product-index.selection-action.link" `) @@ -91,7 +89,7 @@ handle = "bulk-action-title" type: 'bulk_action', draftVersion: { context: 'PRODUCTS#ACTION', - config: '{"text":"bulk action label","url":"https://google.es/"}', + config: '{"text":"Bulk action label","url":"https://google.es/"}', }, } @@ -101,11 +99,10 @@ handle = "bulk-action-title" // Then expect(got).toEqual(`[[extensions]] type = "admin_link" -name = "Bulk action title" +name = "Bulk action label" handle = "bulk-action-title" [[extensions.targeting]] - text = "bulk action label" url = "app://" target = "admin.product-index.selection-action.link" `) @@ -126,7 +123,7 @@ handle = "bulk-action-title" type: 'bulk_action', draftVersion: { context: 'PRODUCTS#ACTION', - config: '{"text":"bulk action label","url":"https://google.es?foo=bar"}', + config: '{"text":"Bulk action label","url":"https://google.es?foo=bar"}', }, } @@ -136,11 +133,10 @@ handle = "bulk-action-title" // Then expect(got).toEqual(`[[extensions]] type = "admin_link" -name = "Bulk action title" +name = "Bulk action label" handle = "bulk-action-title" [[extensions.targeting]] - text = "bulk action label" url = "app://?foo=bar" target = "admin.product-index.selection-action.link" `) diff --git a/packages/app/src/cli/services/admin-link/extension-to-toml.ts b/packages/app/src/cli/services/admin-link/extension-to-toml.ts index 28667ccb49..7c0d5faa7a 100644 --- a/packages/app/src/cli/services/admin-link/extension-to-toml.ts +++ b/packages/app/src/cli/services/admin-link/extension-to-toml.ts @@ -44,11 +44,10 @@ export function buildTomlObject( extensions: [ { type: 'admin_link', - name: extension.title, + name: config.text, handle: slugify(extension.title.substring(0, MAX_EXTENSION_HANDLE_LENGTH)), targeting: [ { - text: config.text, url: config.url, target: contextToTarget(context), },