Some checks failed
Build & Deploy / 🔍 Prepare (push) Successful in 20s
Build & Deploy / 🧪 QA (push) Failing after 34s
Build & Deploy / 🏗️ Build (push) Has started running
Build & Deploy / 🚀 Deploy (push) Has been cancelled
Build & Deploy / 🧪 Smoke Test (push) Has been cancelled
Build & Deploy / ⚡ Lighthouse (push) Has been cancelled
Build & Deploy / 🔔 Notify (push) Has been cancelled
27 lines
697 B
Plaintext
27 lines
697 B
Plaintext
export function getViewActions({
|
|
editConfig,
|
|
viewKey
|
|
}) {
|
|
if (editConfig && viewKey in editConfig && 'actions' in editConfig[viewKey]) {
|
|
return editConfig[viewKey].actions ?? [];
|
|
}
|
|
return [];
|
|
}
|
|
export function getSubViewActions({
|
|
collectionOrGlobal,
|
|
viewKeyArg
|
|
}) {
|
|
if (collectionOrGlobal?.admin?.components?.views?.edit) {
|
|
let viewKey = viewKeyArg || 'default';
|
|
if ('root' in collectionOrGlobal.admin.components.views.edit) {
|
|
viewKey = 'root';
|
|
}
|
|
const actions = getViewActions({
|
|
editConfig: collectionOrGlobal.admin?.components?.views?.edit,
|
|
viewKey
|
|
});
|
|
return actions;
|
|
}
|
|
return [];
|
|
}
|
|
//# sourceMappingURL=attachViewActions.js.map |