diff --git a/admin-ui-sdk/banner-notification/custom-mass-actions/actions/registration/index.js b/admin-ui-sdk/banner-notification/custom-mass-actions/actions/registration/index.js new file mode 100644 index 0000000..5f43c66 --- /dev/null +++ b/admin-ui-sdk/banner-notification/custom-mass-actions/actions/registration/index.js @@ -0,0 +1,44 @@ +/* +Copyright 2024 Adobe. All rights reserved. +This file is licensed to you under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. You may obtain a copy +of the License at http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software distributed under +the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS +OF ANY KIND, either express or implied. See the License for the specific language +governing permissions and limitations under the License. +*/ + +async function main() { + const orderExtensionId = 'order-custom-mass-action' + const productExtensionId = 'product-custom-mass-action' + + return { + statusCode: 200, + body: { + registration: { + bannerNotification: { + massActions: { + order: [ + { + actionId: `${orderExtensionId}::mass-action-with-redirect`, + successMessage: 'Order custom success message', + errorMessage: 'Order custom error message' + } + ], + product: [ + { + actionId: `${productExtensionId}::mass-action-with-redirect`, + successMessage: 'Product custom success message', + errorMessage: 'Product custom error message' + } + ] + } + } + } + } + } +} + +exports.main = main diff --git a/admin-ui-sdk/banner-notification/custom-mass-actions/app.config.yaml b/admin-ui-sdk/banner-notification/custom-mass-actions/app.config.yaml index bb32609..a941ed9 100644 --- a/admin-ui-sdk/banner-notification/custom-mass-actions/app.config.yaml +++ b/admin-ui-sdk/banner-notification/custom-mass-actions/app.config.yaml @@ -4,8 +4,19 @@ extensions: view: - type: web impl: index.html + actions: actions web: web-src runtimeManifest: packages: - CustomMassAction: + admin-ui-sdk: license: Apache-2.0 + actions: + registration: + function: actions/registration/index.js + web: 'yes' + runtime: 'nodejs:18' + inputs: + LOG_LEVEL: debug + annotations: + require-adobe-auth: false + final: true diff --git a/admin-ui-sdk/banner-notification/custom-mass-actions/extension-manifest.json b/admin-ui-sdk/banner-notification/custom-mass-actions/extension-manifest.json index b5bbafc..4425e3b 100644 --- a/admin-ui-sdk/banner-notification/custom-mass-actions/extension-manifest.json +++ b/admin-ui-sdk/banner-notification/custom-mass-actions/extension-manifest.json @@ -1,7 +1,7 @@ { "name": "banner-notification-custom-mass-action", "displayName": "Adobe Commerce banner notification custom mass action", - "description": "Adobe Commerce banner norification custom mass action in admin panel", + "description": "Adobe Commerce banner notification custom mass action in admin panel", "platform": "web", "id": "banner-notification-custom-mass-action", "version": "1.0.0" diff --git a/admin-ui-sdk/banner-notification/custom-mass-actions/package-lock.json b/admin-ui-sdk/banner-notification/custom-mass-actions/package-lock.json index 76e22c9..17bb28e 100644 --- a/admin-ui-sdk/banner-notification/custom-mass-actions/package-lock.json +++ b/admin-ui-sdk/banner-notification/custom-mass-actions/package-lock.json @@ -37,6 +37,9 @@ "@babel/preset-env": "^7.20.2", "@openwhisk/wskdebug": "^1.4.0", "jest": "^29.4.2" + }, + "engines": { + "node": "^16.13 || >=18" } }, "node_modules/@adobe/aio-lib-analytics": { diff --git a/admin-ui-sdk/banner-notification/custom-mass-actions/web-src/src/components/ExtensionRegistration.js b/admin-ui-sdk/banner-notification/custom-mass-actions/web-src/src/components/ExtensionRegistration.js index 639f35a..109d75e 100644 --- a/admin-ui-sdk/banner-notification/custom-mass-actions/web-src/src/components/ExtensionRegistration.js +++ b/admin-ui-sdk/banner-notification/custom-mass-actions/web-src/src/components/ExtensionRegistration.js @@ -17,32 +17,9 @@ export default function ExtensionRegistration() { const init = async () => { - const orderExtensionId = 'order-custom-mass-action' - const productExtensionId = 'product-custom-mass-action' - await register({ id: 'banner-notification-custom-mass-action', methods: { - bannerNotification: { - getMassActions() { - return { - order: [ - { - actionId: `${orderExtensionId}::mass-action-with-redirect`, - successMessage: 'Custom success message', - errorMessage: 'Custom error message' - } - ], - product: [ - { - actionId: `${productExtensionId}::mass-action-with-redirect`, - successMessage: 'Custom success message', - errorMessage: 'Custom error message' - } - ] - } - } - } } }) } diff --git a/admin-ui-sdk/banner-notification/custom-order-view-button/actions/registration/index.js b/admin-ui-sdk/banner-notification/custom-order-view-button/actions/registration/index.js new file mode 100644 index 0000000..9fb40f9 --- /dev/null +++ b/admin-ui-sdk/banner-notification/custom-order-view-button/actions/registration/index.js @@ -0,0 +1,39 @@ +/* +Copyright 2024 Adobe. All rights reserved. +This file is licensed to you under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. You may obtain a copy +of the License at http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software distributed under +the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS +OF ANY KIND, either express or implied. See the License for the specific language +governing permissions and limitations under the License. +*/ + +async function main() { + const extensionId = 'order-custom-view-button' + + return { + statusCode: 200, + body: { + registration: { + bannerNotification: { + orderViewButtons: [ + { + buttonId: `${extensionId}::mass-action-with-redirect`, + successMessage: 'Custom success message', + errorMessage: 'Custom error message' + }, + { + buttonId: `${extensionId}::create-return`, + successMessage: 'Custom success message', + errorMessage: 'Custom error message' + } + ] + } + } + } + } +} + +exports.main = main diff --git a/admin-ui-sdk/banner-notification/custom-order-view-button/app.config.yaml b/admin-ui-sdk/banner-notification/custom-order-view-button/app.config.yaml index bb32609..a941ed9 100644 --- a/admin-ui-sdk/banner-notification/custom-order-view-button/app.config.yaml +++ b/admin-ui-sdk/banner-notification/custom-order-view-button/app.config.yaml @@ -4,8 +4,19 @@ extensions: view: - type: web impl: index.html + actions: actions web: web-src runtimeManifest: packages: - CustomMassAction: + admin-ui-sdk: license: Apache-2.0 + actions: + registration: + function: actions/registration/index.js + web: 'yes' + runtime: 'nodejs:18' + inputs: + LOG_LEVEL: debug + annotations: + require-adobe-auth: false + final: true diff --git a/admin-ui-sdk/banner-notification/custom-order-view-button/package-lock.json b/admin-ui-sdk/banner-notification/custom-order-view-button/package-lock.json index 5ca69ad..9ee303c 100644 --- a/admin-ui-sdk/banner-notification/custom-order-view-button/package-lock.json +++ b/admin-ui-sdk/banner-notification/custom-order-view-button/package-lock.json @@ -37,6 +37,9 @@ "@babel/preset-env": "^7.20.2", "@openwhisk/wskdebug": "^1.4.0", "jest": "^29.4.2" + }, + "engines": { + "node": "^16.13 || >=18" } }, "node_modules/@adobe/aio-lib-analytics": { diff --git a/admin-ui-sdk/banner-notification/custom-order-view-button/web-src/src/components/ExtensionRegistration.js b/admin-ui-sdk/banner-notification/custom-order-view-button/web-src/src/components/ExtensionRegistration.js index dcad010..b633040 100644 --- a/admin-ui-sdk/banner-notification/custom-order-view-button/web-src/src/components/ExtensionRegistration.js +++ b/admin-ui-sdk/banner-notification/custom-order-view-button/web-src/src/components/ExtensionRegistration.js @@ -17,27 +17,9 @@ export default function ExtensionRegistration() { const init = async () => { - const extensionId = 'order-custom-view-button' - await register({ id: 'banner-notification-order-custom-view-button', methods: { - bannerNotification: { - getOrderViewButtons() { - return [ - { - buttonId: `${extensionId}::mass-action-with-redirect`, - successMessage: 'Custom success message', - errorMessage: 'Custom error message' - }, - { - buttonId: `${extensionId}::create-return`, - successMessage: 'Custom success message', - errorMessage: 'Custom error message' - } - ] - } - } } } )} diff --git a/admin-ui-sdk/customer/custom-grid-columns/actions/registration/index.js b/admin-ui-sdk/customer/custom-grid-columns/actions/registration/index.js new file mode 100644 index 0000000..50b684b --- /dev/null +++ b/admin-ui-sdk/customer/custom-grid-columns/actions/registration/index.js @@ -0,0 +1,51 @@ +/* +Copyright 2024 Adobe. All rights reserved. +This file is licensed to you under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. You may obtain a copy +of the License at http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software distributed under +the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS +OF ANY KIND, either express or implied. See the License for the specific language +governing permissions and limitations under the License. +*/ + +async function main() { + return { + statusCode: 200, + body: { + registration: { + customer: { + gridColumns: { + data: { + meshId: '', + apiKey: '' + }, + properties:[ + { + label: 'First App Column', + columnId: 'first_column', + type: 'string', + align: 'left' + }, + { + label: 'Second App Column', + columnId: 'second_column', + type: 'integer', + align: 'left' + }, + { + label: 'Third App Column', + columnId: 'third_column', + type: 'date', + align: 'left' + } + ] + } + } + } + } + } +} + +exports.main = main diff --git a/admin-ui-sdk/customer/custom-grid-columns/app.config.yaml b/admin-ui-sdk/customer/custom-grid-columns/app.config.yaml index 31d1335..ad04f78 100644 --- a/admin-ui-sdk/customer/custom-grid-columns/app.config.yaml +++ b/admin-ui-sdk/customer/custom-grid-columns/app.config.yaml @@ -8,7 +8,19 @@ extensions: web: web-src runtimeManifest: packages: - CustomGridColumns: + admin-ui-sdk: + license: Apache-2.0 + actions: + registration: + function: actions/registration/index.js + web: 'yes' + runtime: 'nodejs:18' + inputs: + LOG_LEVEL: debug + annotations: + require-adobe-auth: false + final: true + customer-custom-grid-columns: license: Apache-2.0 actions: get-customer-grid-columns: diff --git a/admin-ui-sdk/customer/custom-grid-columns/package-lock.json b/admin-ui-sdk/customer/custom-grid-columns/package-lock.json index 89c3a78..e486695 100644 --- a/admin-ui-sdk/customer/custom-grid-columns/package-lock.json +++ b/admin-ui-sdk/customer/custom-grid-columns/package-lock.json @@ -1,11 +1,11 @@ { - "name": "customer-custom-mass-action", + "name": "customer-custom-grid-columns", "version": "1.0.0", "lockfileVersion": 3, "requires": true, "packages": { "": { - "name": "customer-custom-mass-action", + "name": "customer-custom-grid-columns", "version": "1.0.0", "dependencies": { "@adobe/aio-sdk": "^3.0.0", diff --git a/admin-ui-sdk/customer/custom-grid-columns/package.json b/admin-ui-sdk/customer/custom-grid-columns/package.json index a077eda..87ca054 100755 --- a/admin-ui-sdk/customer/custom-grid-columns/package.json +++ b/admin-ui-sdk/customer/custom-grid-columns/package.json @@ -1,5 +1,5 @@ { - "name": "customer-custom-mass-action", + "name": "customer-custom-grid-columns", "version": "1.0.0", "private": true, "dependencies": { diff --git a/admin-ui-sdk/customer/custom-grid-columns/web-src/src/components/ExtensionRegistration.js b/admin-ui-sdk/customer/custom-grid-columns/web-src/src/components/ExtensionRegistration.js index f386f4d..1868a61 100644 --- a/admin-ui-sdk/customer/custom-grid-columns/web-src/src/components/ExtensionRegistration.js +++ b/admin-ui-sdk/customer/custom-grid-columns/web-src/src/components/ExtensionRegistration.js @@ -22,36 +22,6 @@ const init = async () => { await register({ id: extensionId, methods: { - customer: { - getGridColumns() { - return { - data: { - meshId: '', - apiKey: '' - }, - properties:[ - { - label: 'First App Column', - columnId: 'first_column', - type: 'string', - align: 'left' - }, - { - label: 'Second App Column', - columnId: 'second_column', - type: 'integer', - align: 'left' - }, - { - label: 'Third App Column', - columnId: 'third_column', - type: 'date', - align: 'left' - } - ] - } - } - } } }) } diff --git a/admin-ui-sdk/customer/custom-mass-action/actions/registration/index.js b/admin-ui-sdk/customer/custom-mass-action/actions/registration/index.js new file mode 100644 index 0000000..425fd51 --- /dev/null +++ b/admin-ui-sdk/customer/custom-mass-action/actions/registration/index.js @@ -0,0 +1,45 @@ +/* +Copyright 2024 Adobe. All rights reserved. +This file is licensed to you under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. You may obtain a copy +of the License at http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software distributed under +the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS +OF ANY KIND, either express or implied. See the License for the specific language +governing permissions and limitations under the License. +*/ + +async function main() { + const extensionId = 'customer-custom-mass-action' + + return { + statusCode: 200, + body: { + registration: { + customer: { + massActions: [ + { + actionId: `${extensionId}::customer-mass-action`, + label: 'Customer Mass Action', + confirm: { + title: 'Mass Action', + message: 'Are you sure your want to proceed with Mass Action on selected customers?' + }, + path: '#/customer-mass-action', + selectionLimit: 1 + }, + { + actionId: `${extensionId}::mass-action-with-redirect`, + label: 'Mass Action With Redirect', + title: 'Customer Mass Action With Redirect', + path: '#/mass-action-with-redirect' + } + ] + } + } + } + } +} + +exports.main = main diff --git a/admin-ui-sdk/customer/custom-mass-action/app.config.yaml b/admin-ui-sdk/customer/custom-mass-action/app.config.yaml index bb32609..a941ed9 100644 --- a/admin-ui-sdk/customer/custom-mass-action/app.config.yaml +++ b/admin-ui-sdk/customer/custom-mass-action/app.config.yaml @@ -4,8 +4,19 @@ extensions: view: - type: web impl: index.html + actions: actions web: web-src runtimeManifest: packages: - CustomMassAction: + admin-ui-sdk: license: Apache-2.0 + actions: + registration: + function: actions/registration/index.js + web: 'yes' + runtime: 'nodejs:18' + inputs: + LOG_LEVEL: debug + annotations: + require-adobe-auth: false + final: true diff --git a/admin-ui-sdk/customer/custom-mass-action/web-src/src/components/App.js b/admin-ui-sdk/customer/custom-mass-action/web-src/src/components/App.js index 1a9286d..1c3ab30 100755 --- a/admin-ui-sdk/customer/custom-mass-action/web-src/src/components/App.js +++ b/admin-ui-sdk/customer/custom-mass-action/web-src/src/components/App.js @@ -34,7 +34,7 @@ function App (props) { } /> - } /> + } /> } /> diff --git a/admin-ui-sdk/customer/custom-mass-action/web-src/src/components/ExtensionRegistration.js b/admin-ui-sdk/customer/custom-mass-action/web-src/src/components/ExtensionRegistration.js index 663517e..de2152d 100644 --- a/admin-ui-sdk/customer/custom-mass-action/web-src/src/components/ExtensionRegistration.js +++ b/admin-ui-sdk/customer/custom-mass-action/web-src/src/components/ExtensionRegistration.js @@ -17,34 +17,11 @@ export default function ExtensionRegistration() { const init = async () => { - const extensionId = 'product-custom-mass-action' + const extensionId = 'customer-custom-mass-action' await register({ id: extensionId, methods: { - product: { - getMassActions() { - return [ - { - actionId: `${extensionId}::customer-mass-action`, - label: 'Customer Mass Action', - type: `${extensionId}.customer-mass-action`, - confirm: { - title: 'Mass Action', - message: 'Are you sure your want to proceed with Mass Action on selected customers?' - }, - path: '#/mass-action', - customerSelectLimit: 1 - }, - { - actionId: `${extensionId}::mass-action-with-redirect`, - label: 'Mass Action With Redirect', - type: `${extensionId}.mass-action-with-redirect`, - path: '#/mass-action-with-redirect' - } - ] - } - } } }) } diff --git a/admin-ui-sdk/customer/custom-mass-action/web-src/src/components/MassAction.js b/admin-ui-sdk/customer/custom-mass-action/web-src/src/components/MassAction.js index e7cc5d8..0f9259e 100644 --- a/admin-ui-sdk/customer/custom-mass-action/web-src/src/components/MassAction.js +++ b/admin-ui-sdk/customer/custom-mass-action/web-src/src/components/MassAction.js @@ -22,7 +22,7 @@ export const MassAction = () => { const getGuestConnection = async () => { return await attach({ - id: 'product-custom-mass-action' + id: 'customer-custom-mass-action' }) } diff --git a/admin-ui-sdk/customer/custom-mass-action/web-src/src/components/MassActionWithRedirectOnDone.js b/admin-ui-sdk/customer/custom-mass-action/web-src/src/components/MassActionWithRedirectOnDone.js index 360df0b..e35a402 100644 --- a/admin-ui-sdk/customer/custom-mass-action/web-src/src/components/MassActionWithRedirectOnDone.js +++ b/admin-ui-sdk/customer/custom-mass-action/web-src/src/components/MassActionWithRedirectOnDone.js @@ -25,7 +25,7 @@ export const MassActionWithRedirectOnDone = () => { const getGuestConnection = async () => { return await attach({ - id: 'product-custom-mass-action' + id: 'customer-custom-mass-action' }) } diff --git a/admin-ui-sdk/menu/custom-menu/actions/registration/index.js b/admin-ui-sdk/menu/custom-menu/actions/registration/index.js new file mode 100644 index 0000000..23f6fb2 --- /dev/null +++ b/admin-ui-sdk/menu/custom-menu/actions/registration/index.js @@ -0,0 +1,42 @@ +/* +Copyright 2024 Adobe. All rights reserved. +This file is licensed to you under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. You may obtain a copy +of the License at http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software distributed under +the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS +OF ANY KIND, either express or implied. See the License for the specific language +governing permissions and limitations under the License. +*/ + +async function main() { + const extensionId = 'CustomMenu' + + return { + statusCode: 200, + body: { + registration: { + menuItems: [ + { + id: `${extensionId}::first`, + title: 'First App on App Builder', + parent: `${extensionId}::apps`, + sortOrder: 1 + }, + { + id: `${extensionId}::apps`, + title: 'Apps', + isSection: true, + sortOrder: 100 + } + ], + page: { + title: 'Adobe Commerce First App on App Builder' + } + } + } + } +} + +exports.main = main diff --git a/admin-ui-sdk/menu/custom-menu/app.config.yaml b/admin-ui-sdk/menu/custom-menu/app.config.yaml index 7ad4182..53a8338 100644 --- a/admin-ui-sdk/menu/custom-menu/app.config.yaml +++ b/admin-ui-sdk/menu/custom-menu/app.config.yaml @@ -8,6 +8,18 @@ extensions: web: web-src runtimeManifest: packages: + admin-ui-sdk: + license: Apache-2.0 + actions: + registration: + function: actions/registration/index.js + web: 'yes' + runtime: 'nodejs:18' + inputs: + LOG_LEVEL: debug + annotations: + require-adobe-auth: false + final: true CustomMenu: license: Apache-2.0 actions: diff --git a/admin-ui-sdk/menu/custom-menu/extension-manifest.json b/admin-ui-sdk/menu/custom-menu/extension-manifest.json index ba13cab..77a7e7d 100644 --- a/admin-ui-sdk/menu/custom-menu/extension-manifest.json +++ b/admin-ui-sdk/menu/custom-menu/extension-manifest.json @@ -1,8 +1,8 @@ { - "name": "custommenu", + "name": "CustomMenu", "displayName": "Adobe Commerce custom menu", "description": "Adobe Commerce custom menu example in admin panel", "platform": "web", - "id": "custommenu", + "id": "CustomMenu", "version": "1.0.0" } diff --git a/admin-ui-sdk/menu/custom-menu/web-src/src/components/ExtensionRegistration.js b/admin-ui-sdk/menu/custom-menu/web-src/src/components/ExtensionRegistration.js index 90fc9f6..4a3a6f0 100644 --- a/admin-ui-sdk/menu/custom-menu/web-src/src/components/ExtensionRegistration.js +++ b/admin-ui-sdk/menu/custom-menu/web-src/src/components/ExtensionRegistration.js @@ -19,33 +19,11 @@ export default function ExtensionRegistration(props) { const init = async () => { - const extensionId = 'custommenu' + const extensionId = 'custom-menu' await register({ id: extensionId, methods: { - menu: { - getItems() { - return [ - { - id: `${extensionId}::first`, - title: 'First App on App Builder', - parent: `${extensionId}::apps`, - sortOrder: 1 - }, - { - id: `${extensionId}::apps`, - title: 'Apps', - isSection: true - } - ] - } - }, - page: { - getTitle() { - return 'First App on App Builder' - } - } } }) } diff --git a/admin-ui-sdk/menu/custom-menu/web-src/src/hooks/useCommerceOrders.js b/admin-ui-sdk/menu/custom-menu/web-src/src/hooks/useCommerceOrders.js index 11c5b2b..8972ade 100644 --- a/admin-ui-sdk/menu/custom-menu/web-src/src/hooks/useCommerceOrders.js +++ b/admin-ui-sdk/menu/custom-menu/web-src/src/hooks/useCommerceOrders.js @@ -19,7 +19,7 @@ export const useCommerceOrders = props => { const fetchCommerceOrders = async () => { const commerceOrdersResponse = await callAction( props, - 'commerce-rest-get', + 'CustomMenu/commerce-rest-get', 'orders?searchCriteria=all' ) setCommerceOrders(commerceOrdersResponse.error ? [] : commerceOrdersResponse.items) diff --git a/admin-ui-sdk/menu/custom-menu/web-src/src/hooks/useCommerceProducts.js b/admin-ui-sdk/menu/custom-menu/web-src/src/hooks/useCommerceProducts.js index 1564d3a..c3b795d 100644 --- a/admin-ui-sdk/menu/custom-menu/web-src/src/hooks/useCommerceProducts.js +++ b/admin-ui-sdk/menu/custom-menu/web-src/src/hooks/useCommerceProducts.js @@ -19,7 +19,7 @@ export const useCommerceProducts = props => { const fetchCommerceProducts = async () => { const commerceProductsResponse = await callAction( props, - 'commerce-rest-get', + 'CustomMenu/commerce-rest-get', `products?searchCriteria[pageSize]=${props.pageSize}&searchCriteria[currentPage]=${props.currentPage}` ) console.log(commerceProductsResponse) diff --git a/admin-ui-sdk/order/custom-fees/actions/registration/index.js b/admin-ui-sdk/order/custom-fees/actions/registration/index.js new file mode 100644 index 0000000..a586a6a --- /dev/null +++ b/admin-ui-sdk/order/custom-fees/actions/registration/index.js @@ -0,0 +1,41 @@ +/* +Copyright 2024 Adobe. All rights reserved. +This file is licensed to you under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. You may obtain a copy +of the License at http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software distributed under +the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS +OF ANY KIND, either express or implied. See the License for the specific language +governing permissions and limitations under the License. +*/ + +async function main() { + + return { + statusCode: 200, + body: { + registration: { + order: { + customFees: [ + { + id: 'test-fee-1', + label: 'Test Fee 1', + value: 1.00, + applyFeeOnLastCreditMemo: false + }, + { + id: 'test-fee-2', + label: 'Test Fee 2', + value: 5.00, + orderMinimumAmount: 20, + applyFeeOnLastInvoice: true + } + ] + } + } + } + } +} + +exports.main = main diff --git a/admin-ui-sdk/order/custom-fees/app.config.yaml b/admin-ui-sdk/order/custom-fees/app.config.yaml index bb32609..a941ed9 100644 --- a/admin-ui-sdk/order/custom-fees/app.config.yaml +++ b/admin-ui-sdk/order/custom-fees/app.config.yaml @@ -4,8 +4,19 @@ extensions: view: - type: web impl: index.html + actions: actions web: web-src runtimeManifest: packages: - CustomMassAction: + admin-ui-sdk: license: Apache-2.0 + actions: + registration: + function: actions/registration/index.js + web: 'yes' + runtime: 'nodejs:18' + inputs: + LOG_LEVEL: debug + annotations: + require-adobe-auth: false + final: true diff --git a/admin-ui-sdk/order/custom-fees/web-src/src/components/ExtensionRegistration.js b/admin-ui-sdk/order/custom-fees/web-src/src/components/ExtensionRegistration.js index 3fe8f02..4dc9397 100644 --- a/admin-ui-sdk/order/custom-fees/web-src/src/components/ExtensionRegistration.js +++ b/admin-ui-sdk/order/custom-fees/web-src/src/components/ExtensionRegistration.js @@ -17,30 +17,11 @@ export default function ExtensionRegistration() { const init = async () => { - const extensionId = 'order-custom-mass-action' + const extensionId = 'order-custom-fees' await register({ id: extensionId, methods: { - order: { - getOrderCustomFees() { - return [ - { - id: 'test-fee-1', - label: 'Test Fee 1', - value: 1.00, - applyFeeOnLastCreditMemo: false - }, - { - id: 'test-fee-2', - label: 'Test Fee 2', - value: 5.00, - orderMinimumAmount: 20, - applyFeeOnLastInvoice: true - } - ] - } - } } }) } diff --git a/admin-ui-sdk/order/custom-grid-columns/actions/registration/index.js b/admin-ui-sdk/order/custom-grid-columns/actions/registration/index.js new file mode 100644 index 0000000..ee80625 --- /dev/null +++ b/admin-ui-sdk/order/custom-grid-columns/actions/registration/index.js @@ -0,0 +1,51 @@ +/* +Copyright 2024 Adobe. All rights reserved. +This file is licensed to you under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. You may obtain a copy +of the License at http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software distributed under +the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS +OF ANY KIND, either express or implied. See the License for the specific language +governing permissions and limitations under the License. +*/ + +async function main() { + return { + statusCode: 200, + body: { + registration: { + order: { + gridColumns: { + data: { + meshId: '', + apiKey: '' + }, + properties:[ + { + label: 'First App Column', + columnId: 'first_column', + type: 'string', + align: 'left' + }, + { + label: 'Second App Column', + columnId: 'second_column', + type: 'integer', + align: 'left' + }, + { + label: 'Third App Column', + columnId: 'third_column', + type: 'date', + align: 'left' + } + ] + } + } + } + } + } +} + +exports.main = main diff --git a/admin-ui-sdk/order/custom-grid-columns/app.config.yaml b/admin-ui-sdk/order/custom-grid-columns/app.config.yaml index a6ec761..b5d8adc 100644 --- a/admin-ui-sdk/order/custom-grid-columns/app.config.yaml +++ b/admin-ui-sdk/order/custom-grid-columns/app.config.yaml @@ -8,7 +8,19 @@ extensions: web: web-src runtimeManifest: packages: - CustomGridColumns: + admin-ui-sdk: + license: Apache-2.0 + actions: + registration: + function: actions/registration/index.js + web: 'yes' + runtime: 'nodejs:18' + inputs: + LOG_LEVEL: debug + annotations: + require-adobe-auth: false + final: true + order-custom-grid-columns: license: Apache-2.0 actions: get-order-grid-columns: diff --git a/admin-ui-sdk/order/custom-grid-columns/web-src/src/components/ExtensionRegistration.js b/admin-ui-sdk/order/custom-grid-columns/web-src/src/components/ExtensionRegistration.js index 7b78112..e758457 100644 --- a/admin-ui-sdk/order/custom-grid-columns/web-src/src/components/ExtensionRegistration.js +++ b/admin-ui-sdk/order/custom-grid-columns/web-src/src/components/ExtensionRegistration.js @@ -22,36 +22,6 @@ const init = async () => { await register({ id: extensionId, methods: { - order: { - getGridColumns() { - return { - data: { - meshId: '', - apiKey: '' - }, - properties:[ - { - label: 'First App Column', - columnId: 'first_column', - type: 'string', - align: 'left' - }, - { - label: 'Second App Column', - columnId: 'second_column', - type: 'integer', - align: 'left' - }, - { - label: 'Third App Column', - columnId: 'third_column', - type: 'date', - align: 'left' - } - ] - } - } - } } }) } diff --git a/admin-ui-sdk/order/custom-mass-action/actions/registration/index.js b/admin-ui-sdk/order/custom-mass-action/actions/registration/index.js new file mode 100644 index 0000000..2e96189 --- /dev/null +++ b/admin-ui-sdk/order/custom-mass-action/actions/registration/index.js @@ -0,0 +1,45 @@ +/* +Copyright 2024 Adobe. All rights reserved. +This file is licensed to you under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. You may obtain a copy +of the License at http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software distributed under +the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS +OF ANY KIND, either express or implied. See the License for the specific language +governing permissions and limitations under the License. +*/ + +async function main() { + const extensionId = 'order-custom-mass-action' + + return { + statusCode: 200, + body: { + registration: { + order: { + massActions: [ + { + actionId: `${extensionId}::order-mass-action`, + label: 'Order Mass Action', + confirm: { + title: 'Mass Action', + message: 'Are you sure your want to proceed with Mass Action on selected orders?' + }, + path: '#/order-mass-action', + selectionLimit: 1 + }, + { + actionId: `${extensionId}::mass-action-with-redirect`, + label: 'Mass Action With Redirect', + title: 'Order Mass Action With Redirect', + path: '#/mass-action-with-redirect' + } + ] + } + } + } + } +} + +exports.main = main diff --git a/admin-ui-sdk/order/custom-mass-action/app.config.yaml b/admin-ui-sdk/order/custom-mass-action/app.config.yaml index bb32609..a941ed9 100644 --- a/admin-ui-sdk/order/custom-mass-action/app.config.yaml +++ b/admin-ui-sdk/order/custom-mass-action/app.config.yaml @@ -4,8 +4,19 @@ extensions: view: - type: web impl: index.html + actions: actions web: web-src runtimeManifest: packages: - CustomMassAction: + admin-ui-sdk: license: Apache-2.0 + actions: + registration: + function: actions/registration/index.js + web: 'yes' + runtime: 'nodejs:18' + inputs: + LOG_LEVEL: debug + annotations: + require-adobe-auth: false + final: true diff --git a/admin-ui-sdk/order/custom-mass-action/web-src/src/components/ExtensionRegistration.js b/admin-ui-sdk/order/custom-mass-action/web-src/src/components/ExtensionRegistration.js index aab2903..d7e7bd9 100644 --- a/admin-ui-sdk/order/custom-mass-action/web-src/src/components/ExtensionRegistration.js +++ b/admin-ui-sdk/order/custom-mass-action/web-src/src/components/ExtensionRegistration.js @@ -22,29 +22,6 @@ const init = async () => { await register({ id: extensionId, methods: { - order: { - getMassActions() { - return [ - { - actionId: `${extensionId}::order-mass-action`, - label: 'Order Mass Action', - type: `${extensionId}.order-mass-action`, - confirm: { - title: 'Mass Action', - message: 'Are you sure your want to proceed with Mass Action on selected orders?' - }, - path: '#/order-mass-action', - orderSelectLimit: 1 - }, - { - actionId: `${extensionId}::mass-action-with-redirect`, - label: 'Mass Action With Redirect', - type: `${extensionId}.mass-action-with-redirect`, - path: '#/mass-action-with-redirect' - } - ] - } - } } }) } diff --git a/admin-ui-sdk/order/custom-view-button/actions/registration/index.js b/admin-ui-sdk/order/custom-view-button/actions/registration/index.js new file mode 100644 index 0000000..cd80599 --- /dev/null +++ b/admin-ui-sdk/order/custom-view-button/actions/registration/index.js @@ -0,0 +1,48 @@ +/* +Copyright 2024 Adobe. All rights reserved. +This file is licensed to you under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. You may obtain a copy +of the License at http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software distributed under +the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS +OF ANY KIND, either express or implied. See the License for the specific language +governing permissions and limitations under the License. +*/ + +async function main() { + const extensionId = 'order-custom-view-button' + + return { + statusCode: 200, + body: { + registration: { + order: { + viewButtons: [ + { + buttonId: `${extensionId}::delete-order`, + label: 'Delete', + confirm: { + message: 'Are you sure your want to proceed to delete order?' + }, + path: '#/delete-order', + class: 'custom', + level: 0, + sortOrder: 80 + }, + { + buttonId: `${extensionId}::create-return`, + label: 'Create Return', + path: '#/create-return', + class: 'custom', + level: 0, + sortOrder: 80 + } + ] + } + } + } + } +} + +exports.main = main diff --git a/admin-ui-sdk/order/custom-view-button/app.config.yaml b/admin-ui-sdk/order/custom-view-button/app.config.yaml index b04a237..a941ed9 100644 --- a/admin-ui-sdk/order/custom-view-button/app.config.yaml +++ b/admin-ui-sdk/order/custom-view-button/app.config.yaml @@ -4,8 +4,19 @@ extensions: view: - type: web impl: index.html + actions: actions web: web-src runtimeManifest: packages: - CustomViewButton: + admin-ui-sdk: license: Apache-2.0 + actions: + registration: + function: actions/registration/index.js + web: 'yes' + runtime: 'nodejs:18' + inputs: + LOG_LEVEL: debug + annotations: + require-adobe-auth: false + final: true diff --git a/admin-ui-sdk/order/custom-view-button/web-src/src/components/ExtensionRegistration.js b/admin-ui-sdk/order/custom-view-button/web-src/src/components/ExtensionRegistration.js index dbe5fdf..15abdeb 100644 --- a/admin-ui-sdk/order/custom-view-button/web-src/src/components/ExtensionRegistration.js +++ b/admin-ui-sdk/order/custom-view-button/web-src/src/components/ExtensionRegistration.js @@ -22,31 +22,6 @@ const init = async () => { await register({ id: extensionId, methods: { - order: { - getOrderViewButtons() { - return [ - { - buttonId: `${extensionId}::delete-order`, - label: 'Delete', - confirm: { - message: 'Are you sure your want to proceed to delete order?' - }, - path: '#/delete-order', - class: 'custom', - level: 0, - sortOrder: 80 - }, - { - buttonId: `${extensionId}::create-return`, - label: 'Create Return', - path: '#/create-return', - class: 'custom', - level: 0, - sortOrder: 80 - } - ] - } - } } }) } diff --git a/admin-ui-sdk/product/custom-grid-columns/actions/registration/index.js b/admin-ui-sdk/product/custom-grid-columns/actions/registration/index.js new file mode 100644 index 0000000..1b3fcf7 --- /dev/null +++ b/admin-ui-sdk/product/custom-grid-columns/actions/registration/index.js @@ -0,0 +1,39 @@ +/* +Copyright 2024 Adobe. All rights reserved. +This file is licensed to you under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. You may obtain a copy +of the License at http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software distributed under +the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS +OF ANY KIND, either express or implied. See the License for the specific language +governing permissions and limitations under the License. +*/ + +async function main() { + return { + statusCode: 200, + body: { + registration: { + product: { + gridColumns: { + data: { + meshId: '', + apiKey: '' + }, + properties:[ + { + label: 'App Column', + columnId: 'first_column', + type: 'string', + align: 'left' + } + ] + } + } + } + } + } +} + +exports.main = main diff --git a/admin-ui-sdk/product/custom-grid-columns/app.config.yaml b/admin-ui-sdk/product/custom-grid-columns/app.config.yaml index d2a7cfb..7fbfa50 100644 --- a/admin-ui-sdk/product/custom-grid-columns/app.config.yaml +++ b/admin-ui-sdk/product/custom-grid-columns/app.config.yaml @@ -8,13 +8,25 @@ extensions: web: web-src runtimeManifest: packages: - CustomGridColumns: + admin-ui-sdk: + license: Apache-2.0 + actions: + registration: + function: actions/registration/index.js + web: 'yes' + runtime: 'nodejs:18' + inputs: + LOG_LEVEL: debug + annotations: + require-adobe-auth: false + final: true + product-custom-grid-columns: license: Apache-2.0 actions: get-product-grid-columns: function: actions/data/productGridColumns.js web: 'yes' - runtime: 'nodejs:16' + runtime: 'nodejs:18' inputs: LOG_LEVEL: debug annotations: diff --git a/admin-ui-sdk/product/custom-grid-columns/web-src/src/components/ExtensionRegistration.js b/admin-ui-sdk/product/custom-grid-columns/web-src/src/components/ExtensionRegistration.js index fed89ff..7e98b4d 100644 --- a/admin-ui-sdk/product/custom-grid-columns/web-src/src/components/ExtensionRegistration.js +++ b/admin-ui-sdk/product/custom-grid-columns/web-src/src/components/ExtensionRegistration.js @@ -22,24 +22,6 @@ const init = async () => { await register({ id: extensionId, methods: { - product: { - getGridColumns() { - return { - data: { - meshId: '', - apiKey: '' - }, - properties: [ - { - label: 'First Column', - columnId: 'first_column', - type: 'string', - align: 'left' - } - ] - } - } - } } }) } diff --git a/admin-ui-sdk/product/custom-mass-action/actions/registration/index.js b/admin-ui-sdk/product/custom-mass-action/actions/registration/index.js new file mode 100644 index 0000000..297c495 --- /dev/null +++ b/admin-ui-sdk/product/custom-mass-action/actions/registration/index.js @@ -0,0 +1,44 @@ +/* +Copyright 2024 Adobe. All rights reserved. +This file is licensed to you under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. You may obtain a copy +of the License at http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software distributed under +the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS +OF ANY KIND, either express or implied. See the License for the specific language +governing permissions and limitations under the License. +*/ + +async function main() { + const extensionId = 'product-custom-mass-action' + + return { + statusCode: 200, + body: { + registration: { + product: { + massActions: [ + { + actionId: `${extensionId}::product-mass-action`, + label: 'Product Mass Action', + confirm: { + title: 'Mass Action', + message: 'Are you sure your want to proceed with Mass Action on selected products?' + }, + path: '#/mass-action', + productSelectLimit: 1 + }, + { + actionId: `${extensionId}::mass-action-with-redirect`, + label: 'Mass Action With Redirect', + path: '#/mass-action-with-redirect' + } + ] + } + } + } + } +} + +exports.main = main diff --git a/admin-ui-sdk/product/custom-mass-action/app.config.yaml b/admin-ui-sdk/product/custom-mass-action/app.config.yaml index bb32609..44f9ddc 100644 --- a/admin-ui-sdk/product/custom-mass-action/app.config.yaml +++ b/admin-ui-sdk/product/custom-mass-action/app.config.yaml @@ -7,5 +7,15 @@ extensions: web: web-src runtimeManifest: packages: - CustomMassAction: + admin-ui-sdk: license: Apache-2.0 + actions: + registration: + function: actions/registration/index.js + web: 'yes' + runtime: 'nodejs:18' + inputs: + LOG_LEVEL: debug + annotations: + require-adobe-auth: false + final: true diff --git a/admin-ui-sdk/product/custom-mass-action/web-src/src/components/ExtensionRegistration.js b/admin-ui-sdk/product/custom-mass-action/web-src/src/components/ExtensionRegistration.js index 5f271aa..b641996 100644 --- a/admin-ui-sdk/product/custom-mass-action/web-src/src/components/ExtensionRegistration.js +++ b/admin-ui-sdk/product/custom-mass-action/web-src/src/components/ExtensionRegistration.js @@ -22,29 +22,6 @@ const init = async () => { await register({ id: extensionId, methods: { - product: { - getMassActions() { - return [ - { - actionId: `${extensionId}::product-mass-action`, - label: 'Product Mass Action', - type: `${extensionId}.product-mass-action`, - confirm: { - title: 'Mass Action', - message: 'Are you sure your want to proceed with Mass Action on selected products?' - }, - path: '#/mass-action', - productSelectLimit: 1 - }, - { - actionId: `${extensionId}::mass-action-with-redirect`, - label: 'Mass Action With Redirect', - type: `${extensionId}.mass-action-with-redirect`, - path: '#/mass-action-with-redirect' - } - ] - } - } } }) }