import SpacedUpdate from "../../../services/spaced_update.js"; import AbstractBulkAction from "../abstract_bulk_action.js"; import { t } from "../../../services/i18n.js"; const TPL = ` ${t("delete_relation.delete_relation")}
`; export default class DeleteRelationBulkAction extends AbstractBulkAction { static get actionName() { return "deleteRelation"; } static get actionTitle() { return t("delete_relation.delete_relation"); } doRender() { const $action = $(TPL); const $relationName = $action.find(".relation-name"); $relationName.val(this.actionDef.relationName || ""); const spacedUpdate = new SpacedUpdate(async () => { await this.saveAction({ relationName: $relationName.val() }); }, 1000); $relationName.on("input", () => spacedUpdate.scheduleUpdate()); return $action; } }