omppatil
(Om Patil)
9 يناير 2024، 1:37م
1
مرحباً!،
كيف يمكننا إضافة زر إلى نافذة قائمة انتظار مراجعة المنشورات والمواضيع وإجراءات المراجعة لهذا الزر في إضافة Discourse؟ أقدر أي مساعدة في إضافة زر إلى نافذة قائمة انتظار مراجعة المنشورات والمواضيع وتنفيذ إجراءاته في الإضافة.
إعجاب واحد (1)
هناك واجهة برمجة تطبيقات (API) لإضافة إجراءات ونماذج إلى العناصر القابلة للمراجعة هنا:
/**
* Adds additional params to be sent to the reviewable/:id/perform/:action
* endpoint for a given reviewable type. This is so plugins can provide more
* complex reviewable actions that may depend on a custom modal.
*
* This is copied from the reviewable model instance when performing an action
* on the ReviewableItem component.
*
* ```
* api.addPluginReviewableParam("ReviewablePluginType", "some_param");
* ```
**/
addPluginReviewableParam(reviewableType, param) {
addPluginReviewableParam(reviewableType, param);
}
/**
* Registers a mapping between a JavaScript modal component class and a server-side reviewable
* action, which is registered via `actions.add` and `build_actions`.
*
This file has been truncated. show original
تُستخدم هذه في إضافة خبراء الفئات، إذا كنت تبحث عن مثال:
allowingCategoryExpertEndorsements: and(
"custom_fields.category_expert_group_ids",
"custom_fields.category_accepting_endorsements"
),
allowingCategoryExpertQuestions: and(
"custom_fields.category_expert_group_ids",
"custom_fields.category_accepting_questions"
),
});
api.addPluginReviewableParam(
"ReviewableCategoryExpertSuggestion",
"group_id"
);
api.registerReviewableActionModal(
"approve_category_expert",
ExpertGroupChooserModal
);
});
},
3 إعجابات
omppatil
(Om Patil)
11 يناير 2024، 4:42ص
3
إذًا، أي من هذه الدوال تُستخدم لإضافة زر إلى نافذة الموافقة على قائمة المراجعة: addPluginReviewableParam أم registerReviewableActionModal؟ يرجى إرشادي خلال ذلك.