Skip to content

Commit

Permalink
Admin UI SDK - 2.0.0 release compatibility (#24)
Browse files Browse the repository at this point in the history
  • Loading branch information
asalloum5 authored Sep 9, 2024
1 parent 693a210 commit 6636d6f
Show file tree
Hide file tree
Showing 44 changed files with 644 additions and 279 deletions.
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
Expand Up @@ -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
Original file line number Diff line number Diff line change
@@ -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"
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -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'
}
]
}
}
}
}
})
}
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
Expand Up @@ -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

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -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'
}
]
}
}
}
}
)}
Original file line number Diff line number Diff line change
@@ -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
14 changes: 13 additions & 1 deletion admin-ui-sdk/customer/custom-grid-columns/app.config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
4 changes: 2 additions & 2 deletions admin-ui-sdk/customer/custom-grid-columns/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion admin-ui-sdk/customer/custom-grid-columns/package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "customer-custom-mass-action",
"name": "customer-custom-grid-columns",
"version": "1.0.0",
"private": true,
"dependencies": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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'
}
]
}
}
}
}
})
}
Original file line number Diff line number Diff line change
@@ -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
Loading

0 comments on commit 6636d6f

Please sign in to comment.