@adminforth/foreign-inline-list
Advanced tools
Comparing version 1.0.16 to 1.0.17
@@ -16,3 +16,8 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { | ||
} | ||
instanceUniqueRepresentation(pluginOptions) { | ||
console.log('💥💥💥💥 ForeignInlineListPlugin.instanceUniqueRepresentation', pluginOptions); | ||
return `${pluginOptions.foreignResourceId}`; | ||
} | ||
setupEndpoints(server) { | ||
process.env.HEAVY_DEBUG && console.log(`🪲 ForeignInlineListPlugin.setupEndpoints, registering: '/plugin/${this.pluginInstanceId}/get_resource'`); | ||
server.endpoint({ | ||
@@ -36,22 +41,27 @@ method: 'POST', | ||
modifyResourceConfig(adminforth, resourceConfig) { | ||
super.modifyResourceConfig(adminforth, resourceConfig); | ||
this.adminforth = adminforth; | ||
// get resource with foreignResourceId | ||
this.foreignResource = adminforth.config.resources.find((resource) => resource.resourceId === this.options.foreignResourceId); | ||
if (!this.foreignResource) { | ||
throw new Error(`ForeignInlineListPlugin: Resource with ID "${this.options.foreignResourceId}" not found`); | ||
} | ||
resourceConfig.columns.push({ | ||
name: `foreignInlineList_${this.foreignResource.resourceId}`, | ||
label: 'Foreign Inline List', | ||
virtual: true, | ||
showIn: [AdminForthResourcePages.show], | ||
components: { | ||
showRow: { | ||
file: this.componentPath('InlineList.vue'), | ||
meta: Object.assign(Object.assign({}, this.options), { pluginInstanceId: this.pluginInstanceId }) | ||
} | ||
}, | ||
const _super = Object.create(null, { | ||
modifyResourceConfig: { get: () => super.modifyResourceConfig } | ||
}); | ||
return __awaiter(this, void 0, void 0, function* () { | ||
_super.modifyResourceConfig.call(this, adminforth, resourceConfig); | ||
this.adminforth = adminforth; | ||
// get resource with foreignResourceId | ||
this.foreignResource = adminforth.config.resources.find((resource) => resource.resourceId === this.options.foreignResourceId); | ||
if (!this.foreignResource) { | ||
throw new Error(`ForeignInlineListPlugin: Resource with ID "${this.options.foreignResourceId}" not found`); | ||
} | ||
resourceConfig.columns.push({ | ||
name: `foreignInlineList_${this.foreignResource.resourceId}`, | ||
label: 'Foreign Inline List', | ||
virtual: true, | ||
showIn: [AdminForthResourcePages.show], | ||
components: { | ||
showRow: { | ||
file: this.componentPath('InlineList.vue'), | ||
meta: Object.assign(Object.assign({}, this.options), { pluginInstanceId: this.pluginInstanceId }) | ||
} | ||
}, | ||
}); | ||
}); | ||
} | ||
} |
{ | ||
"name": "@adminforth/foreign-inline-list", | ||
"version": "1.0.16", | ||
"version": "1.0.17", | ||
"description": "AdminForth plugin for adding list of children items to the parent item show page", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 1 instance in 1 package
44011
11
410
2