Ethsim2
(Ethan )
26 أغسطس 2026، 6:46م
35
@j.jaffeux متابعةً لسؤال أعلاه، قمت بفتح طلب سحب (PR) يضيف إجراء «حدث» إلى سير العمل:
main ← Ethsim12:workflow-event-close
opened 06:39PM - 26 Aug 26 UTC
## What does this change?
Adds an `Event` action to Discourse Workflows, allo… wing a workflow to:
- Close an event
- Open an event
The action accepts a topic ID and optional actor. The event is resolved from the
topic's first post, consistent with the Events plugin's existing requirement that
an event belongs to the first post.
Rather than updating the event record directly, the action updates the `[event]`
block in the post raw using the normal workflow post-editing path. This allows the
existing Events post-edit synchronization to update the persisted event state.
Edits use the workflow execution context's `edit_post`, which applies the actor's
normal post-edit permissions and uses `skip_workflows: true` to avoid recursively
triggering workflows from the event state change.
The action is idempotent when the event is already in the requested state.
## Example
A `Post created` trigger can use:
- Action: `Event` → `Close event`
- Topic ID: `Input → topic.id`
- Performed by user: System user
This allows, for example, a reply to an event topic to automatically close the
event without closing the topic itself.
## Testing
- RuboCop: no offenses
- Syntax Tree: all files match expected format
- New Event workflow specs after final rebase: 8 examples, 0 failures
- Full `discourse-events` suite before final formatting/rebase: 1124 examples, 0 failures
- Manual browser test confirmed:
- `Post created` → `Event / Close event`
- dynamic `topic.id`
- System user actor
- replying to the topic immediately changed the event to `Closed`
- the topic itself remained open
- the change appeared live without a page refresh
- workflow execution completed successfully
## Screenshots
### Event workflow actions
<img width="1920" height="965" alt="workflow_screen_with_events_menu" src="https://github.com/user-attachments/assets/d283e9e6-e1db-4f5e-8cf9-3ed5c31f55fc" />
### Configuring the Event action with the triggering topic
<img width="1921" height="1003" alt="configuring_events_step" src="https://github.com/user-attachments/assets/725e28ca-f8f2-45f3-b124-4c3310c69eb9" />
### Event automatically closed after the workflow runs
<img width="1920" height="1000" alt="event_topic_after_auto_close" src="https://github.com/user-attachments/assets/a66138ad-bbaa-498a-9d87-2bd1eef9e495" />
يضيف هذا الطلب:
حدث → إغلاق الحدث
حدث → فتح الحدث
يستقبل الإجراء معرّف الموضوع (topic ID)، ويستخرج الحدث من منشور الموضوع الأول، ثم يحدّث الحدث عبر مسار مزامنة تعديل المنشور/الحدث المعتاد.
قمت باختبار الاتجاه الأصلي لاستخدام الحالة مع:
إنشاء منشور → حدث / إغلاق الحدث
باستخدام Input → topic.id.
عند الرد على موضوع الحدث، يُغلق الحدث بينما يبقى الموضوع نفسه مفتوحًا، ويظهر التغيير مباشرةً في واجهة المستخدم.
يتضمن طلب السحب تغطية لاختبارات الوحدة/التكامل، وقد نجح اختبار discourse-events الكامل مع 1124 مثالًا / 0 إخفاقات.
يُعالج هذا الجانب المتعلق بإجراء الحدث من حالة الاستخدام التي أشرتُ إليها أعلاه. يمكن بعد ذلك معالجة شروط المستخدم/الفئة/أصل البريد الإلكتروني بشكل منفصل من خلال محفّز/شروط سير العمل.
إعجابَين (2)