Skip to content

A platform for community discussion. Free, open, simple.

DEV: Move discourse-assign to core (#33570)

Jarek Radosz310f4e9c2db1
diff --git a/.github/labeler.yml b/.github/labeler.yml
index 54e520d37e6..c69ee474443 100644
--- a/.github/labeler.yml
+++ b/.github/labeler.yml
@@ -90,6 +90,10 @@ discourse-user-notes:
- changed-files:
- any-glob-to-any-file: plugins/discourse-user-notes/**/*
+discourse-assign:
+ - changed-files:
+ - any-glob-to-any-file: plugins/discourse-assign/**/*
+
footnote:
- changed-files:
- any-glob-to-any-file: plugins/footnote/**/*
diff --git a/.gitignore b/.gitignore
index 7342871b1cb..448a631a8d8 100644
--- a/.gitignore
+++ b/.gitignore
@@ -65,6 +65,7 @@
!/plugins/discourse-data-explorer
!/plugins/discourse-post-voting
!/plugins/discourse-user-notes
+!/plugins/discourse-assign
/plugins/*/auto_generated
/spec/fixtures/plugins/my_plugin/auto_generated
diff --git a/plugins/discourse-assign/README.md b/plugins/discourse-assign/README.md
new file mode 100644
index 00000000000..c8ff8be22df
--- /dev/null
+++ b/plugins/discourse-assign/README.md
@@ -0,0 +1,5 @@
+# Assign Plugin
+
+Allows you to assign topics and individual posts (both private and public) to a user or group.
+
+For more information, please see: https://meta.discourse.org/t/discourse-assign/58044
diff --git a/plugins/discourse-assign/app/controllers/discourse_assign/assign_controller.rb b/plugins/discourse-assign/app/controllers/discourse_assign/assign_controller.rb
new file mode 100644
index 00000000000..31a776b3fed
--- /dev/null
+++ b/plugins/discourse-assign/app/controllers/discourse_assign/assign_controller.rb
@@ -0,0 +1,258 @@
+# frozen_string_literal: true
+
+module DiscourseAssign
+ class AssignController < ApplicationController
+ requires_plugin DiscourseAssign::PLUGIN_NAME
+ requires_login
+ before_action :ensure_logged_in, :ensure_assign_allowed
+
+ def suggestions
+ users = [current_user, *recent_assignees]
+ render json: {
+ assign_allowed_on_groups:
+ Group.visible_groups(current_user).assign_allowed_groups.pluck(:name),
+ assign_allowed_for_groups:
+ Group.visible_groups(current_user).assignable(current_user).pluck(:name),
+ suggestions:
+ ActiveModel::ArraySerializer.new(
+ users,
+ scope: guardian,
+ each_serializer: FoundUserSerializer,
+ include_status: true,
+ ),
+ }
+ end
+
+ def unassign
+ target_id = params.require(:target_id)
+ target_type = params.require(:target_type)
+ raise Discourse::NotFound if !Assignment.valid_type?(target_type)
+ target = target_type.constantize.where(id: target_id).first
+ raise Discourse::NotFound unless target
+
+ assigner = Assigner.new(target, current_user)
+ assigner.unassign
+
+ render json: success_json
+ end
+
+ def assign
+ target_id = params.require(:target_id)
+ target_type = params.require(:target_type)
+ username = params.permit(:username)["username"]
+ group_name = params.permit(:group_name)["group_name"]
+ note = params.permit(:note)["note"].presence
+ status = params.permit(:status)["status"].presence
+ should_notify = params.permit(:should_notify)["should_notify"]
+ should_notify = (should_notify.present? ? should_notify.to_s == "true" : true)
+
+ assign_to =
+ (
+ if username.present?
+ User.find_by(username_lower: username.downcase)
+ else
+ Group.where("LOWER(name) = ?", group_name.downcase).first
+ end
+ )
+
+ raise Discourse::NotFound unless assign_to
+ raise Discourse::NotFound if !Assignment.valid_type?(target_type)
+ target = target_type.constantize.where(id: target_id).first
+ raise Discourse::NotFound unless target
+
+ assign =
+ Assigner.new(target, current_user).assign(
+ assign_to,
+ note: note,
+ status: status,
+ should_notify: should_notify,
+ )
+
+ if assign[:success]
+ render json: success_json
+ else
+ render json: translate_failure(assign[:reason], assign_to), status: 400
+ end
+ end
+
+ def assigned
+ raise Discourse::InvalidAccess unless current_user&.admin?
+
+ offset = (params[:offset] || 0).to_i
+ limit = (params[:limit] || 100).to_i
+
+ topics =
+ Topic
+ .includes(:tags)
+ .includes(:user)
+ .joins(
+ "JOIN assignments a ON a.target_id = topics.id AND a.target_type = 'Topic' AND a.assigned_to_id IS NOT NULL",
+ )
+ .order("a.assigned_to_id, topics.bumped_at desc")
+ .offset(offset)
+ .limit(limit)
+
+ Topic.preload_custom_fields(topics, TopicList.preloaded_custom_fields)
+
+ topic_assignments =
+ Assignment
+ .where(target_id: topics.map(&:id), target_type: "Topic", active: true)
+ .pluck(:target_id, :assigned_to_id)
+ .to_h
+
+ users =
+ User
+ .where("users.id IN (?)", topic_assignments.values.uniq)
+ .joins("join user_emails on user_emails.user_id = users.id AND user_emails.primary")
+ .select(UserLookup.lookup_columns)
+ .to_a
+
+ User.preload_custom_fields(users, User.allowed_user_custom_fields(guardian))
+
+ users_map = users.index_by(&:id)
+
+ topics.each do |topic|
+ user_id = topic_assignments[topic.id]
+ topic.preload_assigned_to(users_map[user_id]) if user_id
+ end
+
+ render json: { topics: serialize_data(topics, AssignedTopicSerializer) }
+ end
+
+ def group_members
+ limit = (params[:limit] || 50).to_i
+ offset = params[:offset].to_i
+
+ raise Discourse::InvalidParameters.new(:limit) if limit < 0 || limit > 1000
+ raise Discourse::InvalidParameters.new(:offset) if offset < 0
+ raise Discourse::NotFound.new if !params[:group_name].present?
+
+ group = Group.find_by(name: params[:group_name])
+
+ guardian.ensure_can_see_group_members!(group)
+
+ users_with_assignments_count =
+ User
+ .joins("LEFT OUTER JOIN group_users g ON g.user_id = users.id")
+ .joins(
+ "LEFT OUTER JOIN assignments a ON a.assigned_to_id = users.id AND a.assigned_to_type = 'User'",
+ )
+ .joins("LEFT OUTER JOIN topics t ON t.id = a.target_id AND a.target_type = 'Topic'")
+ .where("g.group_id = ? AND users.id > 0 AND t.deleted_at IS NULL", group.id)
+ .where("a.assigned_to_id IS NOT NULL AND a.active")
+ .order("COUNT(users.id) DESC")
+ .group("users.id")
+ .select('users.*, COUNT(users.id) as "assignments_count"')
+ .limit(limit)
+ .offset(offset)
+
+ users_with_assignments_count =
+ users_with_assignments_count.where(<<~SQL, pattern: "%#{params[:filter]}%") if params[
+ users.name ILIKE :pattern OR users.username_lower ILIKE :pattern
+ SQL
+ :filter
+ ]
+ group_assignments_count = Assignment.active_for_group(group).count
+ users_assignments_count =
+ users_with_assignments_count.reduce(0) do |sum, assignment|
+ sum + assignment.assignments_count
+ end
+
+ render json: {
+ members: serialize_data(users_with_assignments_count, GroupUserAssignedSerializer),
+ assignment_count: users_assignments_count + group_assignments_count,
+ group_assignment_count: group_assignments_count,
+ }
+ end
+
+ private
+
+ def translate_failure(reason, assign_to)
+ case reason
+ when :already_assigned
+ { error: I18n.t("discourse_assign.already_assigned", username: assign_to.username) }
+ when :forbidden_assign_to
+ { error: I18n.t("discourse_assign.forbidden_assign_to", username: assign_to.username) }
+ when :forbidden_assignee_not_pm_participant
+ {
+ error:
+ I18n.t(
+ "discourse_assign.forbidden_assignee_not_pm_participant",
+ username: assign_to.username,
+ ),
+ }
+ when :forbidden_assignee_cant_see_topic
+ {
+ error:
+ I18n.t(
+ "discourse_assign.forbidden_assignee_cant_see_topic",
+ username: assign_to.username,
+ ),
+ }
+ when :group_already_assigned
+ { error: I18n.t("discourse_assign.group_already_assigned", group: assign_to.name) }
+ when :forbidden_group_assign_to
+ { error: I18n.t("discourse_assign.forbidden_group_assign_to", group: assign_to.name) }
+ when :forbidden_group_assignee_not_pm_participant
+ {
+ error:
+ I18n.t(
+ "discourse_assign.forbidden_group_assignee_not_pm_participant",
+ group: assign_to.name,
+ ),
+ }
+ when :forbidden_group_assignee_cant_see_topic
+ {
+ error:
+ I18n.t(
+ "discourse_assign.forbidden_group_assignee_cant_see_topic",
+ group: assign_to.name,
+ ),
+ }
+ when :too_many_assigns_for_topic
+ {
+ error:
+ I18n.t(
+ "discourse_assign.too_many_assigns_for_topic",
+ limit: Assigner::ASSIGNMENTS_PER_TOPIC_LIMIT,
+ ),
+ }
+ else
+ max = SiteSetting.max_assigned_topics
+ {
+ error:
+ I18n.t("discourse_assign.too_many_assigns", username: assign_to.username, max: max),
+ }
+ end
+ end
+
+ def ensure_assign_allowed
+ raise Discourse::InvalidAccess.new unless current_user.can_assign?
+ end
+
+ def recent_assignees
+ User
+ .where("users.id <> ?", current_user.id)
+ .joins(<<~SQL)
+ JOIN(
+ SELECT assigned_to_id user_id, MAX(created_at) last_assigned
+ FROM assignments
+ WHERE assignments.assigned_to_type = 'User'
+ GROUP BY assigned_to_id
+ HAVING COUNT(*) < #{SiteSetting.max_assigned_topics}
+ ) as X ON X.user_id = users.id
+ SQL
+ .joins(<<~SQL)
+ LEFT JOIN(
+ SELECT DISTINCT ON (user_id) name, user_id
+ FROM user_custom_fields
+ WHERE name = '#{DiscourseCalendar::HOLIDAY_CUSTOM_FIELD}'
+ ) AS ucf on ucf.user_id = users.id
+ SQL
+ .where("ucf.name is NULL")
+ .assign_allowed
+ .order("X.last_assigned DESC")
+ .limit(5)
+ end
+ end
+end
diff --git a/plugins/discourse-assign/app/jobs/regular/assign_notification.rb b/plugins/discourse-assign/app/jobs/regular/assign_notification.rb
new file mode 100644
index 00000000000..8f0eed9df6a
--- /dev/null
+++ b/plugins/discourse-assign/app/jobs/regular/assign_notification.rb
@@ -0,0 +1,12 @@
+# frozen_string_literal: true
+
+module Jobs
+ class AssignNotification < ::Jobs::Base
+ def execute(args)
+ raise Discourse::InvalidParameters.new(:assignment_id) if args[:assignment_id].nil?
+ return if SilencedAssignment.exists?(assignment_id: args[:assignment_id])
+
+ Assignment.find(args[:assignment_id]).create_missing_notifications!
+ end
+ end
+end
diff --git a/plugins/discourse-assign/app/jobs/regular/remind_user.rb b/plugins/discourse-assign/app/jobs/regular/remind_user.rb
new file mode 100644
index 00000000000..e8c4b6cc674
--- /dev/null
+++ b/plugins/discourse-assign/app/jobs/regular/remind_user.rb
@@ -0,0 +1,14 @@
+# frozen_string_literal: true
+
+module Jobs
+ class RemindUser < ::Jobs::Base
+ sidekiq_options queue: "low"
+
+ def execute(args)
+ user = User.find_by(id: args[:user_id])
+ raise Discourse::InvalidParameters.new(:user_id) if user.nil?
+
+ PendingAssignsReminder.new.remind(user)
+ end
+ end
+end
diff --git a/plugins/discourse-assign/app/jobs/regular/unassign_notification.rb b/plugins/discourse-assign/app/jobs/regular/unassign_notification.rb
new file mode 100644
index 00000000000..6db3f140b28
--- /dev/null
+++ b/plugins/discourse-assign/app/jobs/regular/unassign_notification.rb
@@ -0,0 +1,20 @@
+# frozen_string_literal: true
+
+module Jobs
+ class UnassignNotification < ::Jobs::Base
+ def execute(args)
+ %i[topic_id assigned_to_id assigned_to_type assignment_id].each do |argument|
+ raise Discourse::InvalidParameters.new(argument) if args[argument].nil?
+ end
+
+ assignment = Assignment.new(args.slice(:topic_id, :assigned_to_id, :assigned_to_type))
+ assignment.assigned_users.each do |user|
+ Assigner.publish_topic_tracking_state(assignment.topic, user.id)
+ end
+ Notification
+ .for_assignment(args[:assignment_id])
+ .where(user: assignment.assigned_users, topic: assignment.topic)
+ .destroy_all
+ end
+ end
+end
diff --git a/plugins/discourse-assign/app/jobs/scheduled/enqueue_reminders.rb b/plugins/discourse-assign/app/jobs/scheduled/enqueue_reminders.rb
new file mode 100644
index 00000000000..186ca542751
--- /dev/null
+++ b/plugins/discourse-assign/app/jobs/scheduled/enqueue_reminders.rb
@@ -0,0 +1,65 @@
+# frozen_string_literal: true
+
+module Jobs
+ class EnqueueReminders < ::Jobs::Scheduled
+ REMINDER_BUFFER_MINUTES = 120
+
+ every 1.day
+
+ def execute(_args)
+ return if skip_enqueue?
+ user_ids.each { |id| Jobs.enqueue(:remind_user, user_id: id) }
+ end
+
+ private
+
+ def skip_enqueue?
+ SiteSetting.remind_assigns_frequency.nil? || !SiteSetting.assign_enabled? ||
+ SiteSetting.assign_allowed_on_groups.blank?
+ end
+
+ def allowed_group_ids
+ Group.assign_allowed_groups.pluck(:id).join(",")
+ end
+
+ def reminder_threshold
+ @reminder_threshold ||= SiteSetting.pending_assign_reminder_threshold
+ end
+
+ def user_ids
+ global_frequency = SiteSetting.remind_assigns_frequency
+ frequency =
+ ActiveRecord::Base.sanitize_sql(
+ "COALESCE(user_frequency.value, '#{global_frequency}')::INT",
+ )
+
+ DB.query_single(<<~SQL)
+ SELECT assignments.assigned_to_id
+ FROM assignments
+
+ LEFT OUTER JOIN user_custom_fields AS last_reminder
+ ON assignments.assigned_to_id = last_reminder.user_id
+ AND last_reminder.name = '#{PendingAssignsReminder::REMINDED_AT}'
+
+ LEFT OUTER JOIN user_custom_fields AS user_frequency
+ ON assignments.assigned_to_id = user_frequency.user_id
+ AND user_frequency.name = '#{PendingAssignsReminder::REMINDERS_FREQUENCY}'
+
+ INNER JOIN group_users ON assignments.assigned_to_id = group_users.user_id
+ INNER JOIN topics ON topics.id = assignments.target_id AND assignments.target_type = 'Topic' AND topics.deleted_at IS NULL
+
+ WHERE group_users.group_id IN (#{allowed_group_ids})
+ AND #{frequency} > 0
+ AND (
+ last_reminder.value IS NULL OR
+ last_reminder.value::TIMESTAMP <= CURRENT_TIMESTAMP - ('1 MINUTE'::INTERVAL * #{frequency}) + ('1 MINUTE'::INTERVAL * #{REMINDER_BUFFER_MINUTES})
+ )
+ AND assignments.updated_at::TIMESTAMP <= CURRENT_TIMESTAMP - ('1 MINUTE'::INTERVAL * #{frequency})
+ AND assignments.assigned_to_type = 'User'
+
+ GROUP BY assignments.assigned_to_id
+ HAVING COUNT(assignments.assigned_to_id) >= #{reminder_threshold}
+ SQL
+ end
+ end
+end
diff --git a/plugins/discourse-assign/app/mailers/assign_mailer.rb b/plugins/discourse-assign/app/mailers/assign_mailer.rb
new file mode 100644
index 00000000000..82ab16b8c86
--- /dev/null
+++ b/plugins/discourse-assign/app/mailers/assign_mailer.rb
@@ -0,0 +1,22 @@
+# frozen_string_literal: true
+
+require_dependency "email/message_builder"
+
+class AssignMailer < ActionMailer::Base
+ include Email::BuildEmailHelper
+
+ def self.levels
+ @levels ||= Enum.new(never: "never", different_users: "different_users", always: "always")
+ end
+
+ def send_assignment(to_address, topic, assigned_by)
+ opts = {
+ template: "assign_mailer",
+ topic_title: topic.title,
+ assignee_name: assigned_by.username,
+ topic_excerpt: topic.excerpt,
+ topic_link: topic.url,
+ }
+ build_email(to_address, opts)
+ end
+end
diff --git a/plugins/discourse-assign/app/models/assign_mailer_site_settings.rb b/plugins/discourse-assign/app/models/assign_mailer_site_settings.rb
new file mode 100644
index 00000000000..78f751e08c7
--- /dev/null
+++ b/plugins/discourse-assign/app/models/assign_mailer_site_settings.rb
@@ -0,0 +1,24 @@
+# frozen_string_literal: true
+
+require_dependency "enum_site_setting"
+
+class AssignMailerSiteSettings < EnumSiteSetting
+ def self.valid_value?(val)
+ values.any? { |v| v[:value].to_s == val.to_s }
+ end
+
+ def self.values
+ @values ||= [
+ { name: "discourse_assign.assign_mailer.never", value: AssignMailer.levels[:never] },
+ {
+ name: "discourse_assign.assign_mailer.different_users",
+ value: AssignMailer.levels[:different_users],
+ },
+ { name: "discourse_assign.assign_mailer.always", value: AssignMailer.levels[:always] },
+ ]
+ end
+
+ def self.translate_names?
+ true
+ end
+end
diff --git a/plugins/discourse-assign/app/models/assignment.rb b/plugins/discourse-assign/app/models/assignment.rb
new file mode 100644
index 00000000000..bf28baf34b5
--- /dev/null
+++ b/plugins/discourse-assign/app/models/assignment.rb
@@ -0,0 +1,134 @@
+# frozen_string_literal: true
+
+class Assignment < ActiveRecord::Base
+ VALID_TYPES = %w[topic post].freeze
+
+ belongs_to :topic
+ belongs_to :assigned_to, polymorphic: true
+ belongs_to :assigned_by_user, class_name: "User"
+ belongs_to :target, polymorphic: true
+
+ scope :joins_with_topics,
+ -> do
+ joins(
+ "INNER JOIN topics ON topics.id = assignments.target_id AND assignments.target_type = 'Topic' AND topics.deleted_at IS NULL",
+ )
+ end
+
+ scope :active_for_group, ->(group) { active.where(assigned_to: group) }
+ scope :active, -> { where(active: true) }
+ scope :inactive, -> { where(active: false) }
+
+ before_validation :default_status
+
+ validate :validate_status, if: -> { SiteSetting.enable_assign_status }
+
+ class << self
+ def valid_type?(type)
+ VALID_TYPES.include?(type.downcase)
+ end
+
+ def statuses
+ SiteSetting.assign_statuses.split("|")
+ end
+
+ def default_status
+ Assignment.statuses.first
+ end
+
+ def status_enabled?
+ SiteSetting.enable_assign_status
+ end
+
+ def deactivate!(topic:)
+ active.where(topic: topic).find_each(&:deactivate!)
+ end
+
+ def reactivate!(topic:)
+ inactive.where(topic: topic).find_each(&:reactivate!)
+ end
+ end
+
+ def assigned_to_user?
+ assigned_to.is_a?(User)
+ end
+
+ def assigned_to_group?
+ assigned_to.is_a?(Group)
+ end
+
+ def assigned_users
+ Array.wrap(assigned_to.try(:users) || assigned_to)
+ end
+
+ def post
+ return target.posts.find_by(post_number: 1) if target.is_a?(Topic)
+ target
+ end
+
+ def create_missing_notifications!
+ assigned_users.each do |user|
+ next if user.notifications.for_assignment(self).exists?
+ DiscourseAssign::CreateNotification.call(
+ assignment: self,
+ user: user,
+ mark_as_read: assigned_by_user == user,
+ )
+ end
+ end
+
+ def reactivate!
+ return unless target
+ update!(active: true)
+ Jobs.enqueue(:assign_notification, assignment_id: id)
+ end
+
+ def deactivate!
+ update!(active: false)
+ Jobs.enqueue(
+ :unassign_notification,
+ topic_id: topic_id,
+ assigned_to_id: assigned_to_id,
+ assigned_to_type: assigned_to_type,
+ assignment_id: id,
+ )
+ end
+
+ private
+
+ def default_status
+ self.status ||= Assignment.default_status if SiteSetting.enable_assign_status
+ end
+
+ def validate_status
+ if SiteSetting.enable_assign_status && !Assignment.statuses.include?(self.status)
+ errors.add(:status, :invalid)
+ end
+ end
+end
+
+# == Schema Information
+#
+# Table name: assignments
+#
+# id :bigint not null, primary key
+# topic_id :integer not null
+# assigned_to_id :integer not null
+# assigned_by_user_id :integer not null
+# created_at :datetime not null
+# updated_at :datetime not null
+# assigned_to_type :string not null
+# target_id :integer not null
+# target_type :string not null
+# active :boolean default(TRUE)
+# note :string
+# status :text
+#
+# Indexes
+#
+# index_assignments_on_active (active)
+# index_assignments_on_assigned_to_id_and_assigned_to_type (assigned_to_id,assigned_to_type)
+# index_assignments_on_target_id_and_target_type (target_id,target_type) UNIQUE
+# index_assignments_on_topic_id (topic_id)
+# unique_target_and_assigned (assigned_to_id,assigned_to_type,target_id,target_type) UNIQUE
+#
diff --git a/plugins/discourse-assign/app/models/remind_assigns_frequency_site_settings.rb b/plugins/discourse-assign/app/models/remind_assigns_frequency_site_settings.rb
new file mode 100644
index 00000000000..c806b8da47b
--- /dev/null
+++ b/plugins/discourse-assign/app/models/remind_assigns_frequency_site_settings.rb
@@ -0,0 +1,36 @@
+# frozen_string_literal: true
+
+require_dependency "enum_site_setting"
+
+class RemindAssignsFrequencySiteSettings < EnumSiteSetting
+ def self.valid_value?(val)
+ val.to_i.to_s == val.to_s && values.any? { |v| v[:value] == val.to_i }
+ end
+
+ DAILY_MINUTES = 24 * 60 * 1
+ WEEKLY_MINUTES = DAILY_MINUTES * 7
+ MONTHLY_MINUTES = DAILY_MINUTES * 30
+ QUARTERLY_MINUTES = DAILY_MINUTES * 90
+
+ def self.values
+ @values ||= [
+ { name: "discourse_assign.reminders_frequency.never", value: 0 },
+ { name: "discourse_assign.reminders_frequency.daily", value: DAILY_MINUTES },
+ { name: "discourse_assign.reminders_frequency.weekly", value: WEEKLY_MINUTES },
+ { name: "discourse_assign.reminders_frequency.monthly", value: MONTHLY_MINUTES },
+ { name: "discourse_assign.reminders_frequency.quarterly", value: QUARTERLY_MINUTES },
+ ]
+ end
+
+ def self.translate_names?
+ true
+ end
+
+ def self.frequency_for(minutes)
+ value = values.detect { |v| v[:value] == minutes }
+
+ raise Discourse.InvalidParameters(:task_reminders_frequency) if value.nil?
+
+ I18n.t(value[:name])
+ end
+end
diff --git a/plugins/discourse-assign/app/models/silenced_assignment.rb b/plugins/discourse-assign/app/models/silenced_assignment.rb
new file mode 100644
index 00000000000..5389d9fe895
--- /dev/null
+++ b/plugins/discourse-assign/app/models/silenced_assignment.rb
@@ -0,0 +1,19 @@
+# frozen_string_literal: true
+
+class SilencedAssignment < ActiveRecord::Base
+ belongs_to :assignment
+end
+
+# == Schema Information
+#
+# Table name: silenced_assignments
+#
+# id :bigint not null, primary key
+# assignment_id :bigint not null
+# created_at :datetime not null
+# updated_at :datetime not null
+#
+# Indexes
+#
+# index_silenced_assignments_on_assignment_id (assignment_id) UNIQUE
+#
diff --git a/plugins/discourse-assign/app/serializers/assigned_group_serializer.rb b/plugins/discourse-assign/app/serializers/assigned_group_serializer.rb
new file mode 100644
index 00000000000..c8779c879e2
--- /dev/null
+++ b/plugins/discourse-assign/app/serializers/assigned_group_serializer.rb
@@ -0,0 +1,5 @@
+# frozen_string_literal: true
+
+class AssignedGroupSerializer < ApplicationSerializer
+ attributes :id, :name
+end
diff --git a/plugins/discourse-assign/app/serializers/assigned_topic_serializer.rb b/plugins/discourse-assign/app/serializers/assigned_topic_serializer.rb
new file mode 100644
index 00000000000..20ceebbb2c0
--- /dev/null
+++ b/plugins/discourse-assign/app/serializers/assigned_topic_serializer.rb
@@ -0,0 +1,25 @@
+# frozen_string_literal: true
+
+class AssignedTopicSerializer < BasicTopicSerializer
+ include TopicTagsMixin
+
+ attributes :excerpt, :category_id, :created_at, :updated_at, :assigned_to_user, :assigned_to_group
+
+ has_one :user, serializer: BasicUserSerializer, embed: :objects
+
+ def assigned_to_user
+ BasicUserSerializer.new(object.assigned_to, scope: scope, root: false).as_json
+ end
+
+ def include_assigned_to_user?
+ object.assignment.assigned_to_user? && object.assignment.active
+ end
+
+ def assigned_to_group
+ BasicGroupSerializer.new(object.assigned_to, scope: scope, root: false).as_json
+ end
+
+ def include_assigned_to_group?
+ object.assignment.assigned_to_group? && object.assignment.active
+ end
+end
diff --git a/plugins/discourse-assign/app/serializers/group_user_assigned_serializer.rb b/plugins/discourse-assign/app/serializers/group_user_assigned_serializer.rb
new file mode 100644
index 00000000000..41c2e01b682
--- /dev/null
+++ b/plugins/discourse-assign/app/serializers/group_user_assigned_serializer.rb
@@ -0,0 +1,9 @@
+# frozen_string_literal: true
+
+class GroupUserAssignedSerializer < BasicUserSerializer
+ attributes :assignments_count, :username_lower
+
+ def include_assignments_count
+ object.can_assign?
+ end
+end
diff --git a/plugins/discourse-assign/assets/javascripts/discourse/assigned-group-route-map.js b/plugins/discourse-assign/assets/javascripts/discourse/assigned-group-route-map.js
new file mode 100644
index 00000000000..4b426b9cc45
--- /dev/null
+++ b/plugins/discourse-assign/assets/javascripts/discourse/assigned-group-route-map.js
@@ -0,0 +1,9 @@
+export default {
+ resource: "group",
+
+ map() {
+ this.route("assigned", function () {
+ this.route("show", { path: "/:filter" });
+ });
+ },
+};
diff --git a/plugins/discourse-assign/assets/javascripts/discourse/assigned-messages-route-map.js b/plugins/discourse-assign/assets/javascripts/discourse/assigned-messages-route-map.js
new file mode 100644
index 00000000000..3d465b07a38
--- /dev/null
+++ b/plugins/discourse-assign/assets/javascripts/discourse/assigned-messages-route-map.js
@@ -0,0 +1,9 @@
+export default {
+ resource: "user.userPrivateMessages",
+
+ map() {
+ this.route("assigned", function () {
+ this.route("index", { path: "/" });
+ });
+ },
+};
diff --git a/plugins/discourse-assign/assets/javascripts/discourse/assigns-activity-route-map.js b/plugins/discourse-assign/assets/javascripts/discourse/assigns-activity-route-map.js
new file mode 100644
index 00000000000..494c1473b85
--- /dev/null
+++ b/plugins/discourse-assign/assets/javascripts/discourse/assigns-activity-route-map.js
@@ -0,0 +1,7 @@
+export default {
+ resource: "user.userActivity",
+
+ map() {
+ this.route("assigned");
+ },
+};
diff --git a/plugins/discourse-assign/assets/javascripts/discourse/components/assign-actions-dropdown.js b/plugins/discourse-assign/assets/javascripts/discourse/components/assign-actions-dropdown.js
new file mode 100644
index 00000000000..13ed9f7b514
--- /dev/null
+++ b/plugins/discourse-assign/assets/javascripts/discourse/components/assign-actions-dropdown.js
@@ -0,0 +1,71 @@
+import { action } from "@ember/object";
+import { classNames } from "@ember-decorators/component";
+import { i18n } from "discourse-i18n";
+import DropdownSelectBoxComponent from "select-kit/components/dropdown-select-box";
+import { selectKitOptions } from "select-kit/components/select-kit";
+
+@selectKitOptions({
+ icon: null,
+ translatedNone: "...",
+ showFullTitle: true,
+})
+@classNames("assign-actions-dropdown")
+export default class AssignActionsDropdown extends DropdownSelectBoxComponent {
+ headerIcon = null;
+ allowInitialValueMutation = false;
+ showFullTitle = true;
+
+ computeContent() {
+ let options = [];
+ if (this.assignee) {
+ options = options.concat([
+ {
+ id: "unassign",
+ icon: this.group ? "group-times" : "user-xmark",
+ name: i18n("discourse_assign.unassign.title"),
+ description: i18n("discourse_assign.unassign.help", {
+ username: this.assignee,
+ }),
+ },
+ {
+ id: "reassign",
+ icon: "users",
+ name: i18n("discourse_assign.reassign.title"),
+ description: i18n("discourse_assign.reassign.help"),
+ },
+ ]);
+ }
+
+ if (this.topic.indirectly_assigned_to) {
+ Object.entries(this.topic.indirectly_assigned_to).forEach((entry) => {
+ const [postId, assignment_map] = entry;
+ const assignee = assignment_map.assigned_to;
+ options = options.concat({
+ id: `unassign_post_${postId}`,
+ icon: assignee.username ? "user-xmark" : "group-times",
+ name: i18n("discourse_assign.unassign_post.title"),
+ description: i18n("discourse_assign.unassign_post.help", {
+ username: assignee.username || assignee.name,
+ }),
+ });
+ });
+ }
+ return options;
+ }
+
+ @action
+ onChange(id) {
+ switch (id) {
+ case "unassign":
+ this.unassign(this.topic.id);
+ break;
+ case "reassign":
+ this.reassign(this.topic, this.assignee);
+ break;
+ }
+ const postId = id.match(/unassign_post_(\d+)/)?.[1];
+ if (postId) {
+ this.unassign(postId, "Post");
+ }
+ }
+}
diff --git a/plugins/discourse-assign/assets/javascripts/discourse/components/assign-button.gjs b/plugins/discourse-assign/assets/javascripts/discourse/components/assign-button.gjs
new file mode 100644
index 00000000000..87b7b4f9e22
--- /dev/null
+++ b/plugins/discourse-assign/assets/javascripts/discourse/components/assign-button.gjs
@@ -0,0 +1,59 @@
+import Component from "@glimmer/component";
+import { action } from "@ember/object";
+import { service } from "@ember/service";
+import DButton from "discourse/components/d-button";
+
+export default class AssignButton extends Component {
+ static shouldRender(args) {
+ return !args.post.firstPost;
+ }
+
+ static hidden(args) {
+ return args.post.assigned_to_user?.id !== args.state.currentUser.id;
+ }
+
+ @service taskActions;
+
+ get icon() {
+ return this.isAssigned ? "user-xmark" : "user-plus";
+ }
+
+ get isAssigned() {
+ return this.args.post.assigned_to_user || this.args.post.assigned_to_group;
+ }
+
+ get title() {
+ return this.isAssigned
+ ? "discourse_assign.unassign_post.title"
+ : "discourse_assign.assign_post.title";
+ }
+
+ @action
+ async acceptAnswer() {
+ if (this.isAssigned) {
+ const post = this.args.post;
+
+ await this.taskActions.unassign(post.id, "Post");
+ delete post.topic.indirectly_assigned_to[post.id];
+ } else {
+ this.taskActions.showAssignModal(this.args.post, {
+ isAssigned: false,
+ targetType: "Post",
+ });
+ }
+ }
+
+ <template>
+ <DButton
+ class={{if
+ this.isAssigned
+ "post-action-menu__unassign-post unassign-post"
+ "post-action-menu__assign-post assign-post"
+ }}
+ ...attributes
+ @action={{this.acceptAnswer}}
+ @icon={{this.icon}}
+ @title={{this.title}}
+ />
+ </template>
+}
diff --git a/plugins/discourse-assign/assets/javascripts/discourse/components/assign-user-form.gjs b/plugins/discourse-assign/assets/javascripts/discourse/components/assign-user-form.gjs
new file mode 100644
index 00000000000..f8ff6d78fc8
--- /dev/null
+++ b/plugins/discourse-assign/assets/javascripts/discourse/components/assign-user-form.gjs
@@ -0,0 +1,36 @@
+import Component from "@glimmer/component";
+import { tracked } from "@glimmer/tracking";
+import { action } from "@ember/object";
+import Assignment from "./assignment";
+
+export default class AssignUserForm extends Component {
+ @tracked showValidationErrors = false;
+
+ constructor() {
+ super(...arguments);
+
+ this.args.formApi.submit = this.assign;
+ }
+
+ get assigneeIsEmpty() {
+ return !this.args.model.username && !this.args.model.group_name;
+ }
+
+ @action
+ async assign() {
+ if (this.assigneeIsEmpty) {
+ this.showValidationErrors = true;
+ return;
+ }
+
+ await this.args.onSubmit();
+ }
+
+ <template>
+ <Assignment
+ @assignment={{@model}}
+ @onSubmit={{this.assign}}
+ @showValidationErrors={{this.showValidationErrors}}
+ />
+ </template>
+}
diff --git a/plugins/discourse-assign/assets/javascripts/discourse/components/assigned-to-first-post.gjs b/plugins/discourse-assign/assets/javascripts/discourse/components/assigned-to-first-post.gjs
new file mode 100644
index 00000000000..5a91ae2bb8c
--- /dev/null
+++ b/plugins/discourse-assign/assets/javascripts/discourse/components/assigned-to-first-post.gjs
@@ -0,0 +1,124 @@
+import Component from "@glimmer/component";
+import { service } from "@ember/service";
+import { htmlSafe } from "@ember/template";
+import icon from "discourse/helpers/d-icon";
+import { bind } from "discourse/lib/decorators";
+import { i18n } from "discourse-i18n";
+import { assignedToGroupPath, assignedToUserPath } from "../lib/url";
+
+export default class AssignedToFirstPost extends Component {
+ @service siteSettings;
+
+ get assignedToUser() {
+ return this.args.post?.topic?.assigned_to_user;
+ }
+
+ get assignedToGroup() {
+ return this.args.post?.topic?.assigned_to_group;
+ }
+
+ get icon() {
+ return this.assignedToUser ? "user-plus" : "group-plus";
+ }
+
+ get indirectlyAssignedTo() {
+ return this.args.post?.topic?.indirectly_assigned_to;
+ }
+
+ get indirectAssignments() {
+ if (!this.indirectlyAssignedTo) {
+ return null;
+ }
+
+ return Object.keys(this.indirectlyAssignedTo).map((postId) => {
+ const postNumber = this.indirectlyAssignedTo[postId].post_number;
+
+ return {
+ postId,
+ assignee: this.indirectlyAssignedTo[postId].assigned_to,
+ postNumber,
+ url: `${this.args.post.topic.url}/${postNumber}`,
+ };
+ });
+ }
+
+ get isAssigned() {
+ return !!(
+ this.assignedToUser ||
+ this.assignedToGroup ||
+ this.args.post?.topic?.indirectly_assigned_to
+ );
+ }
+
+ get hasOnlyIndirectAssignments() {
+ return !this.assignedToUser && !this.assignedToGroup;
+ }
+
+ @bind
+ prioritizedAssigneeName(assignee) {
+ // if this code is ever replaced to use `prioritize_username_in_ux`, remove this function and use the helper
+ // userPrioritizedName instead
+ return this.siteSettings.prioritize_full_name_in_ux || !assignee.username
+ ? assignee.name || assignee.username
+ : assignee.username;
+ }
+
+ <template>
+ {{#if this.isAssigned}}
+ <p class="assigned-to">
+ {{icon this.icon}}
+ {{#if this.assignedToUser}}
+ <span class="assignee">
+ <span class="assigned-to--user">
+ {{htmlSafe
+ (i18n
+ "discourse_assign.assigned_topic_to"
+ username=(this.prioritizedAssigneeName this.assignedToUser)
+ path=(assignedToUserPath this.assignedToUser)
+ )
+ }}
+ </span>
+ </span>
+ {{/if}}
+
+ {{#if this.assignedToGroup}}
+ <span class="assignee">
+ <span class="assigned-to--group">
+ {{htmlSafe
+ (i18n
+ "discourse_assign.assigned_topic_to"
+ username=this.assignedToGroup.name
+ path=(assignedToGroupPath this.assignedToGroup)
+ )
+ }}
+ </span>
+ </span>
+ {{/if}}
+
+ {{#if this.hasOnlyIndirectAssignments}}
+ <span class="assign-text">
+ {{i18n "discourse_assign.assigned"}}
+ </span>
+ {{/if}}
+ {{#if this.indirectlyAssignedTo}}
+ {{#each
+ this.indirectAssignments key="postId"
+ as |indirectAssignment|
+ }}
+ <span class="assignee">
+ <a href={{indirectAssignment.url}} class="assigned-indirectly">
+ {{i18n
+ "discourse_assign.assign_post_to_multiple"
+ post_number=indirectAssignment.postNumber
+ username=(this.prioritizedAssigneeName
+ indirectAssignment.assignee
+ )
+ }}
+ </a>
+ </span>
+ {{/each}}
+ {{/if}}
+ </p>
+ {{/if}}
+ </template>
+}
diff --git a/plugins/discourse-assign/assets/javascripts/discourse/components/assigned-to-post.gjs b/plugins/discourse-assign/assets/javascripts/discourse/components/assigned-to-post.gjs
new file mode 100644
index 00000000000..6c17144cb18
--- /dev/null
+++ b/plugins/discourse-assign/assets/javascripts/discourse/components/assigned-to-post.gjs
@@ -0,0 +1,77 @@
+import Component from "@glimmer/component";
+import { action } from "@ember/object";
+import { service } from "@ember/service";
+import DButton from "discourse/components/d-button";
+import DropdownMenu from "discourse/components/dropdown-menu";
+import icon from "discourse/helpers/d-icon";
+import { i18n } from "discourse-i18n";
+import DMenu from "float-kit/components/d-menu";
+
+export default class AssignedToPost extends Component {
+ @service taskActions;
+ @service siteSettings;
+
+ get nameOrUsername() {
+ if (this.siteSettings.prioritize_full_name_in_ux) {
+ return this.args.assignedToUser.name || this.args.assignedToUser.username;
+ } else {
+ return this.args.assignedToUser.username;
+ }
+ }
+
+ @action
+ unassign() {
+ this.taskActions.unassignPost(this.args.post);
+ }
+
+ @action
+ editAssignment() {
+ this.taskActions.showAssignPostModal(this.args.post);
+ }
+
+ <template>
+ {{#if @assignedToUser}}
+ {{icon "user-plus"}}
+ {{else}}
+ {{icon "group-plus"}}
+ {{/if}}
+
+ <span class="assign-text">
+ {{i18n "discourse_assign.assigned_to"}}
+ </span>
+
+ <a href={{@href}} class="assigned-to-username">
+ {{#if @assignedToUser}}
+ {{this.nameOrUsername}}
+ {{else}}
+ {{@assignedToGroup.name}}
+ {{/if}}
+ </a>
+
+ <DMenu
+ @identifier="post-assign-menu"
+ @icon="ellipsis"
+ class="btn-flat more-button"
+ @autofocus={{true}}
+ >
+ <DropdownMenu as |dropdown|>
+ <dropdown.item>
+ <DButton
+ @action={{this.unassign}}
+ @icon="user-plus"
+ @label="discourse_assign.unassign.title"
+ class="btn-transparent unassign-btn"
+ />
+ </dropdown.item>
+ <dropdown.item>
+ <DButton
+ @action={{this.editAssignment}}
+ @icon="group-plus"
+ @label="discourse_assign.reassign.title_w_ellipsis"
+ class="btn-transparent edit-assignment-btn"
+ />
+ </dropdown.item>
+ </DropdownMenu>
+ </DMenu>
+ </template>
+}
diff --git a/plugins/discourse-assign/assets/javascripts/discourse/components/assigned-to.gjs b/plugins/discourse-assign/assets/javascripts/discourse/components/assigned-to.gjs
new file mode 100644
index 00000000000..a5e0a9d3564
--- /dev/null
+++ b/plugins/discourse-assign/assets/javascripts/discourse/components/assigned-to.gjs
@@ -0,0 +1,15 @@
+import avatar from "discourse/helpers/avatar";
+
+const AssignedTo = <template>
+ <div class="assigned-to-user">
+ {{avatar @user imageSize="small"}}
+
+ <span class="assigned-username">
+ {{@user.username}}
+ </span>
+
+ {{yield}}
+ </div>
+</template>;
+
+export default AssignedTo;
diff --git a/plugins/discourse-assign/assets/javascripts/discourse/components/assigned-topic-list-column.gjs b/plugins/discourse-assign/assets/javascripts/discourse/components/assigned-topic-list-column.gjs
new file mode 100644
index 00000000000..0c0b37c7157
--- /dev/null
+++ b/plugins/discourse-assign/assets/javascripts/discourse/components/assigned-topic-list-column.gjs
@@ -0,0 +1,43 @@
+import Component from "@glimmer/component";
+import { action } from "@ember/object";
+import { service } from "@ember/service";
+import AssignActionsDropdown from "./assign-actions-dropdown";
+
+export default class AssignedTopicListColumn extends Component {
+ @service taskActions;
+ @service router;
+
+ @action
+ async unassign(targetId, targetType = "Topic") {
+ await this.taskActions.unassign(targetId, targetType);
+ this.router.refresh();
+ }
+
+ @action
+ reassign(topic) {
+ this.taskActions.showAssignModal(topic, {
+ onSuccess: () => this.router.refresh(),
+ });
+ }
+
+ <template>
+ {{#if @topic.assigned_to_user}}
+ <AssignActionsDropdown
+ @topic={{@topic}}
+ @assignee={{@topic.assigned_to_user.username}}
+ @unassign={{this.unassign}}
+ @reassign={{this.reassign}}
+ />
+ {{else if @topic.assigned_to_group}}
+ <AssignActionsDropdown
+ @topic={{@topic}}
+ @assignee={{@topic.assigned_to_group.name}}
+ @group={{true}}
+ @unassign={{this.unassign}}
+ @reassign={{this.reassign}}
+ />
+ {{else}}
+ <AssignActionsDropdown @topic={{@topic}} @unassign={{this.unassign}} />
+ {{/if}}
+ </template>
+}
diff --git a/plugins/discourse-assign/assets/javascripts/discourse/components/assignee-chooser-row.gjs b/plugins/discourse-assign/assets/javascripts/discourse/components/assignee-chooser-row.gjs
new file mode 100644
index 00000000000..ab53744c0c1
--- /dev/null
+++ b/plugins/discourse-assign/assets/javascripts/discourse/components/assignee-chooser-row.gjs
@@ -0,0 +1,35 @@
+import { and } from "truth-helpers";
+import UserStatusMessage from "discourse/components/user-status-message";
+import avatar from "discourse/helpers/avatar";
+import icon from "discourse/helpers/d-icon";
+import decorateUsernameSelector from "discourse/helpers/decorate-username-selector";
+import formatUsername from "discourse/helpers/format-username";
+import EmailGroupUserChooserRow from "select-kit/components/email-group-user-chooser-row";
+
+export default class AssigneeChooserRow extends EmailGroupUserChooserRow {
+ <template>
+ {{#if this.item.isUser}}
+ {{avatar this.item imageSize="tiny"}}
+ <div class="user-wrapper">
+ <span class="identifier">{{formatUsername this.item.id}}</span>
+ <span class="name">{{this.item.name}}</span>
+ {{#if (and this.item.showUserStatus this.item.status)}}
+ <UserStatusMessage
+ @status={{this.item.status}}
+ @showDescription={{true}}
+ />
+ {{/if}}
+ </div>
+ {{decorateUsernameSelector this.item.id}}
+ {{else if this.item.isGroup}}
+ {{icon "users"}}
+ <div class="user-wrapper">
+ <span class="identifier">{{this.item.id}}</span>
+ <span class="name">{{this.item.full_name}}</span>
+ </div>
+ {{else}}
+ {{icon "envelope"}}
+ <span class="identifier">{{this.item.id}}</span>
+ {{/if}}
+ </template>
+}
diff --git a/plugins/discourse-assign/assets/javascripts/discourse/components/assignee-chooser.js b/plugins/discourse-assign/assets/javascripts/discourse/components/assignee-chooser.js
new file mode 100644
index 00000000000..0fd9e6ed30d
--- /dev/null
+++ b/plugins/discourse-assign/assets/javascripts/discourse/components/assignee-chooser.js
@@ -0,0 +1,7 @@
+import EmailGroupUserChooser from "select-kit/components/email-group-user-chooser";
+
+export default class AssigneeChooser extends EmailGroupUserChooser {
+ modifyComponentForRow() {
+ return "assignee-chooser-row";
+ }
+}
diff --git a/plugins/discourse-assign/assets/javascripts/discourse/components/assignment.gjs b/plugins/discourse-assign/assets/javascripts/discourse/components/assignment.gjs
new file mode 100644
index 00000000000..666b8a96dd5
--- /dev/null
+++ b/plugins/discourse-assign/assets/javascripts/discourse/components/assignment.gjs
@@ -0,0 +1,134 @@
+import Component from "@glimmer/component";
+import { hash } from "@ember/helper";
+import { TextArea } from "@ember/legacy-built-in-components";
+import { on } from "@ember/modifier";
+import { action } from "@ember/object";
+import { service } from "@ember/service";
+import { not } from "truth-helpers";
+import icon from "discourse/helpers/d-icon";
+import { i18n } from "discourse-i18n";
+import ComboBox from "select-kit/components/combo-box";
+import AssigneeChooser from "./assignee-chooser";
+
+export default class Assignment extends Component {
+ @service siteSettings;
+ @service taskActions;
+
+ get assignee() {
+ return this.args.assignment.username || this.args.assignment.group_name;
+ }
+
+ get status() {
+ return this.args.assignment.status || this.assignStatuses[0];
+ }
+
+ get assignStatuses() {
+ return this.siteSettings.assign_statuses.split("|").filter(Boolean);
+ }
+
+ get assignStatusOptions() {
+ return this.assignStatuses.map((status) => ({ id: status, name: status }));
+ }
+
+ get assigneeIsEmpty() {
+ return !this.args.assignment.username && !this.args.assignment.group_name;
+ }
+
+ get showAssigneeIeEmptyError() {
+ return this.assigneeIsEmpty && this.args.showValidationErrors;
+ }
+
+ @action
+ handleTextAreaKeydown(event) {
+ if ((event.ctrlKey || event.metaKey) && event.key === "Enter") {
+ this.args.onSubmit();
+ }
+ }
+
+ @action
+ markAsEdited() {
+ this.args.assignment.isEdited = true;
+ }
+
+ @action
+ setAssignee([newAssignee]) {
+ if (this.taskActions.allowedGroupsForAssignment.includes(newAssignee)) {
+ this.args.assignment.username = null;
+ this.args.assignment.group_name = newAssignee;
+ } else {
+ this.args.assignment.username = newAssignee;
+ this.args.assignment.group_name = null;
+ }
+ this.markAsEdited();
+ }
+
+ @action
+ setStatus(status) {
+ this.args.assignment.status = status;
+ this.markAsEdited();
+ }
+
+ <template>
+ <div
+ class="control-group
+ {{if this.showAssigneeIeEmptyError 'assignee-error'}}"
+ >
+ <label>{{i18n "discourse_assign.assign_modal.assignee_label"}}</label>
+ <AssigneeChooser
+ autocomplete="off"
+ @id="assignee-chooser"
+ @value={{this.assignee}}
+ @onChange={{this.setAssignee}}
+ @showUserStatus={{true}}
+ @options={{hash
+ mobilePlacementStrategy="absolute"
+ includeGroups=true
+ customSearchOptions=(hash
+ assignableGroups=true
+ defaultSearchResults=this.taskActions.suggestions
+ )
+ groupMembersOf=this.taskActions.allowedGroups
+ maximum=1
+ tabindex=1
+ expandedOnInsert=(not this.assignee)
+ caretUpIcon="magnifying-glass"
+ caretDownIcon="magnifying-glass"
+ }}
+ />
+
+ {{#if this.showAssigneeIeEmptyError}}
+ <span class="error-label">
+ {{icon "triangle-exclamation"}}
+ {{i18n "discourse_assign.assign_modal.choose_assignee"}}
+ </span>
+ {{/if}}
+ </div>
+
+ {{#if this.siteSettings.enable_assign_status}}
+ <div class="control-group assign-status">
+ <label>{{i18n "discourse_assign.assign_modal.status_label"}}</label>
+ <ComboBox
+ @id="assign-status"
+ @content={{this.assignStatusOptions}}
+ @value={{this.status}}
+ @onChange={{this.setStatus}}
+ />
+ </div>
+ {{/if}}
+
+ <div class="control-group assign-status">
+ <label>
+ {{i18n "discourse_assign.assign_modal.note_label"}}&nbsp;<span
+ class="label-optional"
+ >{{i18n "discourse_assign.assign_modal.optional_label"}}</span>
+ </label>
+
+ <TextArea
+ id="assign-modal-note"
+ @value={{@assignment.note}}
+ {{on "keydown" this.handleTextAreaKeydown}}
+ {{on "input" this.markAsEdited}}
+ />
+ </div>
+ </template>
+}
diff --git a/plugins/discourse-assign/assets/javascripts/discourse/components/bulk-actions/assign-user.gjs b/plugins/discourse-assign/assets/javascripts/discourse/components/bulk-actions/assign-user.gjs
new file mode 100644
index 00000000000..7b521b8fe08
--- /dev/null
+++ b/plugins/discourse-assign/assets/javascripts/discourse/components/bulk-actions/assign-user.gjs
@@ -0,0 +1,46 @@
+import Component from "@glimmer/component";
+import { action } from "@ember/object";
+import { TrackedObject } from "@ember-compat/tracked-built-ins";
+import DButton from "discourse/components/d-button";
+import AssignUserForm from "../assign-user-form";
+
+export default class AssignUser extends Component {
+ model = new TrackedObject({});
+
+ // `submit` property will be mutated by the `AssignUserForm` component
+ formApi = {
+ submit() {},
+ };
+
+ @action
+ async assign() {
+ return this.args.performAndRefresh({
+ type: "assign",
+ username: this.model.username,
+ status: this.model.status,
+ note: this.model.note,
+ });
+ }
+
+ <template>
+ <div>
+ <AssignUserForm
+ @model={{this.model}}
+ @onSubmit={{this.assign}}
+ @formApi={{this.formApi}}
+ />
+ </div>
+
+ <div>
+ <DButton
+ class="btn-primary"
+ @action={{this.formApi.submit}}
+ @label={{if
+ this.model.reassign
+ "discourse_assign.reassign.title"
+ "discourse_assign.assign_modal.assign"
+ }}
+ />
+ </div>
+ </template>
+}
diff --git a/plugins/discourse-assign/assets/javascripts/discourse/components/bulk-actions/bulk-assign-user.gjs b/plugins/discourse-assign/assets/javascripts/discourse/components/bulk-actions/bulk-assign-user.gjs
new file mode 100644
index 00000000000..f150090d3ca
--- /dev/null
+++ b/plugins/discourse-assign/assets/javascripts/discourse/components/bulk-actions/bulk-assign-user.gjs
@@ -0,0 +1,37 @@
+import Component from "@glimmer/component";
+import { action } from "@ember/object";
+import didInsert from "@ember/render-modifiers/modifiers/did-insert";
+import { TrackedObject } from "@ember-compat/tracked-built-ins";
+import AssignUserForm from "discourse/plugins/discourse-assign/discourse/components/assign-user-form";
+
+export default class BulkActionsAssignUser extends Component {
+ model = new TrackedObject({});
+
+ formApi = {
+ submit() {},
+ };
+
+ @action
+ async assign(performAndRefreshCallback) {
+ return performAndRefreshCallback({
+ type: "assign",
+ username: this.model.username,
+ status: this.model.status,
+ note: this.model.note,
+ });
+ }
+
+ @action
+ performRegistration() {
+ this.args.onRegisterAction?.(this.assign.bind(this));
+ }
+
+ <template>
+ <span {{didInsert this.performRegistration}}></span>
+ <AssignUserForm
+ @model={{this.model}}
+ @onSubmit={{this.assign}}
+ @formApi={{this.formApi}}
+ />
+ </template>
+}
diff --git a/plugins/discourse-assign/assets/javascripts/discourse/components/flagged-topic-listener.js b/plugins/discourse-assign/assets/javascripts/discourse/components/flagged-topic-listener.js
new file mode 100644
index 00000000000..21f27657e69
--- /dev/null
+++ b/plugins/discourse-assign/assets/javascripts/discourse/components/flagged-topic-listener.js
@@ -0,0 +1,27 @@
+import Component from "@ember/component";
+import { set } from "@ember/object";
+
+function assignIfEqual(topic, data) {
+ if (topic && topic.id === data.topic_id) {
+ set(topic, "assigned_to_user", data.assigned_to);
+ }
+}
+
+export default class FlaggedTopicListener extends Component {
+ didInsertElement() {
+ super.didInsertElement(...arguments);
+
+ this.messageBus.subscribe("/staff/topic-assignment", (data) => {
+ if (this.flaggedTopics) {
+ this.flaggedTopics.forEach((ft) => assignIfEqual(ft.topic, data));
+ } else {
+ assignIfEqual(this.topic, data);
+ }
+ });
+ }
+
+ willDestroyElement() {
+ super.willDestroyElement(...arguments);
+ this.messageBus.unsubscribe("/staff/topic-assignment");
+ }
+}
diff --git a/plugins/discourse-assign/assets/javascripts/discourse/components/group-assigned-filter.gjs b/plugins/discourse-assign/assets/javascripts/discourse/components/group-assigned-filter.gjs
new file mode 100644
index 00000000000..3f208619acf
--- /dev/null
+++ b/plugins/discourse-assign/assets/javascripts/discourse/components/group-assigned-filter.gjs
@@ -0,0 +1,66 @@
+import { hash } from "@ember/helper";
+import { LinkTo } from "@ember/routing";
+import avatar from "discourse/helpers/avatar";
+import icon from "discourse/helpers/d-icon";
+import formatUsername from "discourse/helpers/format-username";
+import { i18n } from "discourse-i18n";
+
+const GroupAssignedFilter = <template>
+ <li>
+ {{#if @showAvatar}}
+ <LinkTo
+ @route="group.assigned.show"
+ @model={{@filter.username_lower}}
+ @query={{hash order=@order ascending=@ascending search=@search}}
+ >
+ <div class="assign-image">
+ <a
+ href={{@filter.userPath}}
+ data-user-card={{@filter.username}}
+ >{{avatar this.filter imageSize="large"}}</a>
+ </div>
+
+ <div class="assign-names">
+ <div class="assign-username">{{formatUsername @filter.username}}</div>
+ <div class="assign-name">{{@filter.name}}</div>
+ </div>
+
+ <div class="assign-count">
+ {{@filter.assignments_count}}
+ </div>
+ </LinkTo>
+ {{else if @groupName}}
+ <LinkTo
+ @route="group.assigned.show"
+ @model={{@filter}}
+ @query={{hash order=@order ascending=@ascending search=@search}}
+ >
+ <div class="assign-image">
+ {{icon "group-plus"}}
+ </div>
+ <div class="assign-names">
+ <div class="assign-username">{{@groupName}}</div>
+ </div>
+
+ <div class="assign-count">
+ {{@assignmentCount}}
+ </div>
+ </LinkTo>
+ {{else}}
+ <LinkTo
+ @route="group.assigned.show"
+ @model={{@filter}}
+ @query={{hash order=@order ascending=@ascending search=@search}}
+ >
+ <div class="assign-everyone">
+ {{i18n "discourse_assign.group_everyone"}}
+ </div>
+ <div class="assign-count">
+ {{@assignmentCount}}
+ </div>
+ </LinkTo>
+ {{/if}}
+ </li>
+</template>;
+
+export default GroupAssignedFilter;
diff --git a/plugins/discourse-assign/assets/javascripts/discourse/components/group-assigned-menu-item.gjs b/plugins/discourse-assign/assets/javascripts/discourse/components/group-assigned-menu-item.gjs
new file mode 100644
index 00000000000..6dfb3f1f036
--- /dev/null
+++ b/plugins/discourse-assign/assets/javascripts/discourse/components/group-assigned-menu-item.gjs
@@ -0,0 +1,12 @@
+import { LinkTo } from "@ember/routing";
+import icon from "discourse/helpers/d-icon";
+import { i18n } from "discourse-i18n";
+
+const GroupAssignedMenuItem = <template>
+ <LinkTo @route="group.assigned">
+ {{icon "group-plus" class="glyph"}}{{i18n "discourse_assign.assigned"}}
+ ({{@group.assignment_count}})
+ </LinkTo>
+</template>;
+
+export default GroupAssignedMenuItem;
diff --git a/plugins/discourse-assign/assets/javascripts/discourse/components/modal/assign-user.gjs b/plugins/discourse-assign/assets/javascripts/discourse/components/modal/assign-user.gjs
new file mode 100644
index 00000000000..934b16d7310
--- /dev/null
+++ b/plugins/discourse-assign/assets/javascripts/discourse/components/modal/assign-user.gjs
@@ -0,0 +1,71 @@
+import Component from "@glimmer/component";
+import { action } from "@ember/object";
+import { service } from "@ember/service";
+import { TrackedObject } from "@ember-compat/tracked-built-ins";
+import DButton from "discourse/components/d-button";
+import DModal from "discourse/components/d-modal";
+import DModalCancel from "discourse/components/d-modal-cancel";
+import { i18n } from "discourse-i18n";
+import AssignUserForm from "../assign-user-form";
+
+export default class AssignUser extends Component {
+ @service taskActions;
+
+ model = new TrackedObject(this.args.model);
+
+ // `submit` property will be mutated by the `AssignUserForm` component
+ formApi = {
+ submit() {},
+ };
+
+ get title() {
+ let i18nSuffix;
+
+ switch (this.model.targetType) {
+ case "Post":
+ i18nSuffix = "_post_modal";
+ break;
+ case "Topic":
+ i18nSuffix = "_modal";
+ break;
+ }
+
+ return i18n(
+ `discourse_assign.assign${i18nSuffix}.${
+ this.model.reassign ? "reassign_title" : "title"
+ }`
+ );
+ }
+
+ @action
+ async onSubmit() {
+ this.args.closeModal();
+ await this.taskActions.assign(this.model);
+ }
+
+ <template>
+ <DModal class="assign" @title={{this.title}} @closeModal={{@closeModal}}>
+ <:body>
+ <AssignUserForm
+ @model={{this.model}}
+ @onSubmit={{this.onSubmit}}
+ @formApi={{this.formApi}}
+ />
+ </:body>
+
+ <:footer>
+ <DButton
+ class="btn-primary"
+ @action={{this.formApi.submit}}
+ @label={{if
+ this.model.reassign
+ "discourse_assign.reassign.title"
+ "discourse_assign.assign_modal.assign"
+ }}
+ />
+
+ <DModalCancel @close={{@closeModal}} />
+ </:footer>
+ </DModal>
+ </template>
+}
diff --git a/plugins/discourse-assign/assets/javascripts/discourse/components/modal/edit-topic-assignments.gjs b/plugins/discourse-assign/assets/javascripts/discourse/components/modal/edit-topic-assignments.gjs
new file mode 100644
index 00000000000..fe9302690e9
--- /dev/null
+++ b/plugins/discourse-assign/assets/javascripts/discourse/components/modal/edit-topic-assignments.gjs
@@ -0,0 +1,70 @@
+import Component from "@glimmer/component";
+import { tracked } from "@glimmer/tracking";
+import { action } from "@ember/object";
+import { service } from "@ember/service";
+import DButton from "discourse/components/d-button";
+import DModal from "discourse/components/d-modal";
+import DModalCancel from "discourse/components/d-modal-cancel";
+import { popupAjaxError } from "discourse/lib/ajax-error";
+import { i18n } from "discourse-i18n";
+import TopicAssignments from "../topic-assignments";
+
+export default class EditTopicAssignments extends Component {
+ @service taskActions;
+
+ @tracked assignments = this.topic.assignments();
+
+ get title() {
+ if (this.topic.isAssigned() || this.topic.hasAssignedPosts()) {
+ return i18n("edit_assignments_modal.title");
+ } else {
+ return i18n("discourse_assign.assign_modal.title");
+ }
+ }
+
+ get topic() {
+ return this.args.model.topic;
+ }
+
+ @action
+ async submit() {
+ this.args.closeModal();
+ try {
+ await this.#assign();
+ } catch (error) {
+ popupAjaxError(error);
+ }
+ }
+
+ async #assign() {
+ for (const assignment of this.assignments) {
+ if (assignment.isEdited) {
+ await this.taskActions.putAssignment(assignment);
+ }
+ }
+ }
+
+ <template>
+ <DModal class="assign" @title={{this.title}} @closeModal={{@closeModal}}>
+ <:body>
+ <TopicAssignments
+ @assignments={{this.assignments}}
+ @onSubmit={{this.submit}}
+ />
+ </:body>
+ <:footer>
+ <DButton
+ class="btn-primary"
+ @action={{this.submit}}
+ @label={{if
+ this.model.reassign
+ "discourse_assign.reassign.title"
+ "discourse_assign.assign_modal.assign"
+ }}
+ />
+
+ <DModalCancel @close={{@closeModal}} />
+ </:footer>
+ </DModal>
+ </template>
+}
diff --git a/plugins/discourse-assign/assets/javascripts/discourse/components/post-assignments-display.gjs b/plugins/discourse-assign/assets/javascripts/discourse/components/post-assignments-display.gjs
new file mode 100644
index 00000000000..c078c890bf1
--- /dev/null
+++ b/plugins/discourse-assign/assets/javascripts/discourse/components/post-assignments-display.gjs
@@ -0,0 +1,49 @@
+import Component from "@glimmer/component";
+import { assignedToGroupPath, assignedToUserPath } from "../lib/url";
+import AssignedFirstPost from "./assigned-to-first-post";
+import AssignedToPost from "./assigned-to-post";
+
+export default class PostAssignmentsDisplay extends Component {
+ static shouldRender(args) {
+ return args.post;
+ }
+
+ get post() {
+ return this.args.outletArgs.post;
+ }
+
+ get assignedTo() {
+ return this.post.topic?.indirectly_assigned_to?.[this.post.id]?.assigned_to;
+ }
+
+ get assignedToUser() {
+ return this.assignedTo.username ? this.assignedTo : null;
+ }
+
+ get assignedToGroup() {
+ return !this.assignedToUser && this.assignedTo.name
+ ? this.assignedTo
+ : null;
+ }
+
+ get assignedHref() {
+ return this.assignedToUser
+ ? assignedToUserPath(this.assignedToUser)
+ : assignedToGroupPath(this.assignedToGroup);
+ }
+
+ <template>
+ {{#if this.post.firstPost}}
+ <AssignedFirstPost @post={{this.post}} />
+ {{else if this.assignedTo}}
+ <p class="assigned-to">
+ <AssignedToPost
+ @assignedToUser={{this.assignedToUser}}
+ @assignedToGroup={{this.assignedToGroup}}
+ @href={{this.assignedHref}}
+ @post={{this.post}}
+ />
+ </p>
+ {{/if}}
+ </template>
+}
diff --git a/plugins/discourse-assign/assets/javascripts/discourse/components/remind-assigns-frequency.gjs b/plugins/discourse-assign/assets/javascripts/discourse/components/remind-assigns-frequency.gjs
new file mode 100644
index 00000000000..0a17c98d97e
--- /dev/null
+++ b/plugins/discourse-assign/assets/javascripts/discourse/components/remind-assigns-frequency.gjs
@@ -0,0 +1,51 @@
+import Component from "@ember/component";
+import discourseComputed from "discourse/lib/decorators";
+import { i18n } from "discourse-i18n";
+import ComboBox from "select-kit/components/combo-box";
+
+export default class RemindAssignsFrequency extends Component {
+ @discourseComputed(
+ "user.custom_fields.remind_assigns_frequency",
+ "siteSettings.remind_assigns_frequency"
+ )
+ selectedFrequency(userAssignsFrequency, siteDefaultAssignsFrequency) {
+ if (
+ this.availableFrequencies
+ .map((freq) => freq.value)
+ .includes(userAssignsFrequency)
+ ) {
+ return userAssignsFrequency;
+ }
+
+ return siteDefaultAssignsFrequency;
+ }
+
+ @discourseComputed("user.reminders_frequency")
+ availableFrequencies(userRemindersFrequency) {
+ return userRemindersFrequency.map((freq) => ({
+ name: i18n(freq.name),
+ value: freq.value,
+ selected: false,
+ }));
+ }
+
+ <template>
+ {{#if this.siteSettings.assign_enabled}}
+ <div class="controls controls-dropdown">
+ <label>{{i18n
+ "discourse_assign.reminders_frequency.description"
+ }}</label>
+ <ComboBox
+ @id="remind-assigns-frequency"
+ @valueProperty="value"
+ @content={{this.availableFrequencies}}
+ @value={{this.selectedFrequency}}
+ {{! template-lint-disable no-action }}
+ @onChange={{action
+ (mut this.user.custom_fields.remind_assigns_frequency)
+ }}
+ />
+ </div>
+ {{/if}}
+ </template>
+}
diff --git a/plugins/discourse-assign/assets/javascripts/discourse/components/topic-assignments.gjs b/plugins/discourse-assign/assets/javascripts/discourse/components/topic-assignments.gjs
new file mode 100644
index 00000000000..24bba51cf48
--- /dev/null
+++ b/plugins/discourse-assign/assets/javascripts/discourse/components/topic-assignments.gjs
@@ -0,0 +1,47 @@
+import Component from "@glimmer/component";
+import { tracked } from "@glimmer/tracking";
+import { action } from "@ember/object";
+import { i18n } from "discourse-i18n";
+import ComboBox from "select-kit/components/combo-box";
+import Assignment from "./assignment";
+
+export default class TopicAssignments extends Component {
+ @tracked selectedAssignment = this.args.assignments.find((a) => a.id === 0);
+
+ get assignmentOptions() {
+ return this.args.assignments.map((a) => this.#toComboBoxOption(a));
+ }
+
+ @action
+ selectAssignment(id) {
+ this.selectedAssignment = this.args.assignments.find((a) => a.id === id);
+ }
+
+ #toComboBoxOption(assignment) {
+ const option = { id: assignment.id };
+ if (assignment.targetType === "Topic") {
+ option.name = i18n("edit_assignments_modal.topic");
+ } else {
+ option.name = `${i18n("edit_assignments_modal.post")} #${
+ assignment.postNumber
+ }`;
+ }
+ return option;
+ }
+
+ <template>
+ <div class="control-group target">
+ <label>{{i18n "discourse_assign.assign_modal.assignment_label"}}</label>
+ <ComboBox
+ @value={{this.selectedAssignment.id}}
+ @content={{this.assignmentOptions}}
+ @onChange={{this.selectAssignment}}
+ />
+ </div>
+ <Assignment
+ @assignment={{this.selectedAssignment}}
+ @onSubmit={{@onSubmit}}
+ @showValidationErrors={{false}}
+ />
+ </template>
+}
diff --git a/plugins/discourse-assign/assets/javascripts/discourse/components/topic-level-assign-menu.js b/plugins/discourse-assign/assets/javascripts/discourse/components/topic-level-assign-menu.js
new file mode 100644
index 00000000000..247b1e737d3
--- /dev/null
+++ b/plugins/discourse-assign/assets/javascripts/discourse/components/topic-level-assign-menu.js
@@ -0,0 +1,227 @@
+import { getOwner } from "@ember/application";
+import { htmlSafe } from "@ember/template";
+import { renderAvatar } from "discourse/helpers/user-avatar";
+import { iconHTML } from "discourse/lib/icon-library";
+import { i18n } from "discourse-i18n";
+import EditTopicAssignments from "../components/modal/edit-topic-assignments";
+
+const DEPENDENT_KEYS = [
+ "topic.assigned_to_user",
+ "topic.assigned_to_group",
+ "currentUser.can_assign",
+ "topic.assigned_to_user.username",
+];
+
+export default {
+ id: "reassign",
+ dependentKeys: DEPENDENT_KEYS,
+ classNames: ["reassign"],
+
+ async action(id) {
+ if (!this.currentUser?.can_assign) {
+ return;
+ }
+
+ const taskActions = getOwner(this).lookup("service:task-actions");
+ const modal = getOwner(this).lookup("service:modal");
+ const firstPostId = this.topic.postStream.firstPostId;
+
+ switch (id) {
+ case "unassign": {
+ this.set("topic.assigned_to_user", null);
+ this.set("topic.assigned_to_group", null);
+
+ await taskActions.unassign(this.topic.id);
+ this.appEvents.trigger("post-stream:refresh", { id: firstPostId });
+ break;
+ }
+ case "reassign-self": {
+ this.set("topic.assigned_to_user", null);
+ this.set("topic.assigned_to_group", null);
+
+ await taskActions.reassignUserToTopic(this.currentUser, this.topic);
+ this.appEvents.trigger("post-stream:refresh", { id: firstPostId });
+ break;
+ }
+ case "reassign": {
+ await modal.show(EditTopicAssignments, {
+ model: {
+ topic: this.topic,
+ },
+ onSuccess: () =>
+ this.appEvents.trigger("post-stream:refresh", { id: firstPostId }),
+ });
+ break;
+ }
+ default: {
+ if (id.startsWith("unassign-from-post-")) {
+ const postId = extractPostId(id);
+ await taskActions.unassign(postId, "Post");
+ delete this.topic.indirectly_assigned_to[postId];
+ this.appEvents.trigger("post-stream:refresh", { id: firstPostId });
+ }
+ }
+ }
+ },
+
+ noneItem() {
+ return topicLevelUnassignButton(this.topic.uniqueAssignees());
+ },
+
+ content() {
+ const content = [];
+
+ if (this.topic.isAssigned()) {
+ content.push(
+ unassignFromTopicButton(
+ this.topic,
+ this.siteSettings.prioritize_full_name_in_ux
+ )
+ );
+ }
+
+ if (this.topic.hasAssignedPosts()) {
+ content.push(...unassignFromPostButtons(this.topic));
+ }
+
+ if (this.topic.isAssigned() && !this.topic.isAssignedTo(this.currentUser)) {
+ content.push(reassignToSelfButton());
+ }
+
+ content.push(editAssignmentsButton());
+
+ return content;
+ },
+
+ displayed() {
+ return (
+ this.currentUser?.can_assign &&
+ !this.site.mobileView &&
+ (this.topic.isAssigned() || this.topic.hasAssignedPosts())
+ );
+ },
+};
+
+function avatarHtml(user, size, classes) {
+ return renderAvatar(user, {
+ imageSize: size,
+ extraClasses: classes,
+ ignoreTitle: true,
+ });
+}
+
+function extractPostId(buttonId) {
+ // buttonId format is "unassign-from-post-${postId}"
+ const start = buttonId.lastIndexOf("-") + 1;
+ return buttonId.substring(start);
+}
+
+function editAssignmentsButton() {
+ const icon = iconHTML("pencil");
+ const label = i18n("discourse_assign.topic_level_menu.edit_assignments");
+ return {
+ id: "reassign",
+ name: htmlSafe(label),
+ label: htmlSafe(`${icon} ${label}`),
+ };
+}
+
+function reassignToSelfButton() {
+ const icon = iconHTML("user-plus");
+ const label = i18n("discourse_assign.topic_level_menu.reassign_topic_to_me");
+ return {
+ id: "reassign-self",
+ name: htmlSafe(label),
+ label: htmlSafe(`${icon} ${label}`),
+ };
+}
+
+function unassignFromTopicButton(topic, prioritize_full_name_in_ux) {
+ let username =
+ topic.assigned_to_user?.username || topic.assigned_to_group?.name;
+
+ if (topic.assigned_to_user && prioritize_full_name_in_ux) {
+ username = topic.assigned_to_user?.name || topic.assigned_to_user?.username;
+ }
+
+ const icon = topic.assigned_to_user
+ ? avatarHtml(topic.assigned_to_user, "small")
+ : iconHTML("user-xmark");
+ const label = i18n("discourse_assign.topic_level_menu.unassign_from_topic", {
+ username,
+ });
+
+ return {
+ id: "unassign",
+ name: htmlSafe(label),
+ label: htmlSafe(`${icon} ${label}`),
+ };
+}
+
+function unassignFromPostButtons(topic) {
+ if (!topic.hasAssignedPosts()) {
+ return [];
+ }
+
+ const max_buttons = 10;
+ return Object.entries(topic.indirectly_assigned_to)
+ .slice(0, max_buttons)
+ .map(([postId, assignment]) => unassignFromPostButton(postId, assignment));
+}
+
+function unassignFromPostButton(postId, assignment) {
+ let assignee, icon;
+ const assignedToUser = !!assignment.assigned_to.username;
+ if (assignedToUser) {
+ assignee = assignment.assigned_to.username;
+ icon = avatarHtml(assignment.assigned_to, "small");
+ } else {
+ assignee = assignment.assigned_to.name;
+ icon = iconHTML("group-times");
+ }
+
+ const label = i18n("discourse_assign.topic_level_menu.unassign_from_post", {
+ assignee,
+ post_number: assignment.post_number,
+ });
+ const dataName = i18n(
+ "discourse_assign.topic_level_menu.unassign_from_post_help",
+ {
+ assignee,
+ post_number: assignment.post_number,
+ }
+ );
+ return {
+ id: `unassign-from-post-${postId}`,
+ name: htmlSafe(dataName),
+ label: htmlSafe(`${icon} ${label}`),
+ };
+}
+
+function topicLevelUnassignButton(assignees) {
+ const avatars = topicLevelUnassignButtonAvatars(assignees);
+ const label = `<span class="unassign-label">${i18n(
+ "discourse_assign.topic_level_menu.unassign_with_ellipsis"
+ )}</span>`;
+
+ return {
+ id: null,
+ name: htmlSafe(
+ i18n("discourse_assign.topic_level_menu.unassign_with_ellipsis")
+ ),
+ label: htmlSafe(`${avatars}${label}`),
+ };
+}
+
+function topicLevelUnassignButtonAvatars(assignees) {
+ const users = assignees.filter((a) => a.username);
+ let avatars = "";
+ if (users.length === 1) {
+ avatars = avatarHtml(users[0], "tiny");
+ } else if (users.length > 1) {
+ avatars =
+ avatarHtml(users[0], "tiny", "overlap") + avatarHtml(users[1], "tiny");
+ }
+
+ return avatars;
+}
diff --git a/plugins/discourse-assign/assets/javascripts/discourse/components/user-menu/assigns-list-empty-state.gjs b/plugins/discourse-assign/assets/javascripts/discourse/components/user-menu/assigns-list-empty-state.gjs
new file mode 100644
index 00000000000..267b3c348e5
--- /dev/null
+++ b/plugins/discourse-assign/assets/javascripts/discourse/components/user-menu/assigns-list-empty-state.gjs
@@ -0,0 +1,25 @@
+import icon from "discourse/helpers/d-icon";
+import getUrl from "discourse/helpers/get-url";
+import htmlSafe from "discourse/helpers/html-safe";
+import { i18n } from "discourse-i18n";
+
+const AssignsListEmptyState = <template>
+ <div class="empty-state">
+ <span class="empty-state-title">
+ {{i18n "user.no_assignments_title"}}
+ </span>
+ <div class="empty-state-body">
+ <p>
+ {{htmlSafe
+ (i18n
+ "user.no_assignments_body"
+ icon=(icon "user-plus")
+ preferencesUrl=(getUrl "/my/preferences/notifications")
+ )
+ }}
+ </p>
+ </div>
+ </div>
+</template>;
+
+export default AssignsListEmptyState;
diff --git a/plugins/discourse-assign/assets/javascripts/discourse/components/user-menu/assigns-list.js b/plugins/discourse-assign/assets/javascripts/discourse/components/user-menu/assigns-list.js
new file mode 100644
index 00000000000..e41e7e3e1c9
--- /dev/null
+++ b/plugins/discourse-assign/assets/javascripts/discourse/components/user-menu/assigns-list.js
@@ -0,0 +1,72 @@
+import { set } from "@ember/object";
+import { sort } from "@ember/object/computed";
+import UserMenuNotificationsList from "discourse/components/user-menu/notifications-list";
+import { i18n } from "discourse-i18n";
+import UserMenuAssignsListEmptyState from "./assigns-list-empty-state";
+
+export default class UserMenuAssignNotificationsList extends UserMenuNotificationsList {
+ get dismissTypes() {
+ return this.filterByTypes;
+ }
+
+ get showDismiss() {
+ return this._unreadAssignedNotificationsCount > 0;
+ }
+
+ get dismissTitle() {
+ return i18n("user.dismiss_assigned_tooltip");
+ }
+
+ get showAllHref() {
+ return `${this.currentUser.path}/activity/assigned`;
+ }
+
+ get showAllTitle() {
+ return i18n("user_menu.view_all_assigned");
+ }
+
+ get itemsCacheKey() {
+ return "user-menu-assigns-tab";
+ }
+
+ get emptyStateComponent() {
+ return UserMenuAssignsListEmptyState;
+ }
+
+ get alwaysRenderDismissConfirmation() {
+ return true;
+ }
+
+ get _unreadAssignedNotificationsCount() {
+ const key = `grouped_unread_notifications.${this.site.notification_types.assigned}`;
+ // we're retrieving the value with get() so that Ember tracks the property
+ // and re-renders the UI when it changes.
+ // we can stop using `get()` when the User model is refactored into native
+ // class with @tracked properties.
+ return this.currentUser.get(key) || 0;
+ }
+
+ get dismissConfirmationText() {
+ return i18n("notifications.dismiss_confirmation.body.assigns", {
+ count: this._unreadAssignedNotificationsCount,
+ });
+ }
+
+ async fetchItems() {
+ return new SortedItems(await super.fetchItems()).sortedItems;
+ }
+}
+
+class SortedItems {
+ itemsSorting = [
+ "notification.read",
+ "notification.data.message:desc",
+ "notification.created_at:desc",
+ ];
+
+ @sort("items", "itemsSorting") sortedItems;
+
+ constructor(items) {
+ set(this, "items", items);
+ }
+}
diff --git a/plugins/discourse-assign/assets/javascripts/discourse/connectors/above-review-filters/assigned-to-filter.gjs b/plugins/discourse-assign/assets/javascripts/discourse/connectors/above-review-filters/assigned-to-filter.gjs
new file mode 100644
index 00000000000..76f9b71f008
--- /dev/null
+++ b/plugins/discourse-assign/assets/javascripts/discourse/connectors/above-review-filters/assigned-to-filter.gjs
@@ -0,0 +1,49 @@
+import Component from "@ember/component";
+import { hash } from "@ember/helper";
+import { action } from "@ember/object";
+import { service } from "@ember/service";
+import { classNames } from "@ember-decorators/component";
+import { i18n } from "discourse-i18n";
+import EmailGroupUserChooser from "select-kit/components/email-group-user-chooser";
+
+@classNames("assigned-to-filter")
+export default class AssignedToFilter extends Component {
+ static shouldRender(args) {
+ return args.additionalFilters;
+ }
+
+ @service site;
+ @service siteSettings;
+
+ groupIDs = (this.siteSettings.assign_allowed_on_groups || "")
+ .split("|")
+ .filter(Boolean);
+ allowedGroups = this.site.groups
+ .filter((group) => this.groupIDs.includes(group.id.toString()))
+ .mapBy("name");
+
+ @action
+ updateAssignedTo(selected) {
+ this.set("outletArgs.additionalFilters.assigned_to", selected.firstObject);
+ }
+
+ <template>
+ <div class="reviewable-filter discourse-assign-assign-to-filter">
+ <label class="filter-label">{{i18n
+ "discourse_assign.assigned_to"
+ }}</label>
+
+ <EmailGroupUserChooser
+ @value={{this.outletArgs.additionalFilters.assigned_to}}
+ @onChange={{this.updateAssignedTo}}
+ @options={{hash
+ maximum=1
+ fullWidthWrap=true
+ includeGroups=false
+ groupMembersOf=this.allowedGroups
+ }}
+ autocomplete="off"
+ />
+ </div>
+ </template>
+}
diff --git a/plugins/discourse-assign/assets/javascripts/discourse/connectors/advanced-search-options-below/assigned-advanced-search.gjs b/plugins/discourse-assign/assets/javascripts/discourse/connectors/advanced-search-options-below/assigned-advanced-search.gjs
new file mode 100644
index 00000000000..3c4abea8e36
--- /dev/null
+++ b/plugins/discourse-assign/assets/javascripts/discourse/connectors/advanced-search-options-below/assigned-advanced-search.gjs
@@ -0,0 +1,46 @@
+import Component from "@ember/component";
+import { hash } from "@ember/helper";
+import { action } from "@ember/object";
+import { service } from "@ember/service";
+import { classNames } from "@ember-decorators/component";
+import { i18n } from "discourse-i18n";
+import EmailGroupUserChooser from "select-kit/components/email-group-user-chooser";
+
+@classNames("assigned-advanced-search")
+export default class AssignedAdvancedSearch extends Component {
+ static shouldRender(args, component) {
+ return component.currentUser?.can_assign;
+ }
+
+ @service currentUser;
+
+ @action
+ onChangeAssigned(value) {
+ this.outletArgs.onChangeSearchedTermField(
+ "assigned",
+ "updateSearchTermForAssignedUsername",
+ value
+ );
+ }
+
+ <template>
+ <div class="control-group">
+ <label class="control-label" for="search-assigned-to">
+ {{i18n "search.advanced.assigned.label"}}
+ </label>
+
+ <div class="controls">
+ <EmailGroupUserChooser
+ @value={{this.outletArgs.searchedTerms.assigned}}
+ @onChange={{this.onChangeAssigned}}
+ @options={{hash
+ maximum=1
+ excludeCurrentUser=false
+ includeGroups=true
+ customSearchOptions=(hash assignableGroups=true)
+ }}
+ />
+ </div>
+ </div>
+ </template>
+}
diff --git a/plugins/discourse-assign/assets/javascripts/discourse/connectors/category-custom-settings/assign-settings.gjs b/plugins/discourse-assign/assets/javascripts/discourse/connectors/category-custom-settings/assign-settings.gjs
new file mode 100644
index 00000000000..3823f7b1bcf
--- /dev/null
+++ b/plugins/discourse-assign/assets/javascripts/discourse/connectors/category-custom-settings/assign-settings.gjs
@@ -0,0 +1,35 @@
+import Component, { Input } from "@ember/component";
+import { on } from "@ember/modifier";
+import { action } from "@ember/object";
+import { classNames } from "@ember-decorators/component";
+import { i18n } from "discourse-i18n";
+
+@classNames("assign-settings")
+export default class AssignSettings extends Component {
+ @action
+ onChangeSetting(event) {
+ this.set(
+ "outletArgs.category.custom_fields.enable_unassigned_filter",
+ event.target.checked ? "true" : "false"
+ );
+ }
+
+ <template>
+ <h3>{{i18n "discourse_assign.assign.title"}}</h3>
+
+ <section class="field">
+ <div class="enable-accepted-answer">
+ <label class="checkbox-label">
+ <Input
+ @type="checkbox"
+ @checked={{readonly
+ this.outletArgs.category.enable_unassigned_filter
+ }}
+ {{on "change" this.onChangeSetting}}
+ />
+ {{i18n "discourse_assign.add_unassigned_filter"}}
+ </label>
+ </div>
+ </section>
+ </template>
+}
diff --git a/plugins/discourse-assign/assets/javascripts/discourse/connectors/group-reports-nav-item/assigned-topic-list.gjs b/plugins/discourse-assign/assets/javascripts/discourse/connectors/group-reports-nav-item/assigned-topic-list.gjs
new file mode 100644
index 00000000000..f14dd1d424b
--- /dev/null
+++ b/plugins/discourse-assign/assets/javascripts/discourse/connectors/group-reports-nav-item/assigned-topic-list.gjs
@@ -0,0 +1,17 @@
+import Component from "@ember/component";
+import { classNames, tagName } from "@ember-decorators/component";
+import GroupAssignedMenuItem from "../../components/group-assigned-menu-item";
+
+@tagName("li")
+@classNames("group-reports-nav-item-outlet", "assigned-topic-list")
+export default class AssignedTopicList extends Component {
+ static shouldRender(args, context) {
+ return (
+ context.currentUser?.can_assign &&
+ args.group.can_show_assigned_tab &&
+ args.group.assignment_count > 0
+ );
+ }
+
+ <template><GroupAssignedMenuItem @group={{this.group}} /></template>
+}
diff --git a/plugins/discourse-assign/assets/javascripts/discourse/connectors/groups-interaction-custom-options/assignable-interaction-fields.gjs b/plugins/discourse-assign/assets/javascripts/discourse/connectors/groups-interaction-custom-options/assignable-interaction-fields.gjs
new file mode 100644
index 00000000000..923a64d02b6
--- /dev/null
+++ b/plugins/discourse-assign/assets/javascripts/discourse/connectors/groups-interaction-custom-options/assignable-interaction-fields.gjs
@@ -0,0 +1,47 @@
+import Component from "@glimmer/component";
+import { action } from "@ember/object";
+import { i18n } from "discourse-i18n";
+import ComboBox from "select-kit/components/combo-box";
+
+export default class AssignableInteractionFields extends Component {
+ assignableLevelOptions = [
+ { name: i18n("groups.alias_levels.nobody"), value: 0 },
+ { name: i18n("groups.alias_levels.only_admins"), value: 1 },
+ { name: i18n("groups.alias_levels.mods_and_admins"), value: 2 },
+ { name: i18n("groups.alias_levels.members_mods_and_admins"), value: 3 },
+ { name: i18n("groups.alias_levels.owners_mods_and_admins"), value: 4 },
+ { name: i18n("groups.alias_levels.everyone"), value: 99 },
+ ];
+
+ get assignableLevel() {
+ return this.args.outletArgs.model.get("assignable_level") || 0;
+ }
+
+ @action
+ onChangeAssignableLevel(level) {
+ this.args.outletArgs.model.set("assignable_level", level);
+ }
+
+ <template>
+ <div class="control-group">
+ <label class="control-label">
+ {{i18n "discourse_assign.admin.groups.manage.interaction.assign"}}
+ </label>
+
+ <label for="visibility">
+ {{i18n
+ "discourse_assign.admin.groups.manage.interaction.assignable_levels.title"
+ }}
+ </label>
+
+ <ComboBox
+ @name="alias"
+ @valueProperty="value"
+ @value={{this.assignableLevel}}
+ @content={{this.assignableLevelOptions}}
+ @onChange={{this.onChangeAssignableLevel}}
+ class="groups-form-assignable-level"
+ />
+ </div>
+ </template>
+}
diff --git a/plugins/discourse-assign/assets/javascripts/discourse/connectors/user-activity-bottom/assigned-list.gjs b/plugins/discourse-assign/assets/javascripts/discourse/connectors/user-activity-bottom/assigned-list.gjs
new file mode 100644
index 00000000000..541203a08da
--- /dev/null
+++ b/plugins/discourse-assign/assets/javascripts/discourse/connectors/user-activity-bottom/assigned-list.gjs
@@ -0,0 +1,18 @@
+import Component from "@ember/component";
+import { LinkTo } from "@ember/routing";
+import { classNames, tagName } from "@ember-decorators/component";
+import icon from "discourse/helpers/d-icon";
+import { i18n } from "discourse-i18n";
+
+@tagName("li")
+@classNames("user-activity-bottom-outlet", "assigned-list")
+export default class AssignedList extends Component {
+ <template>
+ {{#if this.currentUser.can_assign}}
+ <LinkTo @route="userActivity.assigned">
+ {{icon "user-plus"}}
+ {{i18n "discourse_assign.assigned"}}
+ </LinkTo>
+ {{/if}}
+ </template>
+}
diff --git a/plugins/discourse-assign/assets/javascripts/discourse/connectors/user-preferences-notifications/remind-assigns-frequency.gjs b/plugins/discourse-assign/assets/javascripts/discourse/connectors/user-preferences-notifications/remind-assigns-frequency.gjs
new file mode 100644
index 00000000000..c27e0302f8b
--- /dev/null
+++ b/plugins/discourse-assign/assets/javascripts/discourse/connectors/user-preferences-notifications/remind-assigns-frequency.gjs
@@ -0,0 +1,13 @@
+import Component from "@ember/component";
+import { classNames, tagName } from "@ember-decorators/component";
+import RemindAssignsFrequency0 from "../../components/remind-assigns-frequency";
+
+@tagName("div")
+@classNames("user-preferences-notifications-outlet", "remind-assigns-frequency")
+export default class RemindAssignsFrequency extends Component {
+ static shouldRender(args, context) {
+ return context.currentUser?.can_assign;
+ }
+
+ <template><RemindAssignsFrequency0 @user={{this.model}} /></template>
+}
diff --git a/plugins/discourse-assign/assets/javascripts/discourse/connectors/user-preferences-tracking-topics/notification-level-when-assigned.gjs b/plugins/discourse-assign/assets/javascripts/discourse/connectors/user-preferences-tracking-topics/notification-level-when-assigned.gjs
new file mode 100644
index 00000000000..8c4553abd27
--- /dev/null
+++ b/plugins/discourse-assign/assets/javascripts/discourse/connectors/user-preferences-tracking-topics/notification-level-when-assigned.gjs
@@ -0,0 +1,53 @@
+import Component from "@glimmer/component";
+import { service } from "@ember/service";
+import { i18n } from "discourse-i18n";
+import ComboBox from "select-kit/components/combo-box";
+
+export default class NotificationLevelWhenAssigned extends Component {
+ @service siteSettings;
+
+ constructor(owner, args) {
+ super(...arguments);
+ if (this.siteSettings.assign_enabled) {
+ args.outletArgs.customAttrNames.push("notification_level_when_assigned");
+ }
+ }
+
+ get notificationLevelsWhenAssigned() {
+ // The order matches the "notification level when replying" user preference
+ return [
+ {
+ name: i18n("user.notification_level_when_assigned.watch_topic"),
+ value: "watch_topic",
+ },
+ {
+ name: i18n("user.notification_level_when_assigned.track_topic"),
+ value: "track_topic",
+ },
+ {
+ name: i18n("user.notification_level_when_assigned.do_nothing"),
+ value: "do_nothing",
+ },
+ ];
+ }
+
+ <template>
+ {{#if this.siteSettings.assign_enabled}}
+ <div
+ class="controls controls-dropdown"
+ data-setting-name="user-notification-level-when-assigned"
+ >
+ <label>{{i18n "user.notification_level_when_assigned.label"}}</label>
+ <ComboBox
+ @content={{this.notificationLevelsWhenAssigned}}
+ @value={{@outletArgs.model.user_option.notification_level_when_assigned}}
+ @valueProperty="value"
+ {{! template-lint-disable no-action }}
+ @onChange={{action
+ (mut @outletArgs.model.user_option.notification_level_when_assigned)
+ }}
+ />
+ </div>
+ {{/if}}
+ </template>
+}
diff --git a/plugins/discourse-assign/assets/javascripts/discourse/controllers/bulk-assign.js b/plugins/discourse-assign/assets/javascripts/discourse/controllers/bulk-assign.js
new file mode 100644
index 00000000000..79090b121fd
--- /dev/null
+++ b/plugins/discourse-assign/assets/javascripts/discourse/controllers/bulk-assign.js
@@ -0,0 +1,22 @@
+import Controller, { inject as controller } from "@ember/controller";
+import { action } from "@ember/object";
+
+export default class BulkAssign extends Controller {
+ @controller topicBulkActions;
+
+ model;
+
+ // `submit` property will be mutated by the `AssignUserForm` component
+ formApi = {
+ submit() {},
+ };
+
+ @action
+ async assign() {
+ return this.topicBulkActions.performAndRefresh({
+ type: "assign",
+ username: this.model.username,
+ note: this.model.note,
+ });
+ }
+}
diff --git a/plugins/discourse-assign/assets/javascripts/discourse/controllers/group-assigned-show.js b/plugins/discourse-assign/assets/javascripts/discourse/controllers/group-assigned-show.js
new file mode 100644
index 00000000000..4a8848c958a
--- /dev/null
+++ b/plugins/discourse-assign/assets/javascripts/discourse/controllers/group-assigned-show.js
@@ -0,0 +1,86 @@
+import { inject as controller } from "@ember/controller";
+import { action } from "@ember/object";
+import { alias } from "@ember/object/computed";
+import { service } from "@ember/service";
+import UserTopicsList from "discourse/controllers/user-topics-list";
+import BulkSelectHelper from "discourse/lib/bulk-select-helper";
+import discourseDebounce from "discourse/lib/debounce";
+import { INPUT_DELAY } from "discourse/lib/environment";
+
+export default class GroupAssignedShow extends UserTopicsList {
+ @service taskActions;
+ @service router;
+ @controller user;
+
+ queryParams = ["order", "ascending", "search"];
+ order = "";
+ ascending = false;
+ search = "";
+ bulkSelectEnabled = false;
+ bulkSelectHelper = new BulkSelectHelper(this);
+ selected = [];
+
+ @alias("currentUser.staff") canBulkSelect;
+
+ _setSearchTerm(searchTerm) {
+ this.set("search", searchTerm);
+ this.refreshModel();
+ }
+
+ refreshModel() {
+ this.set("loading", true);
+ this.store
+ .findFiltered("topicList", {
+ filter: this.model.filter,
+ params: {
+ order: this.order,
+ ascending: this.ascending,
+ search: this.search,
+ direct: this.model.params.direct,
+ },
+ })
+ .then((result) => this.set("model", result))
+ .finally(() => {
+ this.set("loading", false);
+ });
+ }
+
+ @action
+ async unassign(targetId, targetType = "Topic") {
+ await this.taskActions.unassign(targetId, targetType);
+ this.router.refresh();
+ }
+
+ @action
+ reassign(topic) {
+ this.taskActions.showAssignModal(topic, {
+ onSuccess: () => this.router.refresh(),
+ });
+ }
+
+ @action
+ changeSort(sortBy) {
+ if (sortBy === this.order) {
+ this.toggleProperty("ascending");
+ this.refreshModel();
+ } else {
+ this.setProperties({ order: sortBy, ascending: false });
+ this.refreshModel();
+ }
+ }
+
+ @action
+ onChangeFilter(value) {
+ discourseDebounce(this, this._setSearchTerm, value, INPUT_DELAY * 2);
+ }
+
+ @action
+ toggleBulkSelect() {
+ this.toggleProperty("bulkSelectEnabled");
+ }
+
+ @action
+ refresh() {
+ this.refreshModel();
+ }
+}
diff --git a/plugins/discourse-assign/assets/javascripts/discourse/controllers/group-assigned.js b/plugins/discourse-assign/assets/javascripts/discourse/controllers/group-assigned.js
new file mode 100644
index 00000000000..2bae8f756c6
--- /dev/null
+++ b/plugins/discourse-assign/assets/javascripts/discourse/controllers/group-assigned.js
@@ -0,0 +1,96 @@
+import Controller, { inject as controller } from "@ember/controller";
+import { action } from "@ember/object";
+import { service } from "@ember/service";
+import { ajax } from "discourse/lib/ajax";
+import discourseDebounce from "discourse/lib/debounce";
+import discourseComputed from "discourse/lib/decorators";
+import { INPUT_DELAY } from "discourse/lib/environment";
+
+export default class GroupAssigned extends Controller {
+ @service router;
+ @controller application;
+
+ loading = false;
+ offset = 0;
+ filterName = "";
+ filter = "";
+
+ @discourseComputed("router.currentRoute.queryParams.order")
+ order(order) {
+ return order || "";
+ }
+
+ @discourseComputed("router.currentRoute.queryParams.ascending")
+ ascending(ascending) {
+ return ascending || false;
+ }
+
+ @discourseComputed("router.currentRoute.queryParams.search")
+ search(search) {
+ return search || "";
+ }
+
+ @discourseComputed("site.mobileView")
+ isDesktop(mobileView) {
+ return !mobileView;
+ }
+
+ _setFilter(filter) {
+ this.set("loading", true);
+ this.set("offset", 0);
+ this.set("filter", filter);
+
+ const groupName = this.group.name;
+ ajax(`/assign/members/${groupName}`, {
+ type: "GET",
+ data: { filter: this.filter, offset: this.offset },
+ })
+ .then((result) => {
+ if (this.router.currentRoute.params.filter !== "everyone") {
+ this.router.transitionTo(
+ "group.assigned.show",
+ groupName,
+ "everyone"
+ );
+ }
+ this.set("members", result.members);
+ })
+ .finally(() => {
+ this.set("loading", false);
+ });
+ }
+
+ findMembers(refresh) {
+ if (refresh) {
+ this.set("members", this.model.members);
+ return;
+ }
+
+ if (this.loading || !this.model) {
+ return;
+ }
+
+ if (this.model.members.length >= this.offset + 50) {
+ this.set("loading", true);
+ this.set("offset", this.offset + 50);
+ ajax(`/assign/members/${this.group.name}`, {
+ type: "GET",
+ data: { filter: this.filter, offset: this.offset },
+ })
+ .then((result) => {
+ this.members.pushObjects(result.members);
+ })
+ .finally(() => this.set("loading", false));
+ }
+ }
+
+ @action
+ loadMore() {
+ this.findMembers();
+ }
+
+ @action
+ onChangeFilterName(value) {
+ discourseDebounce(this, this._setFilter, value, INPUT_DELAY * 2);
+ }
+}
diff --git a/plugins/discourse-assign/assets/javascripts/discourse/controllers/user-activity-assigned.js b/plugins/discourse-assign/assets/javascripts/discourse/controllers/user-activity-assigned.js
new file mode 100644
index 00000000000..608c21cc6e8
--- /dev/null
+++ b/plugins/discourse-assign/assets/javascripts/discourse/controllers/user-activity-assigned.js
@@ -0,0 +1,74 @@
+import { inject as controller } from "@ember/controller";
+import { action } from "@ember/object";
+import { service } from "@ember/service";
+import { htmlSafe } from "@ember/template";
+import UserTopicsList from "discourse/controllers/user-topics-list";
+import discourseDebounce from "discourse/lib/debounce";
+import discourseComputed from "discourse/lib/decorators";
+import { INPUT_DELAY } from "discourse/lib/environment";
+import getURL from "discourse/lib/get-url";
+import { iconHTML } from "discourse/lib/icon-library";
+import { i18n } from "discourse-i18n";
+
+export default class UserActivityAssigned extends UserTopicsList {
+ @service taskActions;
+ @controller user;
+
+ queryParams = ["order", "ascending", "search"];
+ order = "";
+ ascending = false;
+ search = "";
+
+ @discourseComputed("model.topics.length", "search")
+ doesntHaveAssignments(topicsLength, search) {
+ return !search && !topicsLength;
+ }
+
+ @discourseComputed
+ emptyStateBody() {
+ return htmlSafe(
+ i18n("user.no_assignments_body", {
+ preferencesUrl: getURL("/my/preferences/notifications"),
+ icon: iconHTML("user-plus"),
+ })
+ );
+ }
+
+ _setSearchTerm(searchTerm) {
+ this.set("search", searchTerm);
+ this.refreshModel();
+ }
+
+ refreshModel() {
+ this.set("loading", true);
+ this.store
+ .findFiltered("topicList", {
+ filter: this.model.filter,
+ params: {
+ order: this.order,
+ ascending: this.ascending,
+ search: this.search,
+ },
+ })
+ .then((result) => this.set("model", result))
+ .finally(() => {
+ this.set("loading", false);
+ });
+ }
+
+ @action
+ changeSort(sortBy) {
+ if (sortBy === this.order) {
+ this.toggleProperty("ascending");
+ this.refreshModel();
+ } else {
+ this.setProperties({ order: sortBy, ascending: false });
+ this.refreshModel();
+ }
+ }
+
+ @action
+ onChangeFilter(value) {
+ discourseDebounce(this, this._setSearchTerm, value, INPUT_DELAY * 2);
+ }
+}
diff --git a/plugins/discourse-assign/assets/javascripts/discourse/initializers/assign-extend-user-messages.js b/plugins/discourse-assign/assets/javascripts/discourse/initializers/assign-extend-user-messages.js
new file mode 100644
index 00000000000..a758906a12d
--- /dev/null
+++ b/plugins/discourse-assign/assets/javascripts/discourse/initializers/assign-extend-user-messages.js
@@ -0,0 +1,20 @@
+import { withPluginApi } from "discourse/lib/plugin-api";
+import { i18n } from "discourse-i18n";
+
+export default {
+ name: "assign-extend-user-messages",
+
+ initialize(container) {
+ withPluginApi("1.5.0", (api) => {
+ const currentUser = container.lookup("service:current-user");
+
+ if (currentUser?.can_assign && api.addUserMessagesNavigationDropdownRow) {
+ api.addUserMessagesNavigationDropdownRow(
+ "userPrivateMessages.assigned",
+ i18n("discourse_assign.assigned"),
+ "user-plus"
+ );
+ }
+ });
+ },
+};
diff --git a/plugins/discourse-assign/assets/javascripts/discourse/initializers/assign-user-menu.js b/plugins/discourse-assign/assets/javascripts/discourse/initializers/assign-user-menu.js
new file mode 100644
index 00000000000..f4c5a1602c7
--- /dev/null
+++ b/plugins/discourse-assign/assets/javascripts/discourse/initializers/assign-user-menu.js
@@ -0,0 +1,93 @@
+import { htmlSafe } from "@ember/template";
+import { withPluginApi } from "discourse/lib/plugin-api";
+import { emojiUnescape } from "discourse/lib/text";
+import { i18n } from "discourse-i18n";
+import UserMenuAssignNotificationsList from "../components/user-menu/assigns-list";
+
+export default {
+ name: "assign-user-menu",
+
+ initialize(container) {
+ withPluginApi("1.2.0", (api) => {
+ const siteSettings = container.lookup("service:site-settings");
+ if (!siteSettings.assign_enabled) {
+ return;
+ }
+
+ const currentUser = api.getCurrentUser();
+ if (!currentUser?.can_assign) {
+ return;
+ }
+
+ if (api.registerNotificationTypeRenderer) {
+ api.registerNotificationTypeRenderer(
+ "assigned",
+ (NotificationItemBase) => {
+ return class extends NotificationItemBase {
+ get linkTitle() {
+ if (this.isGroup()) {
+ return i18n(`user.assigned_to_group.${this.postOrTopic()}`, {
+ group_name: this.notification.data.display_username,
+ });
+ }
+ return i18n(`user.assigned_to_you.${this.postOrTopic()}`);
+ }
+
+ get icon() {
+ return this.isGroup() ? "group-plus" : "user-plus";
+ }
+
+ get label() {
+ if (!this.isGroup()) {
+ return "";
+ }
+ return this.notification.data.display_username;
+ }
+
+ get description() {
+ return htmlSafe(
+ emojiUnescape(
+ i18n(`user.assignment_description.${this.postOrTopic()}`, {
+ topic_title: this.notification.fancy_title,
+ post_number: this.notification.post_number,
+ })
+ )
+ );
+ }
+
+ isGroup() {
+ return (
+ this.notification.data.message ===
+ "discourse_assign.assign_group_notification"
+ );
+ }
+
+ postOrTopic() {
+ return this.notification.post_number === 1 ? "topic" : "post";
+ }
+ };
+ }
+ );
+ }
+
+ if (api.registerUserMenuTab) {
+ api.registerUserMenuTab((UserMenuTab) => {
+ return class extends UserMenuTab {
+ id = "assign-list";
+ panelComponent = UserMenuAssignNotificationsList;
+ icon = "user-plus";
+ notificationTypes = ["assigned"];
+
+ get count() {
+ return this.getUnreadCountForType("assigned");
+ }
+
+ get linkWhenActive() {
+ return `${this.currentUser.path}/activity/assigned`;
+ }
+ };
+ });
+ }
+ });
+ },
+};
diff --git a/plugins/discourse-assign/assets/javascripts/discourse/initializers/assignment-list-actions.gjs b/plugins/discourse-assign/assets/javascripts/discourse/initializers/assignment-list-actions.gjs
new file mode 100644
index 00000000000..7f51e09dfa9
--- /dev/null
+++ b/plugins/discourse-assign/assets/javascripts/discourse/initializers/assignment-list-actions.gjs
@@ -0,0 +1,43 @@
+import { withPluginApi } from "discourse/lib/plugin-api";
+import AssignedTopicListColumn from "../components/assigned-topic-list-column";
+
+const ASSIGN_LIST_ROUTES = ["userActivity.assigned", "group.assigned.show"];
+
+const AssignActionsCell = <template>
+ <td class="assign-topic-buttons">
+ <AssignedTopicListColumn @topic={{@topic}} />
+ </td>
+</template>;
+
+export default {
+ name: "assignment-list-dropdowns",
+
+ initialize(container) {
+ const router = container.lookup("service:router");
+
+ withPluginApi("1.39.0", (api) => {
+ api.registerValueTransformer(
+ "topic-list-columns",
+ ({ value: columns }) => {
+ if (ASSIGN_LIST_ROUTES.includes(router.currentRouteName)) {
+ columns.add("assign-actions", {
+ item: AssignActionsCell,
+ after: "activity",
+ });
+ }
+
+ return columns;
+ }
+ );
+ api.registerValueTransformer(
+ "topic-list-item-class",
+ ({ value: classes }) => {
+ if (ASSIGN_LIST_ROUTES.includes(router.currentRouteName)) {
+ classes.push("assigned-list-item");
+ }
+ return classes;
+ }
+ );
+ });
+ },
+};
diff --git a/plugins/discourse-assign/assets/javascripts/discourse/initializers/extend-for-assigns.js b/plugins/discourse-assign/assets/javascripts/discourse/initializers/extend-for-assigns.js
new file mode 100644
index 00000000000..c02fa37fb6d
--- /dev/null
+++ b/plugins/discourse-assign/assets/javascripts/discourse/initializers/extend-for-assigns.js
@@ -0,0 +1,926 @@
+import { getOwner } from "@ember/application";
+import { action } from "@ember/object";
+import { htmlSafe } from "@ember/template";
+import { isEmpty } from "@ember/utils";
+import { hbs } from "ember-cli-htmlbars";
+import { h } from "virtual-dom";
+import { renderAvatar } from "discourse/helpers/user-avatar";
+import discourseComputed from "discourse/lib/decorators";
+import { withSilencedDeprecations } from "discourse/lib/deprecated";
+import getURL from "discourse/lib/get-url";
+import { iconHTML, iconNode } from "discourse/lib/icon-library";
+import { withPluginApi } from "discourse/lib/plugin-api";
+import { registerTopicFooterDropdown } from "discourse/lib/register-topic-footer-dropdown";
+import { applyValueTransformer } from "discourse/lib/transformer";
+import { escapeExpression } from "discourse/lib/utilities";
+import RawHtml from "discourse/widgets/raw-html";
+import RenderGlimmer from "discourse/widgets/render-glimmer";
+import { i18n } from "discourse-i18n";
+import AssignButton from "../components/assign-button";
+import BulkActionsAssignUser from "../components/bulk-actions/bulk-assign-user";
+import EditTopicAssignments from "../components/modal/edit-topic-assignments";
+import PostAssignmentsDisplay from "../components/post-assignments-display";
+import TopicLevelAssignMenu from "../components/topic-level-assign-menu";
+import { assignedToGroupPath, assignedToUserPath } from "../lib/url";
+import { extendTopicModel } from "../models/topic";
+
+const DEPENDENT_KEYS = [
+ "topic.assigned_to_user",
+ "topic.assigned_to_group",
+ "currentUser.can_assign",
+ "topic.assigned_to_user.username",
+ "topic.assigned_to_user.name",
+];
+
+function defaultTitle(topic) {
+ const username =
+ topic.assigned_to_user?.username || topic.assigned_to_group?.name;
+
+ if (username) {
+ return i18n("discourse_assign.unassign.help", { username });
+ } else {
+ return i18n("discourse_assign.assign.help");
+ }
+}
+
+function registerTopicFooterButtons(api) {
+ registerTopicFooterDropdown(TopicLevelAssignMenu);
+
+ api.registerTopicFooterButton({
+ id: "assign",
+ icon() {
+ return this.topic.isAssigned()
+ ? this.site.mobileView
+ ? "user-xmark"
+ : null
+ : "user-plus";
+ },
+ priority: 250,
+ translatedTitle() {
+ return defaultTitle(this.topic);
+ },
+ translatedAriaLabel() {
+ return defaultTitle(this.topic);
+ },
+ translatedLabel() {
+ return i18n("discourse_assign.assign.title");
+ },
+ async action() {
+ if (!this.currentUser?.can_assign) {
+ return;
+ }
+
+ const taskActions = getOwner(this).lookup("service:task-actions");
+ const modal = getOwner(this).lookup("service:modal");
+
+ if (this.topic.isAssigned()) {
+ this.set("topic.assigned_to_user", null);
+ this.set("topic.assigned_to_group", null);
+
+ await taskActions.unassign(this.topic.id, "Topic");
+
+ this.appEvents.trigger("post-stream:refresh", {
+ id: this.topic.postStream.firstPostId,
+ });
+ } else {
+ await modal.show(EditTopicAssignments, {
+ model: {
+ topic: this.topic,
+ },
+ onSuccess: () =>
+ this.appEvents.trigger("post-stream:refresh", {
+ id: this.topic.postStream.firstPostId,
+ }),
+ });
+ }
+ },
+ dropdown() {
+ return this.site.mobileView;
+ },
+ classNames: ["assign"],
+ dependentKeys: DEPENDENT_KEYS,
+ displayed() {
+ return (
+ this.currentUser?.can_assign &&
+ !this.topic.isAssigned() &&
+ !this.topic.hasAssignedPosts()
+ );
+ },
+ });
+
+ api.registerTopicFooterButton({
+ id: "unassign-mobile-header",
+ translatedTitle() {
+ return defaultTitle(this.topic);
+ },
+ translatedAriaLabel() {
+ return defaultTitle(this.topic);
+ },
+ translatedLabel() {
+ const user = this.topic.assigned_to_user;
+ const group = this.topic.assigned_to_group;
+ const label = i18n("discourse_assign.assigned_to_w_ellipsis");
+
+ if (user) {
+ return htmlSafe(
+ `<span class="unassign-label"><span class="text">${label}</span><span class="username">${
+ user.username
+ }</span></span>${renderAvatar(user, {
+ imageSize: "small",
+ ignoreTitle: true,
+ })}`
+ );
+ } else if (group) {
+ return htmlSafe(
+ `<span class="unassign-label">${label}</span> @${group.name}`
+ );
+ }
+ },
+ dropdown() {
+ return this.currentUser?.can_assign && this.topic.isAssigned();
+ },
+ classNames: ["assign"],
+ dependentKeys: DEPENDENT_KEYS,
+ displayed() {
+ // only display the button in the mobile view
+ return this.currentUser?.can_assign && this.site.mobileView;
+ },
+ });
+
+ api.registerTopicFooterButton({
+ id: "unassign-mobile",
+ icon() {
+ return "user-xmark";
+ },
+ translatedTitle() {
+ return defaultTitle(this.topic);
+ },
+ translatedAriaLabel() {
+ return defaultTitle(this.topic);
+ },
+ translatedLabel() {
+ const label = i18n("discourse_assign.unassign.title");
+
+ return htmlSafe(
+ `<span class="unassign-label"><span class="text">${label}</span></span>`
+ );
+ },
+ action() {
+ if (!this.currentUser?.can_assign) {
+ return;
+ }
+
+ const taskActions = getOwner(this).lookup("service:task-actions");
+
+ this.set("topic.assigned_to_user", null);
+ this.set("topic.assigned_to_group", null);
+ taskActions.unassign(this.topic.id).then(() => {
+ this.appEvents.trigger("post-stream:refresh", {
+ id: this.topic.postStream.firstPostId,
+ });
+ });
+ },
+ dropdown() {
+ return this.currentUser?.can_assign && this.topic.isAssigned();
+ },
+ classNames: ["assign"],
+ dependentKeys: DEPENDENT_KEYS,
+ displayed() {
+ // only display the button in the mobile view
+ return (
+ this.currentUser?.can_assign &&
+ this.site.mobileView &&
+ this.topic.isAssigned()
+ );
+ },
+ });
+
+ api.registerTopicFooterButton({
+ id: "reassign-self-mobile",
+ icon() {
+ return "user-plus";
+ },
+ translatedTitle() {
+ return i18n("discourse_assign.reassign.to_self_help");
+ },
+ translatedAriaLabel() {
+ return i18n("discourse_assign.reassign.to_self_help");
+ },
+ translatedLabel() {
+ const label = i18n("discourse_assign.reassign.to_self");
+
+ return htmlSafe(
+ `<span class="unassign-label"><span class="text">${label}</span></span>`
+ );
+ },
+ async action() {
+ if (!this.currentUser?.can_assign) {
+ return;
+ }
+
+ const taskActions = getOwner(this).lookup("service:task-actions");
+
+ this.set("topic.assigned_to_user", null);
+ this.set("topic.assigned_to_group", null);
+
+ await taskActions.reassignUserToTopic(this.currentUser, this.topic);
+
+ this.appEvents.trigger("post-stream:refresh", {
+ id: this.topic.postStream.firstPostId,
+ });
+ },
+ dropdown() {
+ return this.currentUser?.can_assign && this.topic.isAssigned();
+ },
+ classNames: ["assign"],
+ dependentKeys: DEPENDENT_KEYS,
+ displayed() {
+ return (
+ // only display the button in the mobile view
+ this.site.mobileView &&
+ this.currentUser?.can_assign &&
+ this.topic.isAssigned() &&
+ this.topic.assigned_to_user?.username !== this.currentUser.username
+ );
+ },
+ });
+
+ api.registerTopicFooterButton({
+ id: "reassign-mobile",
+ icon() {
+ return "group-plus";
+ },
+ translatedTitle() {
+ return i18n("discourse_assign.reassign.help");
+ },
+ translatedAriaLabel() {
+ return i18n("discourse_assign.reassign.help");
+ },
+ translatedLabel() {
+ const label = i18n("discourse_assign.reassign.title_w_ellipsis");
+
+ return htmlSafe(
+ `<span class="unassign-label"><span class="text">${label}</span></span>`
+ );
+ },
+ async action() {
+ if (!this.currentUser?.can_assign) {
+ return;
+ }
+
+ const taskActions = getOwner(this).lookup("service:task-actions");
+
+ await taskActions.showAssignModal(this.topic, {
+ targetType: "Topic",
+ isAssigned: this.topic.isAssigned(),
+ onSuccess: () =>
+ this.appEvents.trigger("post-stream:refresh", {
+ id: this.topic.postStream.firstPostId,
+ }),
+ });
+ },
+ dropdown() {
+ return this.currentUser?.can_assign && this.topic.isAssigned();
+ },
+ classNames: ["assign"],
+ dependentKeys: DEPENDENT_KEYS,
+ displayed() {
+ // only display the button in the mobile view
+ return this.currentUser?.can_assign && this.site.mobileView;
+ },
+ });
+}
+
+function initialize(api) {
+ const siteSettings = api.container.lookup("service:site-settings");
+ const currentUser = api.getCurrentUser();
+
+ if (siteSettings.assigns_public || currentUser?.can_assign) {
+ api.addNavigationBarItem({
+ name: "unassigned",
+ customFilter: (category) => {
+ return category?.custom_fields?.enable_unassigned_filter === "true";
+ },
+ customHref: (category) => {
+ if (category) {
+ return getURL(category.url) + "/l/latest?status=open&assigned=nobody";
+ }
+ },
+ forceActive: (category, args) => {
+ const queryParams = args.currentRouteQueryParams;
+
+ return (
+ queryParams &&
+ Object.keys(queryParams).length === 2 &&
+ queryParams["assigned"] === "nobody" &&
+ queryParams["status"] === "open"
+ );
+ },
+ before: "top",
+ });
+
+ if (api.getCurrentUser()?.can_assign) {
+ customizePostMenu(api);
+ }
+ }
+
+ api.addAdvancedSearchOptions(
+ api.getCurrentUser()?.can_assign
+ ? {
+ inOptionsForUsers: [
+ {
+ name: i18n("search.advanced.in.assigned"),
+ value: "assigned",
+ },
+ {
+ name: i18n("search.advanced.in.unassigned"),
+ value: "unassigned",
+ },
+ ],
+ }
+ : {}
+ );
+
+ api.modifyClass(
+ "model:bookmark",
+ (Superclass) =>
+ class extends Superclass {
+ @discourseComputed("assigned_to_user")
+ assignedToUserPath(assignedToUser) {
+ return assignedToUserPath(assignedToUser);
+ }
+
+ @discourseComputed("assigned_to_group")
+ assignedToGroupPath(assignedToGroup) {
+ return assignedToGroupPath(assignedToGroup);
+ }
+ }
+ );
+
+ api.modifyClass(
+ "component:topic-notifications-button",
+ (Superclass) =>
+ class extends Superclass {
+ get reasonText() {
+ if (
+ this.currentUser.never_auto_track_topics &&
+ this.args.topic.get("assigned_to_user.username") ===
+ this.currentUser.username
+ ) {
+ return i18n("notification_reason.user");
+ }
+
+ return super.reasonText;
+ }
+ }
+ );
+
+ api.addDiscoveryQueryParam("assigned", { replace: true, refreshModel: true });
+
+ api.addTagsHtmlCallback((topic, params = {}) => {
+ const [assignedToUser, assignedToGroup, topicNote] = Object.values(
+ topic.getProperties(
+ "assigned_to_user",
+ "assigned_to_group",
+ "assignment_note",
+ "assignment_status"
+ )
+ );
+
+ const topicAssignee = {
+ assignee: assignedToUser || assignedToGroup,
+ note: topicNote,
+ };
+
+ let assignedToIndirectly;
+ if (topic.indirectly_assigned_to) {
+ assignedToIndirectly = Object.entries(topic.indirectly_assigned_to).map(
+ ([key, value]) => {
+ value.assigned_to.assignedToPostId = key;
+ return value;
+ }
+ );
+ } else {
+ assignedToIndirectly = [];
+ }
+ const assignedTo = []
+ .concat(
+ topicAssignee,
+ assignedToIndirectly.map((assigned) => ({
+ assignee: assigned.assigned_to,
+ note: assigned.assignment_note,
+ }))
+ )
+ .filter(({ assignee }) => assignee)
+ .flat();
+
+ if (!assignedTo) {
+ return "";
+ }
+
+ const createTagHtml = ({ assignee, note }) => {
+ let assignedPath;
+ if (assignee.assignedToPostId) {
+ assignedPath = `/p/${assignee.assignedToPostId}`;
+ } else {
+ assignedPath = `/t/${topic.id}`;
+ }
+
+ const icon = iconHTML(assignee.username ? "user-plus" : "group-plus");
+ const showNameInUx = siteSettings.prioritize_full_name_in_ux;
+ const name =
+ showNameInUx || !assignee.username
+ ? assignee.name || assignee.username
+ : assignee.username;
+
+ const tagName = params.tagName || "a";
+ const href =
+ tagName === "a"
+ ? `href="${getURL(assignedPath)}" data-auto-route="true"`
+ : "";
+
+ return `<${tagName} class="assigned-to discourse-tag simple" ${href}>${icon}<span title="${escapeExpression(
+ note
+ )}">${name}</span></${tagName}>`;
+ };
+
+ // is there's one assignment just return the tag
+ if (assignedTo.length === 1) {
+ return createTagHtml(assignedTo[0]);
+ }
+
+ // join multiple assignments with a separator
+ let result = "";
+ assignedTo.forEach((assignment, index) => {
+ result += createTagHtml(assignment);
+
+ // add separator if not the last tag
+ if (index < assignedTo.length - 1) {
+ const separator = applyValueTransformer("tag-separator", ",", {
+ topic,
+ index,
+ });
+ result += `<span class="discourse-tags__tag-separator">${separator}</span>`;
+ }
+ });
+
+ return result;
+ });
+
+ api.modifyClass(
+ "model:group",
+ (Superclass) =>
+ class extends Superclass {
+ asJSON() {
+ return Object.assign({}, super.asJSON(...arguments), {
+ assignable_level: this.assignable_level,
+ });
+ }
+ }
+ );
+
+ api.modifyClass(
+ "controller:topic",
+ (Superclass) =>
+ class extends Superclass {
+ subscribe() {
+ super.subscribe(...arguments);
+
+ this.messageBus.subscribe("/staff/topic-assignment", (data) => {
+ const topic = this.model;
+ const topicId = topic.id;
+
+ if (data.topic_id === topicId) {
+ let post;
+ if (data.post_id) {
+ post = topic.postStream.posts.find(
+ (p) => p.id === data.post_id
+ );
+ }
+ const target = post || topic;
+
+ target.set("assignment_note", data.assignment_note);
+ target.set("assignment_status", data.assignment_status);
+ if (data.assigned_type === "User") {
+ target.set(
+ "assigned_to_user_id",
+ data.type === "assigned" ? data.assigned_to.id : null
+ );
+ target.set("assigned_to_user", data.assigned_to);
+ }
+ if (data.assigned_type === "Group") {
+ target.set(
+ "assigned_to_group_id",
+ data.type === "assigned" ? data.assigned_to.id : null
+ );
+ target.set("assigned_to_group", data.assigned_to);
+ }
+
+ if (data.post_id) {
+ if (data.type === "unassigned") {
+ delete topic.indirectly_assigned_to[data.post_number];
+ }
+
+ this.appEvents.trigger("post-stream:refresh", {
+ id: topic.postStream.posts[0].id,
+ });
+ this.appEvents.trigger("post-stream:refresh", {
+ id: data.post_id,
+ });
+ }
+ if (topic.closed) {
+ this.appEvents.trigger("post-stream:refresh", {
+ id: topic.postStream.posts[0].id,
+ });
+ }
+ }
+ this.appEvents.trigger("header:update-topic", topic);
+ this.appEvents.trigger("post-stream:refresh", {
+ id: topic.postStream.posts[0].id,
+ });
+ });
+ }
+
+ unsubscribe() {
+ super.unsubscribe(...arguments);
+
+ if (!this.model?.id) {
+ return;
+ }
+
+ this.messageBus.unsubscribe("/staff/topic-assignment");
+ }
+ }
+ );
+
+ customizePost(api, siteSettings);
+
+ api.replaceIcon("notification.assigned", "user-plus");
+
+ api.replaceIcon(
+ "notification.discourse_assign.assign_group_notification",
+ "group-plus"
+ );
+
+ api.modifyClass(
+ "controller:preferences/notifications",
+ (Superclass) =>
+ class extends Superclass {
+ @action
+ save() {
+ this.saveAttrNames.push("custom_fields");
+ super.save(...arguments);
+ }
+ }
+ );
+
+ api.addKeyboardShortcut("g a", "", { path: "/my/activity/assigned" });
+}
+
+function customizePost(api, siteSettings) {
+ api.addTrackedPostProperties("assigned_to_user", "assigned_to_group");
+
+ api.modifyClass(
+ "model:post",
+ (Superclass) =>
+ class extends Superclass {
+ get can_edit() {
+ return isAssignSmallAction(this.action_code) ? true : super.can_edit;
+ }
+
+ // overriding tracked properties requires overriding both the getter and the setter.
+ // otherwise the superclass will throw an error when the application sets the field value
+ set can_edit(value) {
+ super.can_edit = value;
+ }
+
+ get isSmallAction() {
+ return isAssignSmallAction(this.action_code)
+ ? true
+ : super.isSmallAction;
+ }
+ }
+ );
+
+ api.renderAfterWrapperOutlet(
+ "post-content-cooked-html",
+ PostAssignmentsDisplay
+ );
+
+ api.addPostSmallActionClassesCallback((post) => {
+ // TODO (glimmer-post-stream): only check for .action_code once the widget code is removed
+ const actionCode = post.action_code || post.actionCode;
+
+ if (actionCode.includes("assigned") && !siteSettings.assigns_public) {
+ return ["private-assign"];
+ }
+ });
+
+ api.addPostSmallActionIcon("assigned", "user-plus");
+ api.addPostSmallActionIcon("assigned_to_post", "user-plus");
+ api.addPostSmallActionIcon("assigned_group", "group-plus");
+ api.addPostSmallActionIcon("assigned_group_to_post", "group-plus");
+ api.addPostSmallActionIcon("unassigned", "user-xmark");
+ api.addPostSmallActionIcon("unassigned_group", "group-times");
+ api.addPostSmallActionIcon("unassigned_from_post", "user-xmark");
+ api.addPostSmallActionIcon("unassigned_group_from_post", "group-times");
+ api.addPostSmallActionIcon("reassigned", "user-plus");
+ api.addPostSmallActionIcon("reassigned_group", "group-plus");
+
+ withSilencedDeprecations("discourse.post-stream-widget-overrides", () =>
+ customizeWidgetPost(api)
+ );
+}
+
+function customizeWidgetPost(api) {
+ api.decorateWidget("post-contents:after-cooked", (dec) => {
+ const postModel = dec.getModel();
+ if (postModel) {
+ let assignedToUser, assignedToGroup, postAssignment, href;
+ if (dec.attrs.post_number === 1) {
+ return dec.widget.attach("assigned-to-first-post", {
+ topic: postModel.topic,
+ });
+ } else {
+ postAssignment =
+ postModel.topic.indirectly_assigned_to?.[postModel.id]?.assigned_to;
+ if (postAssignment?.username) {
+ assignedToUser = postAssignment;
+ }
+ if (postAssignment?.name) {
+ assignedToGroup = postAssignment;
+ }
+ }
+ if (assignedToUser || assignedToGroup) {
+ href = assignedToUser
+ ? assignedToUserPath(assignedToUser)
+ : assignedToGroupPath(assignedToGroup);
+ }
+
+ if (href) {
+ return dec.widget.attach("assigned-to-post", {
+ assignedToUser,
+ assignedToGroup,
+ href,
+ post: postModel,
+ });
+ }
+ }
+ });
+
+ api.createWidget("assigned-to-post", {
+ html(attrs) {
+ return new RenderGlimmer(
+ this,
+ "p.assigned-to",
+ hbs`
+ <AssignedToPost @assignedToUser={{@data.assignedToUser}} @assignedToGroup={{@data.assignedToGroup}}
+ @href={{@data.href}} @post={{@data.post}} />`,
+ {
+ assignedToUser: attrs.post.assigned_to_user,
+ assignedToGroup: attrs.post.assigned_to_group,
+ href: attrs.href,
+ post: attrs.post,
+ }
+ );
+ },
+ });
+
+ api.createWidget("assigned-to-first-post", {
+ html(attrs) {
+ const topic = attrs.topic;
+ const [assignedToUser, assignedToGroup, indirectlyAssignedTo] = [
+ topic.assigned_to_user,
+ topic.assigned_to_group,
+ topic.indirectly_assigned_to,
+ ];
+ const assigneeElements = [];
+
+ const assignedHtml = (username, path, type) => {
+ return `<span class="assigned-to--${type}">${htmlSafe(
+ i18n("discourse_assign.assigned_topic_to", {
+ username,
+ path,
+ })
+ )}</span>`;
+ };
+
+ let displayedName = "";
+ if (assignedToUser) {
+ displayedName = this.siteSettings.prioritize_full_name_in_ux
+ ? assignedToUser.name || assignedToUser.username
+ : assignedToUser.username;
+
+ assigneeElements.push(
+ h(
+ "span.assignee",
+ new RawHtml({
+ html: assignedHtml(
+ displayedName,
+ assignedToUserPath(assignedToUser),
+ "user"
+ ),
+ })
+ )
+ );
+ }
+
+ if (assignedToGroup) {
+ assigneeElements.push(
+ h(
+ "span.assignee",
+ new RawHtml({
+ html: assignedHtml(
+ assignedToGroup.name,
+ assignedToGroupPath(assignedToGroup),
+ "group"
+ ),
+ })
+ )
+ );
+ }
+
+ if (indirectlyAssignedTo) {
+ Object.keys(indirectlyAssignedTo).map((postId) => {
+ const assignee = indirectlyAssignedTo[postId].assigned_to;
+ const postNumber = indirectlyAssignedTo[postId].post_number;
+
+ displayedName =
+ !this.siteSettings.prioritize_username_in_ux || !assignee.username
+ ? assignee.name || assignee.username
+ : assignee.username;
+
+ assigneeElements.push(
+ h("span.assignee", [
+ h(
+ "a",
+ {
+ attributes: {
+ class: "assigned-indirectly",
+ href: `${topic.url}/${postNumber}`,
+ },
+ },
+ i18n("discourse_assign.assign_post_to_multiple", {
+ post_number: postNumber,
+ username: displayedName,
+ })
+ ),
+ ])
+ );
+ });
+ }
+
+ if (!isEmpty(assigneeElements)) {
+ return h("p.assigned-to", [
+ assignedToUser ? iconNode("user-plus") : iconNode("group-plus"),
+ assignedToUser || assignedToGroup
+ ? ""
+ : h("span.assign-text", i18n("discourse_assign.assigned")),
+ assigneeElements,
+ ]);
+ }
+ },
+ });
+
+ // `addPostTransformCallback` doesn't have a direct translation in the new Glimmer API.
+ // We need to use a modify class in the post model instead
+ api.addPostTransformCallback((transformed) => {
+ if (isAssignSmallAction(transformed.actionCode)) {
+ transformed.isSmallAction = true;
+ transformed.canEdit = true;
+ }
+ });
+}
+
+function isAssignSmallAction(actionCode) {
+ return [
+ "assigned",
+ "unassigned",
+ "reassigned",
+ "assigned_group",
+ "unassigned_group",
+ "reassigned_group",
+ "assigned_to_post",
+ "assigned_group_to_post",
+ "unassigned_from_post",
+ "unassigned_group_from_post",
+ "details_change",
+ "note_change",
+ "status_change",
+ ].includes(actionCode);
+}
+
+function customizePostMenu(api) {
+ api.registerValueTransformer(
+ "post-menu-buttons",
+ ({
+ value: dag,
+ context: {
+ post,
+ state,
+ firstButtonKey,
+ lastHiddenButtonKey,
+ secondLastHiddenButtonKey,
+ },
+ }) => {
+ dag.add(
+ "assign",
+ AssignButton,
+ post.assigned_to_user?.id === state.currentUser.id
+ ? {
+ before: firstButtonKey,
+ }
+ : {
+ before: lastHiddenButtonKey,
+ after: secondLastHiddenButtonKey,
+ }
+ );
+ }
+ );
+}
+
+const REGEXP_USERNAME_PREFIX = /^(assigned:)/gi;
+
+export default {
+ name: "extend-for-assign",
+
+ initialize(container) {
+ const siteSettings = container.lookup("service:site-settings");
+ if (!siteSettings.assign_enabled) {
+ return;
+ }
+
+ withPluginApi("1.34.0", (api) => {
+ const currentUser = container.lookup("service:current-user");
+ if (currentUser?.can_assign) {
+ api.modifyClass(
+ "component:search-advanced-options",
+ (Superclass) =>
+ class extends Superclass {
+ updateSearchTermForAssignedUsername() {
+ const match = this.filterBlocks(REGEXP_USERNAME_PREFIX);
+ const userFilter = this.searchedTerms?.assigned;
+ let searchTerm = this.searchTerm || "";
+ let keyword = "assigned";
+
+ if (userFilter?.length !== 0) {
+ if (match.length !== 0) {
+ searchTerm = searchTerm.replace(
+ match[0],
+ `${keyword}:${userFilter}`
+ );
+ } else {
+ searchTerm += ` ${keyword}:${userFilter}`;
+ }
+
+ this._updateSearchTerm(searchTerm);
+ } else if (match.length !== 0) {
+ searchTerm = searchTerm.replace(match[0], "");
+ this._updateSearchTerm(searchTerm);
+ }
+ }
+ }
+ );
+ }
+
+ extendTopicModel(api);
+ initialize(api);
+ registerTopicFooterButtons(api);
+
+ api.addSearchSuggestion("in:assigned");
+ api.addSearchSuggestion("in:unassigned");
+
+ api.addGroupPostSmallActionCode("assigned_group");
+ api.addGroupPostSmallActionCode("reassigned_group");
+ api.addGroupPostSmallActionCode("unassigned_group");
+ api.addGroupPostSmallActionCode("assigned_group_to_post");
+ api.addGroupPostSmallActionCode("unassigned_group_from_post");
+
+ api.addUserSearchOption("assignableGroups");
+
+ api.addSaveableUserOptionField("notification_level_when_assigned");
+
+ api.addBulkActionButton({
+ id: "assign-topics",
+ label: "topics.bulk.assign",
+ icon: "user-plus",
+ class: "btn-default assign-topics",
+ action({ setComponent }) {
+ setComponent(BulkActionsAssignUser);
+ },
+ actionType: "setComponent",
+ });
+
+ api.addBulkActionButton({
+ id: "unassign-topics",
+ label: "topics.bulk.unassign",
+ icon: "user-xmark",
+ class: "btn-default unassign-topics",
+ action({ performAndRefresh }) {
+ performAndRefresh({ type: "unassign" });
+ },
+ actionType: "performAndRefresh",
+ });
+ });
+ },
+};
diff --git a/plugins/discourse-assign/assets/javascripts/discourse/lib/url.js b/plugins/discourse-assign/assets/javascripts/discourse/lib/url.js
new file mode 100644
index 00000000000..208cecf0f06
--- /dev/null
+++ b/plugins/discourse-assign/assets/javascripts/discourse/lib/url.js
@@ -0,0 +1,19 @@
+import { getOwnerWithFallback } from "discourse/lib/get-owner";
+import getURL from "discourse/lib/get-url";
+
+export function assignedToUserPath(assignedToUser) {
+ const siteSettings = getOwnerWithFallback(this).lookup(
+ "service:site-settings"
+ );
+
+ return getURL(
+ siteSettings.assigns_user_url_path.replace(
+ "{username}",
+ assignedToUser.username
+ )
+ );
+}
+
+export function assignedToGroupPath(assignedToGroup) {
+ return getURL(`/g/${assignedToGroup.name}/assigned/everyone`);
+}
diff --git a/plugins/discourse-assign/assets/javascripts/discourse/models/assignment.js b/plugins/discourse-assign/assets/javascripts/discourse/models/assignment.js
new file mode 100644
index 00000000000..67b0086ecaf
--- /dev/null
+++ b/plugins/discourse-assign/assets/javascripts/discourse/models/assignment.js
@@ -0,0 +1,42 @@
+import { tracked } from "@glimmer/tracking";
+import EmberObject from "@ember/object";
+
+export class Assignment extends EmberObject {
+ static fromTopic(topic) {
+ const assignment = new Assignment();
+ assignment.id = 0;
+ assignment.username = topic.assigned_to_user?.username;
+ assignment.groupName = topic.assigned_to_group?.name;
+ assignment.status = topic.assignment_status;
+ assignment.note = topic.assignment_note;
+ assignment.targetId = topic.id;
+ assignment.targetType = "Topic";
+ return assignment;
+ }
+
+ static fromPost(post) {
+ const assignment = new Assignment();
+ assignment.username = post.assigned_to.username;
+ assignment.name = post.assigned_to.name;
+ assignment.groupName = post.assigned_to.name;
+ assignment.status = post.assignment_status;
+ assignment.note = post.assignment_note;
+ assignment.targetId = post.postId;
+ assignment.targetType = "Post";
+ assignment.postNumber = post.post_number;
+ assignment.id = post.post_number;
+ return assignment;
+ }
+
+ // to-do rename to groupName, some components use both this model
+ // and models from server, that's why we have to call it "group_name" now
+ @tracked group_name;
+ @tracked username;
+ @tracked name;
+ @tracked status;
+ @tracked note;
+ targetId;
+ targetType;
+ postNumber;
+ isEdited = false;
+}
diff --git a/plugins/discourse-assign/assets/javascripts/discourse/models/topic.js b/plugins/discourse-assign/assets/javascripts/discourse/models/topic.js
new file mode 100644
index 00000000000..6ab960d3aea
--- /dev/null
+++ b/plugins/discourse-assign/assets/javascripts/discourse/models/topic.js
@@ -0,0 +1,73 @@
+import { Assignment } from "./assignment";
+
+export function extendTopicModel(api) {
+ api.modifyClass(
+ "model:topic",
+ (Superclass) =>
+ class extends Superclass {
+ assignees() {
+ const result = [];
+
+ if (this.assigned_to_user) {
+ result.push(this.assigned_to_user);
+ }
+
+ const postAssignees = this.assignedPosts().map((p) => p.assigned_to);
+ result.push(...postAssignees);
+ return result;
+ }
+
+ uniqueAssignees() {
+ const map = new Map();
+ this.assignees().forEach((user) => map.set(user.username, user));
+ return [...map.values()];
+ }
+
+ assignedPosts() {
+ if (!this.indirectly_assigned_to) {
+ return [];
+ }
+
+ return Object.entries(this.indirectly_assigned_to).map(
+ ([key, value]) => {
+ value.postId = key;
+ return value;
+ }
+ );
+ }
+
+ assignments() {
+ return [this.topicAssignment(), ...this.postAssignments()].compact();
+ }
+
+ postAssignments() {
+ if (!this.indirectly_assigned_to) {
+ return [];
+ }
+
+ return Object.entries(this.indirectly_assigned_to).map(
+ ([key, value]) => {
+ value.postId = key;
+ return Assignment.fromPost(value);
+ }
+ );
+ }
+
+ topicAssignment() {
+ return Assignment.fromTopic(this);
+ }
+
+ isAssigned() {
+ return this.assigned_to_user || this.assigned_to_group;
+ }
+
+ isAssignedTo(user) {
+ return this.assigned_to_user?.username === user.username;
+ }
+
+ hasAssignedPosts() {
+ return !!this.postAssignments().length;
+ }
+ }
+ );
+}
diff --git a/plugins/discourse-assign/assets/javascripts/discourse/pre-initializers/extend-category-for-assign.js b/plugins/discourse-assign/assets/javascripts/discourse/pre-initializers/extend-category-for-assign.js
new file mode 100644
index 00000000000..1c59295ac4f
--- /dev/null
+++ b/plugins/discourse-assign/assets/javascripts/discourse/pre-initializers/extend-category-for-assign.js
@@ -0,0 +1,20 @@
+import { computed } from "@ember/object";
+import Category from "discourse/models/category";
+
+export default {
+ name: "extend-category-for-assign",
+ before: "inject-discourse-objects",
+
+ initialize() {
+ Category.reopen({
+ enable_unassigned_filter: computed(
+ "custom_fields.enable_unassigned_filter",
+ {
+ get() {
+ return this?.custom_fields?.enable_unassigned_filter === "true";
+ },
+ }
+ ),
+ });
+ },
+};
diff --git a/plugins/discourse-assign/assets/javascripts/discourse/routes/group-assigned-show.js b/plugins/discourse-assign/assets/javascripts/discourse/routes/group-assigned-show.js
new file mode 100644
index 00000000000..fddc378659c
--- /dev/null
+++ b/plugins/discourse-assign/assets/javascripts/discourse/routes/group-assigned-show.js
@@ -0,0 +1,33 @@
+import { findOrResetCachedTopicList } from "discourse/lib/cached-topic-list";
+import DiscourseRoute from "discourse/routes/discourse";
+
+export default class GroupAssignedShow extends DiscourseRoute {
+ model(params) {
+ let filter;
+ if (["everyone", this.modelFor("group").name].includes(params.filter)) {
+ filter = `topics/group-topics-assigned/${this.modelFor("group").name}`;
+ } else {
+ filter = `topics/messages-assigned/${params.filter}`;
+ }
+
+ return (
+ findOrResetCachedTopicList(this.session, filter) ||
+ this.store.findFiltered("topicList", {
+ filter,
+ params: {
+ order: params.order,
+ ascending: params.ascending,
+ search: params.search,
+ direct: params.filter !== "everyone",
+ },
+ })
+ );
+ }
+
+ setupController(controller, model) {
+ controller.setProperties({
+ model,
+ search: this.currentModel.params.search,
+ });
+ }
+}
diff --git a/plugins/discourse-assign/assets/javascripts/discourse/routes/group-assigned.js b/plugins/discourse-assign/assets/javascripts/discourse/routes/group-assigned.js
new file mode 100644
index 00000000000..004b5bb886c
--- /dev/null
+++ b/plugins/discourse-assign/assets/javascripts/discourse/routes/group-assigned.js
@@ -0,0 +1,31 @@
+import { service } from "@ember/service";
+import { ajax } from "discourse/lib/ajax";
+import DiscourseRoute from "discourse/routes/discourse";
+
+export default class GroupAssigned extends DiscourseRoute {
+ @service router;
+
+ model() {
+ return ajax(`/assign/members/${this.modelFor("group").name}`);
+ }
+
+ setupController(controller, model) {
+ controller.setProperties({
+ model,
+ members: [],
+ group: this.modelFor("group"),
+ });
+ controller.group.setProperties({
+ assignment_count: model.assignment_count,
+ group_assignment_count: model.group_assignment_count,
+ });
+
+ controller.findMembers(true);
+ }
+
+ redirect(model, transition) {
+ if (!transition.to.params.hasOwnProperty("filter")) {
+ this.router.transitionTo("group.assigned.show", "everyone");
+ }
+ }
+}
diff --git a/plugins/discourse-assign/assets/javascripts/discourse/routes/user-activity-assigned.js b/plugins/discourse-assign/assets/javascripts/discourse/routes/user-activity-assigned.js
new file mode 100644
index 00000000000..67cc8129073
--- /dev/null
+++ b/plugins/discourse-assign/assets/javascripts/discourse/routes/user-activity-assigned.js
@@ -0,0 +1,39 @@
+import { service } from "@ember/service";
+import cookie from "discourse/lib/cookie";
+import UserTopicListRoute from "discourse/routes/user-topic-list";
+import { i18n } from "discourse-i18n";
+
+export default class UserActivityAssigned extends UserTopicListRoute {
+ @service router;
+
+ templateName = "user-activity-assigned";
+ controllerName = "user-activity-assigned";
+
+ userActionType = 16;
+ noContentHelpKey = "discourse_assigns.no_assigns";
+
+ beforeModel() {
+ if (!this.currentUser) {
+ cookie("destination_url", window.location.href);
+ this.router.transitionTo("login");
+ }
+ }
+
+ model(params) {
+ return this.store.findFiltered("topicList", {
+ filter: `topics/messages-assigned/${
+ this.modelFor("user").username_lower
+ }`,
+ params: {
+ exclude_category_ids: [-1],
+ order: params.order,
+ ascending: params.ascending,
+ search: params.search,
+ },
+ });
+ }
+
+ titleToken() {
+ return i18n("discourse_assign.assigned");
+ }
+}
diff --git a/plugins/discourse-assign/assets/javascripts/discourse/routes/user-private-messages-assigned-index.js b/plugins/discourse-assign/assets/javascripts/discourse/routes/user-private-messages-assigned-index.js
new file mode 100644
index 00000000000..a7bab1d34ec
--- /dev/null
+++ b/plugins/discourse-assign/assets/javascripts/discourse/routes/user-private-messages-assigned-index.js
@@ -0,0 +1,7 @@
+import createPMRoute from "discourse/routes/build-private-messages-route";
+
+export default createPMRoute(
+ "assigned",
+ "private-messages-assigned",
+ "assigned"
+);
diff --git a/plugins/discourse-assign/assets/javascripts/discourse/services/task-actions.js b/plugins/discourse-assign/assets/javascripts/discourse/services/task-actions.js
new file mode 100644
index 00000000000..2ed05690665
--- /dev/null
+++ b/plugins/discourse-assign/assets/javascripts/discourse/services/task-actions.js
@@ -0,0 +1,132 @@
+import { tracked } from "@glimmer/tracking";
+import Service, { service } from "@ember/service";
+import { isEmpty } from "@ember/utils";
+import { ajax } from "discourse/lib/ajax";
+import { popupAjaxError } from "discourse/lib/ajax-error";
+import AssignUser from "../components/modal/assign-user";
+
+export default class TaskActions extends Service {
+ @service modal;
+
+ @tracked allowedGroups;
+ @tracked allowedGroupsForAssignment;
+ #suggestionsPromise; // eslint-disable-line no-unused-private-class-members
+ @tracked _suggestions;
+
+ get suggestions() {
+ if (this._suggestions) {
+ return this._suggestions;
+ }
+
+ this.#suggestionsPromise ||= this.#fetchSuggestions();
+
+ return null;
+ }
+
+ async #fetchSuggestions() {
+ const data = await ajax("/assign/suggestions");
+
+ if (this.isDestroying || this.isDestroyed) {
+ return;
+ }
+
+ this._suggestions = data.suggestions;
+ this.allowedGroups = data.assign_allowed_on_groups;
+ this.allowedGroupsForAssignment = data.assign_allowed_for_groups;
+ }
+
+ unassign(targetId, targetType = "Topic") {
+ return ajax("/assign/unassign", {
+ type: "PUT",
+ data: {
+ target_id: targetId,
+ target_type: targetType,
+ },
+ });
+ }
+
+ async unassignPost(post) {
+ await this.unassign(post.id, "Post");
+ delete post.topic.indirectly_assigned_to[post.id];
+ }
+
+ showAssignModal(
+ target,
+ { isAssigned = false, targetType = "Topic", onSuccess }
+ ) {
+ return this.modal.show(AssignUser, {
+ model: {
+ reassign: isAssigned,
+ username: target.assigned_to_user?.username,
+ group_name: target.assigned_to_group?.name,
+ status: target.assignment_status,
+ target,
+ targetType,
+ onSuccess,
+ },
+ });
+ }
+
+ showAssignPostModal(post) {
+ return this.showAssignModal(post, { targetType: "Post" });
+ }
+
+ reassignUserToTopic(user, target, targetType = "Topic") {
+ return ajax("/assign/assign", {
+ type: "PUT",
+ data: {
+ username: user.username,
+ target_id: target.id,
+ target_type: targetType,
+ status: target.assignment_status,
+ },
+ });
+ }
+
+ async assign(model) {
+ if (isEmpty(model.username)) {
+ model.target.set("assigned_to_user", null);
+ }
+
+ if (isEmpty(model.group_name)) {
+ model.target.set("assigned_to_group", null);
+ }
+
+ let path = "/assign/assign";
+ if (isEmpty(model.username) && isEmpty(model.group_name)) {
+ path = "/assign/unassign";
+ }
+
+ try {
+ await ajax(path, {
+ type: "PUT",
+ data: {
+ username: model.username,
+ group_name: model.group_name,
+ target_id: model.target.id,
+ target_type: model.targetType,
+ note: model.note,
+ status: model.status,
+ },
+ });
+
+ model.onSuccess?.();
+ } catch (error) {
+ popupAjaxError(error);
+ }
+ }
+
+ async putAssignment(assignment) {
+ await ajax("/assign/assign", {
+ type: "PUT",
+ data: {
+ username: assignment.username,
+ group_name: assignment.group_name,
+ target_id: assignment.targetId,
+ target_type: assignment.targetType,
+ note: assignment.note,
+ status: assignment.status,
+ },
+ });
+ }
+}
diff --git a/plugins/discourse-assign/assets/javascripts/discourse/templates/group-assigned-show.gjs b/plugins/discourse-assign/assets/javascripts/discourse/templates/group-assigned-show.gjs
new file mode 100644
index 00000000000..4338e20e909
--- /dev/null
+++ b/plugins/discourse-assign/assets/javascripts/discourse/templates/group-assigned-show.gjs
@@ -0,0 +1,54 @@
+import { Input } from "@ember/component";
+import { on } from "@ember/modifier";
+import RouteTemplate from "ember-route-template";
+import BasicTopicList from "discourse/components/basic-topic-list";
+import ConditionalLoadingSpinner from "discourse/components/conditional-loading-spinner";
+import LoadMore from "discourse/components/load-more";
+import withEventValue from "discourse/helpers/with-event-value";
+import { i18n } from "discourse-i18n";
+
+export default RouteTemplate(
+ <template>
+ <div class="topic-search-div">
+ <div class="inline-form full-width">
+ <Input
+ {{on "input" (withEventValue @controller.onChangeFilter)}}
+ @value={{readonly @controller.search}}
+ @type="search"
+ placeholder={{i18n "discourse_assign.topic_search_placeholder"}}
+ autocomplete="off"
+ class="no-blur"
+ />
+ </div>
+ </div>
+
+ <LoadMore
+ @selector=".paginated-topics-list .topic-list tr"
+ @action={{@controller.loadMore}}
+ class="paginated-topics-list"
+ >
+ <BasicTopicList
+ @topicList={{@controller.model}}
+ @hideCategory={{@controller.hideCategory}}
+ @showPosters={{@controller.showPosters}}
+ @bulkSelectEnabled={{@controller.bulkSelectEnabled}}
+ @canBulkSelect={{@controller.canBulkSelect}}
+ @selected={{@controller.selected}}
+ @hasIncoming={{@controller.hasIncoming}}
+ @incomingCount={{@controller.incomingCount}}
+ @showInserted={{@controller.showInserted}}
+ @tagsForUser={{@controller.tagsForUser}}
+ @changeSort={{@controller.changeSort}}
+ @toggleBulkSelect={{@controller.toggleBulkSelect}}
+ @bulkSelectAction={{@controller.refresh}}
+ @bulkSelectHelper={{@controller.bulkSelectHelper}}
+ @unassign={{@controller.unassign}}
+ @reassign={{@controller.reassign}}
+ @onScroll={{@controller.saveScrollPosition}}
+ @scrollOnLoad={{true}}
+ />
+
+ <ConditionalLoadingSpinner @condition={{@controller.model.loadingMore}} />
+ </LoadMore>
+ </template>
+);
diff --git a/plugins/discourse-assign/assets/javascripts/discourse/templates/group/assigned.gjs b/plugins/discourse-assign/assets/javascripts/discourse/templates/group/assigned.gjs
new file mode 100644
index 00000000000..c00d1c9caae
--- /dev/null
+++ b/plugins/discourse-assign/assets/javascripts/discourse/templates/group/assigned.gjs
@@ -0,0 +1,76 @@
+import { Input } from "@ember/component";
+import { on } from "@ember/modifier";
+import RouteTemplate from "ember-route-template";
+import ConditionalLoadingSpinner from "discourse/components/conditional-loading-spinner";
+import LoadMore from "discourse/components/load-more";
+import MobileNav from "discourse/components/mobile-nav";
+import bodyClass from "discourse/helpers/body-class";
+import withEventValue from "discourse/helpers/with-event-value";
+import { i18n } from "discourse-i18n";
+import GroupAssignedFilter from "../../components/group-assigned-filter";
+
+export default RouteTemplate(
+ <template>
+ <section class="user-secondary-navigation group-assignments">
+ {{bodyClass "group-assign"}}
+ <MobileNav
+ @desktopClass="action-list activity-list nav-stacked"
+ class="activity-nav"
+ >
+ {{#if @controller.isDesktop}}
+ <div class="search-div">
+ <Input
+ {{on "input" (withEventValue @controller.onChangeFilterName)}}
+ @type="text"
+ @value={{readonly @controller.filterName}}
+ placeholder={{i18n
+ "discourse_assign.sidebar_name_filter_placeholder"
+ }}
+ class="search"
+ />
+ </div>
+ {{/if}}
+
+ <LoadMore @selector=".activity-nav li" @action={{@controller.loadMore}}>
+ <GroupAssignedFilter
+ @showAvatar={{false}}
+ @filter="everyone"
+ @routeType={{@controller.route_type}}
+ @assignmentCount={{@controller.group.assignment_count}}
+ @search={{@controller.search}}
+ @ascending={{@controller.ascending}}
+ @order={{@controller.order}}
+ />
+
+ <GroupAssignedFilter
+ @showAvatar={{false}}
+ @groupName={{@controller.group.name}}
+ @filter={{@controller.group.name}}
+ @routeType={{@controller.route_type}}
+ @assignmentCount={{@controller.group.group_assignment_count}}
+ @search={{@controller.search}}
+ @ascending={{@controller.ascending}}
+ @order={{@controller.order}}
+ />
+
+ {{#each @controller.members as |member|}}
+ <GroupAssignedFilter
+ @showAvatar={{true}}
+ @filter={{member}}
+ @routeType={{@controller.route_type}}
+ @search={{@controller.search}}
+ @ascending={{@controller.ascending}}
+ @order={{@controller.order}}
+ />
+ {{/each}}
+
+ <ConditionalLoadingSpinner @condition={{@controller.loading}} />
+ </LoadMore>
+ </MobileNav>
+ </section>
+
+ <section class="user-content">
+ {{outlet}}
+ </section>
+ </template>
+);
diff --git a/plugins/discourse-assign/assets/javascripts/discourse/templates/modal/bulk-assign.gjs b/plugins/discourse-assign/assets/javascripts/discourse/templates/modal/bulk-assign.gjs
new file mode 100644
index 00000000000..8fe2c16def8
--- /dev/null
+++ b/plugins/discourse-assign/assets/javascripts/discourse/templates/modal/bulk-assign.gjs
@@ -0,0 +1,27 @@
+import RouteTemplate from "ember-route-template";
+import DButton from "discourse/components/d-button";
+import AssignUserForm from "../../components/assign-user-form";
+
+export default RouteTemplate(
+ <template>
+ <div>
+ <AssignUserForm
+ @model={{@controller.model}}
+ @onSubmit={{@controller.assign}}
+ @formApi={{@controller.formApi}}
+ />
+ </div>
+
+ <div>
+ <DButton
+ class="btn-primary"
+ @action={{@controller.formApi.submit}}
+ @label={{if
+ @controller.model.reassign
+ "discourse_assign.reassign.title"
+ "discourse_assign.assign_modal.assign"
+ }}
+ />
+ </div>
+ </template>
+);
diff --git a/plugins/discourse-assign/assets/javascripts/discourse/templates/user-activity-assigned.gjs b/plugins/discourse-assign/assets/javascripts/discourse/templates/user-activity-assigned.gjs
new file mode 100644
index 00000000000..f0932b261b6
--- /dev/null
+++ b/plugins/discourse-assign/assets/javascripts/discourse/templates/user-activity-assigned.gjs
@@ -0,0 +1,60 @@
+import { Input } from "@ember/component";
+import { on } from "@ember/modifier";
+import RouteTemplate from "ember-route-template";
+import BasicTopicList from "discourse/components/basic-topic-list";
+import ConditionalLoadingSpinner from "discourse/components/conditional-loading-spinner";
+import EmptyState from "discourse/components/empty-state";
+import LoadMore from "discourse/components/load-more";
+import withEventValue from "discourse/helpers/with-event-value";
+import { i18n } from "discourse-i18n";
+
+export default RouteTemplate(
+ <template>
+ {{#if @controller.doesntHaveAssignments}}
+ <EmptyState
+ @title={{i18n "user.no_assignments_title"}}
+ @body={{@controller.emptyStateBody}}
+ />
+ {{else}}
+ <div class="topic-search-div">
+ <div class="inline-form full-width">
+ <Input
+ {{on "input" (withEventValue @controller.onChangeFilter)}}
+ @value={{readonly @controller.search}}
+ @type="search"
+ placeholder={{i18n "discourse_assign.topic_search_placeholder"}}
+ autocomplete="off"
+ class="no-blur"
+ />
+ </div>
+ </div>
+
+ <LoadMore
+ @selector=".paginated-topics-list .topic-list tr"
+ @action={{@controller.loadMore}}
+ class="paginated-topics-list"
+ >
+ <BasicTopicList
+ @topicList={{@controller.model}}
+ @hideCategory={{@controller.hideCategory}}
+ @showPosters={{true}}
+ @bulkSelectEnabled={{@controller.bulkSelectEnabled}}
+ @selected={{@controller.selected}}
+ @hasIncoming={{@controller.hasIncoming}}
+ @incomingCount={{@controller.incomingCount}}
+ @showInserted={{@controller.showInserted}}
+ @tagsForUser={{@controller.tagsForUser}}
+ @changeSort={{@controller.changeSort}}
+ @unassign={{@controller.unassign}}
+ @reassign={{@controller.reassign}}
+ @onScroll={{@controller.saveScrollPosition}}
+ @scrollOnLoad={{true}}
+ />
+
+ <ConditionalLoadingSpinner
+ @condition={{@controller.model.loadingMore}}
+ />
+ </LoadMore>
+ {{/if}}
+ </template>
+);
diff --git a/plugins/discourse-assign/assets/javascripts/discourse/templates/user-private-messages-assigned.gjs b/plugins/discourse-assign/assets/javascripts/discourse/templates/user-private-messages-assigned.gjs
new file mode 100644
index 00000000000..29e8eb882f4
--- /dev/null
+++ b/plugins/discourse-assign/assets/javascripts/discourse/templates/user-private-messages-assigned.gjs
@@ -0,0 +1,20 @@
+import { LinkTo } from "@ember/routing";
+import RouteTemplate from "ember-route-template";
+import MessagesSecondaryNav from "discourse/components/user-nav/messages-secondary-nav";
+import icon from "discourse/helpers/d-icon";
+import { i18n } from "discourse-i18n";
+
+export default RouteTemplate(
+ <template>
+ <MessagesSecondaryNav>
+ <li class="messages-assigned-latest">
+ <LinkTo @route="userPrivateMessages.assigned.index">
+ {{icon "envelope"}}
+ <span>{{i18n "categories.latest"}}</span>
+ </LinkTo>
+ </li>
+ </MessagesSecondaryNav>
+
+ {{outlet}}
+ </template>
+);
diff --git a/plugins/discourse-assign/assets/stylesheets/assigns.scss b/plugins/discourse-assign/assets/stylesheets/assigns.scss
new file mode 100644
index 00000000000..c6a82a1afa2
--- /dev/null
+++ b/plugins/discourse-assign/assets/stylesheets/assigns.scss
@@ -0,0 +1,295 @@
+.user-content {
+ .assign-controls {
+ display: flex;
+ justify-content: flex-end;
+ margin-bottom: 0.5em;
+
+ .assign-messages-assigned {
+ margin-right: 0.5em;
+ }
+ }
+}
+
+.assigned-to {
+ .d-icon,
+ i.fa {
+ margin-right: 0.25em;
+ color: var(--primary-medium);
+ }
+
+ .assign-text {
+ margin-right: 0.25em;
+ }
+
+ .composer-popup & {
+ margin-left: 0.5em;
+ }
+
+ .assignee:not(:last-child)::after {
+ content: ", ";
+ }
+
+ .more-button {
+ padding-left: 0.3em;
+ padding-right: 0.3em;
+ vertical-align: middle;
+ }
+}
+
+.topic-body {
+ .assigned-to {
+ padding-left: 11px;
+ }
+}
+
+.cant-act-flagged-post {
+ padding: 0.5em;
+ border: 1px dashed var(--primary-medium);
+ color: var(--primary);
+ display: flex;
+ justify-content: space-between;
+ align-items: center;
+}
+
+.topic-assigned-to {
+ min-width: 15%;
+ width: 15%;
+}
+
+.list-tags.assigned {
+ margin-left: 5px;
+}
+
+.d-modal.assign {
+ .d-modal__body {
+ overflow-y: unset;
+ }
+
+ label {
+ font-weight: bold;
+
+ .label-optional {
+ color: var(--primary-medium);
+ font-weight: normal;
+ }
+ }
+
+ .target {
+ .combo-box {
+ width: 100%;
+ }
+ }
+
+ .email-group-user-chooser {
+ width: 100%;
+
+ .select-kit-header {
+ outline: 0 !important;
+ }
+
+ .select-kit-body {
+ position: absolute !important;
+ transform: none !important;
+ max-width: 100%;
+ }
+
+ &-filter.is-expanded {
+ border: 1px solid var(--tertiary);
+ }
+
+ .caret-icon {
+ color: var(--primary-medium);
+ }
+
+ .user-wrapper {
+ display: flex;
+ align-items: baseline;
+ line-height: var(--line-height-small);
+ overflow: hidden;
+ pointer-events: all;
+ }
+
+ .name {
+ display: contents;
+ }
+
+ .identifier {
+ margin-right: 0.5rem;
+ }
+
+ .user-status-message {
+ overflow: hidden;
+ text-overflow: ellipsis;
+ white-space: nowrap;
+ color: var(--primary-medium);
+ font-size: var(--font-down-2);
+ margin-left: 0.5em;
+
+ .emoji {
+ height: var(--font-0);
+ width: var(--font-0);
+ }
+ }
+
+ .suggestions-label {
+ position: absolute;
+ right: 0;
+ top: 0;
+ margin: 0.25em 0.25em 0 0;
+ color: var(--primary-low-mid);
+ font-size: var(--font-down-3);
+ font-weight: bold;
+ text-transform: uppercase;
+ }
+ }
+
+ .control-group.assignee-error {
+ .select-kit-header {
+ border-color: var(--danger);
+ }
+
+ .error-label {
+ color: var(--danger);
+ font-size: var(--font-down-1);
+ }
+ }
+}
+
+.topic-list-item {
+ .private-message-icon {
+ margin-right: 5px;
+ }
+}
+
+#topic-footer-dropdown-reassign {
+ .name {
+ font-weight: normal;
+ display: flex;
+ align-items: center;
+ gap: 0.25em;
+ }
+
+ .avatar {
+ width: 1.19em;
+ height: 1.19em;
+ }
+
+ .avatar.overlap {
+ z-index: 1;
+ margin-right: -0.4em;
+ }
+
+ .d-icon,
+ i.fa {
+ color: var(--primary-medium);
+ }
+
+ .d-icon {
+ margin-left: 0.165em;
+ margin-right: 0.165em;
+ }
+}
+
+// Group assigns sidebar nav
+.group-assignments {
+ // a little extra space for long names
+ min-width: 250px;
+
+ li a {
+ display: grid;
+ grid-template-areas: " avatar names count";
+ grid-template-columns: auto 1fr auto;
+ align-items: center;
+ padding: 0.5em 13px;
+
+ .assign-image {
+ width: 45px;
+ margin-right: 0.5em;
+ text-align: center;
+ grid-area: avatar;
+
+ a {
+ padding: 0;
+ padding-right: 0.5em;
+ }
+
+ svg {
+ width: 40px;
+ height: 40px;
+ }
+ }
+
+ .assign-names {
+ font-size: var(--font-down-1);
+ grid-area: names;
+ overflow: hidden;
+ line-height: normal;
+ }
+
+ .assign-name {
+ @include ellipsis;
+ margin-top: 3px;
+ }
+
+ .assign-username {
+ font-weight: bold;
+
+ @include ellipsis;
+ }
+
+ .assign-count {
+ font-size: var(--font-up-2);
+ grid-area: count;
+ }
+ }
+
+ .search {
+ width: 100%;
+ }
+
+ .search-div {
+ padding: 0 0;
+ }
+}
+
+.assigned-topic-list-header .topic-list-data.num:last-of-type {
+ margin-right: 50px; // account for button in topic-list-items in topic-list-refactor
+}
+
+.assigned-topic-list-item {
+ .topic-list-data {
+ .topic-item-stats .category a {
+ max-width: 145px;
+ }
+ }
+}
+
+.private-assign {
+ // when assigns are not public, make the description look like a whisper
+ .small-action-custom-message {
+ font-style: italic;
+ color: var(--primary-medium);
+ }
+}
+
+.desktop-view {
+ .group-assign {
+ .user-secondary-navigation {
+ grid-column: 1;
+ grid-row: 2/4;
+ }
+
+ .group-assignments {
+ margin-top: 1.25em;
+ }
+
+ .user-content-wrapper .user-content {
+ grid-column: 2;
+ }
+
+ .nav-stacked {
+ width: 100%;
+ margin-right: 2em;
+ }
+ }
+}
diff --git a/plugins/discourse-assign/assets/stylesheets/mobile/assigns.scss b/plugins/discourse-assign/assets/stylesheets/mobile/assigns.scss
new file mode 100644
index 00000000000..1d69374f092
--- /dev/null
+++ b/plugins/discourse-assign/assets/stylesheets/mobile/assigns.scss
@@ -0,0 +1,122 @@
+.user-right {
+ .assign-controls {
+ justify-content: flex-start;
+ margin-top: 1em;
+ }
+}
+
+.assigned-topic-list-item {
+ .topic-list-data {
+ max-width: unset;
+ display: grid;
+ grid-template-columns: 1fr 37px; // 37px is size of button
+ }
+
+ .pull-right .num.activity {
+ margin-right: 0.5em;
+ }
+
+ .topic-item-stats {
+ display: grid;
+ grid-template-columns: auto auto;
+ grid-template-rows: auto auto;
+ grid-template-areas:
+ "left-top right-top"
+ "left-bottom right-bottom";
+ grid-column-start: 1;
+ grid-column-end: 3;
+
+ .discourse-tags {
+ grid-area: left-top;
+ max-width: unset;
+ }
+
+ .topic-list-num {
+ grid-area: right-bottom;
+ display: flex;
+ justify-content: end;
+ }
+
+ .category {
+ grid-area: left-bottom;
+ }
+ }
+}
+
+.select-kit-row[data-value="unassign-mobile-header"] {
+ background: rgb(var(--primary-low-rgb), 0.5);
+ pointer-events: none;
+}
+
+.select-kit-row.assign {
+ .name {
+ display: flex;
+ align-items: center;
+ justify-content: space-between;
+
+ .unassign-label {
+ margin-right: 25px;
+ display: inline-flex;
+ flex-direction: column;
+ width: auto;
+
+ .username {
+ font-size: var(--font-down-1);
+ color: var(--primary-medium);
+ }
+ }
+ }
+}
+
+.group-assignments .mobile-nav .drop li a {
+ display: grid;
+}
+
+.group-assignments .mobile-nav a.expander > span {
+ display: flex;
+
+ @include ellipsis;
+
+ .assign-count {
+ display: none;
+ }
+
+ .assign-name {
+ margin: 0;
+ padding: 0;
+ }
+
+ a {
+ width: 1em;
+ height: 1em;
+ }
+}
+
+.group-assignments {
+ min-width: unset;
+
+ li > a {
+ .assign-names,
+ .assign-count {
+ font-size: var(--font-0);
+ }
+
+ .assign-image,
+ .assign-name {
+ display: none;
+ }
+
+ .assign-username {
+ font-weight: normal;
+ }
+ }
+}
+
+.group-assignments .activity-nav {
+ width: 100%;
+ margin-top: 1em;
+}
+
+.user-content-wrapper .user-secondary-navigation li a {
+ width: auto;
+}
diff --git a/plugins/discourse-assign/config/locales/client.ar.yml b/plugins/discourse-assign/config/locales/client.ar.yml
new file mode 100644
index 00000000000..e49cc2ecbf0
--- /dev/null
+++ b/plugins/discourse-assign/config/locales/client.ar.yml
@@ -0,0 +1,201 @@
+# WARNING: Never edit this file.
+# It will be overwritten when translations are pulled from Crowdin.
+#
+# To work with us on translations, join this project:
+# https://translate.discourse.org/
+
+ar:
+ admin_js:
+ admin:
+ site_settings:
+ categories:
+ discourse_assign: "تعيين Discourse"
+ js:
+ filters:
+ unassigned:
+ title: "غير معيَّنة"
+ help: "الموضوعات غير المعيَّنة"
+ action_codes:
+ assigned: "تم تعيين %{who} في %{when}"
+ assigned_group: "تم تعيين %{who} في %{when}"
+ assigned_to_post: "تم تعيين %{who} إلى <a href='%{path}'>المنشور</a> في %{when}"
+ assigned_group_to_post: "تم تعيين %{who} إلى <a href='%{path}'>المنشور</a> في %{when}"
+ unassigned: "تم إلغاء تعيين %{who} في %{when}"
+ unassigned_group: "تم إلغاء تعيين %{who} في %{when}"
+ unassigned_from_post: "تم إلغاء تعيين %{who} إلى <a href='%{path}'>المنشور</a> في %{when}"
+ unassigned_group_from_post: "تم إلغاء تعيين %{who} إلى <a href='%{path}'>المنشور</a> في %{when}"
+ reassigned: "تمت إعادة تعيين %{who} في %{when}"
+ reassigned_group: "تمت إعادة تعيين %{who} في %{when}"
+ details_change: "تم تغيير تفاصيل التعيين لـ %{who} في %{when}"
+ note_change: "تم تغيير ملاحظة التعيين لـ %{who} في %{when}"
+ status_change: "تم تغيير حالة التعيين لـ %{who} في %{when}"
+ discourse_assign:
+ add_unassigned_filter: "إضافة المرشح \"غير المعيَّنة\" إلى الفئة"
+ cant_act: "لا يمكنك اتخاذ إجراء بشأن البلاغات التي تم تعيينها إلى مستخدمين آخرين"
+ cant_act_unclaimed: "يجب عليك المطالبة بملكية هذا الموضوع قبل اتخاذ إجراء بشان البلاغات."
+ topic_search_placeholder: "البحث في الموضوعات بالعنوان أو محتوى المنشور"
+ sidebar_name_filter_placeholder: "الاسم/اسم المستخدم"
+ assigned: "المعيَّنة"
+ group_everyone: "الجميع"
+ assigned_to: "معيَّنة إلى"
+ assigned_topic_to: "تم تعيين الموضوع إلى المستخدم <a href='%{path}'>%{username}</a>"
+ assign_post_to: "تم تعيين المنشور #%{post_number} إلى المستخدم %{username}"
+ assign_post_to_multiple: "#%{post_number} إلى %{username}"
+ assigned_to_w_ellipsis: "معيَّنة إلى..."
+ unassign:
+ title: "إلغاء التعيين"
+ title_w_ellipsis: "إلغاء التعيين..."
+ help: "إلغاء تعيين الموضوع إلى %{username}"
+ assign:
+ title: "تعيين"
+ help: "تعيين الموضوع إلى المستخدم"
+ assign_post:
+ title: "تعيين المنشور"
+ unassign_post:
+ title: "إلغاء تعيين المنشور"
+ help: "إلغاء تعيين المنشور إلى %{username}"
+ reassign:
+ title: "تعديل"
+ title_w_ellipsis: "تعديل التعيين..."
+ to_self: "إعادة التعيين إليَّ"
+ to_self_help: "إعادة تعيين الموضوع إليَّ"
+ help: "تعديل تفاصيل التعيين"
+ reassign_modal:
+ title: "إعادة تعيين الموضوع"
+ topic_level_menu:
+ edit_assignments: "تعديل المهام المعيَّنة..."
+ reassign_topic_to_me: "إعادة تعيين الموضوع إليَّ"
+ unassign_with_ellipsis: "إلغاء تعيين..."
+ unassign_from_post: "إلغاء تعيين @%{assignee} من #%{post_number}"
+ unassign_from_post_help: "إلغاء تعيين @%{assignee} من المنشور #%{post_number}"
+ unassign_from_topic: "إلغاء تعيين @%{username} من الموضوع"
+ assign_modal:
+ title: "تعيين الموضوع"
+ reassign_title: "إعادة تعيين الموضوع"
+ assign: "تعيين"
+ assignee_label: المعيَّن
+ assignment_label: التعيين
+ choose_assignee: اختر مستخدمًا لتعيينه.
+ edit_assignments_title: "تعديل المهام المعيَّنة"
+ note_label: ملاحظة
+ optional_label: "(اختياري)"
+ status_label: الحالة
+ suggestions: الاقتراحات
+ assign_post_modal:
+ title: "تعيين المنشور"
+ claim:
+ title: "المطالبة بالملكية"
+ help: "تعيين الموضوع إلى نفسك"
+ assign_mailer:
+ never: "أبدًا"
+ different_users: "فقط إذا كان المعيِّن والمعيَّن مستخدمَين مختلفَين"
+ always: "دائمًا"
+ reminders_frequency:
+ description: "معدل تكرار تلقي التذكيرات بالموضوعات المعيَّنة"
+ never: "أبدًا"
+ daily: "يوميًا"
+ weekly: "أسبوعيًا"
+ monthly: "شهريًا"
+ quarterly: "ربع سنوي"
+ admin:
+ groups:
+ manage:
+ interaction:
+ assign: "تعيين"
+ assignable_levels:
+ title: "من يمكنه تعيين هذه المجموعة"
+ user:
+ notification_level_when_assigned:
+ label: "عند التعيين"
+ watch_topic: "مراقبة الموضوع"
+ track_topic: "تتبُّع الموضوع"
+ do_nothing: "عدم اتخاذ أي إجراء"
+ messages:
+ assigned_title: "المعيَّنة (%{count})"
+ assigned: "المعيَّنة"
+ no_assignments_title: "ليس لديك أي تعيينات بعد"
+ no_assignments_body: >
+ سيتم إدراج الموضوعات والرسائل المعيَّنة إليك هنا. ستتلقى أيضًا إشعار تذكير دوريًا بتعييناتك، والذي يمكنك تعديله في <a href='%{preferencesUrl}'>تفضيلات المستخدم</a>. <br><br> لتعيين موضوع أو رسالة إلى نفسك أو إلى شخص آخر، ابحث عن %{icon} في الأسفل.
+ dismiss_assigned_tooltip: "وضع علامة مقروءة على كل إشعارات التعيين"
+ assigned_to_group:
+ post: "تم تعيين المنشور إلى %{group_name}"
+ topic: "تم تعيين الموضوع إلى %{group_name}"
+ assigned_to_you:
+ post: "تم تعيين المنشور إليك"
+ topic: "تم تعيين الموضوع إليك"
+ assignment_description:
+ post: "%{topic_title} (#%{post_number})"
+ topic: "%{topic_title}"
+ admin:
+ web_hooks:
+ assign_event:
+ group_name: "أحداث التعيين"
+ assigned: "عندما يقوم المستخدم بتعيين موضوع"
+ unassigned: "عندما يلغي المستخدم تعيين موضوع"
+ search:
+ advanced:
+ in:
+ assigned: "معيَّنة"
+ unassigned: "غير معيَّنة"
+ assigned:
+ label: "معيَّنة إلى"
+ topics:
+ bulk:
+ unassign: "إلغاء تعيين الموضوعات"
+ assign: "تعيين الموضوعات"
+ discourse_automation:
+ scriptables:
+ random_assign:
+ fields:
+ post_template:
+ label: نموذج المنشور
+ description: إذا تم ملؤه، فسيتم إنشاء منشور بهذا النموذج وتعيين مستخدم له بدلًا من الموضوع.
+ assignees_group:
+ label: مجموعة المعيَّنين
+ minimum_time_between_assignments:
+ label: الحد الأدنى لعدد الساعات بين المهام المعيَّنة
+ min_recently_assigned_days:
+ label: الحد الأدنى لعدد الأيام التي يعتبر فيها المستخدم حديث التعيين
+ description: الإعداد الافتراضي هو 14 يومًا.
+ skip_new_users_for_days:
+ label: تخطي المستخدمين الجُدد لأيام
+ description: الإعداد الافتراضي هو 0 يوم (يمكن تعيين المستخدمين بعد التسجيل على الفور).
+ max_recently_assigned_days:
+ label: الحد الأقصى لعدد الأيام التي يعتبر فيها المستخدم حديث التعيين
+ description: المحاولة الأولى لاستبعاد المستخدمين المعيَّنين في الأيام `n` الأخيرة. إذا لم يتبقَّ أي مستخدم، يتم التراجع إلى `min_recently_assigned_days`. الإعداد الافتراضي هو 180 يومًا.
+ assigned_topic:
+ label: مُعرِّف الموضوع المعيَّن
+ in_working_hours:
+ label: المستخدمون في ساعات العمل
+ notification_reason:
+ user: "سترى عدد الردود الجديدة لأن هذا الموضوع معيَّن إليك."
+ notifications:
+ assigned: "<span>%{username}</span> %{description}"
+ popup:
+ assigned: "عيَّنك %{username}"
+ titles:
+ assigned: "تم تعيينك"
+ dismiss_confirmation:
+ body:
+ assigns:
+ zero: "هل أنت متأكد؟ لديك %{count} إشعار تعيين غير مقروء."
+ one: "هل أنت متأكد؟ لديك إشعار تعيين واحد (%{count}) غير مقروء."
+ two: "هل أنت متأكد؟ لديك إشعارا (%{count}) تعيين غير مقروءين."
+ few: "هل أنت متأكد؟ لديك %{count} إشعارات تعيين غير مقروءة."
+ many: "هل أنت متأكد؟ لديك %{count} إشعار تعيين غير مقروء."
+ other: "هل أنت متأكد؟ لديك %{count} إشعار تعيين غير مقروء."
+ user_menu:
+ view_all_assigned: "عرض كل المعيَّنة"
+ tabs:
+ assign_list: "قائمة التعيين"
+ assign_list_with_unread:
+ zero: "قائمة التعيين - %{count} تعيين غير مقروء"
+ one: "قائمة التعيين - تعيين واحد (%{count}) غير مقروء"
+ two: "قائمة التعيين - تعيينان (%{count}) غير مقروءين"
+ few: "قائمة التعيين - %{count} تعيينات غير مقروءة"
+ many: "قائمة التعيين - %{count} تعيينًا غير مقروء"
+ other: "قائمة التعيين - %{count} تعيين غير مقروء"
+ edit_assignments_modal:
+ title: "تعديل المهام المعيَّنة"
+ topic: "الموضوع"
+ post: "المنشور"
diff --git a/plugins/discourse-assign/config/locales/client.be.yml b/plugins/discourse-assign/config/locales/client.be.yml
new file mode 100644
index 00000000000..da493a409ad
--- /dev/null
+++ b/plugins/discourse-assign/config/locales/client.be.yml
@@ -0,0 +1,35 @@
+# WARNING: Never edit this file.
+# It will be overwritten when translations are pulled from Crowdin.
+#
+# To work with us on translations, join this project:
+# https://translate.discourse.org/
+
+be:
+ js:
+ discourse_assign:
+ assigned: "прызначаны"
+ group_everyone: "усе"
+ reassign:
+ title: "рэдагаваць"
+ assign_modal:
+ status_label: Статус
+ assign_mailer:
+ never: "ніколі"
+ always: "заўсёды"
+ reminders_frequency:
+ never: "ніколі"
+ daily: "штодня"
+ weekly: "штотыдзень"
+ monthly: "штомесяц"
+ quarterly: "штоквартальна"
+ user:
+ messages:
+ assigned: "прызначаны"
+ assignment_description:
+ topic: "%{topic_title}"
+ notifications:
+ titles:
+ assigned: "прызначаны"
+ edit_assignments_modal:
+ topic: "тэма"
+ post: "пост"
diff --git a/plugins/discourse-assign/config/locales/client.bg.yml b/plugins/discourse-assign/config/locales/client.bg.yml
new file mode 100644
index 00000000000..a48888c0d5d
--- /dev/null
+++ b/plugins/discourse-assign/config/locales/client.bg.yml
@@ -0,0 +1,32 @@
+# WARNING: Never edit this file.
+# It will be overwritten when translations are pulled from Crowdin.
+#
+# To work with us on translations, join this project:
+# https://translate.discourse.org/
+
+bg:
+ js:
+ discourse_assign:
+ group_everyone: "Всички"
+ reassign:
+ title: "Редактирай"
+ assign_modal:
+ optional_label: "(по избор)"
+ status_label: Статус
+ assign_mailer:
+ never: "Никога"
+ always: "Винаги"
+ reminders_frequency:
+ never: "Никога"
+ daily: "Дневно"
+ weekly: "Седмично"
+ monthly: "Месечно"
+ quarterly: "Тримесечно"
+ user:
+ notification_level_when_assigned:
+ do_nothing: "Не прави нищо"
+ notifications:
+ assigned: "<span>%{username}</span> %{description}"
+ edit_assignments_modal:
+ topic: "Тема"
+ post: "Публикация"
diff --git a/plugins/discourse-assign/config/locales/client.bs_BA.yml b/plugins/discourse-assign/config/locales/client.bs_BA.yml
new file mode 100644
index 00000000000..c964043bea0
--- /dev/null
+++ b/plugins/discourse-assign/config/locales/client.bs_BA.yml
@@ -0,0 +1,32 @@
+# WARNING: Never edit this file.
+# It will be overwritten when translations are pulled from Crowdin.
+#
+# To work with us on translations, join this project:
+# https://translate.discourse.org/
+
+bs_BA:
+ js:
+ discourse_assign:
+ group_everyone: "Svatko"
+ reassign:
+ title: "Edit"
+ assign_modal:
+ optional_label: "(opciono)"
+ status_label: Status
+ assign_mailer:
+ never: "Nikad"
+ always: "Uvijek"
+ reminders_frequency:
+ never: "Nikad"
+ daily: "Popularne Dnevno"
+ weekly: "Popularne Sedmično"
+ monthly: "Popularne Mjesečno"
+ quarterly: "Kvartalno"
+ user:
+ notification_level_when_assigned:
+ do_nothing: "Ne radi ništa"
+ notifications:
+ assigned: "<span>%{username}</span> %{description}"
+ edit_assignments_modal:
+ topic: "Topic"
+ post: "Objava"
diff --git a/plugins/discourse-assign/config/locales/client.ca.yml b/plugins/discourse-assign/config/locales/client.ca.yml
new file mode 100644
index 00000000000..600948a811f
--- /dev/null
+++ b/plugins/discourse-assign/config/locales/client.ca.yml
@@ -0,0 +1,77 @@
+# WARNING: Never edit this file.
+# It will be overwritten when translations are pulled from Crowdin.
+#
+# To work with us on translations, join this project:
+# https://translate.discourse.org/
+
+ca:
+ js:
+ filters:
+ unassigned:
+ title: "No assignat"
+ help: "Temes que no estan assignats"
+ action_codes:
+ assigned: "Assignat %{who} %{when}"
+ assigned_group: "Assignat %{who} %{when}"
+ unassigned: "Desassignat %{who} %{when}"
+ unassigned_group: "Desassignat %{who} %{when}"
+ discourse_assign:
+ cant_act: "No podeu actuar sobre banderes assignades a altres usuaris."
+ cant_act_unclaimed: "Cal reclamar el tema abans d'actuar sobre les banderes"
+ assigned: "Assignat"
+ group_everyone: "Tothom"
+ assigned_to: "Assignat a"
+ assigned_to_w_ellipsis: "Assignat a..."
+ unassign:
+ title: "Desassigna"
+ title_w_ellipsis: "Desassigna..."
+ help: "Desassigna %{username} del tema"
+ assign:
+ title: "Assigna"
+ help: "Assigna el tema a l'usuari"
+ reassign:
+ title: "Edita"
+ topic_level_menu:
+ unassign_with_ellipsis: "Desassigna..."
+ assign_modal:
+ title: "Assigna el tema"
+ assign: "Assigna"
+ optional_label: "(opcional)"
+ status_label: Estat
+ claim:
+ title: "reclama"
+ help: "Assigneu-vos el tema"
+ assign_mailer:
+ never: "Mai"
+ always: "Sempre"
+ reminders_frequency:
+ description: "Freqüència per a rebre recordatoris de temes assignats"
+ never: "Mai"
+ daily: "Diàriament"
+ weekly: "Setmanalment"
+ monthly: "Mensualment"
+ quarterly: "Trimestralment"
+ admin:
+ groups:
+ manage:
+ interaction:
+ assign: "Assigna"
+ user:
+ notification_level_when_assigned:
+ do_nothing: "No facis res"
+ messages:
+ assigned_title: "Assignats (%{count})"
+ assigned: "Assignats"
+ assignment_description:
+ topic: "%{topic_title}"
+ search:
+ advanced:
+ assigned:
+ label: "Assignat a"
+ notifications:
+ assigned: "<span>%{username}</span> %{description}"
+ titles:
+ assigned: "Assignat"
+ edit_assignments_modal:
+ topic: "Tema"
+ post: "Publicació"
diff --git a/plugins/discourse-assign/config/locales/client.cs.yml b/plugins/discourse-assign/config/locales/client.cs.yml
new file mode 100644
index 00000000000..3cd526b31f7
--- /dev/null
+++ b/plugins/discourse-assign/config/locales/client.cs.yml
@@ -0,0 +1,197 @@
+# WARNING: Never edit this file.
+# It will be overwritten when translations are pulled from Crowdin.
+#
+# To work with us on translations, join this project:
+# https://translate.discourse.org/
+
+cs:
+ admin_js:
+ admin:
+ site_settings:
+ categories:
+ discourse_assign: "Discourse Assign"
+ js:
+ filters:
+ unassigned:
+ title: "Nepřiděleno"
+ help: "Témata, která nejsou přidělena"
+ action_codes:
+ assigned: "Přiděleno %{who} %{when}"
+ assigned_group: "Přiděleno %{who} %{when}"
+ assigned_to_post: "Uživateli %{who} přidělen <a href='%{path}'>příspěvek</a> %{when}"
+ assigned_group_to_post: "Skupině %{who} přidělen <a href='%{path}'>příspěvek</a> %{when}"
+ unassigned: "%{who} zrušeno přidělení %{when}"
+ unassigned_group: "%{who} zrušeno přidělení %{when}"
+ unassigned_from_post: "Uživateli %{who} zrušeno přidělení <a href='%{path}'>příspěvku</a> %{when}"
+ unassigned_group_from_post: "Skupině %{who} zrušeno přidělení <a href='%{path}'>příspěvku</a> %{when}"
+ reassigned: "Uživateli %{who} znovu přiděleno %{when}"
+ reassigned_group: "Skupině %{who} znovu přiděleno %{when}"
+ details_change: "Změněny podrobnosti přidělení pro %{who} %{when}"
+ note_change: "Změněna poznámka přidělení pro %{who} %{when}"
+ status_change: "Změněn stav přidělení pro %{who} %{when}"
+ discourse_assign:
+ add_unassigned_filter: "Přidat do kategorie filtr \"Nepřiděleno\""
+ cant_act: "Nemůžete reagovat na nahlášení, která byla přiřazena jiným uživatelům"
+ cant_act_unclaimed: "Než začnete reagovat na nahlášení, musíte si toto téma nárokovat."
+ topic_search_placeholder: "Hledat témata podle názvu nebo obsahu příspěvku"
+ sidebar_name_filter_placeholder: "Jméno/Uživatelské jméno"
+ assigned: "Přiděleno"
+ group_everyone: "Všichni"
+ assigned_to: "Přiděleno"
+ assigned_topic_to: "Téma přiděleno <a href='%{path}'>%{username}</a>"
+ assign_post_to: "#%{post_number} přiděleno %{username}"
+ assign_post_to_multiple: "#%{post_number} uživateli %{username}"
+ assigned_to_w_ellipsis: "Přiděleno..."
+ unassign:
+ title: "Odebrat přidělení"
+ title_w_ellipsis: "Odebrat přidělení..."
+ help: "Zrušit přidělení %{username} k tématu"
+ assign:
+ title: "Přidělit"
+ help: "Zadat téma uživateli"
+ assign_post:
+ title: "Přidělit příspěvek"
+ unassign_post:
+ title: "Zrušit přidělení k příspěvku"
+ help: "Zrušit přidělení %{username} k příspěvku"
+ reassign:
+ title: "Upravit"
+ title_w_ellipsis: "Upravit přidělení..."
+ to_self: "Přidělit sobě"
+ to_self_help: "Přidělit téma sobě"
+ help: "Upravit podrobnosti přidělení"
+ reassign_modal:
+ title: "Změnit přidělení tématu"
+ topic_level_menu:
+ edit_assignments: "Upravit přidělení..."
+ reassign_topic_to_me: "Znovu přiřadit téma mně"
+ unassign_with_ellipsis: "Odebrat přidělení..."
+ unassign_from_post: "Zrušit přiřazení @%{assignee} z #%{post_number}"
+ unassign_from_post_help: "Zrušení přiřazení @%{assignee} z příspěvku #%{post_number}"
+ unassign_from_topic: "Zrušit přiřazení @%{username} k tématu"
+ assign_modal:
+ title: "Zadat téma"
+ reassign_title: "Změnit přidělení tématu"
+ assign: "Zadat"
+ assignee_label: Komu
+ assignment_label: Přiřazení
+ choose_assignee: Vyberte uživatele, kterého chcete přidělit.
+ edit_assignments_title: "Upravit přiřazení"
+ note_label: Poznámka
+ optional_label: "(volitelné)"
+ status_label: Stav
+ suggestions: návrhy
+ assign_post_modal:
+ title: "Přidělit příspěvek"
+ claim:
+ title: "nárok"
+ help: "Přidělte téma sami sobě"
+ assign_mailer:
+ never: "Nikdy"
+ different_users: "Pouze pokud přidělující a přidělený jsou různí uživatelé."
+ always: "Vždy"
+ reminders_frequency:
+ description: "Frekvence upozorňování na přidělená témata"
+ never: "Nikdy"
+ daily: "Denně"
+ weekly: "Týdně"
+ monthly: "Měsíčně"
+ quarterly: "Čtvrtletně"
+ admin:
+ groups:
+ manage:
+ interaction:
+ assign: "Přidělit"
+ assignable_levels:
+ title: "Kdo může přidělit této skupině"
+ user:
+ notification_level_when_assigned:
+ label: "Při přidělení"
+ watch_topic: "Hlídat téma"
+ track_topic: "Sledovat téma"
+ do_nothing: "Nic nedělat"
+ messages:
+ assigned_title: "Přiděleno (%{count})"
+ assigned: "Přiděleno"
+ no_assignments_title: "Zatím nemáte žádné úkoly"
+ no_assignments_body: >
+ Zde budou uvedena vám přidělená témata a zprávy. Na vaše úkoly budete také pravidelně dostávat upozornění, která můžete upravit ve <a href='%{preferencesUrl}'>vašich uživatelských předvolbách</a>. <br><br> Chcete-li přidělit téma nebo zprávu sobě nebo někomu jinému, hledejte dole tlačítko %{icon} přidělit .
+ dismiss_assigned_tooltip: "Označit všechna upozornění na přidělení jako přečtená"
+ assigned_to_group:
+ post: "příspěvek přidělen uživateli %{group_name}"
+ topic: "téma přiděleno uživateli %{group_name}"
+ assigned_to_you:
+ post: "příspěvek přidělen vám"
+ topic: "téma přiděleno vám"
+ assignment_description:
+ post: "%{topic_title} (#%{post_number})"
+ topic: "%{topic_title}"
+ admin:
+ web_hooks:
+ assign_event:
+ group_name: "Události přidělení"
+ assigned: "Když uživatel přidělí téma"
+ unassigned: "Když uživatel zruší přidělení tématu"
+ search:
+ advanced:
+ in:
+ assigned: "jsou přidělena"
+ unassigned: "nejsou přidělena"
+ assigned:
+ label: "Přiděleno uživateli"
+ topics:
+ bulk:
+ unassign: "Zrušit přidělení témat"
+ assign: "Přidělit témata"
+ discourse_automation:
+ scriptables:
+ random_assign:
+ fields:
+ post_template:
+ label: Šablona příspěvku
+ description: Pokud je vyplněno, bude vytvořen příspěvek s touto šablonou a uživatel k němu bude přidělen místo k tématu.
+ assignees_group:
+ label: Skupina přidělených
+ minimum_time_between_assignments:
+ label: Minimální počet hodin mezi přiděleními
+ min_recently_assigned_days:
+ label: Min. počet dní pro "přiděleno v poslední době"
+ description: Výchozí hodnota je 14 dní.
+ skip_new_users_for_days:
+ label: Přeskočit nové uživatele po počet dní
+ description: Výchozí hodnota je 0 dní (uživatelé mohou být přiděleni ihned po registraci).
+ max_recently_assigned_days:
+ label: Max. počet dní pro "přiděleno v poslední době"
+ description: První pokus vyloučit uživatele přidělené v posledních `n` dnech. Pokud žádný uživatel nezůstal, použije se `min_recently_assigned_day`. Výchozí hodnota je 180 dní.
+ assigned_topic:
+ label: Přidělené ID tématu
+ in_working_hours:
+ label: V pracovní době uživatele
+ notification_reason:
+ user: "Uvidíte počet nových odpovědí, protože toto téma vám bylo přiděleno."
+ notifications:
+ assigned: "<span>%{username}</span> %{description}"
+ popup:
+ assigned: "%{username} vám přidělil"
+ titles:
+ assigned: "Přiděleno"
+ dismiss_confirmation:
+ body:
+ assigns:
+ one: "Jste si jisti? Máte %{count} nepřečtené přidělení."
+ few: "Jste si jisti? Máte %{count} nepřečtená přidělení."
+ many: "Jste si jisti? Máte %{count} nepřečtených přidělení."
+ other: "Jste si jisti? Máte %{count} nepřečtených přidělení."
+ user_menu:
+ view_all_assigned: "zobrazit všechny přidělené"
+ tabs:
+ assign_list: "Seznam přidělení"
+ assign_list_with_unread:
+ one: "Seznam přidělení - %{count} nepřečtené přidělení"
+ few: "Seznam přidělení - %{count} nepřečtená přidělení"
+ many: "Seznam přidělení - %{count} nepřečtených přidělení"
+ other: "Seznam přidělení - %{count} nepřečtených přidělení"
+ edit_assignments_modal:
+ title: "Upravit přiřazení"
+ topic: "Témata"
+ post: "Příspěvek"
diff --git a/plugins/discourse-assign/config/locales/client.da.yml b/plugins/discourse-assign/config/locales/client.da.yml
new file mode 100644
index 00000000000..61ec11e0b1a
--- /dev/null
+++ b/plugins/discourse-assign/config/locales/client.da.yml
@@ -0,0 +1,97 @@
+# WARNING: Never edit this file.
+# It will be overwritten when translations are pulled from Crowdin.
+#
+# To work with us on translations, join this project:
+# https://translate.discourse.org/
+
+da:
+ js:
+ filters:
+ unassigned:
+ title: "Ikke tildelt"
+ help: "Emner, der ikke er tildelt"
+ action_codes:
+ assigned: "Tildelt %{who} %{when}"
+ assigned_group: "Tildelt %{who} %{when}"
+ assigned_to_post: "Tildelte %{who} til <a href='%{path}'>indlæg</a> %{when}"
+ assigned_group_to_post: "Tildelte %{who} til <a href='%{path}'>indlæg</a> %{when}"
+ unassigned: "Fradelt %{who} %{when}"
+ unassigned_group: "Fradelt %{who} %{when}"
+ discourse_assign:
+ add_unassigned_filter: "Føj 'ikke-tildelt' filter til kategori"
+ cant_act: "Du kan ikke handle på markeringsflag, der er tildelt andre brugere"
+ cant_act_unclaimed: "Du skal gøre krav på dette emne, før du handler på markeringsflag."
+ topic_search_placeholder: "Søg i emner efter titel eller indhold"
+ sidebar_name_filter_placeholder: "Navn/Brugernavn"
+ assigned: "Tildelt"
+ group_everyone: "Alle"
+ assigned_to: "Tildelt til"
+ assigned_to_w_ellipsis: "Tildelt til..."
+ unassign:
+ title: "Fjern tildeling"
+ title_w_ellipsis: "Fjern tildeling..."
+ help: "Fjern tildelingen til %{username} fra Emne"
+ assign:
+ title: "Tildel"
+ help: "Tildel Emne til Bruger"
+ reassign:
+ title: "Redigér"
+ topic_level_menu:
+ unassign_with_ellipsis: "Fjern tildeling..."
+ assign_modal:
+ title: "Tildel Emne"
+ assign: "Tildel"
+ optional_label: "(valgfri)"
+ status_label: Status
+ claim:
+ title: "gør krav"
+ help: "Tildel emne til dig selv"
+ assign_mailer:
+ never: "Aldrig"
+ different_users: "Kun hvis tildeler og modtager er forskellige brugere"
+ always: "Altid"
+ reminders_frequency:
+ description: "Frekvens for modtagelse af påmindelser om tildelte emner"
+ never: "Aldrig"
+ daily: "Dagligt"
+ weekly: "Ugentligt"
+ monthly: "Månedligt"
+ quarterly: "Kvartalvis"
+ admin:
+ groups:
+ manage:
+ interaction:
+ assign: "Tildel"
+ user:
+ notification_level_when_assigned:
+ do_nothing: "Gøre ingenting"
+ messages:
+ assigned_title: "Tildelt (%{count})"
+ assigned: "Tildelt"
+ assignment_description:
+ topic: "%{topic_title}"
+ search:
+ advanced:
+ in:
+ assigned: "er tildelt"
+ unassigned: "er ikke tildelt"
+ assigned:
+ label: "Tildelt til"
+ topics:
+ bulk:
+ unassign: "Fjern tildeling af emner"
+ assign: "Tildel emner"
+ discourse_automation:
+ scriptables:
+ random_assign:
+ fields:
+ post_template:
+ label: Indlæg skabelon
+ description: Hvis den udfyldes, oprettes et indlæg med denne skabelon, og der tildeles en bruger til det i stedet for emnet.
+ notifications:
+ assigned: "<span>%{username}</span> %{description}"
+ titles:
+ assigned: "Tildelt"
+ edit_assignments_modal:
+ topic: "Emne"
+ post: "Indlæg"
diff --git a/plugins/discourse-assign/config/locales/client.de.yml b/plugins/discourse-assign/config/locales/client.de.yml
new file mode 100644
index 00000000000..49c9e6111f8
--- /dev/null
+++ b/plugins/discourse-assign/config/locales/client.de.yml
@@ -0,0 +1,193 @@
+# WARNING: Never edit this file.
+# It will be overwritten when translations are pulled from Crowdin.
+#
+# To work with us on translations, join this project:
+# https://translate.discourse.org/
+
+de:
+ admin_js:
+ admin:
+ site_settings:
+ categories:
+ discourse_assign: "Discourse – Zuordnen"
+ js:
+ filters:
+ unassigned:
+ title: "Zuordnung aufgehoben"
+ help: "Nicht zugeordnete Themen"
+ action_codes:
+ assigned: "%{who} zugeordnet %{when}"
+ assigned_group: "%{who} zugeordnet %{when}"
+ assigned_to_post: "%{who} zu <a href='%{path}'>Beitrag</a> zugeordnet %{when}"
+ assigned_group_to_post: "%{who} zu <a href='%{path}'>Beitrag</a> zugeordnet %{when}"
+ unassigned: "Zuordnung von %{who} aufgehoben %{when}"
+ unassigned_group: "Zuordnung von %{who} aufgehoben %{when}"
+ unassigned_from_post: "Zuordnung von %{who} zu <a href='%{path}'>Beitrag</a> aufgehoben %{when}"
+ unassigned_group_from_post: "Zuordnung von %{who} zu <a href='%{path}'>Beitrag</a> aufgehoben %{when}"
+ reassigned: "%{who} %{when} erneut zugeordnet"
+ reassigned_group: "%{who} %{when} erneut zugeordnet"
+ details_change: "Zuordnungsdetails geändert für %{who} %{when}"
+ note_change: "Zuordnungsnotiz geändert für %{who} %{when}"
+ status_change: "Zuordnungsstatus geändert für %{who} %{when}"
+ discourse_assign:
+ add_unassigned_filter: "Filter „Nicht zugeordnet“ zur Kategorie hinzufügen"
+ cant_act: "Du kannst nicht auf Meldungen reagieren, die anderen Benutzern zugeordnet wurden."
+ cant_act_unclaimed: "Du musst das Thema übernehmen, bevor du Meldungen behandeln kannst."
+ topic_search_placeholder: "Themen nach Titel oder Beitragsinhalt suchen"
+ sidebar_name_filter_placeholder: "Name/Benutzername"
+ assigned: "Zugeordnet"
+ group_everyone: "Jeder"
+ assigned_to: "Zugeordnet zu"
+ assigned_topic_to: "Thema zugeordnet zu <a href='%{path}'>%{username}</a>"
+ assign_post_to: "#%{post_number} %{username} zugeordnet"
+ assign_post_to_multiple: "#%{post_number} zu %{username}"
+ assigned_to_w_ellipsis: "Zugeordnet zu …"
+ unassign:
+ title: "Zuordnung aufheben"
+ title_w_ellipsis: "Zuordnung aufheben …"
+ help: "Zuordnung von %{username} zu Thema aufheben"
+ assign:
+ title: "Zuordnen"
+ help: "Thema einem Benutzer zuordnen"
+ assign_post:
+ title: "Beitrag zuordnen"
+ unassign_post:
+ title: "Zuordnung zu Beitrag aufheben"
+ help: "Zuordnung von %{username} zu Beitrag aufheben"
+ reassign:
+ title: "Bearbeiten"
+ title_w_ellipsis: "Zuordnung bearbeiten …"
+ to_self: "Mir neu zuordnen"
+ to_self_help: "Thema mir neu zuordnen"
+ help: "Zuordnungsdetails bearbeiten"
+ reassign_modal:
+ title: "Thema neu zuordnen"
+ topic_level_menu:
+ edit_assignments: "Zuordnungen bearbeiten …"
+ reassign_topic_to_me: "Thema mir neu zuordnen"
+ unassign_with_ellipsis: "Zuordnung aufheben …"
+ unassign_from_post: "Zuordnung von @%{assignee} zu #%{post_number} aufheben"
+ unassign_from_post_help: "Zuordnung von @%{assignee} zu Beitrag #%{post_number} aufheben"
+ unassign_from_topic: "Zuordnung von @%{username} zu Thema aufheben"
+ assign_modal:
+ title: "Thema zuordnen"
+ reassign_title: "Thema neu zuordnen"
+ assign: "Zuordnen"
+ assignee_label: Zugeordnete Person
+ assignment_label: Zuordnung
+ choose_assignee: Wähle einen Benutzer aus, den du zuordnen möchtest.
+ edit_assignments_title: "Zuordnungen bearbeiten"
+ note_label: Notiz
+ optional_label: "(optional)"
+ status_label: Status
+ suggestions: Vorschläge
+ assign_post_modal:
+ title: "Beitrag zuordnen"
+ claim:
+ title: "übernehmen"
+ help: "Thema mir selbst zuordnen"
+ assign_mailer:
+ never: "Nie"
+ different_users: "Nur wenn die zuordnende Person und die zugeordnete Person unterschiedliche Benutzer sind"
+ always: "Immer"
+ reminders_frequency:
+ description: "Intervall für das Erhalten von Erinnerungen an zugeordnete Themen"
+ never: "Nie"
+ daily: "Täglich"
+ weekly: "Wöchentlich"
+ monthly: "Monatlich"
+ quarterly: "Vierteljährlich"
+ admin:
+ groups:
+ manage:
+ interaction:
+ assign: "Zuordnen"
+ assignable_levels:
+ title: "Wer kann für diese Gruppe Zuordnungen vornehmen"
+ user:
+ notification_level_when_assigned:
+ label: "Bei Zuordnung"
+ watch_topic: "Thema beobachten"
+ track_topic: "Thema verfolgen"
+ do_nothing: "Nichts tun"
+ messages:
+ assigned_title: "Zugeordnet (%{count})"
+ assigned: "Zugeordnet"
+ no_assignments_title: "Du hast noch keine Zuordnungen"
+ no_assignments_body: >
+ Deine zugeordneten Themen und Nachrichten werden hier aufgelistet. Außerdem erhältst du regelmäßig eine Erinnerungsbenachrichtigung betreffend deine Zuordnungen, die du in deinen <a href='%{preferencesUrl}'>Benutzereinstellungen</a> anpassen kannst. <br><br> Um dir selbst oder einer anderen Person ein Thema oder eine Nachricht zuzuordnen, verwende die Zuordnungsschaltfläche %{icon} unten.
+ dismiss_assigned_tooltip: "Alle ungelesenen Zuordnungsbenachrichtigungen als gelesen markieren"
+ assigned_to_group:
+ post: "Beitrag zugeordnet zu %{group_name}"
+ topic: "Thema zugeordnet zu %{group_name}"
+ assigned_to_you:
+ post: "Beitrag wurde dir zugeordnet"
+ topic: "Thema wurde dir zugeordnet"
+ assignment_description:
+ post: "%{topic_title} (#%{post_number})"
+ topic: "%{topic_title}"
+ admin:
+ web_hooks:
+ assign_event:
+ group_name: "Ereignisse zuordnen"
+ assigned: "Wenn ein Benutzer ein Thema zuordnet"
+ unassigned: "Wenn ein Benutzer die Zuordnung eines Themas aufhebt"
+ search:
+ advanced:
+ in:
+ assigned: "sind zugeordnet"
+ unassigned: "sind nicht zugeordnet"
+ assigned:
+ label: "Zugeordnet zu"
+ topics:
+ bulk:
+ unassign: "Zuordnung von Themen aufheben"
+ assign: "Themen zuordnen"
+ discourse_automation:
+ scriptables:
+ random_assign:
+ fields:
+ post_template:
+ label: Beitragsvorlage
+ description: Wenn ausgefüllt, wird ein Beitrag mit dieser Vorlage erstellt und ein Benutzer anstelle des Themas zugeordnet.
+ assignees_group:
+ label: Gruppe der zugeordneten Personen
+ minimum_time_between_assignments:
+ label: Mindestanzahl der Stunden zwischen Zuordnungen
+ min_recently_assigned_days:
+ label: 'Kürzlich zugeordnet: Mindestanzahl der Tage'
+ description: Standardmäßig 14 Tage.
+ skip_new_users_for_days:
+ label: Neue Benutzer überspringen für Anzahl von Tagen
+ description: Standardmäßig 0 Tage (Benutzer können sofort nach der Registrierung zugeordnet werden).
+ max_recently_assigned_days:
+ label: 'Kürzlich zugeordnet: Maximalanzahl der Tage'
+ description: Erster Versuch, Benutzer auszuschließen, die in den letzten `n` Tagen zugeordnet wurden. Wenn kein Benutzer übrig ist, wird auf `min_recently_assigned_days` zurückgegriffen. Standardmäßig 180 Tage.
+ assigned_topic:
+ label: Zugeordnete Themen-ID
+ in_working_hours:
+ label: Benutzer in Arbeitszeit
+ notification_reason:
+ user: "Du siehst die Anzahl der neuen Antworten, weil dir dieses Thema zugeordnet wurde."
+ notifications:
+ assigned: "<span>%{username}</span> %{description}"
+ popup:
+ assigned: "%{username} hat dich zugeordnet"
+ titles:
+ assigned: "Zugeordnet"
+ dismiss_confirmation:
+ body:
+ assigns:
+ one: "Bist du sicher? Du hast %{count} ungelesene Zuordnungsbenachrichtigung."
+ other: "Bist du sicher? Du hast %{count} ungelesene Zuordnungsbenachrichtigungen."
+ user_menu:
+ view_all_assigned: "alle zugeordneten anzeigen"
+ tabs:
+ assign_list: "Zuordnungsliste"
+ assign_list_with_unread:
+ one: "Zuordnungsliste – %{count} ungelesene Zuordnung"
+ other: "Zuordnungsliste – %{count} ungelesene Zuordnungen"
+ edit_assignments_modal:
+ title: "Zuordnungen bearbeiten"
+ topic: "Thema"
+ post: "Beitrag"
diff --git a/plugins/discourse-assign/config/locales/client.el.yml b/plugins/discourse-assign/config/locales/client.el.yml
new file mode 100644
index 00000000000..a0f81dcccb1
--- /dev/null
+++ b/plugins/discourse-assign/config/locales/client.el.yml
@@ -0,0 +1,34 @@
+# WARNING: Never edit this file.
+# It will be overwritten when translations are pulled from Crowdin.
+#
+# To work with us on translations, join this project:
+# https://translate.discourse.org/
+
+el:
+ js:
+ discourse_assign:
+ group_everyone: "Όλοι"
+ reassign:
+ title: "Επεξεργασία"
+ assign_modal:
+ optional_label: "(προεραιτικό)"
+ status_label: Κατάσταση
+ assign_mailer:
+ never: "Ποτέ"
+ always: "Πάντα"
+ reminders_frequency:
+ never: "Ποτέ"
+ daily: "Ημερήσια"
+ weekly: "Εβδομαδιαία"
+ monthly: "Μηνιαία"
+ quarterly: "Τριμηνιαία"
+ user:
+ notification_level_when_assigned:
+ do_nothing: "Μην κάνετε τίποτα"
+ assignment_description:
+ topic: "%{topic_title}"
+ notifications:
+ assigned: "<span>%{username}</span> %{description}"
+ edit_assignments_modal:
+ topic: "Νήμα"
+ post: "Ανάρτηση"
diff --git a/plugins/discourse-assign/config/locales/client.en.yml b/plugins/discourse-assign/config/locales/client.en.yml
new file mode 100644
index 00000000000..2a9bfc8a52f
--- /dev/null
+++ b/plugins/discourse-assign/config/locales/client.en.yml
@@ -0,0 +1,190 @@
+en:
+ admin_js:
+ admin:
+ site_settings:
+ categories:
+ discourse_assign: "Discourse Assign"
+ js:
+ filters:
+ unassigned:
+ title: "Unassigned"
+ help: "Topics that are not assigned"
+ action_codes:
+ assigned: "Assigned %{who} %{when}"
+ assigned_group: "Assigned %{who} %{when}"
+ assigned_to_post: "Assigned %{who} to <a href='%{path}'>post</a> %{when}"
+ assigned_group_to_post: "Assigned %{who} to <a href='%{path}'>post</a> %{when}"
+ unassigned: "Unassigned %{who} %{when}"
+ unassigned_group: "Unassigned %{who} %{when}"
+ unassigned_from_post: "Unassigned %{who} from <a href='%{path}'>post</a> %{when}"
+ unassigned_group_from_post: "Unassigned %{who} from <a href='%{path}'>post</a> %{when}"
+ reassigned: "Reassigned %{who} %{when}"
+ reassigned_group: "Reassigned %{who} %{when}"
+ details_change: "Changed assignment details for %{who} %{when}"
+ note_change: "Changed assignment note for %{who} %{when}"
+ status_change: "Changed assignment status for %{who} %{when}"
+ discourse_assign:
+ add_unassigned_filter: "Add 'unassigned' filter to category"
+ cant_act: "You cannot act on flags that have been assigned to other users"
+ cant_act_unclaimed: "You must claim this topic before acting on flags."
+ topic_search_placeholder: "Search topics by title or post content"
+ sidebar_name_filter_placeholder: "Name/Username"
+ assigned: "Assigned"
+ group_everyone: "Everyone"
+ assigned_to: "Assigned to"
+ assigned_topic_to: "Assigned topic to <a href='%{path}'>%{username}</a>"
+ assign_post_to: "Assigned #%{post_number} to %{username}"
+ # assign_post_to_multiple used in list form, example: "Assigned topic to username0, [#2 to username1], [#10 to username2]"
+ assign_post_to_multiple: "#%{post_number} to %{username}"
+ assigned_to_w_ellipsis: "Assigned to..."
+ unassign:
+ title: "Unassign"
+ title_w_ellipsis: "Unassign..."
+ help: "Unassign %{username} from Topic"
+ assign:
+ title: "Assign"
+ help: "Assign Topic to User"
+ assign_post:
+ title: "Assign Post"
+ unassign_post:
+ title: "Unassign from Post"
+ help: "Unassign %{username} from Post"
+ reassign:
+ title: "Edit"
+ title_w_ellipsis: "Edit assignment..."
+ to_self: "Reassign to me"
+ to_self_help: "Reassign Topic to me"
+ help: "Edit assignment details"
+ reassign_modal:
+ title: "Reassign Topic"
+ topic_level_menu:
+ edit_assignments: "Edit assignments..."
+ reassign_topic_to_me: "Reassign topic to me"
+ unassign_with_ellipsis: "Unassign..."
+ unassign_from_post: "Unassign @%{assignee} from #%{post_number}"
+ unassign_from_post_help: "Unassign @%{assignee} from post #%{post_number}"
+ unassign_from_topic: "Unassign @%{username} from topic"
+ assign_modal:
+ title: "Assign Topic"
+ reassign_title: "Reassign Topic"
+ assign: "Assign"
+ assignee_label: Assignee
+ assignment_label: Assignment
+ choose_assignee: Choose a user to assign.
+ edit_assignments_title: "Edit Assignments"
+ note_label: Note
+ optional_label: "(optional)"
+ status_label: Status
+ suggestions: suggestions
+ assign_post_modal:
+ title: "Assign Post"
+ claim:
+ title: "claim"
+ help: "Assign topic to yourself"
+ assign_mailer:
+ never: "Never"
+ different_users: "Only if assigner and assignee are different users"
+ always: "Always"
+ reminders_frequency:
+ description: "Frequency for receiving assigned topics reminders"
+ never: "Never"
+ daily: "Daily"
+ weekly: "Weekly"
+ monthly: "Monthly"
+ quarterly: "Quarterly"
+ admin:
+ groups:
+ manage:
+ interaction:
+ assign: "Assign"
+ assignable_levels:
+ title: "Who can assign this group"
+ user:
+ notification_level_when_assigned:
+ label: "When assigned"
+ watch_topic: "Watch topic"
+ track_topic: "Track topic"
+ do_nothing: "Do nothing"
+ messages:
+ assigned_title: "Assigned (%{count})"
+ assigned: "Assigned"
+ no_assignments_title: "You don’t have any assignments yet"
+ no_assignments_body: >
+ Your assigned topics and messages will be listed here. You will also receive a periodic reminder notification of your assignments, which you can adjust in your <a href='%{preferencesUrl}'>user preferences</a>.
+ <br><br>
+ To assign a topic or message to yourself or to someone else, look for the %{icon} assign button at the bottom.
+ dismiss_assigned_tooltip: "Mark all unread assign notifications as read"
+ assigned_to_group:
+ post: "post assigned to %{group_name}"
+ topic: "topic assigned to %{group_name}"
+ assigned_to_you:
+ post: "post assigned to you"
+ topic: "topic assigned to you"
+ assignment_description:
+ post: "%{topic_title} (#%{post_number})"
+ topic: "%{topic_title}"
+ admin:
+ web_hooks:
+ assign_event:
+ group_name: "Assign Events"
+ assigned: "When an user assigns a topic"
+ unassigned: "When an user unassigns a topic"
+ search:
+ advanced:
+ in:
+ assigned: "are assigned"
+ unassigned: "are unassigned"
+ assigned:
+ label: "Assigned to"
+ topics:
+ bulk:
+ unassign: "Unassign Topics"
+ assign: "Assign Topics"
+ discourse_automation:
+ scriptables:
+ random_assign:
+ fields:
+ post_template:
+ label: Post template
+ description: If filled, a post with this template will be created and a user assigned to it instead of the topic.
+ assignees_group:
+ label: Assignees Group
+ minimum_time_between_assignments:
+ label: Minimum hours between assignments
+ min_recently_assigned_days:
+ label: Min recently assigned days
+ description: Defaults to 14 days.
+ skip_new_users_for_days:
+ label: Skip new users for days
+ description: Defaults to 0 days (users can be assigned immediately after signing up).
+ max_recently_assigned_days:
+ label: Max recently assigned days
+ description: First attempt to exclude users assigned in the last `n` days. If no user left, fallbacks to `min_recently_assigned_days`. Defaults to 180 days.
+ assigned_topic:
+ label: Assigned Topic ID
+ in_working_hours:
+ label: Users in working hours
+ notification_reason:
+ user: "You will see a count of new replies because this topic was assigned to you."
+ notifications:
+ assigned: "<span>%{username}</span> %{description}"
+ popup:
+ assigned: "%{username} assigned you"
+ titles:
+ assigned: "Assigned"
+ dismiss_confirmation:
+ body:
+ assigns:
+ one: "Are you sure? You have %{count} unread assign notification."
+ other: "Are you sure? You have %{count} unread assign notifications."
+ user_menu:
+ view_all_assigned: "view all assigned"
+ tabs:
+ assign_list: "Assign list"
+ assign_list_with_unread:
+ one: "Assign list - %{count} unread assignment"
+ other: "Assign list - %{count} unread assignments"
+ edit_assignments_modal:
+ title: "Edit assignments"
+ topic: "Topic"
+ post: "Post"
diff --git a/plugins/discourse-assign/config/locales/client.en_GB.yml b/plugins/discourse-assign/config/locales/client.en_GB.yml
new file mode 100644
index 00000000000..5239d91f7b3
--- /dev/null
+++ b/plugins/discourse-assign/config/locales/client.en_GB.yml
@@ -0,0 +1,10 @@
+# WARNING: Never edit this file.
+# It will be overwritten when translations are pulled from Crowdin.
+#
+# To work with us on translations, join this project:
+# https://translate.discourse.org/
+
+en_GB:
+ js:
+ edit_assignments_modal:
+ post: "Post"
diff --git a/plugins/discourse-assign/config/locales/client.es.yml b/plugins/discourse-assign/config/locales/client.es.yml
new file mode 100644
index 00000000000..5acb412e02e
--- /dev/null
+++ b/plugins/discourse-assign/config/locales/client.es.yml
@@ -0,0 +1,193 @@
+# WARNING: Never edit this file.
+# It will be overwritten when translations are pulled from Crowdin.
+#
+# To work with us on translations, join this project:
+# https://translate.discourse.org/
+
+es:
+ admin_js:
+ admin:
+ site_settings:
+ categories:
+ discourse_assign: "Asignación de Discourse"
+ js:
+ filters:
+ unassigned:
+ title: "Sin asignar"
+ help: "Temas sin asignar"
+ action_codes:
+ assigned: "Asignó a %{who} el %{when}"
+ assigned_group: "Asignó a %{who} el %{when}"
+ assigned_to_post: "Asignó a %{who} a la <a href='%{path}'>publicación</a> el %{when}"
+ assigned_group_to_post: "Asignó a %{who} a la <a href='%{path}'>publicación</a> el %{when}"
+ unassigned: "Anuló la asignación de %{who} el %{when}"
+ unassigned_group: "Anuló la asignación de %{who} el %{when}"
+ unassigned_from_post: "Anuló la asignación de %{who} de <a href='%{path}'>publicación</a> el %{when}"
+ unassigned_group_from_post: "Anuló la asignación de %{who} de <a href='%{path}'>publicación</a> el %{when}"
+ reassigned: "Reasignó a %{who} %{when}"
+ reassigned_group: "Reasignó a %{who} %{when}"
+ details_change: "Detalles de asignación cambiados para %{who} el %{when}"
+ note_change: "Nota de asignación cambiada para %{who} el %{when}"
+ status_change: "Estado de asignación cambiado para %{who} el %{when}"
+ discourse_assign:
+ add_unassigned_filter: "Añadir filtro «sin asignar» a la categoría"
+ cant_act: "No puedes actuar sobre denuncias que han sido asignadas a otros usuarios"
+ cant_act_unclaimed: "Debes reclamar este tema antes de actuar sobre las denuncias."
+ topic_search_placeholder: "Buscar temas por título o contenido"
+ sidebar_name_filter_placeholder: "Nombre/nombre de usuario"
+ assigned: "Asignado"
+ group_everyone: "Todos"
+ assigned_to: "Asignado a"
+ assigned_topic_to: "Tema asignado a <a href='%{path}'>%{username}</a>"
+ assign_post_to: "Asignado #%{post_number} a %{username}"
+ assign_post_to_multiple: "#%{post_number} a %{username}"
+ assigned_to_w_ellipsis: "Asignado a..."
+ unassign:
+ title: "Anular asignación"
+ title_w_ellipsis: "Anular asignación..."
+ help: "Anular asignación del tema a %{username}"
+ assign:
+ title: "Asignar"
+ help: "Asignar tema al usuario"
+ assign_post:
+ title: "Asignar publicación"
+ unassign_post:
+ title: "Anular asignación de la publicación"
+ help: "Anular la asignación de %{username} de la publicación"
+ reassign:
+ title: "Editar"
+ title_w_ellipsis: "Editar asignación..."
+ to_self: "Reasignar a mí"
+ to_self_help: "Reasignar tema a mí"
+ help: "Editar detalles de la asignación"
+ reassign_modal:
+ title: "Reasignar tema"
+ topic_level_menu:
+ edit_assignments: "Editar asignaciones..."
+ reassign_topic_to_me: "Reasignar tema a mí"
+ unassign_with_ellipsis: "Anular asignación..."
+ unassign_from_post: "Anular asignación de @%{assignee} de #%{post_number}"
+ unassign_from_post_help: "Anular asignación de @%{assignee} de la publicación #%{post_number}"
+ unassign_from_topic: "Anular asignación de @%{username} del tema"
+ assign_modal:
+ title: "Asignar tema"
+ reassign_title: "Reasignar tema"
+ assign: "Asignar"
+ assignee_label: Asignado
+ assignment_label: Asignación
+ choose_assignee: Elige un usuario para asignar.
+ edit_assignments_title: "Editar asignaciones"
+ note_label: Nota
+ optional_label: "(opcional)"
+ status_label: Estado
+ suggestions: sugerencias
+ assign_post_modal:
+ title: "Asignar publicación"
+ claim:
+ title: "reclamar"
+ help: "Asignar tema a ti mismo"
+ assign_mailer:
+ never: "Nunca"
+ different_users: "Solo si quien asigna y quien es asignado son diferentes usuarios"
+ always: "Siempre"
+ reminders_frequency:
+ description: "Frecuencia para recibir recordatorios de temas asignados."
+ never: "Nunca"
+ daily: "Diario"
+ weekly: "Semanal"
+ monthly: "Mensual"
+ quarterly: "Trimestral"
+ admin:
+ groups:
+ manage:
+ interaction:
+ assign: "Asignar"
+ assignable_levels:
+ title: "Quién puede asignar este grupo"
+ user:
+ notification_level_when_assigned:
+ label: "Cuando se asigne"
+ watch_topic: "Observar tema"
+ track_topic: "Seguir tema"
+ do_nothing: "No hacer nada"
+ messages:
+ assigned_title: "Asignados (%{count})"
+ assigned: "Asignado"
+ no_assignments_title: "Aún no tienes asignaciones"
+ no_assignments_body: >
+ Tus temas y mensajes asignados aparecerán aquí. También recibirás una notificación periódica de recordatorio de tus asignaciones, que puedes ajustar en tus <a href='%{preferencesUrl}'>preferencias de usuario</a>. <br><br> Para asignar un tema o mensaje a ti mismo o a otra persona, busca el botón %{icon} de asignar en la parte inferior.
+ dismiss_assigned_tooltip: "Marcar todas las notificaciones de asignación no leídas como leídas"
+ assigned_to_group:
+ post: "publicación asignada a %{group_name}"
+ topic: "tema asignado a %{group_name}"
+ assigned_to_you:
+ post: "publicación asignada a ti"
+ topic: "tema asignado a ti"
+ assignment_description:
+ post: "%{topic_title} (#%{post_number})"
+ topic: "%{topic_title}"
+ admin:
+ web_hooks:
+ assign_event:
+ group_name: "Asignar eventos"
+ assigned: "Cuando un usuario asigna un tema"
+ unassigned: "Cuando un usuario anula la asignación de un tema"
+ search:
+ advanced:
+ in:
+ assigned: "están asignados"
+ unassigned: "están sin asignar"
+ assigned:
+ label: "Asignado a"
+ topics:
+ bulk:
+ unassign: "Anular asignación de temas"
+ assign: "Asignar temas"
+ discourse_automation:
+ scriptables:
+ random_assign:
+ fields:
+ post_template:
+ label: Plantilla de publicación
+ description: Si se completa, se creará una publicación con esta plantilla y se le asignará un usuario en lugar del tema.
+ assignees_group:
+ label: Grupo de asignados
+ minimum_time_between_assignments:
+ label: Horas mínimas entre asignaciones
+ min_recently_assigned_days:
+ label: Días mínimos asignados recientemente
+ description: El valor predeterminado es 14 días.
+ skip_new_users_for_days:
+ label: Omitir a los nuevos usuarios durante días
+ description: El valor predeterminado es 0 días (los usuarios se pueden asignar inmediatamente después de registrarse).
+ max_recently_assigned_days:
+ label: Días máximos asignados recientemente
+ description: Primer intento de excluir a los usuarios asignados en los últimos `n` días. Si no queda ningún usuario, se recurre a `mínimo_días_de_asignación_reciente`. Por defecto, 180 días.
+ assigned_topic:
+ label: ID del tema asignado
+ in_working_hours:
+ label: Usuarios en horario laboral
+ notification_reason:
+ user: "Verás un recuento de nuevas respuestas porque este tema te fue asignado."
+ notifications:
+ assigned: "<span>%{username}</span> %{description}"
+ popup:
+ assigned: "%{username} te asignó"
+ titles:
+ assigned: "Asignada"
+ dismiss_confirmation:
+ body:
+ assigns:
+ one: "¿Seguro? Tienes %{count} notificación de asignación no leída."
+ other: "¿Seguro? Tienes %{count} notificaciones de asignación no leídas."
+ user_menu:
+ view_all_assigned: "ver todas las asignadas"
+ tabs:
+ assign_list: "Asignar lista"
+ assign_list_with_unread:
+ one: "Asignar lista - %{count} asignación no leída"
+ other: "Asignar lista - %{count} asignación no leída"
+ edit_assignments_modal:
+ title: "Editar asignaciones"
+ topic: "Tema"
+ post: "Publicación"
diff --git a/plugins/discourse-assign/config/locales/client.et.yml b/plugins/discourse-assign/config/locales/client.et.yml
new file mode 100644
index 00000000000..c4f889e469e
--- /dev/null
+++ b/plugins/discourse-assign/config/locales/client.et.yml
@@ -0,0 +1,61 @@
+# WARNING: Never edit this file.
+# It will be overwritten when translations are pulled from Crowdin.
+#
+# To work with us on translations, join this project:
+# https://translate.discourse.org/
+
+et:
+ js:
+ discourse_assign:
+ assigned: "Määratud"
+ group_everyone: "Kõik"
+ assigned_to: "Määratud kasutajale"
+ assigned_to_w_ellipsis: "Määratud kasutajale..."
+ unassign:
+ title: "Eemalda määramine"
+ title_w_ellipsis: "Eemalda määramine..."
+ assign:
+ title: "Määra"
+ reassign:
+ title: "Muuda"
+ topic_level_menu:
+ unassign_with_ellipsis: "Eemalda määramine..."
+ assign_modal:
+ title: "Määra teema"
+ assign: "Määra"
+ optional_label: "(valikuline)"
+ status_label: Staatus
+ claim:
+ help: "Määra teema endale"
+ assign_mailer:
+ never: "Mitte kunagi"
+ always: "Alati"
+ reminders_frequency:
+ never: "Mitte kunagi"
+ daily: "Igapäevaselt"
+ weekly: "Iganädalaselt"
+ monthly: "Igakuiselt"
+ quarterly: "Kvartaalselt"
+ admin:
+ groups:
+ manage:
+ interaction:
+ assign: "Määra"
+ user:
+ notification_level_when_assigned:
+ do_nothing: "Ära tee midagi"
+ messages:
+ assigned: "Määratud"
+ assignment_description:
+ topic: "%{topic_title}"
+ search:
+ advanced:
+ assigned:
+ label: "Määratud kasutajale"
+ notifications:
+ assigned: "<span>%{username}</span> %{description}"
+ titles:
+ assigned: "Määratud"
+ edit_assignments_modal:
+ topic: "Teema"
+ post: "Postitus"
diff --git a/plugins/discourse-assign/config/locales/client.fa_IR.yml b/plugins/discourse-assign/config/locales/client.fa_IR.yml
new file mode 100644
index 00000000000..7c904e6683f
--- /dev/null
+++ b/plugins/discourse-assign/config/locales/client.fa_IR.yml
@@ -0,0 +1,41 @@
+# WARNING: Never edit this file.
+# It will be overwritten when translations are pulled from Crowdin.
+#
+# To work with us on translations, join this project:
+# https://translate.discourse.org/
+
+fa_IR:
+ js:
+ action_codes:
+ assigned: "اختصاص داده شده %{who} %{when}"
+ assigned_group: "اختصاص داده شده %{who} %{when}"
+ assigned_to_post: "%{who} به <a href='%{path}'>نوشته</a> %{when} اختصاص داده شده است"
+ assigned_group_to_post: "%{who} به <a href='%{path}'>نوشته</a> %{when} اختصاص داده شده است"
+ unassigned: "اختصاص داده نشده %{who} %{when}"
+ unassigned_group: "اختصاص داده نشده %{who} %{when}"
+ discourse_assign:
+ group_everyone: "همه"
+ reassign:
+ title: "ویرایش"
+ assign_modal:
+ note_label: یادداشت
+ optional_label: "(اختیاری)"
+ status_label: وضعیت
+ suggestions: پیشنهادها
+ assign_mailer:
+ never: "هیچ‌وقت"
+ always: "همیشه"
+ reminders_frequency:
+ never: "هیچ‌وقت"
+ daily: "روزانه"
+ weekly: "هفتگی"
+ monthly: "ماهانه"
+ quarterly: "فصلی"
+ user:
+ assignment_description:
+ topic: "%{topic_title}"
+ notifications:
+ assigned: "<span>%{username}</span> %{description}"
+ edit_assignments_modal:
+ topic: "موضوع"
+ post: "نوشته"
diff --git a/plugins/discourse-assign/config/locales/client.fi.yml b/plugins/discourse-assign/config/locales/client.fi.yml
new file mode 100644
index 00000000000..91b3854b29f
--- /dev/null
+++ b/plugins/discourse-assign/config/locales/client.fi.yml
@@ -0,0 +1,193 @@
+# WARNING: Never edit this file.
+# It will be overwritten when translations are pulled from Crowdin.
+#
+# To work with us on translations, join this project:
+# https://translate.discourse.org/
+
+fi:
+ admin_js:
+ admin:
+ site_settings:
+ categories:
+ discourse_assign: "Discourse-osoitus"
+ js:
+ filters:
+ unassigned:
+ title: "Osoittamattomat"
+ help: "Ketjut, joita ei ole osoitettu"
+ action_codes:
+ assigned: "Osoitti käyttäjälle %{who} %{when}"
+ assigned_group: "Osoitti ryhmälle %{who} %{when}"
+ assigned_to_post: "Osoitti käyttäjän %{who} <a href='%{path}'>viestiin</a> %{when}"
+ assigned_group_to_post: "Osoitti käyttäjän %{who} <a href='%{path}'>viestiin</a> %{when}"
+ unassigned: "Perui osoituksen käyttäjälle %{who} %{when}"
+ unassigned_group: "Perui osoituksen ryhmälle %{who} %{when}"
+ unassigned_from_post: "Perui käyttäjän %{who} osoituksen <a href='%{path}'>viestiin</a> %{when}"
+ unassigned_group_from_post: "Perui ryhmän %{who} osoituksen <a href='%{path}'>viestiin</a> %{when}"
+ reassigned: "Osoitti uudelleen käyttäjälle %{who} %{when}"
+ reassigned_group: "Osoitti uudelleen käyttäjälle %{who} %{when}"
+ details_change: "Muutti osoitustiedot käyttäjälle %{who} %{when}"
+ note_change: "Muutti osoitushuomautuksen käyttäjälle %{who} %{when}"
+ status_change: "Muutti osoitustilan käyttäjälle %{who} %{when}"
+ discourse_assign:
+ add_unassigned_filter: "Lisää alueille osoittamattomat-suodatin"
+ cant_act: "Et voi käsitellä lippua, joka on osoitettu toiselle käyttäjälle"
+ cant_act_unclaimed: "Sinun täytyy omia ketju ennen kuin käsittelet lippuja."
+ topic_search_placeholder: "Hae ketjuja otsikon tai viestin sisällön perusteella"
+ sidebar_name_filter_placeholder: "Nimi/käyttäjänimi"
+ assigned: "Osoitettu"
+ group_everyone: "Kaikki"
+ assigned_to: "Osoitettu käyttäjälle"
+ assigned_topic_to: "Osoitti ketjun käyttäjälle <a href='%{path}'>%{username}</a>"
+ assign_post_to: "Osoitti viestin %{post_number} käyttäjälle %{username}"
+ assign_post_to_multiple: "#%{post_number} käyttäjälle %{username}"
+ assigned_to_w_ellipsis: "Osoitettu käyttäjälle..."
+ unassign:
+ title: "Peru osoitus"
+ title_w_ellipsis: "Peru osoitus..."
+ help: "Peru käyttäjän %{username} osoitus ketjusta"
+ assign:
+ title: "Osoita"
+ help: "Osoita ketju käyttäjälle"
+ assign_post:
+ title: "Osoita viesti"
+ unassign_post:
+ title: "Peru osoitus viestistä"
+ help: "Peru käyttäjän %{username} osoitus viestistä"
+ reassign:
+ title: "Muokkaa"
+ title_w_ellipsis: "Muokkaa osoitusta..."
+ to_self: "Osoita uudelleen minulle"
+ to_self_help: "Osoita ketju uudelleen minulle"
+ help: "Muokkaa osoituksen tietoja"
+ reassign_modal:
+ title: "Osoita ketju uudelleen"
+ topic_level_menu:
+ edit_assignments: "Muokkaa osoituksia..."
+ reassign_topic_to_me: "Osoita ketju uudelleen minulle"
+ unassign_with_ellipsis: "Peru osoitus..."
+ unassign_from_post: "Peru käyttäjän @%{assignee} osoitus viestistä %{post_number}"
+ unassign_from_post_help: "Peru käyttäjän @%{assignee} osoitus viestistä %{post_number}"
+ unassign_from_topic: "Peru käyttäjän @%{username} osoitus ketjusta"
+ assign_modal:
+ title: "Osoita ketju"
+ reassign_title: "Osoita ketju uudelleen"
+ assign: "Osoita"
+ assignee_label: Osoituksensaaja
+ assignment_label: Osoitus
+ choose_assignee: Valitse osoitettava käyttäjä.
+ edit_assignments_title: "Muokkaa osoituksia"
+ note_label: Huomautus
+ optional_label: "(valinnainen)"
+ status_label: Tila
+ suggestions: ehdotukset
+ assign_post_modal:
+ title: "Osoita viesti"
+ claim:
+ title: "omi"
+ help: "Osoita ketju itsellesi"
+ assign_mailer:
+ never: "Ei koskaan"
+ different_users: "Vain jos osoittaja ja osoitettu ovat eri käyttäjiä"
+ always: "Aina"
+ reminders_frequency:
+ description: "Osoitettujen ketjujen muistutusten toistuvuus"
+ never: "Ei koskaan"
+ daily: "Päivittäin"
+ weekly: "Viikoittain"
+ monthly: "Kuukausittain"
+ quarterly: "Vuosineljännettäin"
+ admin:
+ groups:
+ manage:
+ interaction:
+ assign: "Osoita"
+ assignable_levels:
+ title: "Ketkä voivat osoittaa tämän ryhmän"
+ user:
+ notification_level_when_assigned:
+ label: "Kun osoitetaan"
+ watch_topic: "Tarkkailtu ketju"
+ track_topic: "Seurattu ketju"
+ do_nothing: "Älä tee mitään"
+ messages:
+ assigned_title: "Osoitettu (%{count})"
+ assigned: "Osoitettu"
+ no_assignments_title: "Sinulla ei ole vielä osoituksia"
+ no_assignments_body: >
+ Sinulle osoitetut ketjut ja viestit luetellaan tässä. Saat myös ajoittain muistutusilmoituksia osoituksistasi, joita voit muuttaa <a href='%{preferencesUrl}'>käyttäjäasetuksissasi</a>. <br><br> Jos haluat osoittaa ketjun tai viestin itsellesi tai jollekulle toiselle, etsi osoituspainike %{icon} alaosasta.
+ dismiss_assigned_tooltip: "Merkitse kaikki lukemattomat osoitusilmoitukset luetuiksi"
+ assigned_to_group:
+ post: "viesti osoitettu ryhmälle %{group_name}"
+ topic: "ketju osoitettu ryhmälle %{group_name}"
+ assigned_to_you:
+ post: "viesti osoitettu sinulle"
+ topic: "ketju osoitettu sinulle"
+ assignment_description:
+ post: "%{topic_title} (#%{post_number})"
+ topic: "%{topic_title}"
+ admin:
+ web_hooks:
+ assign_event:
+ group_name: "Osoitustapahtumat"
+ assigned: "Kun käyttäjä osoittaa ketjun"
+ unassigned: "Kun käyttäjä peruu ketjun osoituksen"
+ search:
+ advanced:
+ in:
+ assigned: "ovat osoitettu"
+ unassigned: "ovat osoittamattomia"
+ assigned:
+ label: "Osoitettu käyttäjälle"
+ topics:
+ bulk:
+ unassign: "Peru ketjujen osoitus"
+ assign: "Osoita ketjut"
+ discourse_automation:
+ scriptables:
+ random_assign:
+ fields:
+ post_template:
+ label: Viestimalli
+ description: Jos tämä täytetään, viesti tällä mallilla luodaan, ja käyttäjä osoitetaan sille ketjun sijaan.
+ assignees_group:
+ label: Osoitettujen ryhmä
+ minimum_time_between_assignments:
+ label: Vähimmäismäärä tunteja osoitusten välillä
+ min_recently_assigned_days:
+ label: Hiljattain osoitettujen päivien vähimmäismäärä
+ description: Oletusarvo on 14 päivää.
+ skip_new_users_for_days:
+ label: Ohita uudet käyttäjät päivien ajaksi
+ description: Oletusarvo on 0 päivää (käyttäjät voidaan osoittaa heti rekisteröitymisen jälkeen).
+ max_recently_assigned_days:
+ label: Hiljattain osoitettujen päivien enimmäismäärä
+ description: Ensimmäinen yritys sulkea pois käyttäjiä, jotka on osoitettu viimeisten n:n päivän aikana. Jos käyttäjiä ei ole jäljellä, käytetään `min_recently_assigned_days`-asetusta. Oletusarvo on 180 päivää.
+ assigned_topic:
+ label: Osoitetun ketjun tunnus
+ in_working_hours:
+ label: Käyttäjät työaikana
+ notification_reason:
+ user: "Näet uusien vastausten määrän, koska tämä ketju on osoitettu sinulle."
+ notifications:
+ assigned: "<span>%{username}</span> %{description}"
+ popup:
+ assigned: "%{username} osoitti sinut"
+ titles:
+ assigned: "Osoitettu"
+ dismiss_confirmation:
+ body:
+ assigns:
+ one: "Oletko varma? Sinulla on %{count} lukematon osoitusilmoitus."
+ other: "Oletko varma? Sinulla on %{count} lukematonta osoitusilmoitusta."
+ user_menu:
+ view_all_assigned: "näytä kaikki osoitetut"
+ tabs:
+ assign_list: "Osoitusluettelo"
+ assign_list_with_unread:
+ one: "Osoitusluettelo – %{count} lukematon osoitus"
+ other: "Osoitusluettelo – %{count} lukematonta osoitusta"
+ edit_assignments_modal:
+ title: "Muokkaa osoituksia"
+ topic: "Ketju"
+ post: "Viesti"
diff --git a/plugins/discourse-assign/config/locales/client.fr.yml b/plugins/discourse-assign/config/locales/client.fr.yml
new file mode 100644
index 00000000000..19c575550f4
--- /dev/null
+++ b/plugins/discourse-assign/config/locales/client.fr.yml
@@ -0,0 +1,193 @@
+# WARNING: Never edit this file.
+# It will be overwritten when translations are pulled from Crowdin.
+#
+# To work with us on translations, join this project:
+# https://translate.discourse.org/
+
+fr:
+ admin_js:
+ admin:
+ site_settings:
+ categories:
+ discourse_assign: "Affectation de Discourse"
+ js:
+ filters:
+ unassigned:
+ title: "Désattribué"
+ help: "Sujets qui ne sont pas attribués"
+ action_codes:
+ assigned: "A attribué à %{who} le %{when}"
+ assigned_group: "A attribué à %{who} le %{when}"
+ assigned_to_post: "A attribué %{who} au <a href='%{path}'>message</a> le %{when}"
+ assigned_group_to_post: "A attribué %{who} au <a href='%{path}'>message</a> le %{when}"
+ unassigned: "A annulé l'attribution à %{who} le %{when}"
+ unassigned_group: "A annulé l'attribution à %{who} le %{when}"
+ unassigned_from_post: "A annulé l'attribution de %{who} au <a href='%{path}'>message</a> le %{when}"
+ unassigned_group_from_post: "A annulé l'attribution de %{who} au <a href='%{path}'>message</a> le %{when}"
+ reassigned: "Réattribution à %{who} le %{when}"
+ reassigned_group: "Réattribution à %{who} le %{when}"
+ details_change: "A modifié les détails de l'attribution à %{who} le %{when}"
+ note_change: "A modifié la note de l'attribution à %{who} le %{when}"
+ status_change: "A modifié le statut de l'attribution à %{who} le %{when}"
+ discourse_assign:
+ add_unassigned_filter: "Ajouter le filtre « Non attribués » à la catégorie"
+ cant_act: "Vous ne pouvez pas agir sur des signalements qui ont été attribués à d'autres utilisateurs"
+ cant_act_unclaimed: "Il faut réserver ce sujet avant d'agir sur les signalements."
+ topic_search_placeholder: "Rechercher des sujets par titre ou contenu"
+ sidebar_name_filter_placeholder: "Nom ou nom d'utilisateur"
+ assigned: "Attribué"
+ group_everyone: "Tout le monde"
+ assigned_to: "Attribué à"
+ assigned_topic_to: "A attribué le message à <a href='%{path}'>%{username}</a>"
+ assign_post_to: "A attribué %{post_number} à %{username}"
+ assign_post_to_multiple: "#%{post_number} à %{username}"
+ assigned_to_w_ellipsis: "Attribué à…"
+ unassign:
+ title: "Annuler l'attribution"
+ title_w_ellipsis: "Annuler l'attribution…"
+ help: "Annuler l'attribution de %{username} au sujet"
+ assign:
+ title: "Attribuer"
+ help: "Attribuer le sujet à l'utilisateur"
+ assign_post:
+ title: "Attribuer un message"
+ unassign_post:
+ title: "Annuler l'attribution du message"
+ help: "Annuler l'attribution de %{username} au message"
+ reassign:
+ title: "Modifier"
+ title_w_ellipsis: "Modifier l'attribution…"
+ to_self: "Réattribuer à moi"
+ to_self_help: "Me réattribuer le sujet"
+ help: "Modifier les détails de l'attribution"
+ reassign_modal:
+ title: "Réattribuer le sujet"
+ topic_level_menu:
+ edit_assignments: "Modifier les attributions…"
+ reassign_topic_to_me: "Me réattribuer le sujet"
+ unassign_with_ellipsis: "Annuler l'attribution…"
+ unassign_from_post: "Annuler l'attribution de @%{assignee} à #%{post_number}"
+ unassign_from_post_help: "Annuler l'attribution de @%{assignee} à la publication #%{post_number}"
+ unassign_from_topic: "Annuler l'attribution de @%{username} au sujet"
+ assign_modal:
+ title: "Attribuer le sujet"
+ reassign_title: "Réattribuer le sujet"
+ assign: "Attribuer"
+ assignee_label: Attributaire
+ assignment_label: Attribution
+ choose_assignee: Choisissez un utilisateur à attribuer.
+ edit_assignments_title: "Modifier les attributions"
+ note_label: Note
+ optional_label: "(facultatif)"
+ status_label: Statut
+ suggestions: suggestions
+ assign_post_modal:
+ title: "Attribuer un message"
+ claim:
+ title: "réserver"
+ help: "Attribuer le sujet à vous-même"
+ assign_mailer:
+ never: "Jamais"
+ different_users: "Uniquement si l'utilisateur qui effectue l'attribution et l'utilisateur qui reçoit l'attribution sont différents"
+ always: "Toujours"
+ reminders_frequency:
+ description: "Fréquence à laquelle recevoir des rappels de sujets attribués"
+ never: "Jamais"
+ daily: "Chaque jour"
+ weekly: "Chaque semaine"
+ monthly: "Chaque mois"
+ quarterly: "Chaque trimestre"
+ admin:
+ groups:
+ manage:
+ interaction:
+ assign: "Attribuer"
+ assignable_levels:
+ title: "Qui peut attribuer ce groupe"
+ user:
+ notification_level_when_assigned:
+ label: "En cas d'attribution"
+ watch_topic: "Surveiller le sujet"
+ track_topic: "Suivre le sujet"
+ do_nothing: "Ne rien faire"
+ messages:
+ assigned_title: "Attribué(s) (%{count})"
+ assigned: "Attribué(s)"
+ no_assignments_title: "Vous n'avez pas encore d'attribution"
+ no_assignments_body: >
+ Vos sujets et messages attribués seront répertoriés ici. Vous recevrez également une notification de rappel périodique de vos attributions que vous pouvez ajuster dans vos <a href='%{preferencesUrl}'>préférences d'utilisateur</a>. <br><br> Pour attribuer un sujet ou un message à vous-même ou à quelqu'un d'autre, recherchez le bouton d'attribution %{icon} en bas de l'écran.
+ dismiss_assigned_tooltip: "Marquer toutes les notifications d'attribution non lues comme lues"
+ assigned_to_group:
+ post: "message attribué à %{group_name}"
+ topic: "sujet attribué à %{group_name}"
+ assigned_to_you:
+ post: "message attribué à vous"
+ topic: "sujet attribué à vous"
+ assignment_description:
+ post: "%{topic_title} (#%{post_number})"
+ topic: "%{topic_title}"
+ admin:
+ web_hooks:
+ assign_event:
+ group_name: "Événements d'attribution"
+ assigned: "Lorsqu'un utilisateur attribue un sujet"
+ unassigned: "Lorsqu'un utilisateur annule l'attribution d'un sujet"
+ search:
+ advanced:
+ in:
+ assigned: "sont attribués"
+ unassigned: "ne sont pas attribués"
+ assigned:
+ label: "Attribué à"
+ topics:
+ bulk:
+ unassign: "Annuler l'attribution des sujets"
+ assign: "Attribuer les sujets"
+ discourse_automation:
+ scriptables:
+ random_assign:
+ fields:
+ post_template:
+ label: Modèle de publication
+ description: S'il est rempli, un message avec ce modèle sera créé et un utilisateur lui sera attribué à la place du sujet.
+ assignees_group:
+ label: Groupe d'attributaires
+ minimum_time_between_assignments:
+ label: Nombre minimal d'heures entre les attributions
+ min_recently_assigned_days:
+ label: Nombre minimal de jours récemment attribués
+ description: La valeur par défaut est fixée à 14 jours.
+ skip_new_users_for_days:
+ label: Ignorer les nouveaux utilisateurs pendant plusieurs jours
+ description: La valeur par défaut est de 0 jour (les utilisateurs peuvent être attribués immédiatement après leur inscription).
+ max_recently_assigned_days:
+ label: Nombre maximal de jours récemment attribués
+ description: Première tentative d'exclusion des utilisateurs attribués au cours des « n » derniers jours. Si aucun utilisateur n'est parti, cette valeur revient à « min_recently_assigned_days ». La valeur par défaut est de 180 jours.
+ assigned_topic:
+ label: ID du sujet attribué
+ in_working_hours:
+ label: Utilisateurs pendant les heures de travail
+ notification_reason:
+ user: "Vous verrez le nombre de nouvelles réponses, car ce sujet vous a été attribué."
+ notifications:
+ assigned: "<span>%{username}</span> %{description}"
+ popup:
+ assigned: "%{username} vous a attribué"
+ titles:
+ assigned: "Attribué(s)"
+ dismiss_confirmation:
+ body:
+ assigns:
+ one: "Vous avez %{count} notification d'attribution non lue. Voulez-vous continuer ?"
+ other: "Vous avez %{count} notifications d'attribution non lues. Voulez-vous continuer ?"
+ user_menu:
+ view_all_assigned: "voir toutes les attributions"
+ tabs:
+ assign_list: "Liste des attributions"
+ assign_list_with_unread:
+ one: "Liste des attributions - %{count} attribution non lue"
+ other: "Liste des attributions - %{count} attributions non lues"
+ edit_assignments_modal:
+ title: "Modifier les attributions"
+ topic: "Sujet"
+ post: "Publication"
diff --git a/plugins/discourse-assign/config/locales/client.gl.yml b/plugins/discourse-assign/config/locales/client.gl.yml
new file mode 100644
index 00000000000..22247812de6
--- /dev/null
+++ b/plugins/discourse-assign/config/locales/client.gl.yml
@@ -0,0 +1,39 @@
+# WARNING: Never edit this file.
+# It will be overwritten when translations are pulled from Crowdin.
+#
+# To work with us on translations, join this project:
+# https://translate.discourse.org/
+
+gl:
+ js:
+ discourse_assign:
+ assigned: "Asignado"
+ group_everyone: "Todos"
+ reassign:
+ title: "Editar"
+ assign_modal:
+ optional_label: "(opcional)"
+ status_label: Estado
+ assign_mailer:
+ never: "Nunca"
+ always: "Sempre"
+ reminders_frequency:
+ never: "Nunca"
+ daily: "Diario"
+ weekly: "Semanal"
+ monthly: "Mensual"
+ quarterly: "Trimestral"
+ user:
+ notification_level_when_assigned:
+ do_nothing: "Non facer nada"
+ messages:
+ assigned: "Asignado"
+ assignment_description:
+ topic: "%{topic_title}"
+ notifications:
+ assigned: "<span>%{username}</span> %{description}"
+ titles:
+ assigned: "Asignado"
+ edit_assignments_modal:
+ topic: "Tema"
+ post: "Publicación"
diff --git a/plugins/discourse-assign/config/locales/client.he.yml b/plugins/discourse-assign/config/locales/client.he.yml
new file mode 100644
index 00000000000..b7728d2ade2
--- /dev/null
+++ b/plugins/discourse-assign/config/locales/client.he.yml
@@ -0,0 +1,194 @@
+# WARNING: Never edit this file.
+# It will be overwritten when translations are pulled from Crowdin.
+#
+# To work with us on translations, join this project:
+# https://translate.discourse.org/
+
+he:
+ admin_js:
+ admin:
+ site_settings:
+ categories:
+ discourse_assign: "Discourse הקצאות"
+ js:
+ filters:
+ unassigned:
+ title: "לא מוקצה"
+ help: "נושאים שאינם מוקצים"
+ action_codes:
+ assigned: "מוקצה לטובת %{who} %{when}"
+ assigned_group: "מוקצה לטובת %{who} %{when}"
+ assigned_to_post: "בוצעה הקצאה של %{who} ל<a href='%{path}'>פוסט</a> ב־%{when}"
+ assigned_group_to_post: "בוצעה הקצאה של %{who} ל<a href='%{path}'>פוסט</a> ב־%{when}"
+ unassigned: "הוסרה ההקצאה של %{who} %{when}"
+ unassigned_group: "הוסרה ההקצאה של %{who} %{when}"
+ unassigned_from_post: "בוטלה הקצאה של %{who} מה<a href='%{path}'>פוסט</a> ב־%{when}"
+ unassigned_group_from_post: "בוטלה הקצאה של %{who} מה<a href='%{path}'>פוסט</a> ב־%{when}"
+ reassigned: "הוקצה מחדש לטובת %{who} %{when}"
+ reassigned_group: "הוקצה מחדש לטובת %{who} %{when}"
+ details_change: "הוחלפו פרטי ההקצאה עבור %{who} %{when}"
+ note_change: "הערת ההקצאה של %{who} נערכה ב־%{when}"
+ status_change: "הוחלף מצב ההקצאה עבור %{who} %{when}"
+ discourse_assign:
+ add_unassigned_filter: "הוספת מסנן ‚ללא הקצאה’ לקטגוריה"
+ cant_act: "אין לך אפשרות לפעול על דגלים שהוקצו למשתמשים אחרים"
+ cant_act_unclaimed: "עליך לדרוש את הנושא הזה לפני נקיטת פעולות על דגלים."
+ topic_search_placeholder: "חפש נושאים לפי כותרת או תוכן הפוסט"
+ sidebar_name_filter_placeholder: "שם/שם משתמש"
+ assigned: "מוקצה"
+ group_everyone: "כולם"
+ assigned_to: "מוקצה לטובת"
+ assigned_topic_to: "נושא הוקצה לטובת <a href='%{path}'>%{username}</a>"
+ assign_post_to: "מס׳ %{post_number} הוקצה לטובת %{username}"
+ assign_post_to_multiple: "מס׳ %{post_number} אל %{username}"
+ assigned_to_w_ellipsis: "מוקצה לטובת..."
+ unassign:
+ title: "ביטול הקצאה"
+ title_w_ellipsis: "ביטול הקצאה..."
+ help: "לבטל את הקצאת %{username} מהנושא"
+ assign:
+ title: "הקצאה"
+ help: "הקצאת משתמש לנושא"
+ assign_post:
+ title: "הקצאת פוסט"
+ unassign_post:
+ title: "ביטול הקצאת פוסט"
+ help: "לבטל את הקצאת %{username} מהפוסט"
+ reassign:
+ title: "עריכה"
+ title_w_ellipsis: "עריכת הקצאה…"
+ to_self: "הקצאה מחדש אלי"
+ to_self_help: "הקצאת נושא אלי מחדש"
+ help: "עריכת פרטי משימה"
+ reassign_modal:
+ title: "הקצאת נושא מחדש"
+ topic_level_menu:
+ edit_assignments: "עריכת הקצאות…"
+ reassign_topic_to_me: "הקצאת הנושא אליי מחדש"
+ unassign_with_ellipsis: "ביטול הקצאה..."
+ unassign_from_post: "ביטול הקצאת ‎@%{assignee} ממס׳ %{post_number}"
+ unassign_from_post_help: "ביטול הקצאת ‎@%{assignee} מפוסט מס׳ %{post_number}"
+ unassign_from_topic: "ביטול הקצאת ‎@%{username} מנושא"
+ assign_modal:
+ title: "הקצאת נושא"
+ reassign_title: "הקצאת נושא מחדש"
+ assign: "הקצאה"
+ assignee_label: ממונה
+ assignment_label: הקצאה
+ choose_assignee: נא לבחור משתמש להקצאה.
+ edit_assignments_title: "עריכת הקצאות"
+ note_label: הערה
+ optional_label: "(רשות)"
+ status_label: מצב
+ suggestions: הצעות
+ assign_post_modal:
+ title: "הקצאת פוסט"
+ claim:
+ title: "דרישה"
+ help: "הקצאת נושא לעצמך"
+ assign_mailer:
+ never: "אף פעם"
+ different_users: "רק אם הצד המקצה או הצד שהוקצה אליו הם משתמשים שונים"
+ always: "תמיד"
+ reminders_frequency:
+ description: "תדירות קבלת תזכורות לנושאים מוקצים"
+ never: "אף פעם"
+ daily: "יומי"
+ weekly: "שבועי"
+ monthly: "חודשי"
+ quarterly: "רבעוני"
+ admin:
+ groups:
+ manage:
+ interaction:
+ assign: "הקצאה"
+ assignable_levels:
+ title: "מי יכול להקצות את הקבוצה הזאת"
+ user:
+ notification_level_when_assigned:
+ do_nothing: "לא לעשות דבר"
+ messages:
+ assigned_title: "מוקצים (%{count})"
+ assigned: "מוקצה"
+ no_assignments_title: "אין לך מטלות עדיין"
+ no_assignments_body: >
+ הנושאים שמוקצים אליך יופיעו כאן. תישלחנה אליך הודעות תזכורת מדי פעם בפעם כדי להזכיר לך את המטלות שלך, ניתן להגדיר אותן <a href='%{preferencesUrl}'>בהעדפות המשתמש</a> שלך. <br><br> כדי להקצות נושא או הודעה לעצמך או למישהו אחר יש לחפש את הכפתור %{icon} הקצאה למטה.
+ dismiss_assigned_tooltip: "סימון כל התראות ההקצאה שלא נקראו כהתראות שנקראו"
+ assigned_to_group:
+ post: "הפוסט הוקצה לטובת %{group_name}"
+ topic: "הנושא הוקצה לטובת %{group_name}"
+ assigned_to_you:
+ post: "הפוסט הוקצה לך"
+ topic: "הנושא הוקצה לך"
+ assignment_description:
+ post: "%{topic_title} (מס׳ %{post_number})"
+ topic: "%{topic_title}"
+ admin:
+ web_hooks:
+ assign_event:
+ group_name: "הקצאת אירועים"
+ assigned: "בעת הקצאת נושא על ידי משתמש"
+ unassigned: "בעת ביטול הקצאת נושא על ידי משתמש"
+ search:
+ advanced:
+ in:
+ assigned: "מוקצים"
+ unassigned: "אינם מוקצים"
+ assigned:
+ label: "מוקצה לטובת"
+ topics:
+ bulk:
+ unassign: "ביטול הקצאת נושאים"
+ assign: "הקצאת נושאים"
+ discourse_automation:
+ scriptables:
+ random_assign:
+ fields:
+ post_template:
+ label: תבנית פוסט
+ description: אם ימולא, יווצר פוסט עם התבנית הזאת ויוקצה אליו משתמש במקום הנושא.
+ assignees_group:
+ label: קבוצת מוקצים
+ minimum_time_between_assignments:
+ label: כמות מזערית של שעות בין הקצאות
+ min_recently_assigned_days:
+ label: כמות מזערית של ימים שהוקצו לאחרונה
+ description: ברירת המחדל היא 14 ימים.
+ skip_new_users_for_days:
+ label: דילוג על משתמשים חדשים למשך ימים
+ description: ברירת המחדל היא 0 ימים (אפשר להקצות משתמשים מיידית לאחר ההרשמה).
+ max_recently_assigned_days:
+ label: כמות מרבית של ימים שהוקצו לאחרונה
+ description: הניסיון הראשון להחריג משתמש שהוקצו ב־`n` הימים האחרונים. אם לא עזבו משתמשים, תתבצע נסיגה אל `min_recently_assigned_days`. ברירת המחדל היא 180 ימים.
+ assigned_topic:
+ label: מזהה נושא מוקצה
+ in_working_hours:
+ label: משתמשים בשעות עבודה
+ notification_reason:
+ user: "תופיע ספירה של תגובות חדשות כיוון שהנושא הזה הוקצה אליך."
+ notifications:
+ assigned: "<span>%{username}</span> %{description}"
+ popup:
+ assigned: "הוקצה אליך על ידי %{username}"
+ titles:
+ assigned: "מוקצה"
+ dismiss_confirmation:
+ body:
+ assigns:
+ one: "בוודאות? יש לך התראת הקצאה %{count}."
+ two: "בוודאות? יש לך %{count} התראות הקצאה."
+ many: "בוודאות? יש לך %{count} התראות הקצאה."
+ other: "בוודאות? יש לך %{count} התראות הקצאה."
+ user_menu:
+ view_all_assigned: "הצגת כל ההקצאות"
+ tabs:
+ assign_list: "הצגת הקצאות"
+ assign_list_with_unread:
+ one: "רשימת הקצאות - הקצאה %{count} שלא נקראה"
+ two: "רשימת הקצאות - %{count} הקצאות שלא נקראו"
+ many: "רשימת הקצאות - %{count} הקצאות שלא נקראו"
+ other: "רשימת הקצאות - %{count} הקצאות שלא נקראו"
+ edit_assignments_modal:
+ title: "עריכת הקצאות"
+ topic: "נושא"
+ post: "פוסט"
diff --git a/plugins/discourse-assign/config/locales/client.hr.yml b/plugins/discourse-assign/config/locales/client.hr.yml
new file mode 100644
index 00000000000..43d2ae24db2
--- /dev/null
+++ b/plugins/discourse-assign/config/locales/client.hr.yml
@@ -0,0 +1,35 @@
+# WARNING: Never edit this file.
+# It will be overwritten when translations are pulled from Crowdin.
+#
+# To work with us on translations, join this project:
+# https://translate.discourse.org/
+
+hr:
+ js:
+ discourse_assign:
+ sidebar_name_filter_placeholder: "Ime/korisnički nadimak"
+ group_everyone: "Svi"
+ reassign:
+ title: "Uredi"
+ assign_modal:
+ optional_label: "(opcionalno)"
+ status_label: Statust
+ assign_mailer:
+ never: "Nikada"
+ always: "Uvijek"
+ reminders_frequency:
+ never: "Nikada"
+ daily: "Dnevno"
+ weekly: "Tjedno"
+ monthly: "Mjesečno"
+ quarterly: "Tromjesečno"
+ user:
+ notification_level_when_assigned:
+ do_nothing: "Ne radi ništa"
+ assignment_description:
+ topic: "%{topic_title}"
+ notifications:
+ assigned: "<span>%{username}</span> %{description}"
+ edit_assignments_modal:
+ topic: "Tema"
+ post: "Objava"
diff --git a/plugins/discourse-assign/config/locales/client.hu.yml b/plugins/discourse-assign/config/locales/client.hu.yml
new file mode 100644
index 00000000000..f2e0dfbba9b
--- /dev/null
+++ b/plugins/discourse-assign/config/locales/client.hu.yml
@@ -0,0 +1,123 @@
+# WARNING: Never edit this file.
+# It will be overwritten when translations are pulled from Crowdin.
+#
+# To work with us on translations, join this project:
+# https://translate.discourse.org/
+
+hu:
+ js:
+ filters:
+ unassigned:
+ title: "Nem kiosztott"
+ help: "Témák, amelyek nincsenek kiosztva"
+ action_codes:
+ assigned: "Kiosztva %{who} részére, %{when}"
+ assigned_group: "Kiosztva %{who} részére, %{when}"
+ assigned_to_post: "<a href='%{path}'>Bejegyzés</a> kiosztva %{who} részére, %{when}"
+ assigned_group_to_post: "<a href='%{path}'>Bejegyzés</a> kiosztva %{who} részére, %{when}"
+ unassigned: "%{who} Elvéve, %{when}"
+ unassigned_group: "%{who} Elvéve, %{when}"
+ unassigned_from_post: "%{who} Elvéve a <a href='%{path}'>bejegyzéstől</a>, %{when}"
+ unassigned_group_from_post: "%{who} Elvéve a <a href='%{path}'>bejegyzéstől</a>, %{when}"
+ reassigned: "Átadva %{who} részére, %{when}"
+ reassigned_group: "Átadva %{who} részére, %{when}"
+ discourse_assign:
+ add_unassigned_filter: "A „nem kiosztott” szűrő hozzáadása a kategóriához"
+ cant_act: "Nem kezelheti a más felhasználóhoz hozzárendelt jelzőket"
+ cant_act_unclaimed: "Le kell foglalnia a témát, mielőtt a jelzőket kezelhetné."
+ topic_search_placeholder: "Témák keresése cím vagy bejegyzéstartalom alapján"
+ sidebar_name_filter_placeholder: "Név/felhasználónév"
+ assigned: "Kiosztott"
+ group_everyone: "Mindenki"
+ assigned_to: "Kiosztva:"
+ assigned_to_w_ellipsis: "Kiosztva…"
+ unassign:
+ title: "Elvétel"
+ title_w_ellipsis: "Elvétel…"
+ help: "%{username} elvétele a témától"
+ assign:
+ title: "Kiosztás"
+ help: "Téma kiosztása a felhasználónak"
+ assign_post:
+ title: "Bejegyzés kiosztása"
+ unassign_post:
+ title: "Elvétel a bejegyzéstől"
+ help: "%{username} elvétele a bejegyzéstől"
+ reassign:
+ title: "Szerkesztés"
+ to_self: "Átvétel"
+ to_self_help: "Téma átvétele"
+ reassign_modal:
+ title: "Téma átadása"
+ topic_level_menu:
+ unassign_with_ellipsis: "Elvétel…"
+ assign_modal:
+ title: "Téma kiosztása"
+ reassign_title: "Téma átadása"
+ assign: "Kiosztás"
+ note_label: Megjegyzés
+ optional_label: "(nem kötelező)"
+ status_label: Állapot
+ assign_post_modal:
+ title: "Bejegyzés kiosztása"
+ claim:
+ title: "lefoglalás"
+ help: "Téma kiosztása saját magának"
+ assign_mailer:
+ never: "Soha"
+ different_users: "Csak akkor, ha a kiosztó, és aki kapja, különböző felhasználók"
+ always: "Mindig"
+ reminders_frequency:
+ description: "Kiosztott témákra vonatkozó emlékeztetők fogadási gyakorisága"
+ never: "Soha"
+ daily: "Naponta"
+ weekly: "Hetente"
+ monthly: "Havonta"
+ quarterly: "Negyedévente"
+ admin:
+ groups:
+ manage:
+ interaction:
+ assign: "Kiosztás"
+ assignable_levels:
+ title: "Ki oszthat ki ennek a csoportnak"
+ user:
+ notification_level_when_assigned:
+ do_nothing: "Ne csinálj semmit"
+ messages:
+ assigned_title: "Kiosztott (%{count})"
+ assigned: "Kiosztva"
+ no_assignments_title: "Még nincsenek kiosztott feladatai"
+ no_assignments_body: >
+ A kiosztott témák és üzenetek itt jelennek meg. Rendszeresen kap egy emlékeztető értesítést is a kiosztott feladatokról, amelyeket a <a href='%{preferencesUrl}'>felhasználói beállításokban</a> módosíthat. <br><br>Téma vagy üzenet saját magának vagy valaki másnak történő kiosztásához keresse a lenti %{icon} kiosztás gombot.
+ assignment_description:
+ topic: "%{topic_title}"
+ search:
+ advanced:
+ assigned:
+ label: "Kiosztva:"
+ topics:
+ bulk:
+ unassign: "Témák elvétele"
+ assign: "Témák kiosztása"
+ discourse_automation:
+ scriptables:
+ random_assign:
+ fields:
+ assignees_group:
+ label: Megbízottak csoportja
+ minimum_time_between_assignments:
+ label: Feladatkiosztások közti órák legkisebb száma
+ min_recently_assigned_days:
+ description: Alapértelmezés szerint 14 nap.
+ in_working_hours:
+ label: Felhasználók munkaidőben
+ notification_reason:
+ user: "Látni fogja az új válaszok számát, mert ezt a témát Önnek osztották ki."
+ notifications:
+ assigned: "<span>%{username}</span>%{description}"
+ titles:
+ assigned: "Kiosztott"
+ edit_assignments_modal:
+ topic: "Téma"
+ post: "Bejegyzés"
diff --git a/plugins/discourse-assign/config/locales/client.hy.yml b/plugins/discourse-assign/config/locales/client.hy.yml
new file mode 100644
index 00000000000..f1419fc6642
--- /dev/null
+++ b/plugins/discourse-assign/config/locales/client.hy.yml
@@ -0,0 +1,71 @@
+# WARNING: Never edit this file.
+# It will be overwritten when translations are pulled from Crowdin.
+#
+# To work with us on translations, join this project:
+# https://translate.discourse.org/
+
+hy:
+ js:
+ action_codes:
+ assigned: "Վերագրված է %{who}-ին %{when}"
+ assigned_group: "Վերագրված է %{who}-ին %{when}"
+ unassigned: "Ետկանչված է %{who} -ից%{when}"
+ unassigned_group: "Ետկանչված է %{who} -ից%{when}"
+ discourse_assign:
+ cant_act: "Դուք չեք կարող գործողություն կատարել դրոշակների հետ, որոնք վերագրված են այլ օգտատերերի"
+ cant_act_unclaimed: "Դուք պետք է պահանջեք այս թեման՝ մինչ դրոշի հետ որևէ գործողություն ձեռնարկելը:"
+ assigned: "Վերագրված"
+ group_everyone: "Բոլորը"
+ assigned_to: "Վերագրված է"
+ assigned_to_w_ellipsis: "Վերագրված է..."
+ unassign:
+ title: "Ետ կանչել վերագրումը"
+ title_w_ellipsis: "Ետ կանչել վերագրումը..."
+ assign:
+ title: "Վերագրել"
+ help: "Վերագրել Թեման Օգտատիրոջը"
+ reassign:
+ title: "Խմբագրել"
+ topic_level_menu:
+ unassign_with_ellipsis: "Ետ կանչել վերագրումը..."
+ assign_modal:
+ title: "Վերագրել Թեման"
+ assign: "Վերագրել"
+ optional_label: "(ընտրովի)"
+ status_label: Ստատուս
+ claim:
+ title: "պահանջ"
+ help: "Վերագրել թեման ինքներդ Ձեզ"
+ assign_mailer:
+ never: "Երբեք"
+ always: "Միշտ"
+ reminders_frequency:
+ never: "Երբեք"
+ daily: "Օրվա Ընթացքում"
+ weekly: "Շաբաթվա Ընթացքում"
+ monthly: "Ամսվա Ընթացքում"
+ quarterly: "Եռամսյակի Ընթացքում"
+ admin:
+ groups:
+ manage:
+ interaction:
+ assign: "Վերագրել"
+ user:
+ notification_level_when_assigned:
+ do_nothing: "Ոչինչ չանել"
+ messages:
+ assigned_title: "Վերագրված (%{count})"
+ assigned: "Վերագրված"
+ assignment_description:
+ topic: "%{topic_title}"
+ search:
+ advanced:
+ assigned:
+ label: "Վերագրված է"
+ notifications:
+ assigned: "<span>%{username}</span> %{description}"
+ titles:
+ assigned: "Վերագրված"
+ edit_assignments_modal:
+ topic: "Թեմա"
+ post: "Գրառում"
diff --git a/plugins/discourse-assign/config/locales/client.id.yml b/plugins/discourse-assign/config/locales/client.id.yml
new file mode 100644
index 00000000000..42190144cf5
--- /dev/null
+++ b/plugins/discourse-assign/config/locales/client.id.yml
@@ -0,0 +1,32 @@
+# WARNING: Never edit this file.
+# It will be overwritten when translations are pulled from Crowdin.
+#
+# To work with us on translations, join this project:
+# https://translate.discourse.org/
+
+id:
+ js:
+ discourse_assign:
+ assigned: "Ditugaskan"
+ group_everyone: "Semua orang"
+ reassign:
+ title: "Ubah"
+ assign_modal:
+ optional_label: "(opsional)"
+ status_label: Status
+ assign_mailer:
+ never: "Tidak pernah"
+ always: "Selalu"
+ reminders_frequency:
+ never: "Tidak pernah"
+ user:
+ notification_level_when_assigned:
+ do_nothing: "Tidak melakukan apapun"
+ messages:
+ assigned: "Ditugaskan"
+ notifications:
+ titles:
+ assigned: "Ditugaskan"
+ edit_assignments_modal:
+ topic: "Topik"
+ post: "Postingan"
diff --git a/plugins/discourse-assign/config/locales/client.it.yml b/plugins/discourse-assign/config/locales/client.it.yml
new file mode 100644
index 00000000000..f8cffa92b27
--- /dev/null
+++ b/plugins/discourse-assign/config/locales/client.it.yml
@@ -0,0 +1,193 @@
+# WARNING: Never edit this file.
+# It will be overwritten when translations are pulled from Crowdin.
+#
+# To work with us on translations, join this project:
+# https://translate.discourse.org/
+
+it:
+ admin_js:
+ admin:
+ site_settings:
+ categories:
+ discourse_assign: "Assegnazione Discourse"
+ js:
+ filters:
+ unassigned:
+ title: "Non assegnato"
+ help: "Argomenti non assegnati"
+ action_codes:
+ assigned: "Assegnato a %{who} %{when}"
+ assigned_group: "Assegnato a %{who} %{when}"
+ assigned_to_post: "Assegnato %{who} al <a href='%{path}'>messaggio</a> %{when}"
+ assigned_group_to_post: "Assegnato %{who} al <a href='%{path}'>messaggio</a> %{when}"
+ unassigned: "Assegnazione a %{who} %{when} annullata"
+ unassigned_group: "Assegnazione a %{who} %{when} annullata"
+ unassigned_from_post: "Assegnazione a %{who} del <a href='%{path}' data-auto-route='true'>messaggio</a> annullata %{when}"
+ unassigned_group_from_post: "Assegnazione a %{who} del <a href='%{path}' data-auto-route='true'>messaggio</a> annullata %{when}"
+ reassigned: "Riassegnato a %{who} %{when}"
+ reassigned_group: "Riassegnato a %{who} %{when}"
+ details_change: "Dettagli di assegnazione modificati per %{who} %{when}"
+ note_change: "Nota di assegnazione modificata per %{who} %{when}"
+ status_change: "Stato di assegnazione modificato per %{who} %{when}"
+ discourse_assign:
+ add_unassigned_filter: "Aggiungi il filtro 'non assegnato' alla categoria"
+ cant_act: "Non puoi intervenire su segnalazioni assegnate ad altri utenti"
+ cant_act_unclaimed: "Devi prima rivendicare questo argomento per poter intervenire sulle segnalazioni. "
+ topic_search_placeholder: "Ricerca argomenti per titolo o contenuto del messaggio"
+ sidebar_name_filter_placeholder: "Nome/Nome utente"
+ assigned: "Assegnato"
+ group_everyone: "Chiunque"
+ assigned_to: "Assegnato a"
+ assigned_topic_to: "Argomento assegnato a <a href='%{path}'>%{username}</a>"
+ assign_post_to: "#%{post_number} assegnato a %{username}"
+ assign_post_to_multiple: "n°%{post_number} a %{username}"
+ assigned_to_w_ellipsis: "Assegnato a..."
+ unassign:
+ title: "Annulla assegnazione"
+ title_w_ellipsis: "Annullamento assegnazione..."
+ help: "Annulla assegnazione di %{username} da messaggio"
+ assign:
+ title: "Assegna"
+ help: "Assegna Argomento ad Utente"
+ assign_post:
+ title: "Assegna messaggio"
+ unassign_post:
+ title: "Annulla assegnazione da messaggio"
+ help: "Annulla assegnazione di %{username} da messaggio"
+ reassign:
+ title: "Modifica"
+ title_w_ellipsis: "Modifica assegnazione..."
+ to_self: "Riassegna a me"
+ to_self_help: "Riassegna argomento a me"
+ help: "Modifica dettagli dell'assegnazione"
+ reassign_modal:
+ title: "Riassegna argomento"
+ topic_level_menu:
+ edit_assignments: "Modifica assegnazioni..."
+ reassign_topic_to_me: "Riassegna argomento a me"
+ unassign_with_ellipsis: "Annullamento assegnazione..."
+ unassign_from_post: "Annulla assegnazione di @%{assignee} da #%{post_number}"
+ unassign_from_post_help: "Annulla assegnazione di @%{assignee} dal messaggio #%{post_number}"
+ unassign_from_topic: "Annulla l'assegnazione di @%{username} dall'argomento"
+ assign_modal:
+ title: "Assegna Argomento"
+ reassign_title: "Riassegna argomento"
+ assign: "Assegna"
+ assignee_label: Assegnatario
+ assignment_label: Assegnazione
+ choose_assignee: Scegli un utente da assegnare.
+ edit_assignments_title: "Modifica assegnazioni"
+ note_label: Nota
+ optional_label: "(opzionale)"
+ status_label: Stato
+ suggestions: suggerimenti
+ assign_post_modal:
+ title: "Assegna messaggio"
+ claim:
+ title: "rivendica"
+ help: "Assegna l'argomento a te stesso"
+ assign_mailer:
+ never: "Mai"
+ different_users: "Solo se cedente e assegnatario sono utenti diversi"
+ always: "Sempre"
+ reminders_frequency:
+ description: "Frequenza per la ricezione di promemoria per argomenti assegnati"
+ never: "Mai"
+ daily: "Giornaliero"
+ weekly: "Settimanale"
+ monthly: "Mensile"
+ quarterly: "Trimestrale"
+ admin:
+ groups:
+ manage:
+ interaction:
+ assign: "Assegna"
+ assignable_levels:
+ title: "Chi può assegnare questo gruppo"
+ user:
+ notification_level_when_assigned:
+ label: "Quando assegnato"
+ watch_topic: "Ossera l'argomento"
+ track_topic: "Traccia l'argomento"
+ do_nothing: "Non fare nulla"
+ messages:
+ assigned_title: "Assegnato (%{count})"
+ assigned: "Assegnato"
+ no_assignments_title: "Non hai ancora assegnazioni"
+ no_assignments_body: >
+ Gli argomenti e i messaggi a te assegnati verranno elencati qui. Riceverai anche una notifica di promemoria periodica delle tue assegnazioni, che puoi modificare nelle tue <a href='%{preferencesUrl}'>preferenze utente</a>. <br><br> Per assegnare un argomento o un messaggio a te stesso o a qualcun altro, cerca il pulsante Assegna %{icon} in fondo.
+ dismiss_assigned_tooltip: "Imposta tutte le notifiche di assegnazione non lette come lette"
+ assigned_to_group:
+ post: "messaggio assegnato a %{group_name}"
+ topic: "argomento assegnato a %{group_name}"
+ assigned_to_you:
+ post: "messaggio assegnato a te"
+ topic: "argomento assegnato a te"
+ assignment_description:
+ post: "%{topic_title} (n°%{post_number})"
+ topic: "%{topic_title}"
+ admin:
+ web_hooks:
+ assign_event:
+ group_name: "Assegna eventi"
+ assigned: "Quando un utente assegna un argomento"
+ unassigned: "Quando un utente rimuove l'assegnazione di un argomento"
+ search:
+ advanced:
+ in:
+ assigned: "sono assegnati"
+ unassigned: "non sono assegnati"
+ assigned:
+ label: "Assegnato a"
+ topics:
+ bulk:
+ unassign: "Annulla assegnazione argomenti"
+ assign: "Assegna argomenti"
+ discourse_automation:
+ scriptables:
+ random_assign:
+ fields:
+ post_template:
+ label: Modello di messaggio
+ description: Compilando questa opzione, verrà creato un messaggio con questo modello e un utente verrà assegnato a esso invece che all'argomento.
+ assignees_group:
+ label: Gruppo di assegnatari
+ minimum_time_between_assignments:
+ label: Tempo minimo in ore tra le assegnazioni
+ min_recently_assigned_days:
+ label: Numero min di giorni per assegnazioni recenti
+ description: Valore predefinito 14 giorni.
+ skip_new_users_for_days:
+ label: Ignora nuovi utenti per giorni
+ description: Il valore predefinito è 0 giorni (gli utenti possono essere assegnati immediatamente dopo la registrazione).
+ max_recently_assigned_days:
+ label: Numero max di giorni per assegnazioni recenti
+ description: Primo tentativo di escludere gli utenti assegnati negli ultimi `n` giorni. Se non rimangono utenti, si applica il valore di `min_recently_assigned_days`. Il valore predefinito è 180 giorni.
+ assigned_topic:
+ label: ID argomento assegnato
+ in_working_hours:
+ label: Utenti in orario di lavoro
+ notification_reason:
+ user: "Vedrai il conteggio delle nuove risposte perché questo argomento ti è stato assegnato."
+ notifications:
+ assigned: "<span>%{username}</span> %{description}"
+ popup:
+ assigned: "%{username} ti ha assegnato"
+ titles:
+ assigned: "Assegnato"
+ dismiss_confirmation:
+ body:
+ assigns:
+ one: "Procedere? Hai %{count} notifica di assegnazione non letta."
+ other: "Procedere? Hai %{count} notifiche di assegnazione non lette."
+ user_menu:
+ view_all_assigned: "visualizza tutte le assegnazioni"
+ tabs:
+ assign_list: "Elenco assegnazioni"
+ assign_list_with_unread:
+ one: "Elenco assegnazioni: %{count} assegnazione non letta"
+ other: "Elenco assegnazioni: %{count} assegnazioni non lette"
+ edit_assignments_modal:
+ title: "Modifica assegnazioni"
+ topic: "Argomento"
+ post: "Messaggio"
diff --git a/plugins/discourse-assign/config/locales/client.ja.yml b/plugins/discourse-assign/config/locales/client.ja.yml
new file mode 100644
index 00000000000..8e98bf875bf
--- /dev/null
+++ b/plugins/discourse-assign/config/locales/client.ja.yml
@@ -0,0 +1,191 @@
+# WARNING: Never edit this file.
+# It will be overwritten when translations are pulled from Crowdin.
+#
+# To work with us on translations, join this project:
+# https://translate.discourse.org/
+
+ja:
+ admin_js:
+ admin:
+ site_settings:
+ categories:
+ discourse_assign: "Discourse 割り当て"
+ js:
+ filters:
+ unassigned:
+ title: "未割り当て"
+ help: "未割り当てのトピック"
+ action_codes:
+ assigned: "%{who} を割り当てました: %{when}"
+ assigned_group: "%{who} を割り当てました: %{when}"
+ assigned_to_post: "%{who} を<a href='%{path}'>投稿</a>に割り当てました: %{when}"
+ assigned_group_to_post: "%{who} を<a href='%{path}'>投稿</a>に割り当てました: %{when}"
+ unassigned: "%{who} の割り当てを解除しました: %{when}"
+ unassigned_group: "%{who} の割り当てを解除しました: %{when}"
+ unassigned_from_post: "%{who} を<a href='%{path}'>投稿</a>の割り当てから解除しました: %{when}"
+ unassigned_group_from_post: "%{who} を<a href='%{path}'>投稿</a>の割り当てから解除しました: %{when}"
+ reassigned: "%{who} を再割り当てしました: %{when}"
+ reassigned_group: "%{who} を再割り当てしました: %{when}"
+ details_change: "が %{who} の割り当て情報を変更しました: %{when}"
+ note_change: "が %{who} の割り当てメモを変更しました: %{when}"
+ status_change: "が %{who} の割り当てステータスを変更しました: %{when}"
+ discourse_assign:
+ add_unassigned_filter: "カテゴリに「未割り当て」フィルターを追加"
+ cant_act: "他のユーザーに割り当てられた通報に対応することはできません"
+ cant_act_unclaimed: "通報に対応する前に、このトピックを引き受ける必要があります。"
+ topic_search_placeholder: "タイトルまたは投稿のコンテンツでトピックを検索"
+ sidebar_name_filter_placeholder: "名前/ユーザー名"
+ assigned: "割り当て済み"
+ group_everyone: "全員"
+ assigned_to: "割り当て先"
+ assigned_topic_to: "トピックを <a href='%{path}'>%{username}</a> に割り当てました"
+ assign_post_to: "#%{post_number} を %{username} に割り当てました"
+ assign_post_to_multiple: "#%{post_number} を %{username}"
+ assigned_to_w_ellipsis: "割り当て先..."
+ unassign:
+ title: "割り当て解除"
+ title_w_ellipsis: "割り当て解除..."
+ help: "トピックから %{username} の割り当てを解除する"
+ assign:
+ title: "割り当て"
+ help: "トピックをユーザーに割り当てる"
+ assign_post:
+ title: "投稿を割り当てる"
+ unassign_post:
+ title: "投稿の割り当てを解除する"
+ help: "投稿から %{username} の割り当てを解除する"
+ reassign:
+ title: "編集"
+ title_w_ellipsis: "割り当てを編集..."
+ to_self: "自分に再割り当てする"
+ to_self_help: "トピックを自分に再割り当てする"
+ help: "割り当て情報を編集します"
+ reassign_modal:
+ title: "トピックを再割り当てする"
+ topic_level_menu:
+ edit_assignments: "割り当てを編集..."
+ reassign_topic_to_me: "トピックを自分に割り当て直す"
+ unassign_with_ellipsis: "割り当て解除..."
+ unassign_from_post: "#%{post_number} から @%{assignee} の割り当てを解除"
+ unassign_from_post_help: "投稿 #%{post_number} から @%{assignee} の割り当てを解除"
+ unassign_from_topic: "トピックから @%{username} の割り当てを解除"
+ assign_modal:
+ title: "トピックを割り当てる"
+ reassign_title: "トピックを再割り当てする"
+ assign: "割り当てる"
+ assignee_label: 割り当てられた担当者
+ assignment_label: 割り当て
+ choose_assignee: 割り当てるユーザーを選択します。
+ edit_assignments_title: "割り当ての編集"
+ note_label: メモ
+ optional_label: "(オプション)"
+ status_label: ステータス
+ suggestions: 提案
+ assign_post_modal:
+ title: "投稿を割り当てる"
+ claim:
+ title: "引き受ける"
+ help: "トピックを自分に割り当てる"
+ assign_mailer:
+ never: "通知しない"
+ different_users: "割り当てユーザーと割り当てられたユーザーが異なるユーザーである場合のみ"
+ always: "常に"
+ reminders_frequency:
+ description: "割り当てられたトピックのリマインダーを受け取る頻度"
+ never: "通知しない"
+ daily: "毎日"
+ weekly: "毎週"
+ monthly: "毎月"
+ quarterly: "3 か月ごと"
+ admin:
+ groups:
+ manage:
+ interaction:
+ assign: "割り当てる"
+ assignable_levels:
+ title: "このグループを割り当てられるユーザー"
+ user:
+ notification_level_when_assigned:
+ label: "割り当てられたとき"
+ watch_topic: "トピックをウォッチ"
+ track_topic: "トピックを追跡"
+ do_nothing: "何もしない"
+ messages:
+ assigned_title: "割り当て済み(%{count})"
+ assigned: "割り当てました"
+ no_assignments_title: "まだ割り当てはありません"
+ no_assignments_body: >
+ 割り当てられたトピックとメッセージがここに一覧表示されます。また、割り当てのリマインダーが定期的に通知されます。この通知頻度は<a href='%{preferencesUrl}'>ユーザー設定</a>で変更できます。 <br><br>トピックまたはメッセージを自分または別のユーザーに割り当てるには、下にある %{icon} 割り当てボタンを探してください。
+ dismiss_assigned_tooltip: "すべての未読の割り当てを既読にします"
+ assigned_to_group:
+ post: "%{group_name} に割り当てられた投稿"
+ topic: "%{group_name} に割り当てられたトピック"
+ assigned_to_you:
+ post: "あなたに割り当てられた投稿"
+ topic: "あなたに割り当てらたトピック"
+ assignment_description:
+ post: "%{topic_title} (#%{post_number})"
+ topic: "%{topic_title}"
+ admin:
+ web_hooks:
+ assign_event:
+ group_name: "割り当てイベント"
+ assigned: "ユーザーがトピックを割り当てたとき"
+ unassigned: "ユーザーがトピックの割り当てを解除したとき"
+ search:
+ advanced:
+ in:
+ assigned: "割り当て済みである"
+ unassigned: "未割り当てである"
+ assigned:
+ label: "割り当て先"
+ topics:
+ bulk:
+ unassign: "トピックを割り当て解除"
+ assign: "トピックを割り当てる"
+ discourse_automation:
+ scriptables:
+ random_assign:
+ fields:
+ post_template:
+ label: 投稿テンプレート
+ description: 入力すると、このテンプレートを使った投稿が作成され、トピックではなく、その投稿にユーザーが割り当てられます。
+ assignees_group:
+ label: 割り当て先グループ
+ minimum_time_between_assignments:
+ label: 割り当て間の最低時間
+ min_recently_assigned_days:
+ label: 最近の割り当ての最小日数
+ description: デフォルトは 14 日です。
+ skip_new_users_for_days:
+ label: 新しいユーザーを数日間スキップ
+ description: デフォルトは 0 日です(ユーザーがサインアップした直後に割り当てられます)。
+ max_recently_assigned_days:
+ label: 最近の割り当ての最大日数
+ description: まず、過去 `n` 日に割り当てられたユーザーを除外します。ほかにユーザーがいない場合、`min_recently_assigned_days` にフォールバックします。デフォルトは 180 日です。
+ assigned_topic:
+ label: 割り当てられたトピック ID
+ in_working_hours:
+ label: 勤務時間内のユーザー
+ notification_reason:
+ user: "このトピックはあなたに割り当てられたため、新しい返信の件数が表示されます。"
+ notifications:
+ assigned: "<span>%{username}</span> %{description}"
+ popup:
+ assigned: "%{username} があなたを割り当てました"
+ titles:
+ assigned: "割り当て完了"
+ dismiss_confirmation:
+ body:
+ assigns:
+ other: "本当によろしいですか?未読の割り当て通知が %{count} 件あります。"
+ user_menu:
+ view_all_assigned: "すべての割り当て済みを表示"
+ tabs:
+ assign_list: "割り当てリスト"
+ assign_list_with_unread:
+ other: "割り当てリスト - %{count} 件の未読の割り当て"
+ edit_assignments_modal:
+ title: "割り当ての編集"
+ topic: "トピック"
+ post: "投稿"
diff --git a/plugins/discourse-assign/config/locales/client.ko.yml b/plugins/discourse-assign/config/locales/client.ko.yml
new file mode 100644
index 00000000000..2f8c74b07d7
--- /dev/null
+++ b/plugins/discourse-assign/config/locales/client.ko.yml
@@ -0,0 +1,78 @@
+# WARNING: Never edit this file.
+# It will be overwritten when translations are pulled from Crowdin.
+#
+# To work with us on translations, join this project:
+# https://translate.discourse.org/
+
+ko:
+ js:
+ filters:
+ unassigned:
+ title: "미 할당"
+ help: "할당되지 않은 주제"
+ action_codes:
+ assigned: "할당 된 %{who} %{when}"
+ assigned_group: "할당 된 %{who} %{when}"
+ unassigned: "할당되지 않은 %{who} %{when}"
+ unassigned_group: "할당되지 않은 %{who} %{when}"
+ discourse_assign:
+ add_unassigned_filter: "카테고리에 &#39;지정되지 않은&#39;필터 추가"
+ cant_act: "다른 사용자에게 할당 된 플래그에는 작동 할 수 없습니다"
+ cant_act_unclaimed: "플래그에 대해 조치를 취하기 전에이 주제를 청구해야합니다."
+ assigned: "할당됨"
+ group_everyone: "모두"
+ assigned_to: "다음으로 할당"
+ assigned_to_w_ellipsis: "다음으로 할당..."
+ unassign:
+ title: "할당 해제"
+ title_w_ellipsis: "할당 해제..."
+ assign:
+ title: "할당"
+ help: "사용자에게 토픽 할당"
+ reassign:
+ title: "수정"
+ topic_level_menu:
+ unassign_with_ellipsis: "할당 해제..."
+ assign_modal:
+ title: "토픽 할당"
+ assign: "할당"
+ optional_label: "(선택 사항)"
+ status_label: 상태
+ claim:
+ title: "청구"
+ help: "나에게 토픽 할당"
+ assign_mailer:
+ never: "알림 받지 않기"
+ different_users: "담당자와 담당자가 다른 사용자 인 경우에만"
+ always: "항상 알림받기"
+ reminders_frequency:
+ description: "할당 된 주제 알림 수신 빈도"
+ never: "알림 받지 않기"
+ daily: "일"
+ weekly: "주"
+ monthly: "월"
+ quarterly: "분기마다"
+ admin:
+ groups:
+ manage:
+ interaction:
+ assign: "할당"
+ user:
+ notification_level_when_assigned:
+ do_nothing: "아무것도하지 않음"
+ messages:
+ assigned_title: "할당됨 (%{count})"
+ assigned: "할당됨"
+ assignment_description:
+ topic: "%{topic_title}"
+ search:
+ advanced:
+ assigned:
+ label: "다음으로 할당"
+ notifications:
+ assigned: "<span>%{username}</span> %{description}"
+ titles:
+ assigned: "할당됨"
+ edit_assignments_modal:
+ topic: "글"
+ post: "글"
diff --git a/plugins/discourse-assign/config/locales/client.lt.yml b/plugins/discourse-assign/config/locales/client.lt.yml
new file mode 100644
index 00000000000..76fadd46823
--- /dev/null
+++ b/plugins/discourse-assign/config/locales/client.lt.yml
@@ -0,0 +1,44 @@
+# WARNING: Never edit this file.
+# It will be overwritten when translations are pulled from Crowdin.
+#
+# To work with us on translations, join this project:
+# https://translate.discourse.org/
+
+lt:
+ js:
+ action_codes:
+ assigned: "Priskirta %{who}%{when}"
+ assigned_group: "Priskirta %{who}%{when}"
+ unassigned: "Nepriskirta %{who}%{when}"
+ unassigned_group: "Nepriskirta %{who}%{when}"
+ discourse_assign:
+ assigned: "Priskirta"
+ group_everyone: "Visi"
+ reassign:
+ title: "Redaguoti"
+ assign_modal:
+ optional_label: "(pasoronktinai)"
+ status_label: Statusas
+ assign_mailer:
+ never: "Niekada"
+ always: "Visada"
+ reminders_frequency:
+ never: "Niekada"
+ daily: "Kasdien"
+ weekly: "Kas savaitę"
+ monthly: "Kas mėnesį"
+ quarterly: "Kas ketvirtį"
+ user:
+ notification_level_when_assigned:
+ do_nothing: "Nieko nedaryti"
+ messages:
+ assigned: "Priskirta"
+ assignment_description:
+ topic: "%{topic_title}"
+ notifications:
+ assigned: "<span>%{username}</span> %{description}"
+ titles:
+ assigned: "Priskirta"
+ edit_assignments_modal:
+ topic: "Tema"
+ post: "Įrašai"
diff --git a/plugins/discourse-assign/config/locales/client.lv.yml b/plugins/discourse-assign/config/locales/client.lv.yml
new file mode 100644
index 00000000000..f1ae91c76a9
--- /dev/null
+++ b/plugins/discourse-assign/config/locales/client.lv.yml
@@ -0,0 +1,27 @@
+# WARNING: Never edit this file.
+# It will be overwritten when translations are pulled from Crowdin.
+#
+# To work with us on translations, join this project:
+# https://translate.discourse.org/
+
+lv:
+ js:
+ discourse_assign:
+ group_everyone: "Ikviens"
+ reassign:
+ title: "Rediģēt"
+ assign_modal:
+ optional_label: "(pēc izvēles)"
+ status_label: Statuss
+ assign_mailer:
+ never: "Nekad"
+ always: "Vienmēr"
+ reminders_frequency:
+ never: "Nekad"
+ daily: "Dienas"
+ weekly: "Nedēļas"
+ monthly: "Mēneša"
+ quarterly: "Ceturkšņa"
+ edit_assignments_modal:
+ topic: "Tēmas"
+ post: "Ieraksts"
diff --git a/plugins/discourse-assign/config/locales/client.nb_NO.yml b/plugins/discourse-assign/config/locales/client.nb_NO.yml
new file mode 100644
index 00000000000..c585b4647b9
--- /dev/null
+++ b/plugins/discourse-assign/config/locales/client.nb_NO.yml
@@ -0,0 +1,68 @@
+# WARNING: Never edit this file.
+# It will be overwritten when translations are pulled from Crowdin.
+#
+# To work with us on translations, join this project:
+# https://translate.discourse.org/
+
+nb_NO:
+ js:
+ action_codes:
+ assigned: "Tildelt %{who} %{when}"
+ assigned_group: "Tildelt %{who} %{when}"
+ unassigned: "Ikke tildelt %{who} %{when}"
+ unassigned_group: "Ikke tildelt %{who} %{when}"
+ discourse_assign:
+ cant_act: "Du kan ikke handle på flagg som har blitt tildelt andre brukere"
+ cant_act_unclaimed: "Du overta ansvaret for dette emnet før du tar beslutninger om rapporteringer."
+ assigned: "Tildelt"
+ group_everyone: "Alle"
+ assigned_to: "Tildelt til"
+ assigned_to_w_ellipsis: "Tildelt til..."
+ unassign:
+ title: "Fjern tildelning"
+ title_w_ellipsis: "Fjern tildelning..."
+ assign:
+ title: "Tildel"
+ help: "Tildel emne til bruker"
+ reassign:
+ title: "Endre"
+ topic_level_menu:
+ unassign_with_ellipsis: "Fjern tildelning..."
+ assign_modal:
+ title: "Tildel emne"
+ assign: "Tildel"
+ optional_label: "(valgfritt)"
+ status_label: Status
+ claim:
+ title: "ta"
+ help: "Tildel emne til deg selv"
+ assign_mailer:
+ never: "Aldri"
+ always: "Alltid"
+ reminders_frequency:
+ never: "Aldri"
+ daily: "Daglig"
+ weekly: "Ukentlig"
+ monthly: "Månedlig"
+ quarterly: "Kvartalsvis"
+ admin:
+ groups:
+ manage:
+ interaction:
+ assign: "Tildel"
+ user:
+ notification_level_when_assigned:
+ do_nothing: "ikke gjør noe"
+ messages:
+ assigned: "Tildelt"
+ search:
+ advanced:
+ assigned:
+ label: "Tildelt til"
+ notifications:
+ assigned: "<span>%{username}</span> %{description}"
+ titles:
+ assigned: "Tildelt"
+ edit_assignments_modal:
+ topic: "Emne"
+ post: "Innlegg"
diff --git a/plugins/discourse-assign/config/locales/client.nl.yml b/plugins/discourse-assign/config/locales/client.nl.yml
new file mode 100644
index 00000000000..ba588148348
--- /dev/null
+++ b/plugins/discourse-assign/config/locales/client.nl.yml
@@ -0,0 +1,193 @@
+# WARNING: Never edit this file.
+# It will be overwritten when translations are pulled from Crowdin.
+#
+# To work with us on translations, join this project:
+# https://translate.discourse.org/
+
+nl:
+ admin_js:
+ admin:
+ site_settings:
+ categories:
+ discourse_assign: "Discourse-toewijzing"
+ js:
+ filters:
+ unassigned:
+ title: "Niet toegewezen"
+ help: "Topics die niet zijn toegewezen"
+ action_codes:
+ assigned: "Heeft %{who} toegewezen op %{when}"
+ assigned_group: "Heeft %{who} toegewezen op %{when}"
+ assigned_to_post: "Heeft %{who} toegewezen aan <a href='%{path}'>bericht</a> op %{when}"
+ assigned_group_to_post: "Heeft %{who} toegewezen aan <a href='%{path}'>bericht</a> op %{when}"
+ unassigned: "Heeft de toewijzing aan %{who} opgeheven op %{when}"
+ unassigned_group: "Heeft de toewijzing aan %{who} opgeheven op %{when}"
+ unassigned_from_post: "Heeft de toewijzing van %{who} aan <a href='%{path}'>bericht</a> opgeheven op %{when}"
+ unassigned_group_from_post: "Heeft de toewijzing van %{who} aan <a href='%{path}'>bericht</a> opgeheven op %{when}"
+ reassigned: "heeft %{who} opnieuw toegewezen op %{when}"
+ reassigned_group: "heeft %{who} opnieuw toegewezen op %{when}"
+ details_change: "Heeft de toewijzingsdetails voor %{who} gewijzigd op %{when}"
+ note_change: "Heeft de toewijzingsopmerking voor %{who} gewijzigd op %{when}"
+ status_change: "Heeft de toewijzingsstatus voor %{who} gewijzigd op %{when}"
+ discourse_assign:
+ add_unassigned_filter: "Filter 'niet toegewezen' toevoegen aan categorie"
+ cant_act: "Je kunt geen actie ondernemen voor markeringen die aan andere gebruikers zijn toegewezen"
+ cant_act_unclaimed: "Je moet dit topic opeisen voordat je actie kunt ondernemen voor markeringen."
+ topic_search_placeholder: "Zoek topics op titel of berichtinhoud"
+ sidebar_name_filter_placeholder: "Naam/gebruikersnaam"
+ assigned: "Toegewezen"
+ group_everyone: "Iedereen"
+ assigned_to: "Toegewezen aan"
+ assigned_topic_to: "Topic toegewezen aan <a href='%{path}'>%{username}</a>"
+ assign_post_to: "#%{post_number} toegewezen aan %{username}"
+ assign_post_to_multiple: "#%{post_number} aan %{username}"
+ assigned_to_w_ellipsis: "Toegewezen aan..."
+ unassign:
+ title: "Toewijzing opheffen"
+ title_w_ellipsis: "Toewijzing opheffen..."
+ help: "Toewijzing van topic aan %{username} opheffen"
+ assign:
+ title: "Toewijzen"
+ help: "Topic toewijzen aan gebruiker"
+ assign_post:
+ title: "Bericht toewijzen"
+ unassign_post:
+ title: "Toewijzing aan bericht opheffen"
+ help: "Toewijzing van %{username} aan bericht opheffen"
+ reassign:
+ title: "Bewerken"
+ title_w_ellipsis: "Toewijzing bewerken..."
+ to_self: "Opnieuw toewijzen aan mij"
+ to_self_help: "Topic opnieuw toewijzen aan mij"
+ help: "Toewijzingsdetails bewerken"
+ reassign_modal:
+ title: "Topic opnieuw toewijzen"
+ topic_level_menu:
+ edit_assignments: "Toewijzingen bewerken..."
+ reassign_topic_to_me: "Topic opnieuw toewijzen aan mij"
+ unassign_with_ellipsis: "Toewijzing opheffen..."
+ unassign_from_post: "Toewijzing van @%{assignee} aan %{post_number} opheffen"
+ unassign_from_post_help: "Toewijzing van @%{assignee} aan bericht %{post_number} opheffen"
+ unassign_from_topic: "Toewijzing van @%{username} aan topic opheffen"
+ assign_modal:
+ title: "Topic toewijzen"
+ reassign_title: "Topic opnieuw toewijzen"
+ assign: "Toewijzen"
+ assignee_label: Toegewezen persoon
+ assignment_label: Toewijzing
+ choose_assignee: Kies een gebruiker om toe te wijzen.
+ edit_assignments_title: "Toewijzingen bewerken"
+ note_label: Opmerking
+ optional_label: "(optioneel)"
+ status_label: Status
+ suggestions: suggesties
+ assign_post_modal:
+ title: "Bericht toewijzen"
+ claim:
+ title: "claimen"
+ help: "Wijs het topic toe aan jezelf"
+ assign_mailer:
+ never: "Nooit"
+ different_users: "Alleen als toewijzer en toegewezen persoon verschillend zijn"
+ always: "Altijd"
+ reminders_frequency:
+ description: "Frequentie voor het ontvangen van herinneringen over toegewezen topics"
+ never: "Nooit"
+ daily: "Dagelijks"
+ weekly: "Wekelijks"
+ monthly: "Maandelijks"
+ quarterly: "Driemaandelijks"
+ admin:
+ groups:
+ manage:
+ interaction:
+ assign: "Toewijzen"
+ assignable_levels:
+ title: "Wie kan deze groep toewijzen"
+ user:
+ notification_level_when_assigned:
+ label: "Wanneer toegewezen"
+ watch_topic: "Topic observeren"
+ track_topic: "Topic volgen"
+ do_nothing: "Niets doen"
+ messages:
+ assigned_title: "Toegewezen (%{count})"
+ assigned: "Toegewezen"
+ no_assignments_title: "Je hebt nog geen toewijzingen"
+ no_assignments_body: >
+ Je toegewezen topics en berichten worden hier weergegeven. Ook ontvang je periodiek een herinneringsmelding over je toewijzingen, die je kunt aanpassen in je <a href='%{preferencesUrl}'>gebruikersvoorkeuren</a>. <br><br> Om een topic of bericht aan jezelf of iemand anders toe te wijzen, zoek je de knop %{icon} Toewijzen onderaan.
+ dismiss_assigned_tooltip: "Alle ongelezen toewijzingsmeldingen markeren als gelezen"
+ assigned_to_group:
+ post: "bericht toegewezen aan %{group_name}"
+ topic: "topic toegewezen aan %{group_name}"
+ assigned_to_you:
+ post: "bericht toegewezen aan jou"
+ topic: "topic toegewezen aan jou"
+ assignment_description:
+ post: "%{topic_title} (#%{post_number})"
+ topic: "%{topic_title}"
+ admin:
+ web_hooks:
+ assign_event:
+ group_name: "Toewijzingsgebeurtenissen"
+ assigned: "Wanneer een gebruiker een topic toewijst"
+ unassigned: "Wanneer een gebruiker de toewijzing van een topic opheft"
+ search:
+ advanced:
+ in:
+ assigned: "zijn toegewezen"
+ unassigned: "zijn niet langer toegewezen"
+ assigned:
+ label: "Toegewezen aan"
+ topics:
+ bulk:
+ unassign: "Toewijzing van topics opheffen"
+ assign: "Topics toewijzen"
+ discourse_automation:
+ scriptables:
+ random_assign:
+ fields:
+ post_template:
+ label: Berichtsjabloon
+ description: Indien ingevuld, wordt een bericht met dit sjabloon gemaakt en wordt er een gebruiker aan toegewezen in plaats van het topic.
+ assignees_group:
+ label: Groep van toegewezen gebruikers
+ minimum_time_between_assignments:
+ label: Minimaal aantal uren tussen toewijzingen
+ min_recently_assigned_days:
+ label: Min. dagen recent toegewezen
+ description: Standaard ingesteld op 14 dagen.
+ skip_new_users_for_days:
+ label: Dagen om nieuwe gebruikers over te slaan
+ description: Standaard ingesteld op 0 dagen (gebruikers kunnen direct na registratie worden toegewezen).
+ max_recently_assigned_days:
+ label: Max. dagen recent toegewezen
+ description: Eerste poging om gebruikers uit te sluiten die de afgelopen 'n' dagen zijn toegewezen. Als er geen gebruiker over is, valt dit terug naar 'min_recently_assigned_days'. Standaard ingesteld op 180 dagen.
+ assigned_topic:
+ label: ID toegewezen topic
+ in_working_hours:
+ label: Gebruikers tijdens werktijd
+ notification_reason:
+ user: "Je ziet het aantal nieuwe antwoorden omdat dit topic aan jou is toegewezen."
+ notifications:
+ assigned: "<span>%{username}</span> %{description}"
+ popup:
+ assigned: "%{username} heeft je toegewezen"
+ titles:
+ assigned: "Toegewezen"
+ dismiss_confirmation:
+ body:
+ assigns:
+ one: "Weet je het zeker? Je hebt %{count} ongelezen toewijzingsmelding."
+ other: "Weet je het zeker? Je hebt %{count} ongelezen toewijzingsmeldingen."
+ user_menu:
+ view_all_assigned: "alle toegewezen items weergeven"
+ tabs:
+ assign_list: "Toewijzingslijst"
+ assign_list_with_unread:
+ one: "Toewijzingslijst - %{count} ongelezen toewijzing"
+ other: "Toewijzingslijst - %{count} ongelezen toewijzingen"
+ edit_assignments_modal:
+ title: "Toewijzingen bewerken"
+ topic: "Topic"
+ post: "Bericht"
diff --git a/plugins/discourse-assign/config/locales/client.pl_PL.yml b/plugins/discourse-assign/config/locales/client.pl_PL.yml
new file mode 100644
index 00000000000..93a9e9eedad
--- /dev/null
+++ b/plugins/discourse-assign/config/locales/client.pl_PL.yml
@@ -0,0 +1,163 @@
+# WARNING: Never edit this file.
+# It will be overwritten when translations are pulled from Crowdin.
+#
+# To work with us on translations, join this project:
+# https://translate.discourse.org/
+
+pl_PL:
+ js:
+ filters:
+ unassigned:
+ title: "Nieprzypisany"
+ help: "Wątki, które nie są przypisane"
+ action_codes:
+ assigned: "Przypisano %{who} %{when}"
+ assigned_group: "Przypisano %{who} %{when}"
+ assigned_to_post: "Przypisano %{who} do <a href='%{path}'>postu</a> %{when}"
+ assigned_group_to_post: "Przypisano %{who} do <a href='%{path}'>postu</a> %{when}"
+ unassigned: "Nieprzypisany %{who} %{when}"
+ unassigned_group: "Nieprzypisany %{who} %{when}"
+ unassigned_from_post: "Cofnieto przypisanie %{who} z <a href='%{path}'>postu</a> %{when}"
+ unassigned_group_from_post: "Cofnieto przypisanie %{who} z <a href='%{path}'>postu</a> %{when}"
+ reassigned: "Przypisano ponownie %{who} %{when}"
+ reassigned_group: "Przypisano ponownie %{who} %{when}"
+ details_change: "Zmieniono szczegóły przypisania dla %{who} %{when}"
+ note_change: "Zmieniono notatkę przypisania dla %{who} %{when}"
+ status_change: "Zmieniono status przypisania dla %{who} %{when}"
+ discourse_assign:
+ add_unassigned_filter: "Dodaj filtr \"nieprzypisane\" do tej kategorii"
+ cant_act: "Nie możesz działać na flagach, które nie zostały przydzielone innymi użytkownikom"
+ cant_act_unclaimed: "Musisz przejąć ten temat, zanim zaczniesz działać na flagach."
+ topic_search_placeholder: "Szukaj tematów według tytułu lub treści"
+ sidebar_name_filter_placeholder: "Imię/Nazwa użytkownika"
+ assigned: "Przypisany"
+ group_everyone: "Wszyscy"
+ assigned_to: "Przypisany do"
+ assigned_topic_to: "Przypisano temat do <a href='%{path}'>%{username}</a>"
+ assign_post_to: "Przypisano #%{post_number} do %{username}"
+ assigned_to_w_ellipsis: "Przypisano do..."
+ unassign:
+ title: "Cofnij przypisanie"
+ title_w_ellipsis: "Cofnij przypisanie..."
+ help: "Anuluj przypisanie %{username} do tematu"
+ assign:
+ title: "Przypisz"
+ help: "Przypisz temat do użytkownika"
+ assign_post:
+ title: "Przypisz post"
+ unassign_post:
+ title: "Cofnij przypisanie z posta"
+ help: "Cofnij przypisanie %{username} z posta"
+ reassign:
+ title: "Edytuj"
+ title_w_ellipsis: "Edytuj przypisanie..."
+ to_self: "Przypisz ponownie do mnie"
+ to_self_help: "Przypisz ponownie temat do mnie"
+ help: "Edytuj szczegóły przypisania"
+ reassign_modal:
+ title: "Przypisz ponownie temat"
+ topic_level_menu:
+ unassign_with_ellipsis: "Cofnij przypisanie..."
+ assign_modal:
+ title: "Przypisz temat"
+ reassign_title: "Przypisz ponownie temat"
+ assign: "Przypisz"
+ choose_assignee: Wybierz użytkownika do przypisania.
+ note_label: Notatka
+ optional_label: "(opcjonalne)"
+ status_label: Status
+ suggestions: sugestie
+ assign_post_modal:
+ title: "Przypisz post"
+ claim:
+ title: "przejmij"
+ help: "Przypisz temat sobie"
+ assign_mailer:
+ never: "Nigdy"
+ different_users: "Tylko jeśli przypisujący lub przypisany są innymi użytkownikami"
+ always: "Zawsze"
+ reminders_frequency:
+ description: "Częstotliwość otrzymwania przypomnień o przypisanych tematach"
+ never: "Nigdy"
+ daily: "Dziennie"
+ weekly: "Tygodniowo"
+ monthly: "Miesięcznie"
+ quarterly: "Kwartalnie"
+ admin:
+ groups:
+ manage:
+ interaction:
+ assign: "Przypisz"
+ assignable_levels:
+ title: "Kto może przypisać tę grupę"
+ user:
+ notification_level_when_assigned:
+ do_nothing: "Nic nie rób"
+ messages:
+ assigned_title: "Przypisano (%{count})"
+ assigned: "Przypisany"
+ no_assignments_title: "Nie masz jeszcze żadnych przypisów"
+ no_assignments_body: >
+ Tutaj zostaną wyświetlone Twoje przypisane tematy i wiadomości. Będziesz również otrzymywać okresowe przypomnienie o swoich przypisach, które możesz dostosować w swoich <a href='%{preferencesUrl}'>preferencjach użytkownika</a>. <br><br> Aby przypisać temat lub wiadomość do siebie lub innej osoby, poszukaj przycisku %{icon} przypisywania na dole.
+ dismiss_assigned_tooltip: "Oznacz wszystkie nieprzeczytane powiadomienia o przypisaniu jako przeczytane"
+ assigned_to_group:
+ post: "post przypisany do %{group_name}"
+ topic: "temat przypisany do %{group_name}"
+ assigned_to_you:
+ post: "post przypisany do Ciebie"
+ topic: "temat przypisany do Ciebie"
+ assignment_description:
+ topic: "%{topic_title}"
+ admin:
+ web_hooks:
+ assign_event:
+ assigned: "Gdy użytkownik przypisze temat"
+ unassigned: "Gdy użytkownik anuluje przypisanie tematu"
+ search:
+ advanced:
+ in:
+ assigned: "jest przypisany"
+ unassigned: "jest nieprzypisany"
+ assigned:
+ label: "Przypisany do"
+ topics:
+ bulk:
+ unassign: "Cofnij przypisanie tematów"
+ assign: "Przypisz tematy"
+ discourse_automation:
+ scriptables:
+ random_assign:
+ fields:
+ post_template:
+ label: Szablon postu
+ description: Jeśli to pole zostanie wypełnione, zostanie utworzony post z tym szablonem i przypisany do niego użytkownik zamiast tematu.
+ minimum_time_between_assignments:
+ label: Minimalna liczba godzin pomiędzy przypisaniami
+ min_recently_assigned_days:
+ label: Minim. ostatnio przypisane dni
+ description: Domyślnie 14 dni.
+ skip_new_users_for_days:
+ label: Pomiń nowych użytkowników przez określoną liczbę dni
+ description: Domyślnie 0 dni (użytkowników można przypisać natychmiast po rejestracji).
+ max_recently_assigned_days:
+ label: Maks. ostatnio przypisane dni
+ description: Pierwsza próba wykluczenia użytkowników przypisanych w ciągu ostatnich `n` dni. Jeśli nie zostanie żaden użytkownik, powraca do `min_recently_assigned_days`. Domyślnie 180 dni.
+ assigned_topic:
+ label: Przypisany ID tematu
+ in_working_hours:
+ label: Użytkownicy w godzinach pracy
+ notification_reason:
+ user: "Zobaczysz liczbę nowych odpowiedzi, ponieważ ten temat został do Ciebie przypisany."
+ notifications:
+ assigned: "<span>%{username}</span> %{description}"
+ popup:
+ assigned: "%{username} przypisał Ciebie"
+ titles:
+ assigned: "Przypisany"
+ user_menu:
+ view_all_assigned: "wyświetl wszystkie przypisania"
+ tabs:
+ assign_list: "Lista przypisań"
+ edit_assignments_modal:
+ topic: "Temat"
+ post: "Post"
diff --git a/plugins/discourse-assign/config/locales/client.pt.yml b/plugins/discourse-assign/config/locales/client.pt.yml
new file mode 100644
index 00000000000..0f3fa5225e5
--- /dev/null
+++ b/plugins/discourse-assign/config/locales/client.pt.yml
@@ -0,0 +1,161 @@
+# WARNING: Never edit this file.
+# It will be overwritten when translations are pulled from Crowdin.
+#
+# To work with us on translations, join this project:
+# https://translate.discourse.org/
+
+pt:
+ js:
+ filters:
+ unassigned:
+ title: "Não atribuído(a)"
+ help: "Tópicos que não foram atribuídos"
+ action_codes:
+ assigned: "Atribuiu %{who} %{when}"
+ assigned_group: "Atribuiu %{who} %{when}"
+ assigned_to_post: "Atribuiu %{who} à <a href='%{path}'>postagem</a> %{when}"
+ assigned_group_to_post: "Atribuiu %{who} à <a href='%{path}'>postagem</a> %{when}"
+ unassigned: "Cancelou atribuição de %{who} %{when}"
+ unassigned_group: "Cancelou atribuição de %{who} %{when}"
+ unassigned_from_post: "Cancelou atribuição de %{who} da <a href='%{path}'>postagem</a> %{when}"
+ unassigned_group_from_post: "Cancelou atribuição de %{who} da <a href='%{path}'>postagem</a> %{when}"
+ reassigned: "Reatribuiu %{who} %{when}"
+ reassigned_group: "Reatribuiu %{who} %{when}"
+ details_change: "Detalhes da atribuição alterados para %{who} %{when}"
+ note_change: "Nota da atribuição alterada para %{who} %{when}"
+ status_change: "Status da atribuição alterado para %{who} %{when}"
+ discourse_assign:
+ add_unassigned_filter: "Adicionar filtro \"não atribuído\" à categoria"
+ cant_act: "Você não pode agir em sinalizadores que foram atribuídos a outros(as) usuários(as)"
+ cant_act_unclaimed: "Você deve solicitar este tópico antes de agir nos sinalizadores."
+ topic_search_placeholder: "Pesquisar tópicos por título ou conteúdo da publicação"
+ sidebar_name_filter_placeholder: "Nome/nome do(a) usuário(a)"
+ assigned: "Atribuído(a)"
+ group_everyone: "Todos"
+ assigned_to: "Atribuído(a) a"
+ assigned_topic_to: "Tópico atribuído a <a href='%{path}'>%{username}</a>"
+ assign_post_to: "Atribuiu #%{post_number} a %{username}"
+ assigned_to_w_ellipsis: "Atribuído(a) a..."
+ unassign:
+ title: "Cancelar atribuição"
+ title_w_ellipsis: "Cancelar atribuição..."
+ help: "Cancelar atribuição de %{username} do tópico"
+ assign:
+ title: "Atribuir"
+ help: "Atribuir tópico ao(à) usuário(a)"
+ assign_post:
+ title: "Atribuir postagem"
+ unassign_post:
+ title: "Cancelar atribuição da postagem"
+ help: "Cancelar atribuição de %{username} da postagem"
+ reassign:
+ title: "Editar"
+ title_w_ellipsis: "Editar atribuição..."
+ to_self: "Reatribuir a mim"
+ to_self_help: "Reatribuir tópico a mim"
+ help: "Editar detalhes da atribuição"
+ reassign_modal:
+ title: "Reatribuir tópico"
+ topic_level_menu:
+ unassign_with_ellipsis: "Cancelar atribuição..."
+ assign_modal:
+ title: "Atribuir tópico"
+ reassign_title: "Reatribuir tópico"
+ assign: "Atribuir"
+ assignee_label: Destinatário(a)
+ choose_assignee: Escolha um(a) usuário(a) para atribuir.
+ note_label: Observação
+ optional_label: "(opcional)"
+ status_label: Estado
+ suggestions: sugestões
+ assign_post_modal:
+ title: "Atribuir postagem"
+ claim:
+ title: "solicitar"
+ help: "Atribuir tópico a si"
+ assign_mailer:
+ never: "Nunca"
+ different_users: "Apenas se o(a) atribuidor(a) e o(a) destinatário(a) forem usuários(as) diferentes"
+ always: "Sempre"
+ reminders_frequency:
+ description: "Frequência de recebimento de lembretes de tópicos atribuídos"
+ never: "Nunca"
+ daily: "Diário"
+ weekly: "Semanal"
+ monthly: "Mensal"
+ quarterly: "Trimestral"
+ admin:
+ groups:
+ manage:
+ interaction:
+ assign: "Atribuir"
+ assignable_levels:
+ title: "Quem pode atribuir este grupo"
+ user:
+ messages:
+ assigned_title: "Atribuiu (%{count})"
+ assigned: "Atribuído(a)"
+ no_assignments_title: "Você ainda não tem atribuições"
+ no_assignments_body: >
+ Seus tópicos e mensagens atribuídos serão listados aqui. Você receberá uma notificação periódica com um lembrete das suas atribuições, que pode ser ajustada nas suas <a href='%{preferencesUrl}'>preferências do(a) usuário(a)</a>. <br><br> Para atribuir um tópico ou mensagem a si ou a outra pessoa, procure o botão de atribuir %{icon} na parte inferior.
+ dismiss_assigned_tooltip: "Marcar como lidas todas as notificações não atribuídas não lidas"
+ assignment_description:
+ topic: "%{topic_title}"
+ search:
+ advanced:
+ in:
+ assigned: "foram atribuídos(as)"
+ unassigned: "tiveram atribuição cancelada"
+ assigned:
+ label: "Atribuído(a) a"
+ topics:
+ bulk:
+ unassign: "Cancelar atribuição de tópico"
+ assign: "Atribuir tópicos"
+ discourse_automation:
+ scriptables:
+ random_assign:
+ fields:
+ post_template:
+ label: Modelo de postagem
+ description: Se for preenchida, uma postagem com este modelo será criada e um(a) usuário(a) será atribuído(a) a ela no lugar do tópico.
+ assignees_group:
+ label: Grupo de destinatários(as)
+ minimum_time_between_assignments:
+ label: Mínimo de horas entre atribuições
+ min_recently_assigned_days:
+ label: Mínimo de dias atribuídos recentemente
+ description: Padrão para 14 dias.
+ skip_new_users_for_days:
+ label: Ignorar usuários(as) novos(as) por dias
+ description: Padrão para 0 dia (usuários(as) podem ser atribuídos(as) imediatamente após a inscrição).
+ max_recently_assigned_days:
+ label: Máximo de dias atribuídos recentemente
+ description: Primeira tentativa de excluir usuários(as) atribuídos(as) nos últimos "n" dias. Se não restar nenhum, reverte para "min_recently_assigned_days". Padrão para 180 dias.
+ assigned_topic:
+ label: ID do tópico atribuído
+ in_working_hours:
+ label: Usuários(as) em horário de trabalho
+ notification_reason:
+ user: "Você verá uma contagem de respostas novas porque este tópico foi atribuído a você."
+ notifications:
+ assigned: "<span>%{username}</span> %{description}"
+ popup:
+ assigned: "%{username} atribuiu você"
+ titles:
+ assigned: "Atribuído(a)"
+ dismiss_confirmation:
+ body:
+ assigns:
+ one: "Tem certeza? Você tem %{count} notificação de atribuição não lida."
+ other: "Tem certeza? Você tem %{count} notificações de atribuição não lidas."
+ user_menu:
+ view_all_assigned: "ver todos(as) atribuídos(as)"
+ tabs:
+ assign_list: "Atribuir lista"
+ assign_list_with_unread:
+ one: "Atribuir lista - %{count} atribuição não lida"
+ other: "Atribuir lista - %{count} atribuições não lidas"
+ edit_assignments_modal:
+ topic: "Tópico"
+ post: "Publicação"
diff --git a/plugins/discourse-assign/config/locales/client.pt_BR.yml b/plugins/discourse-assign/config/locales/client.pt_BR.yml
new file mode 100644
index 00000000000..0740f2e80f9
--- /dev/null
+++ b/plugins/discourse-assign/config/locales/client.pt_BR.yml
@@ -0,0 +1,193 @@
+# WARNING: Never edit this file.
+# It will be overwritten when translations are pulled from Crowdin.
+#
+# To work with us on translations, join this project:
+# https://translate.discourse.org/
+
+pt_BR:
+ admin_js:
+ admin:
+ site_settings:
+ categories:
+ discourse_assign: "Atribuição do Discourse"
+ js:
+ filters:
+ unassigned:
+ title: "Não atribuído"
+ help: "Tópicos que não têm atribuição"
+ action_codes:
+ assigned: "Atribuiu a %{who} %{when}"
+ assigned_group: "Atribuiu a %{who} %{when}"
+ assigned_to_post: "Atribuiu %{who} à <a href='%{path}'>postagem</a> %{when}"
+ assigned_group_to_post: "Atribuiu %{who} à <a href='%{path}'>postagem</a> %{when}"
+ unassigned: "Cancelou atribuição de %{who} %{when}"
+ unassigned_group: "Cancelou atribuição de %{who} %{when}"
+ unassigned_from_post: "Cancelou atribuição de %{who} da <a href='%{path}'>postagem</a> %{when}"
+ unassigned_group_from_post: "Cancelou atribuição de %{who} da <a href='%{path}'>postagem</a> %{when}"
+ reassigned: "reatribuiu %{who} %{when}"
+ reassigned_group: "reatribuiu %{who} %{when}"
+ details_change: "Detalhes de atribuição alterados para %{who} %{when}"
+ note_change: "Observação de atribuição alterada para %{who} %{when}"
+ status_change: "Status de atribuição alterado para %{who} %{when}"
+ discourse_assign:
+ add_unassigned_filter: "Adicionar o filtro \"não atribuído\" à categoria"
+ cant_act: "Você não pode agir em sinalizações que foram atribuídas a outros(as) usuários(as)"
+ cant_act_unclaimed: "Você precisa reivindicar este tópico antes de agir em sinalizações."
+ topic_search_placeholder: "Procurar tópicos por título ou conteúdo da postagem"
+ sidebar_name_filter_placeholder: "Nome/nome de usuário(a)"
+ assigned: "Atribuiu"
+ group_everyone: "Todos"
+ assigned_to: "Atribuiu a"
+ assigned_topic_to: "Tópico atribuído a <a href='%{path}'>%{username}</a>"
+ assign_post_to: "Atribuiu #%{post_number} a %{username}"
+ assign_post_to_multiple: "#%{post_number} para %{username}"
+ assigned_to_w_ellipsis: "Atribuiu a..."
+ unassign:
+ title: "Remover atribuição"
+ title_w_ellipsis: "Remover atribuição..."
+ help: "Remover atribuição de %{username} do tópico"
+ assign:
+ title: "Atribuir"
+ help: "Atribuir tópico a usuário(a)"
+ assign_post:
+ title: "Atribuir postagem"
+ unassign_post:
+ title: "Remover atribuição da postagem"
+ help: "Remover atribuição de %{username} da postagem"
+ reassign:
+ title: "Editar"
+ title_w_ellipsis: "Editar atribuição..."
+ to_self: "Reatribuir a mim"
+ to_self_help: "Reatribuir tópico a mim"
+ help: "Editar detalhes da atribuição"
+ reassign_modal:
+ title: "Reatribuir tópico"
+ topic_level_menu:
+ edit_assignments: "Editar atribuições..."
+ reassign_topic_to_me: "Reatribuir tópico a mim"
+ unassign_with_ellipsis: "Remover atribuição..."
+ unassign_from_post: "Remover atribuição de @%{assignee} a #%{post_number}"
+ unassign_from_post_help: "Remover atribuição de @%{assignee} à postagem #%{post_number}"
+ unassign_from_topic: "Remover atribuição de @%{username} do tópico"
+ assign_modal:
+ title: "Atribuir tópico"
+ reassign_title: "Reatribuir tópico"
+ assign: "Atribuir"
+ assignee_label: Destinatário(a)
+ assignment_label: Atribuição
+ choose_assignee: Escolha um(a) usuário(a) para atribuir.
+ edit_assignments_title: "Editar atribuições"
+ note_label: Observação
+ optional_label: "(opcional)"
+ status_label: Status
+ suggestions: sugestões
+ assign_post_modal:
+ title: "Atribuir postagem"
+ claim:
+ title: "reivindicar"
+ help: "Atribuir tópico a si"
+ assign_mailer:
+ never: "Nunca"
+ different_users: "Apenas se o(a) atribuidor(a) e destinatário(a) forem usuários(as) diferentes"
+ always: "Sempre"
+ reminders_frequency:
+ description: "Freqüência para receber lembretes de tópicos designados"
+ never: "Nunca"
+ daily: "Diariamente"
+ weekly: "Semanalmente"
+ monthly: "Mensalmente"
+ quarterly: "Trimestralmente"
+ admin:
+ groups:
+ manage:
+ interaction:
+ assign: "Atribuir"
+ assignable_levels:
+ title: "Quem pode atribuir este grupo"
+ user:
+ notification_level_when_assigned:
+ label: "Ao atribuir"
+ watch_topic: "Acompanhar tópico"
+ track_topic: "Monitorar tópico"
+ do_nothing: "Não fazer nada"
+ messages:
+ assigned_title: "Atribuiu (%{count})"
+ assigned: "Atribuiu"
+ no_assignments_title: "Você não tem atribuições ainda"
+ no_assignments_body: >
+ Seus tópicos e mensagens atribuídas serão listados aqui. Você receberá uma notificação periódica de lembrete das suas atribuições, que você pode ajustar em suas <a href='%{preferencesUrl}'>preferências de usuário(a)/a>. <br><br> Para atribuir uma mensagem ou tópico a si ou a outra pessoa, procure o botão de atribuir %{icon} na parte inferior.
+ dismiss_assigned_tooltip: "Marcar todas as notificações atribuídas não lidas como lidas"
+ assigned_to_group:
+ post: "postagem atribuída a %{group_name}"
+ topic: "tópico atribuído a %{group_name}"
+ assigned_to_you:
+ post: "postagem atribuída a você"
+ topic: "tópico atribuído a você"
+ assignment_description:
+ post: "%{topic_title} (#%{post_number})"
+ topic: "%{topic_title}"
+ admin:
+ web_hooks:
+ assign_event:
+ group_name: "Eventos de atribuição"
+ assigned: "Quando um(a) usuário(a) atribuir um tópico"
+ unassigned: "Quando um(a) usuário(a) cancelar a atribuição de um tópico"
+ search:
+ advanced:
+ in:
+ assigned: "foram atribuídos"
+ unassigned: "tiveram atribuição removida"
+ assigned:
+ label: "Atribuiu a"
+ topics:
+ bulk:
+ unassign: "Remover atribuição de tópicos"
+ assign: "Atribuir tópicos"
+ discourse_automation:
+ scriptables:
+ random_assign:
+ fields:
+ post_template:
+ label: Modelo de postagem
+ description: Se preenchida, uma postagem com este modelo será criada e um usuário será atribuído a ela em vez do tópico.
+ assignees_group:
+ label: Grupo de destinatários
+ minimum_time_between_assignments:
+ label: Horas mínimas entre atribuições
+ min_recently_assigned_days:
+ label: Dias mínimos atribuídos recentemente
+ description: O padrão é de 14 dias.
+ skip_new_users_for_days:
+ label: Ignorar novos usuários por dias
+ description: O padrão é 0 dias (os usuários podem ser atribuídos imediatamente após a inscrição).
+ max_recently_assigned_days:
+ label: Dias máximos atribuídos recentemente
+ description: Primeira tentativa de excluir usuários(as) atribuídos(as) nos últimos "n" dias. Se não restar usuários(as), é revertido para "min_recently_assigned_days". O padrão é de 180 dias.
+ assigned_topic:
+ label: ID de tópico atribuído
+ in_working_hours:
+ label: Usuários(as) em horário de trabalho
+ notification_reason:
+ user: "Você verá uma contagem de novas respostas porque este tópico foi atribuído a você."
+ notifications:
+ assigned: "<span>%{username}</span> %{description}"
+ popup:
+ assigned: "%{username} atribuiu a você"
+ titles:
+ assigned: "Atribuiu"
+ dismiss_confirmation:
+ body:
+ assigns:
+ one: "Tem certeza? Você tem %{count} notificação atribuída não lida."
+ other: "Tem certeza? Você tem %{count} notificações atribuídas não lidas."
+ user_menu:
+ view_all_assigned: "ver todos os atribuídos"
+ tabs:
+ assign_list: "Lista de atribuições"
+ assign_list_with_unread:
+ one: "Lista de atribuições - %{count} atribuição não lida"
+ other: "Lista de atribuições - %{count} atribuições não lidas"
+ edit_assignments_modal:
+ title: "Editar atribuições"
+ topic: "Tópico"
+ post: "Postar"
diff --git a/plugins/discourse-assign/config/locales/client.ro.yml b/plugins/discourse-assign/config/locales/client.ro.yml
new file mode 100644
index 00000000000..01596a558d4
--- /dev/null
+++ b/plugins/discourse-assign/config/locales/client.ro.yml
@@ -0,0 +1,35 @@
+# WARNING: Never edit this file.
+# It will be overwritten when translations are pulled from Crowdin.
+#
+# To work with us on translations, join this project:
+# https://translate.discourse.org/
+
+ro:
+ js:
+ discourse_assign:
+ group_everyone: "Toată lumea"
+ reassign:
+ title: "Modifică"
+ assign_modal:
+ note_label: Notă
+ optional_label: "(opțional)"
+ status_label: Status
+ assign_mailer:
+ never: "Niciodată"
+ always: "Întotdeauna"
+ reminders_frequency:
+ never: "Niciodată"
+ daily: "Zilnic"
+ weekly: "Săptămânal"
+ monthly: "Lunar"
+ quarterly: "Trimestrial"
+ user:
+ notification_level_when_assigned:
+ do_nothing: "Nu face nimic"
+ assignment_description:
+ topic: "%{topic_title}"
+ notifications:
+ assigned: "<span>%{username}</span> %{description}"
+ edit_assignments_modal:
+ topic: "Discuție"
+ post: "Articol"
diff --git a/plugins/discourse-assign/config/locales/client.ru.yml b/plugins/discourse-assign/config/locales/client.ru.yml
new file mode 100644
index 00000000000..17b00a9e4cd
--- /dev/null
+++ b/plugins/discourse-assign/config/locales/client.ru.yml
@@ -0,0 +1,197 @@
+# WARNING: Never edit this file.
+# It will be overwritten when translations are pulled from Crowdin.
+#
+# To work with us on translations, join this project:
+# https://translate.discourse.org/
+
+ru:
+ admin_js:
+ admin:
+ site_settings:
+ categories:
+ discourse_assign: "Плагин Discourse «Назначение»"
+ js:
+ filters:
+ unassigned:
+ title: "Неназначенные"
+ help: "Неназначенные темы"
+ action_codes:
+ assigned: "Назначил(а) ответственным %{who} %{when}"
+ assigned_group: "Назначил(а) ответственным %{who} %{when}"
+ assigned_to_post: "Назначил(а) ответственного %{who} в <a href='%{path}'>это сообщение</a> %{when}"
+ assigned_group_to_post: "Назначил(а) ответственного %{who} в <a href='%{path}'>это сообщение</a> %{when}"
+ unassigned: "Снял(а) ответственного %{who} %{when}"
+ unassigned_group: "Снял(а) ответственного %{who} %{when}"
+ unassigned_from_post: "Снял(а) ответственного %{who} с <a href='%{path}'>этого сообщения</a> %{when}"
+ unassigned_group_from_post: "Снял(а) ответственного %{who} с <a href='%{path}'>этого сообщения</a> %{when}"
+ reassigned: "Переназначено: %{who} %{when}"
+ reassigned_group: "Переназначено: %{who} %{when}"
+ details_change: "Изменены подробности назначения для %{who} %{when}"
+ note_change: "Изменено примечание назначения для %{who} %{when}"
+ status_change: "Изменен статус назначения для %{who} %{when}"
+ discourse_assign:
+ add_unassigned_filter: "Добавить в раздел фильтр 'Неназначенные'"
+ cant_act: "Вы не можете работать с жалобами, назначенными другому сотруднику"
+ cant_act_unclaimed: "Вы должны зарезервировать эту тему прежде чем рассматривать жалобу."
+ topic_search_placeholder: "Поиск тем по заголовку или содержанию сообщения"
+ sidebar_name_filter_placeholder: "Имя / псевдоним"
+ assigned: "Назначенные темы"
+ group_everyone: "Все"
+ assigned_to: "Назначено:"
+ assigned_topic_to: "Назначил(а) тему пользователю <a href='%{path}'>%{username}</a>"
+ assign_post_to: "Назначил(а) ответственным %{username} в сообщение #%{post_number}"
+ assign_post_to_multiple: "#%{post_number} для пользователя %{username}"
+ assigned_to_w_ellipsis: "Назначено..."
+ unassign:
+ title: "Снять ответственного"
+ title_w_ellipsis: "Отменить назначение..."
+ help: "Отменить назначение %{username} из темы"
+ assign:
+ title: "Назначить ответственного"
+ help: "Назначить ответственного в тему"
+ assign_post:
+ title: "Назначить сообщение"
+ unassign_post:
+ title: "Снять назначение"
+ help: "Убрать пользователя %{username} из ответственных за сообщение"
+ reassign:
+ title: "Изменить"
+ title_w_ellipsis: "Изменить назначение..."
+ to_self: "Переназначить мне"
+ to_self_help: "Переназначить тему мне"
+ help: "Изменить детали назначения"
+ reassign_modal:
+ title: "Переназначить тему"
+ topic_level_menu:
+ edit_assignments: "Изменить назначения..."
+ reassign_topic_to_me: "Переназначить тему мне"
+ unassign_with_ellipsis: "Отменить назначение..."
+ unassign_from_post: "Снять ответственного @%{assignee} с публикации #%{post_number}"
+ unassign_from_post_help: "Снять ответственного @%{assignee} с публикации #%{post_number}"
+ unassign_from_topic: "Снять ответственного @%{username} с темы"
+ assign_modal:
+ title: "Назначить ответственного в тему"
+ reassign_title: "Переназначить тему"
+ assign: "Назначить"
+ assignee_label: Назначенный
+ assignment_label: Назначение
+ choose_assignee: Выберите пользователя для назначения.
+ edit_assignments_title: "Изменить назначения"
+ note_label: Примечание
+ optional_label: "(необязательно)"
+ status_label: Статус
+ suggestions: подсказки
+ assign_post_modal:
+ title: "Назначить сообщение"
+ claim:
+ title: "Пожаловаться"
+ help: "Назначить тему себе"
+ assign_mailer:
+ never: "Никогда"
+ different_users: "Только если текущий ответственный и назначаемый ответственный являются разными пользователями"
+ always: "Всегда"
+ reminders_frequency:
+ description: "Частота напоминаний о назначенных темах"
+ never: "Никогда"
+ daily: "Ежедневно"
+ weekly: "Еженедельно"
+ monthly: "Ежемесячно"
+ quarterly: "Ежеквартально"
+ admin:
+ groups:
+ manage:
+ interaction:
+ assign: "Назначить"
+ assignable_levels:
+ title: "Кто может назначить эту группу"
+ user:
+ notification_level_when_assigned:
+ label: "Когда назначено"
+ watch_topic: "Наблюдаемая тема"
+ track_topic: "Отслеживаемая тема"
+ do_nothing: "Ничего не делать"
+ messages:
+ assigned_title: "Назначенные (%{count})"
+ assigned: "Назначенные темы"
+ no_assignments_title: "У вас пока нет назначений"
+ no_assignments_body: >
+ Здесь будут перечислены назначенные вами темы и сообщения. Вы также будете получать периодические напоминания о ваших назначениях, которые вы можете изменить в <a href='%{preferencesUrl}'>настройках пользователя</a>. <br><br> Чтобы назначить тему или сообщение себе или кому-то ещё, используйте кнопку %{icon}, расположенную в нижней части темы.
+ dismiss_assigned_tooltip: "Пометить все непрочитанные уведомления о назначении как прочитанные"
+ assigned_to_group:
+ post: "публикация назначена группе %{group_name}"
+ topic: "тема назначена группе %{group_name}"
+ assigned_to_you:
+ post: "публикация, назначенная вам"
+ topic: "тема, назначенная вам"
+ assignment_description:
+ post: "%{topic_title} (#%{post_number})"
+ topic: "%{topic_title}"
+ admin:
+ web_hooks:
+ assign_event:
+ group_name: "Назначение событий"
+ assigned: "Когда пользователь назначает тему"
+ unassigned: "Когда пользователь отменяет назначение темы"
+ search:
+ advanced:
+ in:
+ assigned: "С назначенным ответственным"
+ unassigned: "Без назначенного ответственного"
+ assigned:
+ label: "Назначен ответственный"
+ topics:
+ bulk:
+ unassign: "Снять ответственного"
+ assign: "Назначить ответственного"
+ discourse_automation:
+ scriptables:
+ random_assign:
+ fields:
+ post_template:
+ label: Шаблон записи
+ description: Если это заполнить, на основе этого шаблона будет создана запись и пользователь будет назначен ей, а не теме целом.
+ assignees_group:
+ label: Группа назначенных
+ minimum_time_between_assignments:
+ label: Минимальное количество часов между назначениями
+ min_recently_assigned_days:
+ label: Минимальное количество дней, в течение которых пользователь считается недавно назначенным
+ description: По умолчанию - 14 дней.
+ skip_new_users_for_days:
+ label: Не назначать новых пользователей в течение указанного количества дней
+ description: По умолчанию 0 дней (пользователей можно назначать сразу после регистрации).
+ max_recently_assigned_days:
+ label: Максимальное количество дней, в течение которых пользователь считается недавно назначенным
+ description: Попытка исключить пользователей, назначенных в течение указанного здесь количества дней. Если ни одного пользователя не осталось, используется значение параметра `min_recently_assigned_days`. По умолчанию — 180 дней.
+ assigned_topic:
+ label: ID назначенной темы
+ in_working_hours:
+ label: В рабочее время
+ notification_reason:
+ user: "Вы увидите количество новых ответов, поскольку эта тема была назначена вам."
+ notifications:
+ assigned: "<span>%{username}</span> %{description}"
+ popup:
+ assigned: "%{username} назначил(а) вас"
+ titles:
+ assigned: "Назначение"
+ dismiss_confirmation:
+ body:
+ assigns:
+ one: "Вы уверены? У вас есть %{count} непрочитанное уведомление о назначении."
+ few: "Вы уверены? У вас есть %{count} непрочитанных уведомления о назначении."
+ many: "Вы уверены? У вас есть %{count} непрочитанных уведомлений о назначении."
+ other: "Вы уверены? У вас есть %{count} непрочитанного уведомления о назначении."
+ user_menu:
+ view_all_assigned: "просмотреть все назначения"
+ tabs:
+ assign_list: "Список назначений"
+ assign_list_with_unread:
+ one: "Список назначений - %{count} непрочитанное назначение"
+ few: "Список назначений - %{count} непрочитанных назначения"
+ many: "Список назначений - %{count} непрочитанных назначений"
+ other: "Список назначений - %{count} непрочитанных назначений"
+ edit_assignments_modal:
+ title: "Изменить назначения"
+ topic: "Тема"
+ post: "Публикация"
diff --git a/plugins/discourse-assign/config/locales/client.sk.yml b/plugins/discourse-assign/config/locales/client.sk.yml
new file mode 100644
index 00000000000..e29d06037b2
--- /dev/null
+++ b/plugins/discourse-assign/config/locales/client.sk.yml
@@ -0,0 +1,69 @@
+# WARNING: Never edit this file.
+# It will be overwritten when translations are pulled from Crowdin.
+#
+# To work with us on translations, join this project:
+# https://translate.discourse.org/
+
+sk:
+ js:
+ action_codes:
+ assigned: "Priradené %{who}%{when}"
+ assigned_group: "Priradené %{who}%{when}"
+ unassigned: "Nepriradené %{who}%{when}"
+ unassigned_group: "Nepriradené %{who}%{when}"
+ discourse_assign:
+ assigned: "Priradené"
+ group_everyone: "Každý"
+ assigned_to: "Priradené komu"
+ assigned_to_w_ellipsis: "Priradené komu..."
+ unassign:
+ title: "Nepriradené"
+ title_w_ellipsis: "Nepriradené..."
+ assign:
+ title: "Priradiť"
+ help: "Priradiť tému používateľovi"
+ reassign:
+ title: "Upraviť"
+ topic_level_menu:
+ unassign_with_ellipsis: "Nepriradené..."
+ assign_modal:
+ title: "Priradiť tému"
+ assign: "Priraď"
+ note_label: Poznámka
+ optional_label: "(nepovinné)"
+ status_label: Stav
+ claim:
+ title: "prevziať"
+ help: "Priradiť tému sebe"
+ assign_mailer:
+ never: "Nikdy"
+ always: "Vždy"
+ reminders_frequency:
+ never: "Nikdy"
+ daily: "Denne"
+ weekly: "Týždenne"
+ monthly: "Mesačne"
+ quarterly: "Štvrťročne"
+ admin:
+ groups:
+ manage:
+ interaction:
+ assign: "Priradiť"
+ user:
+ notification_level_when_assigned:
+ do_nothing: "Nerobiť nič"
+ messages:
+ assigned: "Priradené"
+ assignment_description:
+ topic: "%{topic_title}"
+ search:
+ advanced:
+ assigned:
+ label: "Priradené komu"
+ notifications:
+ assigned: "<span>%{username}</span> %{description}"
+ titles:
+ assigned: "Priradené"
+ edit_assignments_modal:
+ topic: "Témy"
+ post: "Príspevok"
diff --git a/plugins/discourse-assign/config/locales/client.sl.yml b/plugins/discourse-assign/config/locales/client.sl.yml
new file mode 100644
index 00000000000..7c8bc244e66
--- /dev/null
+++ b/plugins/discourse-assign/config/locales/client.sl.yml
@@ -0,0 +1,34 @@
+# WARNING: Never edit this file.
+# It will be overwritten when translations are pulled from Crowdin.
+#
+# To work with us on translations, join this project:
+# https://translate.discourse.org/
+
+sl:
+ js:
+ discourse_assign:
+ group_everyone: "Vsi"
+ reassign:
+ title: "Uredi"
+ assign_modal:
+ optional_label: "(neobvezno)"
+ status_label: Stanje
+ assign_mailer:
+ never: "Nikoli"
+ always: "Vedno"
+ reminders_frequency:
+ never: "Nikoli"
+ daily: "Dnevno"
+ weekly: "Tedensko"
+ monthly: "Mesečno"
+ quarterly: "V četrtletju"
+ user:
+ notification_level_when_assigned:
+ do_nothing: "Ne naredi nič"
+ assignment_description:
+ topic: "%{topic_title}"
+ notifications:
+ assigned: "<span>%{username}</span> %{description}"
+ edit_assignments_modal:
+ topic: "Tema"
+ post: "Prispevek"
diff --git a/plugins/discourse-assign/config/locales/client.sq.yml b/plugins/discourse-assign/config/locales/client.sq.yml
new file mode 100644
index 00000000000..ce340b461c9
--- /dev/null
+++ b/plugins/discourse-assign/config/locales/client.sq.yml
@@ -0,0 +1,27 @@
+# WARNING: Never edit this file.
+# It will be overwritten when translations are pulled from Crowdin.
+#
+# To work with us on translations, join this project:
+# https://translate.discourse.org/
+
+sq:
+ js:
+ discourse_assign:
+ group_everyone: "Të gjithë"
+ reassign:
+ title: "Redakto"
+ assign_mailer:
+ never: "Asnjëherë"
+ always: "Gjithmonë"
+ reminders_frequency:
+ never: "Asnjëherë"
+ daily: "Ditore"
+ weekly: "Javore"
+ monthly: "Mujore"
+ quarterly: "Tremujorsh"
+ user:
+ assignment_description:
+ topic: "%{topic_title}"
+ edit_assignments_modal:
+ topic: "Topic"
+ post: "Postim"
diff --git a/plugins/discourse-assign/config/locales/client.sr.yml b/plugins/discourse-assign/config/locales/client.sr.yml
new file mode 100644
index 00000000000..06fe936013c
--- /dev/null
+++ b/plugins/discourse-assign/config/locales/client.sr.yml
@@ -0,0 +1,24 @@
+# WARNING: Never edit this file.
+# It will be overwritten when translations are pulled from Crowdin.
+#
+# To work with us on translations, join this project:
+# https://translate.discourse.org/
+
+sr:
+ js:
+ discourse_assign:
+ group_everyone: "Svi"
+ reassign:
+ title: "Izmeni"
+ assign_mailer:
+ never: "Nikada"
+ always: "Uvek"
+ reminders_frequency:
+ never: "Nikada"
+ daily: "Top dnevne"
+ weekly: "Top nedeljne"
+ monthly: "Top mesečne"
+ quarterly: "Top kvartalne"
+ edit_assignments_modal:
+ topic: "Tema"
+ post: "Post"
diff --git a/plugins/discourse-assign/config/locales/client.sv.yml b/plugins/discourse-assign/config/locales/client.sv.yml
new file mode 100644
index 00000000000..2d0555a67bf
--- /dev/null
+++ b/plugins/discourse-assign/config/locales/client.sv.yml
@@ -0,0 +1,150 @@
+# WARNING: Never edit this file.
+# It will be overwritten when translations are pulled from Crowdin.
+#
+# To work with us on translations, join this project:
+# https://translate.discourse.org/
+
+sv:
+ js:
+ filters:
+ unassigned:
+ title: "Otilldelat"
+ help: "Ämnen som inte är tilldelade"
+ action_codes:
+ assigned: "Tilldelat %{who} %{when}"
+ assigned_group: "Tilldelat %{who} %{when}"
+ assigned_to_post: "Tilldelat %{who} för <a href='%{path}'>inlägg</a> %{when}"
+ assigned_group_to_post: "Tilldelat %{who} för <a href='%{path}'>inlägg</a> %{when}"
+ unassigned: "Otilldelat %{who} %{when}"
+ unassigned_group: "Otilldelat %{who} %{when}"
+ unassigned_from_post: "Otilldelat %{who} från <a href='%{path}'>inlägg</a> %{when}"
+ unassigned_group_from_post: "Otilldelat %{who} från <a href='%{path}'>inlägg</a> %{when}"
+ reassigned: "Omtilldelad %{who} %{when}"
+ reassigned_group: "Omtilldelad %{who} %{when}"
+ details_change: "Ändrade tilldelningsdetaljer för %{who} %{when}"
+ note_change: "Ändrade tilldelningsanteckning för %{who} %{when}"
+ status_change: "Ändrad tilldelningsstatus för %{who} %{when}"
+ discourse_assign:
+ add_unassigned_filter: "Lägg till 'otilldelat' som en filterkategori"
+ cant_act: "Du kan inte agera på flaggor som har tilldelats andra användare"
+ cant_act_unclaimed: "Du måste ta kontroll över detta ämne innan du kan agera på flaggor."
+ topic_search_placeholder: "Sök ämnen efter titel eller inläggsinnehåll"
+ sidebar_name_filter_placeholder: "Namn/användarnamn"
+ assigned: "Tilldelat"
+ group_everyone: "Alla"
+ assigned_to: "Tilldelat till"
+ assigned_to_w_ellipsis: "Tilldelad till..."
+ unassign:
+ title: "Otilldela"
+ title_w_ellipsis: "Ta bort tilldelning..."
+ help: "Otilldela %{username} för ämne"
+ assign:
+ title: "Tilldela"
+ help: "Tilldela ämne till användare"
+ assign_post:
+ title: "Tilldela inlägg"
+ unassign_post:
+ title: "Ta bort tilldelning från inlägg"
+ help: "Ta bort tilldelning %{username} från inlägg"
+ reassign:
+ title: "Redigera"
+ title_w_ellipsis: "Redigera uppgift..."
+ to_self: "Omtilldela till mig"
+ to_self_help: "Omtilldela ämne till mig"
+ help: "Redigera tilldelningsdetaljer"
+ reassign_modal:
+ title: "Tilldela om ämne"
+ topic_level_menu:
+ unassign_with_ellipsis: "Ta bort tilldelning..."
+ assign_modal:
+ title: "Tilldela ämne"
+ reassign_title: "Tilldela om ämne"
+ assign: "Tilldela"
+ note_label: Anteckning
+ optional_label: "(valfri)"
+ status_label: Status
+ assign_post_modal:
+ title: "Tilldela inlägg"
+ claim:
+ title: "begär"
+ help: "Tilldela ämne till dig själv"
+ assign_mailer:
+ never: "Aldrig"
+ different_users: "Enbart om tilldelare och tilldelad är olika användare"
+ always: "Alltid"
+ reminders_frequency:
+ description: "Frekvens för att erhålla ämnespåminnelser"
+ never: "Aldrig"
+ daily: "Dagligen"
+ weekly: "Veckovis"
+ monthly: "Månadsvis"
+ quarterly: "Kvartalsvis"
+ admin:
+ groups:
+ manage:
+ interaction:
+ assign: "Tilldela"
+ assignable_levels:
+ title: "Vem som kan tilldela denna grupp"
+ user:
+ notification_level_when_assigned:
+ do_nothing: "Gör ingenting"
+ messages:
+ assigned_title: "Tilldelade (%{count})"
+ assigned: "Tilldelad"
+ no_assignments_title: "Du har inga tilldelningar än"
+ no_assignments_body: >
+ Dina tilldelade ämnen och meddelanden visas här i en lista. Du kommer också att få en periodisk påminnelse om dina tilldelningar, som du kan justera i dina <a href='%{preferencesUrl}'>användarinställningar</a>. <br><br> Om du vill tilldela ett ämne eller ett meddelande till dig själv eller till någon annan letar du efter tilldelningsknappen %{icon} längst ned.
+ dismiss_assigned_tooltip: "Markera alla olästa tilldelningsmeddelanden som lästa"
+ assignment_description:
+ topic: "%{topic_title}"
+ search:
+ advanced:
+ in:
+ assigned: "är tilldelade"
+ unassigned: "är otilldelade"
+ assigned:
+ label: "Tilldelad till"
+ topics:
+ bulk:
+ unassign: "Otilldela ämnen"
+ assign: "Tilldela ämnen"
+ discourse_automation:
+ scriptables:
+ random_assign:
+ fields:
+ post_template:
+ label: Inläggsmall
+ description: Om den fylls i skapas ett inlägg med den här mallen och en användare tilldelas inlägget istället för ämnet.
+ assignees_group:
+ label: Tilldelade-grupp
+ minimum_time_between_assignments:
+ label: Minsta antal timmar mellan tilldelningar
+ min_recently_assigned_days:
+ label: Lägsta antal dagar som nyligen tilldelat
+ description: Standardvärdet är 14 dagar.
+ max_recently_assigned_days:
+ label: Högsta antal dagar som nyligen tilldelat
+ description: Första försöket att hoppa över användare som tilldelats under de senaste `n` dagarna. Om ingen användare finns kvar återgår det till 'min_recently_assigned_days'. Standardvärden är 180 dagar.
+ assigned_topic:
+ label: Tilldelat ämnes-ID
+ in_working_hours:
+ label: Användare under arbetstid
+ notification_reason:
+ user: "Du kommer att se en räknare för nya svar eftersom detta ämne tilldelades dig."
+ notifications:
+ assigned: "<span>%{username}</span> %{description}"
+ popup:
+ assigned: "%{username} tilldelade dig"
+ titles:
+ assigned: "Tilldelad"
+ dismiss_confirmation:
+ body:
+ assigns:
+ one: "Är du säker? Du har %{count} olästa tilldelningsmeddelande."
+ other: "Är du säker? Du har %{count} olästa tilldelningsmeddelande."
+ user_menu:
+ view_all_assigned: "visa alla tilldelade"
+ edit_assignments_modal:
+ topic: "Ämne"
+ post: "Inlägg"
diff --git a/plugins/discourse-assign/config/locales/client.sw.yml b/plugins/discourse-assign/config/locales/client.sw.yml
new file mode 100644
index 00000000000..32ccb48843a
--- /dev/null
+++ b/plugins/discourse-assign/config/locales/client.sw.yml
@@ -0,0 +1,69 @@
+# WARNING: Never edit this file.
+# It will be overwritten when translations are pulled from Crowdin.
+#
+# To work with us on translations, join this project:
+# https://translate.discourse.org/
+
+sw:
+ js:
+ action_codes:
+ assigned: "%{who}Amepewa %{when}"
+ assigned_group: "%{who}Amepewa %{when}"
+ unassigned: "%{who}Hajakabidhiwa %{when}"
+ unassigned_group: "%{who}Hajakabidhiwa %{when}"
+ discourse_assign:
+ cant_act: "Hauwezi kutumia bendera ambazo zimeshatumiwa na watu wengine"
+ cant_act_unclaimed: "Lazima uimiliki mada kabla ya kuweka bendera."
+ assigned: "Kukabidhi"
+ group_everyone: "Kila Mtu"
+ assigned_to: "Imekabidhiwa kwa"
+ assigned_to_w_ellipsis: "Imekabidhiwa kwa..."
+ unassign:
+ title: "Haijakabithiwa"
+ title_w_ellipsis: "Haijakabithiwa..."
+ assign:
+ title: "Kabidhi"
+ help: "Pangia Mada kwa Mtumiaji"
+ reassign:
+ title: "Hariri"
+ topic_level_menu:
+ unassign_with_ellipsis: "Haijakabithiwa..."
+ assign_modal:
+ title: "Awadha Mada"
+ assign: "Kabidhi"
+ optional_label: "(sio muhimu)"
+ claim:
+ title: "Miliki"
+ help: "Jipe Mada"
+ assign_mailer:
+ never: "Kamwe"
+ always: "Mara kwa mara"
+ reminders_frequency:
+ never: "Kamwe"
+ daily: "Kila siku"
+ weekly: "Kila wiki"
+ monthly: "Klla mwezi"
+ quarterly: "Kila baada ya miezi mitatu"
+ admin:
+ groups:
+ manage:
+ interaction:
+ assign: "Kabidhi"
+ user:
+ notification_level_when_assigned:
+ do_nothing: "Usifanye chochote"
+ messages:
+ assigned_title: "Amekabidhiwa (%{count})"
+ assigned: "Imekabidhiwa"
+ assignment_description:
+ topic: "%{topic_title}"
+ search:
+ advanced:
+ assigned:
+ label: "Imekabidhiwa kwa"
+ notifications:
+ titles:
+ assigned: "Kukabidhi"
+ edit_assignments_modal:
+ topic: "Mada"
+ post: "Ujumbe"
diff --git a/plugins/discourse-assign/config/locales/client.te.yml b/plugins/discourse-assign/config/locales/client.te.yml
new file mode 100644
index 00000000000..399b17d290e
--- /dev/null
+++ b/plugins/discourse-assign/config/locales/client.te.yml
@@ -0,0 +1,37 @@
+# WARNING: Never edit this file.
+# It will be overwritten when translations are pulled from Crowdin.
+#
+# To work with us on translations, join this project:
+# https://translate.discourse.org/
+
+te:
+ js:
+ discourse_assign:
+ assigned: "కేటాయించబడింది"
+ group_everyone: "అందరూ"
+ reassign:
+ title: "సవరణ"
+ assign_modal:
+ optional_label: "(ఐచ్ఛికం)"
+ status_label: స్థితి
+ assign_mailer:
+ never: "ఎప్పటికీ వద్దు"
+ always: "ఎల్లప్పుడూ"
+ reminders_frequency:
+ never: "ఎప్పటికీ వద్దు"
+ daily: "రోజువారీ"
+ weekly: "వారానికోసారి"
+ monthly: "నెలవారీ"
+ quarterly: "త్రైమాసిక"
+ user:
+ notification_level_when_assigned:
+ do_nothing: "ఏమీ చేయవద్దు"
+ messages:
+ assigned: "కేటాయించబడింది"
+ notifications:
+ assigned: "<span>%{username}</span> %{description}"
+ titles:
+ assigned: "కేటాయించబడింది"
+ edit_assignments_modal:
+ topic: "విషయం"
+ post: "పోస్ట్"
diff --git a/plugins/discourse-assign/config/locales/client.th.yml b/plugins/discourse-assign/config/locales/client.th.yml
new file mode 100644
index 00000000000..d7be72c0f28
--- /dev/null
+++ b/plugins/discourse-assign/config/locales/client.th.yml
@@ -0,0 +1,29 @@
+# WARNING: Never edit this file.
+# It will be overwritten when translations are pulled from Crowdin.
+#
+# To work with us on translations, join this project:
+# https://translate.discourse.org/
+
+th:
+ js:
+ discourse_assign:
+ group_everyone: "ทุกคน"
+ reassign:
+ title: "แก้ไข"
+ assign_modal:
+ optional_label: "(ทางเลือก)"
+ status_label: สถานะ
+ assign_mailer:
+ never: "ไม่เคย"
+ always: "เสมอ"
+ reminders_frequency:
+ never: "ไม่เคย"
+ daily: "วัน"
+ weekly: "อาทิตย์"
+ monthly: "เดือน"
+ quarterly: "สามเดือน"
+ notifications:
+ assigned: "<span>%{username}</span>%{description}"
+ edit_assignments_modal:
+ topic: "หัวข้อ"
+ post: "โพส"
diff --git a/plugins/discourse-assign/config/locales/client.tr_TR.yml b/plugins/discourse-assign/config/locales/client.tr_TR.yml
new file mode 100644
index 00000000000..fba2dd4881d
--- /dev/null
+++ b/plugins/discourse-assign/config/locales/client.tr_TR.yml
@@ -0,0 +1,193 @@
+# WARNING: Never edit this file.
+# It will be overwritten when translations are pulled from Crowdin.
+#
+# To work with us on translations, join this project:
+# https://translate.discourse.org/
+
+tr_TR:
+ admin_js:
+ admin:
+ site_settings:
+ categories:
+ discourse_assign: "Discourse Atama"
+ js:
+ filters:
+ unassigned:
+ title: "Atanmamış"
+ help: "Atanmamış konular"
+ action_codes:
+ assigned: "%{when} tarihinde %{who} adlı kullanıcıyı atadı"
+ assigned_group: "%{when} tarihinde %{who} adlı kullanıcıyı atadı"
+ assigned_to_post: "%{when} tarihinde %{who} adlı kullanıcıyı <a href='%{path}'>gönderiye</a> atadı"
+ assigned_group_to_post: "%{when} tarihinde %{who} adlı kullanıcıyı <a href='%{path}'>gönderiye</a> atadı"
+ unassigned: "%{when} tarihinde %{who} adlı kullanıcının atamasını kaldırdı"
+ unassigned_group: "%{when} tarihinde %{who} adlı kullanıcının atamasını kaldırdı"
+ unassigned_from_post: "%{when} tarihinde %{who} adlı kullanıcının <a href='%{path}'>gönderiden</a> atamasını kaldırdı"
+ unassigned_group_from_post: "%{when} tarihinde %{who} adlı kullanıcının <a href='%{path}'>gönderiden</a> atamasını kaldırdı"
+ reassigned: "%{when} tarihinde %{who} adlı kullanıcıyı tekrar atadı"
+ reassigned_group: "%{when} tarihinde %{who} adlı kullanıcıyı tekrar atadı"
+ details_change: "%{when} tarihinde %{who} adlı kullanıcı için atama bilgilerini değiştirdi"
+ note_change: "%{when} tarihinde %{who} adlı kullanıcı için atama notunu değiştirdi"
+ status_change: "%{when} tarihinde %{who} için atama durumunu değiştirdi"
+ discourse_assign:
+ add_unassigned_filter: "Kategoriye \"atanmamış\" filtresi ekle"
+ cant_act: "Başka kullanıcılara atanmış bayraklar üzerinde işlem yapamazsınız"
+ cant_act_unclaimed: "Bayraklar üzerinde hareket etmeden önce bu konuyu talep etmelisiniz."
+ topic_search_placeholder: "Konuları başlığa veya gönderi içeriğine göre arayın"
+ sidebar_name_filter_placeholder: "Ad/Kullanıcı Adı"
+ assigned: "Atandı"
+ group_everyone: "Herkes"
+ assigned_to: "Şuraya atandı:"
+ assigned_topic_to: "Konu <a href='%{path}'>%{username}</a> adlı kullanıcıya atandı"
+ assign_post_to: "#%{post_number}, %{username} adlı kullanıcıya atandı"
+ assign_post_to_multiple: "%{username} adlı kullanıcıya #%{post_number}"
+ assigned_to_w_ellipsis: "Şuraya atandı..."
+ unassign:
+ title: "Atamayı kaldır"
+ title_w_ellipsis: "Atamayı kaldır..."
+ help: "%{username} adlı kullanıcının Konudan atamasını kaldır"
+ assign:
+ title: "Ata"
+ help: "Kullanıcıya konu ata"
+ assign_post:
+ title: "Gönderi ata"
+ unassign_post:
+ title: "Gönderiden atamayı kaldır"
+ help: "%{username} adlı kullanıcının Gönderiden atamasını kaldır"
+ reassign:
+ title: "Düzenle"
+ title_w_ellipsis: "Atamayı düzenle..."
+ to_self: "Bana geri ata"
+ to_self_help: "Konuyu bana geri ata"
+ help: "Atama bilgilerini düzenle"
+ reassign_modal:
+ title: "Konuyu yeniden ata"
+ topic_level_menu:
+ edit_assignments: "Atamaları düzenle..."
+ reassign_topic_to_me: "Konuyu bana geri ata"
+ unassign_with_ellipsis: "Atamayı kaldır..."
+ unassign_from_post: "#%{post_number} numaralı gönderiden @%{assignee} atamasını kaldır"
+ unassign_from_post_help: "#%{post_number} numaralı gönderiden @%{assignee} atamasını kaldır"
+ unassign_from_topic: "@%{username} adlı kullanıcının konudan atamasını kaldır"
+ assign_modal:
+ title: "Konu Ata"
+ reassign_title: "Konuyu yeniden ata"
+ assign: "Ata"
+ assignee_label: Atanan kişi
+ assignment_label: Ata
+ choose_assignee: Atanacak bir kullanıcı seçin.
+ edit_assignments_title: "Atamaları düzenle"
+ note_label: Not
+ optional_label: "(isteğe bağlı)"
+ status_label: Durum
+ suggestions: öneriler
+ assign_post_modal:
+ title: "Gönderi ata"
+ claim:
+ title: "al"
+ help: "Konuyu kendinize atayın"
+ assign_mailer:
+ never: "Asla"
+ different_users: "Yalnızca atanan ve vekil kullanıcılar farklıysa"
+ always: "Her zaman"
+ reminders_frequency:
+ description: "Atanan konu hatırlatıcılarını alma sıklığı"
+ never: "Asla"
+ daily: "Günlük"
+ weekly: "Haftalık"
+ monthly: "Aylık"
+ quarterly: "Üç aylık"
+ admin:
+ groups:
+ manage:
+ interaction:
+ assign: "Ata"
+ assignable_levels:
+ title: "Bu grubu kim atayabilir?"
+ user:
+ notification_level_when_assigned:
+ label: "Atandığında"
+ watch_topic: "Konuyu izle"
+ track_topic: "Konuyu takip et"
+ do_nothing: "Hiçbir şey yapma"
+ messages:
+ assigned_title: "Atandı (%{count})"
+ assigned: "Atandı"
+ no_assignments_title: "Henüz atamanız yok"
+ no_assignments_body: >
+ Atanan konularınız ve mesajlarınız burada listelenir. Ayrıca, atamalarınızla ilgili periyodik bir anımsatma bildirimi alırsınız; bunu <a href='%{preferencesUrl}'>kullanıcı tercihlerinizden</a> ayarlayabilirsiniz. <br><br>Kendinize veya bir başkasına bir konu veya mesaj atamak için alttaki %{icon} ata düğmesini kullanın.
+ dismiss_assigned_tooltip: "Okunmamış tüm atama bildirimlerini okundu olarak işaretle"
+ assigned_to_group:
+ post: "gönderi %{group_name} adlı gruba atandı"
+ topic: "konu %{group_name} adlı gruba atandı"
+ assigned_to_you:
+ post: "gönderi size atandı"
+ topic: "konu size atandı"
+ assignment_description:
+ post: "%{topic_title} (#%{post_number})"
+ topic: "%{topic_title}"
+ admin:
+ web_hooks:
+ assign_event:
+ group_name: "Etkinlik Ata"
+ assigned: "Bir kullanıcı bir konu atadığında"
+ unassigned: "Bir kullanıcı bir konunun atamasını kaldırdığında"
+ search:
+ advanced:
+ in:
+ assigned: "atanmış"
+ unassigned: "atanmamış"
+ assigned:
+ label: "Şu kişiye atandı:"
+ topics:
+ bulk:
+ unassign: "Konuların atamalarını kaldır"
+ assign: "Konuları ata"
+ discourse_automation:
+ scriptables:
+ random_assign:
+ fields:
+ post_template:
+ label: Gönderi şablonu
+ description: Doldurulursa bu şablonla bir gönderi oluşturulur ve gönderiye konu yerine bir kullanıcı atanır.
+ assignees_group:
+ label: Atananlar Grubu
+ minimum_time_between_assignments:
+ label: Atamalar arasındaki minimum saatler
+ min_recently_assigned_days:
+ label: Minimum en son atanan günler
+ description: Varsayılan değer 14 gündür.
+ skip_new_users_for_days:
+ label: Yeni kullanıcıları günlerce atla
+ description: Varsayılan değer 0 gündür (kullanıcılar kaydolduktan hemen sonra atanabilir).
+ max_recently_assigned_days:
+ label: Maksimum en son atanan günler
+ description: Son "n" gün içinde atanan kullanıcıları hariç tutmak için ilk deneme. Kullanıcı kalmamışsa "min_recently_assigned_days" değerine geri dönülür. Varsayılan değer 180 gündür.
+ assigned_topic:
+ label: Atanan Konu Kimliği
+ in_working_hours:
+ label: Çalışma saatlerindeki kullanıcılar
+ notification_reason:
+ user: "Bu konu size atandığı için yeni yanıtların sayısını görürsünüz."
+ notifications:
+ assigned: "<span>%{username}</span> %{description}"
+ popup:
+ assigned: "%{username} sizi atadı"
+ titles:
+ assigned: "Atandı"
+ dismiss_confirmation:
+ body:
+ assigns:
+ one: "Emin misiniz? %{count} okunmamış atama bildiriminiz var."
+ other: "Emin misiniz? %{count} okunmamış atama bildiriminiz var."
+ user_menu:
+ view_all_assigned: "tüm atananları görüntüle"
+ tabs:
+ assign_list: "Atama listesi"
+ assign_list_with_unread:
+ one: "Atama listesi - %{count} okunmamış atama"
+ other: "Atama listesi - %{count} okunmamış atama"
+ edit_assignments_modal:
+ title: "Atamaları düzenle"
+ topic: "Konu"
+ post: "Gönderi"
diff --git a/plugins/discourse-assign/config/locales/client.ug.yml b/plugins/discourse-assign/config/locales/client.ug.yml
new file mode 100644
index 00000000000..858a53447bd
--- /dev/null
+++ b/plugins/discourse-assign/config/locales/client.ug.yml
@@ -0,0 +1,40 @@
+# WARNING: Never edit this file.
+# It will be overwritten when translations are pulled from Crowdin.
+#
+# To work with us on translations, join this project:
+# https://translate.discourse.org/
+
+ug:
+ js:
+ discourse_assign:
+ assigned: "تەقسىملەنگەن"
+ group_everyone: "ھەممەيلەن"
+ reassign:
+ title: "تەھرىر"
+ assign_modal:
+ note_label: ئەسكەرتىش
+ optional_label: "(تاللاشچان)"
+ status_label: ھالەت
+ assign_mailer:
+ never: "ھەرگىز"
+ always: "ھەمىشە"
+ reminders_frequency:
+ never: "ھەرگىز"
+ daily: "كۈندىلىك"
+ weekly: "ھەپتىلىك"
+ monthly: "ئايلىق"
+ quarterly: "پەسىللىك"
+ user:
+ notification_level_when_assigned:
+ do_nothing: "ھېچ ئىش قىلما"
+ messages:
+ assigned: "تەقسىملەنگەن"
+ assignment_description:
+ topic: "%{topic_title}"
+ notifications:
+ assigned: "<span>%{username}</span> %{description}"
+ titles:
+ assigned: "تەقسىملەنگەن"
+ edit_assignments_modal:
+ topic: "تېما"
+ post: "يازما"
diff --git a/plugins/discourse-assign/config/locales/client.uk.yml b/plugins/discourse-assign/config/locales/client.uk.yml
new file mode 100644
index 00000000000..5e98eeb977d
--- /dev/null
+++ b/plugins/discourse-assign/config/locales/client.uk.yml
@@ -0,0 +1,79 @@
+# WARNING: Never edit this file.
+# It will be overwritten when translations are pulled from Crowdin.
+#
+# To work with us on translations, join this project:
+# https://translate.discourse.org/
+
+uk:
+ js:
+ filters:
+ unassigned:
+ title: "Непризначені"
+ help: "Теми, які не призначені"
+ action_codes:
+ assigned: "Призначено %{who} %{when}"
+ assigned_group: "Призначено %{who} %{when}"
+ unassigned: "Скасовано %{who} %{when}"
+ unassigned_group: "Скасовано %{who} %{when}"
+ discourse_assign:
+ add_unassigned_filter: "Додайте фільтр «непризначені» до категорії"
+ cant_act: "Ви не можете діяти на основі прапорів, призначених іншим користувачам"
+ cant_act_unclaimed: "Ви повинні претендувати на цю тему, перш ніж реагувати на прапори."
+ assigned: "Призначено"
+ group_everyone: "Усі"
+ assigned_to: "Призначено на"
+ assigned_to_w_ellipsis: "Призначено на..."
+ unassign:
+ title: "Скасувати призначення"
+ title_w_ellipsis: "Скасувати призначення..."
+ assign:
+ title: "Призначити"
+ help: "Призначити тему користувачеві"
+ reassign:
+ title: "Редагувати"
+ topic_level_menu:
+ unassign_with_ellipsis: "Скасувати призначення..."
+ assign_modal:
+ title: "Призначити тему"
+ assign: "Призначити"
+ note_label: Примітка
+ optional_label: "(опціонально)"
+ status_label: Статус
+ claim:
+ title: "претензія"
+ help: "Призначте тему собі"
+ assign_mailer:
+ never: "Ніколи"
+ different_users: "Тільки якщо правонаступник і передавач є різними користувачами"
+ always: "Завжди"
+ reminders_frequency:
+ description: "Частота прийому нагадувань про призначені теми"
+ never: "Ніколи"
+ daily: "Щодня"
+ weekly: "Щотижня"
+ monthly: "Щомісяця"
+ quarterly: "Щоквартала"
+ admin:
+ groups:
+ manage:
+ interaction:
+ assign: "Призначити"
+ user:
+ notification_level_when_assigned:
+ do_nothing: "Нічого не робити"
+ messages:
+ assigned_title: "Призначено (%{count})"
+ assigned: "Призначено"
+ assignment_description:
+ topic: "%{topic_title}"
+ search:
+ advanced:
+ assigned:
+ label: "Призначено на"
+ notifications:
+ assigned: "<span>%{username}</span> %{description}"
+ titles:
+ assigned: "Призначено"
+ edit_assignments_modal:
+ topic: "Тема"
+ post: "Допис"
diff --git a/plugins/discourse-assign/config/locales/client.ur.yml b/plugins/discourse-assign/config/locales/client.ur.yml
new file mode 100644
index 00000000000..8a9fae97cc6
--- /dev/null
+++ b/plugins/discourse-assign/config/locales/client.ur.yml
@@ -0,0 +1,122 @@
+# WARNING: Never edit this file.
+# It will be overwritten when translations are pulled from Crowdin.
+#
+# To work with us on translations, join this project:
+# https://translate.discourse.org/
+
+ur:
+ js:
+ filters:
+ unassigned:
+ title: "غیر اسائین کریں"
+ help: "عنوانات جو تفویض نہیں کیے گئے ہیں"
+ action_codes:
+ assigned: "تفویض کردہ %{who} %{when}"
+ assigned_group: "تفویض کردہ %{who} %{when}"
+ assigned_to_post: "تفویض کردہ %{who} سے <a href='%{path}'>پوسٹ</a> %{when}"
+ assigned_group_to_post: "تفویض کردہ %{who} سے <a href='%{path}'>پوسٹ</a> %{when}"
+ unassigned: "غیر تفویض کردہ %{who} %{when}"
+ unassigned_group: "غیر تفویض کردہ %{who} %{when}"
+ unassigned_from_post: "<a href='%{path}'>پوسٹ</a> %{when}سے %{who} کو غیر تفویض کیا گیا۔"
+ unassigned_group_from_post: "<a href='%{path}'>پوسٹ</a> %{when}سے %{who} کو غیر تفویض کیا گیا۔"
+ reassigned: "%{who} %{when}دوبارہ تفویض کیا گیا۔"
+ reassigned_group: "%{who} %{when}دوبارہ تفویض کیا گیا۔"
+ discourse_assign:
+ add_unassigned_filter: "زمرے میں 'غیر تفویض' فلٹر شامل کریں"
+ cant_act: "آپ دوسرے صارفین کو اسائین کردہ فلیگ پر کاروائی نہیں کر سکتے"
+ cant_act_unclaimed: "فلَیگز پر عمل کرنے سے پہلے آپ کو یہ ٹاپک کَلَیم کرنا ہوگا۔"
+ topic_search_placeholder: "عنوان یا پوسٹ مواد کے ذریعہ موضوعات تلاش کریں"
+ sidebar_name_filter_placeholder: "نام/صارف نام"
+ assigned: "اسائین کردہ"
+ group_everyone: "ہر کوئی"
+ assigned_to: "جس کو اسائین کیا گیا"
+ assigned_to_w_ellipsis: "کو تفویض..."
+ unassign:
+ title: "غیر اسائین کریں"
+ title_w_ellipsis: "غیر تفویض کریں..."
+ help: "موضوع سے %{username} کو غیر متعین کریں"
+ assign:
+ title: "اسائین کریں"
+ help: "صارف کو ٹاپک اسائین کریں"
+ assign_post:
+ title: "پوسٹ تفویض کریں"
+ unassign_post:
+ title: "پوسٹ سے غیر تفویض"
+ help: "پوسٹ سے %{username} غیر تفویض کریں"
+ reassign:
+ title: "ترمیم کریں"
+ to_self: "مجھے دوبارہ تفویض کریں"
+ to_self_help: "مجھے موضوع دوبارہ تفویض کریں"
+ reassign_modal:
+ title: "موضوع دوبارہ تفویض کریں"
+ topic_level_menu:
+ unassign_with_ellipsis: "غیر تفویض کریں..."
+ assign_modal:
+ title: "ٹاپک اسائین کریں"
+ reassign_title: "موضوع دوبارہ تفویض کریں"
+ assign: "اسائین کریں"
+ optional_label: "(اختیاری)"
+ status_label: سٹیٹس
+ assign_post_modal:
+ title: "پوسٹ تفویض کریں"
+ claim:
+ title: "کلیم کریں"
+ help: "اپنے آپ کو ٹاپک اسائین کریں"
+ assign_mailer:
+ never: "کبھی نہیں "
+ different_users: "صرف اس صورت میں جب تفویض کرنے والے اور تفویض کرنے والے مختلف صارفین ہیں"
+ always: "ہمیشہ"
+ reminders_frequency:
+ description: "اسائین کردہ ٹاپکس کے بارے میں یاد دہانیاں وصول کرنے کی فریکوئینسی"
+ never: "کبھی نہیں "
+ daily: "روزانہ "
+ weekly: "ہفتہ وار"
+ monthly: "ماہانہ"
+ quarterly: "سہ ماہی"
+ admin:
+ groups:
+ manage:
+ interaction:
+ assign: "تفویض"
+ assignable_levels:
+ title: "کون اس گروپ کو تفویض کر سکتا ہے"
+ user:
+ notification_level_when_assigned:
+ do_nothing: "کچھ نہ کریں"
+ messages:
+ assigned_title: "اسائین کردہ (%{count})"
+ assigned: "اسائین کردہ"
+ no_assignments_title: "آپ کے پاس ابھی تک کوئی اسائنمنٹ نہیں ہے"
+ no_assignments_body: >
+ آپ کے تفویض کردہ عنوانات اور پیغامات یہاں درج ہوں گے۔ آپ کو اپنے اسائنمنٹس کی وقفے وقفہ سے یاد دہانی کا نوٹیفکیشن بھی ملے گا ، جسے آپ اپنی <a href='%{preferencesUrl}'>صارف ترجیحات</a>میں ایڈجسٹ کرسکتے ہیں۔ <br><br> اپنے آپ کو یا کسی اور کو موضوع یا پیغام تفویض کرنے کے لئے ، %{icon} تفویض والے بٹن کو تلاش کریں۔
+ assignment_description:
+ topic: "%{topic_title}"
+ search:
+ advanced:
+ in:
+ assigned: "تفویض کیے گئے"
+ unassigned: "غیرتفویض شدہ ہیں"
+ assigned:
+ label: "کو تفویض"
+ topics:
+ bulk:
+ unassign: "موضوعات کو غیر تفویض کریں"
+ assign: "موضوعات تفویض کریں"
+ discourse_automation:
+ scriptables:
+ random_assign:
+ fields:
+ post_template:
+ label: پوسٹ کا سانچہ
+ description: اگر پُر ہو جائے تو اس سانچے کے ساتھ ایک پوسٹ بنائی جائے گی اور موضوع کی بجائے اس کے لیے ایک صارف تفویض کیا جائے گا۔
+ assignees_group:
+ label: تفویض کا روں کاگروپ
+ minimum_time_between_assignments:
+ label: اسائنمنٹس کے درمیان کم از کم گھنٹے
+ notifications:
+ assigned: "<span>%{username}</span> %{description}"
+ titles:
+ assigned: "تفویض کردہ"
+ edit_assignments_modal:
+ topic: "ٹاپک"
+ post: "پوسٹ"
diff --git a/plugins/discourse-assign/config/locales/client.vi.yml b/plugins/discourse-assign/config/locales/client.vi.yml
new file mode 100644
index 00000000000..45070a7f0f7
--- /dev/null
+++ b/plugins/discourse-assign/config/locales/client.vi.yml
@@ -0,0 +1,42 @@
+# WARNING: Never edit this file.
+# It will be overwritten when translations are pulled from Crowdin.
+#
+# To work with us on translations, join this project:
+# https://translate.discourse.org/
+
+vi:
+ js:
+ discourse_assign:
+ cant_act: "Bạn không thể hành động trên các cờ đã được gán cho Thành viên khác"
+ assigned: "Được chỉ định"
+ group_everyone: "Mọi người"
+ assign:
+ help: "Gán chủ đề cho Thành viên"
+ reassign:
+ title: "Sửa"
+ assign_modal:
+ optional_label: "(tùy chọn)"
+ status_label: Trạng thái
+ assign_mailer:
+ never: "Không"
+ always: "Luôn luôn"
+ reminders_frequency:
+ never: "Không"
+ daily: "Hàng ngày"
+ weekly: "Hàng tuần"
+ monthly: "Hàng tháng"
+ quarterly: "Hàng quý"
+ user:
+ notification_level_when_assigned:
+ do_nothing: "Không làm gì cả"
+ messages:
+ assigned: "Được chỉ định"
+ assignment_description:
+ topic: "%{topic_title}"
+ notifications:
+ assigned: "<span>%{username}</span> %{description}"
+ titles:
+ assigned: "Được chỉ định"
+ edit_assignments_modal:
+ topic: "Chủ đề"
+ post: "Bài đăng"
diff --git a/plugins/discourse-assign/config/locales/client.zh_CN.yml b/plugins/discourse-assign/config/locales/client.zh_CN.yml
new file mode 100644
index 00000000000..f6293efd7ee
--- /dev/null
+++ b/plugins/discourse-assign/config/locales/client.zh_CN.yml
@@ -0,0 +1,191 @@
+# WARNING: Never edit this file.
+# It will be overwritten when translations are pulled from Crowdin.
+#
+# To work with us on translations, join this project:
+# https://translate.discourse.org/
+
+zh_CN:
+ admin_js:
+ admin:
+ site_settings:
+ categories:
+ discourse_assign: "Discourse Assign"
+ js:
+ filters:
+ unassigned:
+ title: "已取消指定"
+ help: "未指定的话题"
+ action_codes:
+ assigned: "于 %{when}指定给 %{who}"
+ assigned_group: "于 %{when}指定给 %{who}"
+ assigned_to_post: "于 %{when}将 %{who} 指定到<a href='%{path}'>帖子</a>"
+ assigned_group_to_post: "于 %{when}将 %{who} 指定到<a href='%{path}'>帖子</a>"
+ unassigned: "于 %{when}取消指定 %{who}"
+ unassigned_group: "于 %{when}取消指定 %{who}"
+ unassigned_from_post: "于 %{when}将 %{who} 从<a href='%{path}'>帖子</a>中取消指定"
+ unassigned_group_from_post: "于 %{when}将 %{who} 从<a href='%{path}'>帖子</a>中取消指定"
+ reassigned: "于 %{when}重新指定 %{who}"
+ reassigned_group: "于 %{when}重新指定 %{who}"
+ details_change: "于 %{when}更改了 %{who} 的指定详细信息"
+ note_change: "于 %{when}更改了 %{who} 的指定注释"
+ status_change: "于 %{when}更改了 %{who} 的指定状态"
+ discourse_assign:
+ add_unassigned_filter: "将“未指定”筛选器添加到类别"
+ cant_act: "您不能对已指定给其他用户的举报采取行动"
+ cant_act_unclaimed: "在对举报采取行动之前,您必须先认领此话题。"
+ topic_search_placeholder: "按标题或帖子内容搜索话题"
+ sidebar_name_filter_placeholder: "名称/用户名"
+ assigned: "已指定"
+ group_everyone: "所有人"
+ assigned_to: "已指定给"
+ assigned_topic_to: "将话题指定给 <a href='%{path}'>%{username}</a>"
+ assign_post_to: "将 #%{post_number} 指定给 %{username}"
+ assign_post_to_multiple: "#%{post_number} 被分配给 %{username}"
+ assigned_to_w_ellipsis: "已指定给…"
+ unassign:
+ title: "取消指定"
+ title_w_ellipsis: "取消指定…"
+ help: "从话题中取消指定 %{username}"
+ assign:
+ title: "指定"
+ help: "将话题指定给用户"
+ assign_post:
+ title: "指定帖子"
+ unassign_post:
+ title: "从帖子中取消指定"
+ help: "从帖子中取消指定 %{username}"
+ reassign:
+ title: "编辑"
+ title_w_ellipsis: "编辑指定…"
+ to_self: "重新指定给我"
+ to_self_help: "将话题重新指定给我"
+ help: "编辑指定详细信息"
+ reassign_modal:
+ title: "重新指定话题"
+ topic_level_menu:
+ edit_assignments: "编辑指定…"
+ reassign_topic_to_me: "将话题重新指定给我"
+ unassign_with_ellipsis: "取消指定…"
+ unassign_from_post: "从 #%{post_number} 中取消指定 @%{assignee}"
+ unassign_from_post_help: "从帖子 #%{post_number} 中取消指定 @%{assignee}"
+ unassign_from_topic: "从话题中取消指定 %{username}"
+ assign_modal:
+ title: "指定话题"
+ reassign_title: "重新指定话题"
+ assign: "指定"
+ assignee_label: 受理人
+ assignment_label: 指定
+ choose_assignee: 选择要指定的用户。
+ edit_assignments_title: "编辑指定"
+ note_label: 注释
+ optional_label: "(可选)"
+ status_label: 状态
+ suggestions: 建议
+ assign_post_modal:
+ title: "指定帖子"
+ claim:
+ title: "认领"
+ help: "将话题指定给自己"
+ assign_mailer:
+ never: "永不"
+ different_users: "仅当指定者和受理人是不同的用户时"
+ always: "始终"
+ reminders_frequency:
+ description: "接收指定话题提醒的频率"
+ never: "永不"
+ daily: "每天"
+ weekly: "每周"
+ monthly: "每月"
+ quarterly: "每季度"
+ admin:
+ groups:
+ manage:
+ interaction:
+ assign: "指定"
+ assignable_levels:
+ title: "谁可以指定此群组"
+ user:
+ notification_level_when_assigned:
+ label: "指定后"
+ watch_topic: "关注话题"
+ track_topic: "跟踪话题"
+ do_nothing: "不进行操作"
+ messages:
+ assigned_title: "已指定 (%{count})"
+ assigned: "已指定"
+ no_assignments_title: "您还没有任何任务指定"
+ no_assignments_body: >
+ 指定给您的话题和消息将在此处列出。您还将收到关于您的任务指定的定期提醒通知,您可以在<a href='%{preferencesUrl}'>用户偏好设置</a>中进行调整。 <br><br>要将话题或消息指定给自己或其他人,请查找底部的 %{icon} 指定按钮。
+ dismiss_assigned_tooltip: "将所有未读指定通知标记为已读"
+ assigned_to_group:
+ post: "帖子被指定给 %{group_name}"
+ topic: "话题被指定给 %{group_name}"
+ assigned_to_you:
+ post: "帖子被指定给您"
+ topic: "话题被指定给您"
+ assignment_description:
+ post: "%{topic_title} (#%{post_number})"
+ topic: "%{topic_title}"
+ admin:
+ web_hooks:
+ assign_event:
+ group_name: "指定事件"
+ assigned: "当用户指定主题时"
+ unassigned: "当用户取消指定主题时"
+ search:
+ advanced:
+ in:
+ assigned: "已指定"
+ unassigned: "已被取消指定"
+ assigned:
+ label: "已指定给"
+ topics:
+ bulk:
+ unassign: "取消指定话题"
+ assign: "指定话题"
+ discourse_automation:
+ scriptables:
+ random_assign:
+ fields:
+ post_template:
+ label: 帖子模板
+ description: 填写后,将创建一个使用此模板的帖子,并为其指定一个用户而不是话题。
+ assignees_group:
+ label: 受理人群组
+ minimum_time_between_assignments:
+ label: 两次任务指定之间的最小时数
+ min_recently_assigned_days:
+ label: 最近指定的最小天数
+ description: 默认为 14 天。
+ skip_new_users_for_days:
+ label: 跳过新用户的天数
+ description: 默认设置为 0 天(可以在用户注册后立即向其指定)。
+ max_recently_assigned_days:
+ label: 最近指定的最大天数
+ description: 首先尝试排除在最近 `n` 天内指定的用户。如果不剩任何用户,则回退到 `min_recently_assigned_days`。默认为 180 天。
+ assigned_topic:
+ label: 指定的话题 ID
+ in_working_hours:
+ label: 正在上班的用户
+ notification_reason:
+ user: "由于此话题已被指定给您,您将看到新回复的计数。"
+ notifications:
+ assigned: "<span>%{username}</span> %{description}"
+ popup:
+ assigned: "%{username} 已为您指定"
+ titles:
+ assigned: "已指定"
+ dismiss_confirmation:
+ body:
+ assigns:
+ other: "确定吗?您有 %{count} 个未读指定通知。"
+ user_menu:
+ view_all_assigned: "查看所有指定"
+ tabs:
+ assign_list: "指定列表"
+ assign_list_with_unread:
+ other: "指定列表 - %{count} 个未读指定"
+ edit_assignments_modal:
+ title: "编辑指定"
+ topic: "话题"
+ post: "帖子"
diff --git a/plugins/discourse-assign/config/locales/client.zh_TW.yml b/plugins/discourse-assign/config/locales/client.zh_TW.yml
new file mode 100644
index 00000000000..8ee63022be8
--- /dev/null
+++ b/plugins/discourse-assign/config/locales/client.zh_TW.yml
@@ -0,0 +1,71 @@
+# WARNING: Never edit this file.
+# It will be overwritten when translations are pulled from Crowdin.
+#
+# To work with us on translations, join this project:
+# https://translate.discourse.org/
+
+zh_TW:
+ js:
+ action_codes:
+ assigned: "已指派 %{who} %{when}"
+ assigned_group: "已指派 %{who} %{when}"
+ unassigned: "取消指派 %{who} %{when}"
+ unassigned_group: "取消指派 %{who} %{when}"
+ discourse_assign:
+ cant_act: "您不能對已經指派給其他使用者的旗標做操作"
+ assigned: "已指派"
+ group_everyone: "所有使用者"
+ assigned_to: "已指派給"
+ assigned_to_w_ellipsis: "已指派給..."
+ unassign:
+ title: "取消指派"
+ title_w_ellipsis: "取消指派..."
+ assign:
+ title: "指派"
+ help: "指派主題給使用者"
+ reassign:
+ title: "編輯"
+ topic_level_menu:
+ unassign_with_ellipsis: "取消指派..."
+ assign_modal:
+ title: "指派主題"
+ assign: "指派"
+ optional_label: "(選擇性)"
+ status_label: 狀態
+ claim:
+ title: "認領"
+ help: "指派主題給您自己"
+ assign_mailer:
+ never: "永不"
+ always: "總是"
+ reminders_frequency:
+ never: "永不"
+ daily: "日"
+ weekly: "周"
+ monthly: "月"
+ quarterly: "季度"
+ admin:
+ groups:
+ manage:
+ interaction:
+ assign: "指派"
+ user:
+ notification_level_when_assigned:
+ do_nothing: "不做任何動作"
+ messages:
+ assigned: "已指派"
+ assigned_to_you:
+ post: "分配給您的帖子"
+ assignment_description:
+ topic: "%{topic_title}"
+ search:
+ advanced:
+ assigned:
+ label: "已指派給"
+ notifications:
+ assigned: "<span>%{username}</span> %{description}"
+ titles:
+ assigned: "已指派"
+ edit_assignments_modal:
+ topic: "話題"
+ post: "貼文"
diff --git a/plugins/discourse-assign/config/locales/server.ar.yml b/plugins/discourse-assign/config/locales/server.ar.yml
new file mode 100644
index 00000000000..3e896ba5e1e
--- /dev/null
+++ b/plugins/discourse-assign/config/locales/server.ar.yml
@@ -0,0 +1,101 @@
+# WARNING: Never edit this file.
+# It will be overwritten when translations are pulled from Crowdin.
+#
+# To work with us on translations, join this project:
+# https://translate.discourse.org/
+
+ar:
+ site_settings:
+ assign_enabled: "تفعيل المكوِّن الإضافي للتعيين"
+ assigns_public: "السماح للعامة برؤية تعيينات الموضوعات"
+ assigns_user_url_path: "مسار الموضوعات المعيَّنة إلى المستخدمين (استخدم: {username} لاستبدال اسم المستخدم)"
+ assigns_by_staff_mention: "تعيين الموضوع تلقائيًا إذا أشار أحد أعضاء طاقم العمل إلى عضو آخر في طاقم العمل"
+ unassign_creates_tracking_post: "إنشاء همسة أو إجراء صغير لتتبُّع التغيير إذا ألغيت تعيين موضوع"
+ assign_self_regex: "العبارة النمطية التي يجب تمريرها للتعيين الذاتي. مثال: 'قائمتي'"
+ assign_other_regex: "العبارة النمطية التي يجب تمريرها لتعيين الموضوعات إلى الآخرين من خلال الإشارة. مثال: \"قائمتك\""
+ unassign_on_group_archive: "إلغاء تعيين الرسالة (وإعادة تعيينها إذا عادت إلى صندوق الوارد) عند أرشفة إحدى المجموعات للرسالة"
+ unassign_on_close: "إلغاء تعيين الموضوع عند إغلاقه"
+ reassign_on_open: "إعادة تعيين المستخدمين/المجموعات المعيَّنة مسبقًا عند فتح الموضوع"
+ invite_on_assign: "دعوة المستخدم أو المجموعة إلى الرسالة الشخصية عند تعيينها إليهما، إذا لم يكونا مشاركين فيها بالفعل."
+ assign_mailer: "متى يتم إرسال إشعار بالمهام المعيَّنة عبر البريد الإلكتروني"
+ remind_assigns: "تذكير المستخدمين بالمهام المعيَّنة قيد الانتظار"
+ remind_assigns_frequency: "معدل تكرار تذكير المستخدمين بالموضوعات المعيَّنة"
+ pending_assign_reminder_threshold: "عدد المهام المعيَّنة المعلَّقة التي تؤدي إلى ظهور إشعار تذكير."
+ max_assigned_topics: "أقصى عدد من الموضوعات التي يمكن تعيينها إلى مستخدم"
+ assign_allowed_on_groups: "المجموعات المسموح للمستخدمين فيها بتعيين الموضوعات ويمكن تعيين الموضوعات إليها"
+ enable_assign_status: "أضِف حقل حالة قابل للتخصيص لكل تعيين."
+ assign_statuses: "قائمة الحالات المتاحة لكل تعيين. الحالة الأولى هي الحالة الافتراضية المطبَّقة على كل تعيين جديد."
+ errors:
+ assign_statuses:
+ too_few: "يجب أن تتوفَّر حالتان مختلفتان على الأقل."
+ duplicate: "هناك قيم حالة مكرَّرة."
+ removed_in_use: "لا يمكن إزالة حالة من القائمة إذا كانت هناك تعيينات حالية تستخدم هذه الحالة."
+ discourse_assign:
+ assigned_to: "تم تعيين الموضوع إلى @%{username}"
+ unassigned: "تم إلغاء تعيين الموضوع"
+ already_claimed: "تمت المطالبة بملكية هذا الموضوع بالفعل."
+ already_assigned: "الموضوع معيَّن بالفعل إلى @%{username}"
+ too_many_assigns: "لقد بلغ @%{username} أقصى عدد من الموضوعات المعيَّنة (%{max})."
+ too_many_assigns_for_topic: "تم بلوغ الحد الأقصى لعدد المهام المعيَّنة في الموضوع والبالغ %{limit}."
+ forbidden_assign_to: "لا يمكن تعيين @%{username} لأنه لا ينتمي إلى المجموعات المسموح بها المعيَّنة."
+ forbidden_assignee_not_pm_participant: "لا يمكن تعيين @%{username} لأنه لا يملك إذن الوصول إلى هذه الرسالة الخاصة. يمكنك منح @%{username} إذن الوصول من خلال دعوته إلى هذه الرسالة الخاصة."
+ forbidden_assignee_cant_see_topic: "لا يمكن تعيين @%{username} لأنه لا يملك إذن الوصول إلى هذا الموضوع."
+ group_already_assigned: "الموضوع معيَّن بالفعل إلى @%{group}"
+ forbidden_group_assign_to: "لا يمكن تعيين @%{group} لأنه لا ينتمي إلى المجموعات المسموح بها المعيَّنة."
+ forbidden_group_assignee_not_pm_participant: "لا يمكن تعيين @%{group} لأن بعض أعضائها لا يملكون إذن الوصول إلى هذه الرسالة الخاصة."
+ forbidden_group_assignee_cant_see_topic: "لا يمكن تعيين @%{group} لأن بعض أعضائها لا يملكون إذن الوصول إلى هذا الموضوع."
+ flag_assigned: "عذرًا، موضوع هذا البلاغ معيَّن إلى مستخدم آخر"
+ flag_unclaimed: "يجب عليك المطالبة بملكية هذا الموضوع قبل اتخاذ إجراء بشأن البلاغ"
+ topic_assigned_excerpt: "عيَّن الموضوع \"%{title}\" إليك"
+ topic_group_assigned_excerpt: "تم تعيين الموضوع '%{title}' إلى المجموعة @%{group}"
+ reminders_frequency:
+ never: "أبدًا"
+ daily: "يوميًا"
+ weekly: "أسبوعيًا"
+ monthly: "شهريًا"
+ quarterly: "ربع سنوي"
+ assign_mailer:
+ title: "تعيين مرسل البريد"
+ subject_template: "عيَّن [%{email_prefix}] %{assignee_name} الموضوع \"%{topic_title}\" إليك!"
+ text_body_template: |
+ مرحبًا، **عيَّن** %{assignee_name} مناقشةً إليك
+ > **%{topic_title}**
+ >
+ > %{topic_excerpt}
+
+ إذا كنت مهتمًا، فانقر على الرابط أدناه:
+ [%{topic_link}](%{topic_link})
+ pending_assigns_reminder:
+ title: "لديك %{pending_assignments} من المهام المعيَّنة قيد الانتظار"
+ body: |
+ لديك حاليًا [%{pending_assignments} من المهام المعيَّنة قيد الانتظار](%{assignments_link}).
+
+ %{newest_assignments}
+ %{oldest_assignments}
+
+ سيتم إرسال هذا التذكير %{frequency} إذا كان لديك أكثر من موضوع واحد معيَّن.
+ newest: |
+ ### الأحدث
+ %{topic_0}
+ %{topic_1}
+ %{topic_2}
+ oldest: |
+ ### الأقدم
+ %{topic_0}
+ %{topic_1}
+ %{topic_2}
+ discourse_automation:
+ scriptables:
+ random_assign:
+ title: تعيين عشوائي
+ no_one: "تمت محاولة تعيين عضو من المجموعة @%{group} عشوائيًا، ولكن لم يكن هناك أي عضو متاح."
+ discourse_push_notifications:
+ popup:
+ assigned: "عيَّنك @%{username}"
+ activerecord:
+ errors:
+ models:
+ assignment:
+ attributes:
+ status:
+ invalid: "الحالة المحدَّدة غير صالحة (لم يتم تضمينها في إعداد الموقع assigned_status)."
diff --git a/plugins/discourse-assign/config/locales/server.be.yml b/plugins/discourse-assign/config/locales/server.be.yml
new file mode 100644
index 00000000000..47faebfcaa6
--- /dev/null
+++ b/plugins/discourse-assign/config/locales/server.be.yml
@@ -0,0 +1,48 @@
+# WARNING: Never edit this file.
+# It will be overwritten when translations are pulled from Crowdin.
+#
+# To work with us on translations, join this project:
+# https://translate.discourse.org/
+
+be:
+ site_settings:
+ assign_enabled: "Ўключэнне прысвойце убудова"
+ assigns_public: "Дазволіць шырокую грамадскасць, каб убачыць тэму прызначэння"
+ assigns_user_url_path: "Шлях да карыстальнікаў прысвойваюцца тэмы (выкарыстанне: {імя карыстальніка} падставіць імя карыстальніка)"
+ assigns_by_staff_mention: "Калі супрацоўнік згадвае іншы супрацоўнік, тэма аўтаматычна прызначаюцца"
+ unassign_creates_tracking_post: "Калі адмяніць прызначэнне тэмы шэпту ці невялікае дзеянне будзе створана, каб адсочваць змены"
+ assign_self_regex: "Regex, які павінен прайсці для самастойнага правапераемніка. Прыклад «мой спіс»"
+ assign_other_regex: "Regex, які неабходна перадаць для прызначэння тым, каб іншыя з дапамогай згадкі. Прыклад «ваш спіс»."
+ unassign_on_group_archive: "Калі паведамленне архівуецца групай, прызначыць паведамленне (прызначыць пры перамяшчэнні назад у паштовую скрыню)"
+ unassign_on_close: "Калі тэма зачынена тэма адмяніць прызначэнне"
+ remind_assigns: "Нагадваць карыстальнікам аб незавершаных правапераемнікаў."
+ remind_assigns_frequency: "Частата для напамінку карыстальнікаў пра прызначаныя тэмах."
+ max_assigned_topics: "Максімальную колькасць тэм, якія могуць быць прызначаныя карыстальнікам."
+ discourse_assign:
+ assigned_to: "Тэма прысвоены @% {імя карыстальніка}"
+ unassigned: "Тэма была Unassigned"
+ already_claimed: "Гэтая тэма ўжо запатрабаваная."
+ already_assigned: "Тэма ўжо прызначана на @% {імя карыстальніка}"
+ too_many_assigns: "@% {Імя карыстальніка} ужо дасягнута максімальная колькасць прысвоеных тэм (% {макс})."
+ flag_assigned: "На жаль, тэма гэтага сцяга прысвойваецца іншаму карыстальніку"
+ flag_unclaimed: "Вы павінны сцвярджаць, што тэма, перш чым дзейнічаць на сцягу"
+ topic_assigned_excerpt: "прызначаны вам тэму «% {назву}»"
+ reminders_frequency:
+ never: "ніколі"
+ daily: "штодня"
+ weekly: "штотыдзень"
+ monthly: "штомесяц"
+ quarterly: "квартальны"
+ assign_mailer:
+ title: "прызначаюць Mailer"
+ subject_template: "[% {Email_prefix}] {% assignee_name} прысвойваецца вам '% {TOPIC_TITLE}'!"
+ text_body_template: |
+ Эй,% {assignee_name} ** ** Вы прызначаныя на абмеркаванне> **% {TOPIC_TITLE} **>>% {Topic_excerpt}Калі вы зацікаўлены, націсніце на спасылку ніжэй:[% {Topic_link}] (% {topic_link})
+ pending_assigns_reminder:
+ title: "У вас ёсць% {pending_assignments} адкладзеныя заданні"
+ body: |
+ У вас [% {} pending_assignments адкладзеных заданняў] (% {assignments_link}).% {Newest_assignments}% {Oldest_assignments}Гэта напамін будзе адпраўлена% {частоты}, калі ў вас ёсць больш чым адзін прызначаная тэма.
+ newest: |
+ ### Новыя% {Topic_0}% {TOPIC_1}% {Topic_2}
+ oldest: |
+ ### Старыя% {Topic_0}% {TOPIC_1}% {Topic_2}
diff --git a/plugins/discourse-assign/config/locales/server.bg.yml b/plugins/discourse-assign/config/locales/server.bg.yml
new file mode 100644
index 00000000000..47ca3112e6e
--- /dev/null
+++ b/plugins/discourse-assign/config/locales/server.bg.yml
@@ -0,0 +1,14 @@
+# WARNING: Never edit this file.
+# It will be overwritten when translations are pulled from Crowdin.
+#
+# To work with us on translations, join this project:
+# https://translate.discourse.org/
+
+bg:
+ discourse_assign:
+ reminders_frequency:
+ never: "никога"
+ daily: "дневно"
+ weekly: "седмично"
+ monthly: "месечно"
+ quarterly: "тримесечно"
diff --git a/plugins/discourse-assign/config/locales/server.bs_BA.yml b/plugins/discourse-assign/config/locales/server.bs_BA.yml
new file mode 100644
index 00000000000..73b6b8e6ada
--- /dev/null
+++ b/plugins/discourse-assign/config/locales/server.bs_BA.yml
@@ -0,0 +1,24 @@
+# WARNING: Never edit this file.
+# It will be overwritten when translations are pulled from Crowdin.
+#
+# To work with us on translations, join this project:
+# https://translate.discourse.org/
+
+bs_BA:
+ site_settings:
+ assign_enabled: "Omogućite dodavanje dodatka"
+ assigns_public: "Omogući široj javnosti da vidi zadatke tema"
+ assigns_user_url_path: "Put do dodijeljenih tema korisnicima (koristite: {username} za zamjensko korisničko ime)"
+ assigns_by_staff_mention: "Ako član osoblja spomene drugog člana osoblja, tema se automatski dodjeljuje"
+ unassign_creates_tracking_post: "Ako odustanete od teme, kreirat će se šapat ili mala akcija za praćenje promjena"
+ assign_self_regex: "Regex koji treba da prođe za samostalno dodeljivanje. Primjer &quot;moja lista&quot;"
+ assign_other_regex: "Regex koji treba da prođe za dodeljivanje tema drugima putem spomena. Primjer &#39;vaša lista&#39;."
+ unassign_on_group_archive: "Kada se poruka arhivira od strane grupe, opozovite poruku (ponovno dodijelite ako se vratite u mapu s pristiglom poštom)"
+ unassign_on_close: "Kada je tema zatvorena, ne dodijeli temu"
+ discourse_assign:
+ reminders_frequency:
+ never: "nikad"
+ daily: "dnevno"
+ weekly: "sedmično"
+ monthly: "mesečno"
+ quarterly: "kvartalno"
diff --git a/plugins/discourse-assign/config/locales/server.ca.yml b/plugins/discourse-assign/config/locales/server.ca.yml
new file mode 100644
index 00000000000..c8bd89d2486
--- /dev/null
+++ b/plugins/discourse-assign/config/locales/server.ca.yml
@@ -0,0 +1,66 @@
+# WARNING: Never edit this file.
+# It will be overwritten when translations are pulled from Crowdin.
+#
+# To work with us on translations, join this project:
+# https://translate.discourse.org/
+
+ca:
+ site_settings:
+ assign_enabled: "Habilita el connector d'assignació"
+ assigns_public: "Permet al públic en general veure les assignacions de tema"
+ assigns_user_url_path: "Camí als temes assignats als usuaris (utilitzeu: {username} per a substituir el nom d'usuari)"
+ assigns_by_staff_mention: "Si un membre de l'equip responsable menciona un altre membre de l'equip responsable, se li assignarà automàticament el tema."
+ unassign_creates_tracking_post: "Si desassigneu un tema, es crearà un xiuxiueig o una petita acció per a fer un seguiment del canvi."
+ assign_self_regex: "Expressió regular que ha de complir-se per a l'autoassignació. Exemple: &quot;la meva llista&quot;"
+ assign_other_regex: "Expressió regular que ha de complir-se per a assignar temes a altres persones mitjançant menció. Exemple: 'la vostra llista'."
+ unassign_on_group_archive: "Quan un missatge és arxivat per un grup, desassigna el missatge (reassigna'l si és mogut de nou a la safata d'entrada)."
+ unassign_on_close: "Quan es tanca un tema, desassigna el tema."
+ remind_assigns: "Recorda als usuaris les assignacions pendents."
+ remind_assigns_frequency: "Freqüència per a fer memòria als usuaris sobre temes assignats."
+ max_assigned_topics: "Nombre màxim de temes que es poden assignar a un usuari."
+ discourse_assign:
+ assigned_to: "Tema assignat a @%{username}"
+ unassigned: "El tema no estava assignat"
+ already_claimed: "El tema ja ha estat reclamat."
+ already_assigned: "El tema ja és assignat a @%{username}"
+ too_many_assigns: "@%{username} ja ha assolit el nombre màxim de temes assignats (%{max})."
+ group_already_assigned: "El tema ja és assignat a @%{group}"
+ flag_assigned: "Ho sentim, el tema d'aquesta bandera és assignat a un altre usuari."
+ flag_unclaimed: "Cal reclamar el tema abans d'actuar sobre la bandera"
+ topic_assigned_excerpt: "us ha assignat el tema '%{title}'"
+ reminders_frequency:
+ never: "mai"
+ daily: "diari"
+ weekly: "setmanal"
+ monthly: "mensual"
+ quarterly: "trimestral"
+ assign_mailer:
+ title: "Assignació"
+ subject_template: "[%{email_prefix}] %{assignee_name} us ha assignat a '%{topic_title}'."
+ text_body_template: |
+ Ei, %{assignee_name} us ha **assignat** a una discussió
+ > ** %{topic_title} **
+ >
+ > %{topic_excerpt}
+
+ Si hi esteu interessat, feu clic en l'enllaç següent:
+ [%{topic_link}] (%{topic_link})
+ pending_assigns_reminder:
+ title: "Teniu %{pending_assignments} assignacions pendents"
+ body: |
+ Actualment teniu [%{pending_assignments} assignacions pendents](%{assignments_link}).
+
+ %{newest_assignments}
+ %{oldest_assignments}
+
+ Aquest recordatori s'enviarà %{frequency} si teniu més d'un tema assignat.
+ newest: |
+ ### Més nous
+ %{topic_0}
+ %{topic_1}
+ %{topic_2}
+ oldest: |
+ ### Més antics
+ %{topic_0}
+ %{topic_1}
+ %{topic_2}
diff --git a/plugins/discourse-assign/config/locales/server.cs.yml b/plugins/discourse-assign/config/locales/server.cs.yml
new file mode 100644
index 00000000000..c03c98bbb92
--- /dev/null
+++ b/plugins/discourse-assign/config/locales/server.cs.yml
@@ -0,0 +1,101 @@
+# WARNING: Never edit this file.
+# It will be overwritten when translations are pulled from Crowdin.
+#
+# To work with us on translations, join this project:
+# https://translate.discourse.org/
+
+cs:
+ site_settings:
+ assign_enabled: "Povolit plugin Assign (přidělování)"
+ assigns_public: "Umožněte veřejné zobrazení přidělených témat"
+ assigns_user_url_path: "Cesta k tématům přiřazeným uživatelům (použijte: {username} jako náhradu uživatelského jména)"
+ assigns_by_staff_mention: "Pokud člen redakce zmíní jiného člena redakce, téma se automaticky přidělí"
+ unassign_creates_tracking_post: "Pokud zrušíte přidělení tématu, zaznamená se z důvodu sledování změn malá aktivita"
+ assign_self_regex: "Regulární výraz, který musí vyhovět pro přidělení sobě. Příklad 'můj seznam'"
+ assign_other_regex: "Regulární výraz, který musí vyhovět pro přidělení ostatním pomocí zmínky. Příklad 'váš seznam'"
+ unassign_on_group_archive: "Pokud je zpráva archivována skupinou, zrušit přidělení zprávy (znovu přidělit, pokud je přesunuta zpět do složky Doručené)"
+ unassign_on_close: "Zrušit přidělení, když je téma uzavřeno"
+ reassign_on_open: "Při otevření tématu znovu přidělit dříve přidělené uživatele/skupiny."
+ invite_on_assign: "Pokud je uživateli nebo skupině přiřazena osobní zpráva, pozvěte je na soukromé zprávy, pokud ještě nejsou účastníky."
+ assign_mailer: "Kdy odeslat e-mail s upozorněním na úkoly"
+ remind_assigns: "Připomenout uživatelům nevyřízené úkoly."
+ remind_assigns_frequency: "Frekvence připomínání přidělených témat uživatelům."
+ pending_assign_reminder_threshold: "Počet nevyřízených úkolů, které spustí upozornění na připomenutí."
+ max_assigned_topics: "Maximální počet témat, která lze uživateli přidělit."
+ assign_allowed_on_groups: "Uživatelé v těchto skupinách mohou přidělovat témata a mohou jim být témata přidělována."
+ enable_assign_status: "Ke každému úkolu přidat přizpůsobitelné stavové pole."
+ assign_statuses: "Seznam stavů dostupných pro každý úkol. První stav je výchozí stav použitý pro každé nové přidělení."
+ errors:
+ assign_statuses:
+ too_few: "Musí být k dispozici alespoň dva různé stavy."
+ duplicate: "Existují duplicitní hodnoty stavu."
+ removed_in_use: "Nelze odebrat stav ze seznamu, pokud existují přidělení používající tento stav."
+ discourse_assign:
+ assigned_to: "Téma přiděleno uživateli @%{username}"
+ unassigned: "Přidělení tématu bylo odstraněno"
+ already_claimed: "Toto téma již bylo nárokováno."
+ already_assigned: "Téma je již přiděleno uživateli @%{username}"
+ too_many_assigns: "@%{username} již dosáhl/a maximálního počtu přidělených témat (%{max})."
+ too_many_assigns_for_topic: "Bylo dosaženo limitu %{limit} úkolů na téma."
+ forbidden_assign_to: "@%{username} nelze přidělit, protože nepatří do skupin, které mají povoleno přidělování."
+ forbidden_assignee_not_pm_participant: "@%{username} nelze přidělit, protože nemá přístup k této konverzaci. Uživateli @%{username} můžete udělit přístup tím, že je pozvete do této soukromé konverzace."
+ forbidden_assignee_cant_see_topic: "@%{username} nelze přidělit, protože k tomuto tématu nemá přístup."
+ group_already_assigned: "Téma je již přiděleno skupině @%{group}"
+ forbidden_group_assign_to: "@%{group} nelze přidělit, protože nepatří do skupin, které mají povoleno přidělování."
+ forbidden_group_assignee_not_pm_participant: "@%{group} nelze přidělit, protože ne všichni členové mají přístup k této soukromé konverzaci."
+ forbidden_group_assignee_cant_see_topic: "@%{group} nelze přidělit, protože ne všichni členové mají přístup k tomuto tématu."
+ flag_assigned: "Omlouváme se, toto nahlášené téma je přiděleno jinému uživateli"
+ flag_unclaimed: "Než začnete reagovat na nahlášení, musíte si toto téma nárokovat"
+ topic_assigned_excerpt: "vám přidělil/a téma '%{title}'"
+ topic_group_assigned_excerpt: "přidělil/a téma '%{title}' skupině @%{group}"
+ reminders_frequency:
+ never: "nikdy"
+ daily: "denně"
+ weekly: "týdně"
+ monthly: "měsíčně"
+ quarterly: "čtvrtletně"
+ assign_mailer:
+ title: "Assign Mailer"
+ subject_template: "[%{email_prefix}] %{assignee_name} vám přidělil/a '%{topic_title}'!"
+ text_body_template: |
+ Ahoj, %{assignee_name} ti **přidělil/a** diskusi
+ > **%{topic_title}**
+ >
+ > %{topic_excerpt}
+
+ Pokud máš zájem, klikni na níže uvedený odkaz:
+ [%{topic_link}](%{topic_link})
+ pending_assigns_reminder:
+ title: "Máte %{pending_assignments} nevyřízených úkolů"
+ body: |
+ Aktuálně máte [%{pending_assignments} nevyřízených úkolů](%{assignments_link}).
+
+ %{newest_assignments}
+ %{oldest_assignments}
+
+ Toto připomenutí bude odesláno %{frequency} , pokud máte více než jedno přiřazené téma.
+ newest: |
+ ### Nejnovější
+ %{topic_0}
+ %{topic_1}
+ %{topic_2}
+ oldest: |
+ ### Nejstarší
+ %{topic_0}
+ %{topic_1}
+ %{topic_2}
+ discourse_automation:
+ scriptables:
+ random_assign:
+ title: Náhodné přidělení
+ no_one: "Pokusili jsme se náhodně přiřadit člena `@%{group}`, ale nikdo nebyl dostupný."
+ discourse_push_notifications:
+ popup:
+ assigned: "@%{username} vás přidělil"
+ activerecord:
+ errors:
+ models:
+ assignment:
+ attributes:
+ status:
+ invalid: "Vybraný stav je neplatný (není zahrnut v nastavení assigned_status)."
diff --git a/plugins/discourse-assign/config/locales/server.da.yml b/plugins/discourse-assign/config/locales/server.da.yml
new file mode 100644
index 00000000000..aa0c47bbf46
--- /dev/null
+++ b/plugins/discourse-assign/config/locales/server.da.yml
@@ -0,0 +1,57 @@
+# WARNING: Never edit this file.
+# It will be overwritten when translations are pulled from Crowdin.
+#
+# To work with us on translations, join this project:
+# https://translate.discourse.org/
+
+da:
+ site_settings:
+ assign_enabled: "Aktiver tildelings udvidelse"
+ assigns_public: "Tillad offentligheden at se emnetildelinger"
+ assigns_user_url_path: "Sti til brugerens tildelte emner (brug: {username} til at erstatte brugernavnet)"
+ assigns_by_staff_mention: "Hvis en medarbejder nævner en anden medarbejder, tildeles emnet automatisk"
+ unassign_creates_tracking_post: "Hvis du fjerner tildelingen af et emne, oprettes der en hvisken eller en lille handling for at spore ændringer"
+ assign_self_regex: "Regex, der skal bestå for selvtildeling. Eksempel 'min liste'"
+ assign_other_regex: "Regex, der skal bestå for at tildele emner til andre via omtale. Eksempel 'din liste'."
+ discourse_assign:
+ assigned_to: "Emne tildelt til @%{username}"
+ unassigned: "Emne blev fradelt"
+ already_claimed: "Det emne er allerede blevet hævdet."
+ already_assigned: "Emnet er allerede tildelt @%{username}"
+ too_many_assigns: "@%{username} har allerede nået det maksimale antal tildelte emner (%{max})."
+ forbidden_assign_to: "@%{username} kan ikke tildeles, da de ikke tilhører tildelte tilladte grupper."
+ forbidden_assignee_not_pm_participant: "@%{username} kan ikke tildeles, fordi de ikke har adgang til denne PM. Du kan give @%{username} adgang ved at invitere dem til denne PM."
+ forbidden_assignee_cant_see_topic: "@%{username} kan ikke tildeles, fordi der ikke har adgang til dette emne."
+ group_already_assigned: "Emnet er allerede tildelt @%{group}"
+ forbidden_group_assign_to: "@%{group} kan ikke tildeles, da de ikke tilhører tildelte tilladte grupper."
+ flag_assigned: "Beklager, dette flag er tildelt til en anden bruger"
+ flag_unclaimed: "Du skal gøre krav på emnet, før du handler på markeringsflaget"
+ topic_assigned_excerpt: "tildelte dig emnet '%{title}“"
+ reminders_frequency:
+ never: "aldrig"
+ daily: "dagligt"
+ weekly: "ugenligt"
+ monthly: "Månedligt"
+ quarterly: "kvartalvis"
+ assign_mailer:
+ title: "Tildel Mailer"
+ subject_template: "[%{email_prefix}] %{assignee_name} tildelte dig til '%{topic_title}'!"
+ text_body_template: |
+ Hej, %{assignee_name} **tildelte** dig til en diskussion
+ > **%{topic_title}**
+ >
+ > %{topic_excerpt}
+
+ Hvis du er interesseret, skal du klikke på nedenstående link:
+ [%{topic_link}] (%{topic_link})
+ pending_assigns_reminder:
+ newest: |
+ ### Nyeste
+ %{topic_0}
+ %{topic_1}
+ %{topic_2}
+ oldest: |
+ ### Ældste
+ %{topic_0}
+ %{topic_1}
+ %{topic_2}
diff --git a/plugins/discourse-assign/config/locales/server.de.yml b/plugins/discourse-assign/config/locales/server.de.yml
new file mode 100644
index 00000000000..a3170365a93
--- /dev/null
+++ b/plugins/discourse-assign/config/locales/server.de.yml
@@ -0,0 +1,101 @@
+# WARNING: Never edit this file.
+# It will be overwritten when translations are pulled from Crowdin.
+#
+# To work with us on translations, join this project:
+# https://translate.discourse.org/
+
+de:
+ site_settings:
+ assign_enabled: "Zuordnungs-Plug-in aktivieren"
+ assigns_public: "Zuordnung von Themen öffentlich sichtbar machen"
+ assigns_user_url_path: "Pfad zu Themen, die einem Benutzer zugeordnet sind (verwende {username}, um den Benutzernamen zu ersetzen)"
+ assigns_by_staff_mention: "Wenn ein Team-Mitglied ein anderes Team-Mitglied erwähnt, wird das Thema automatisch zugeordnet"
+ unassign_creates_tracking_post: "Wenn die Zuordnung aufgehoben wird, zur Nachvollziehbarkeit einen geflüsterten Beitrag oder eine Aktion erstellen"
+ assign_self_regex: "Regulärer Ausdruck, der erfüllt sein muss, um sich einem Thema selbst zuzuordnen. Beispiel: „meine Liste“"
+ assign_other_regex: "Regulärer Ausdruck, der erfüllt sein muss, um ein Thema jemand anderem per Erwähnung zuzuordnen. Beispiel: „deine Liste“"
+ unassign_on_group_archive: "Zuordnung aufheben, wenn eine Nachricht von einer Gruppe archiviert wurde (neu zuordnen, wenn sie wieder in den Posteingang verschoben wird)"
+ unassign_on_close: "Zuordnung aufheben, wenn ein Thema geschlossen wird"
+ reassign_on_open: "Wenn ein Thema eröffnet wird, ordne zuvor zugeordnete Benutzer/Gruppen neu zu"
+ invite_on_assign: "Wenn eine persönliche Nachricht einem Benutzer oder einer Gruppe zugeordnet wird, lade ihn/sie zu der PN ein, wenn er/sie nicht bereits Teilnehmer ist."
+ assign_mailer: "Wann für Zuordnungen Benachrichtigungs-E-Mails gesendet werden"
+ remind_assigns: "Benutzer an ausstehende Zuordnungen erinnern."
+ remind_assigns_frequency: "Häufigkeit, mit der Benutzer an zugeordnete Themen erinnert werden."
+ pending_assign_reminder_threshold: "Anzahl ausstehender Zuweisungen zum Auslösen einer Erinnerungsbenachrichtigung."
+ max_assigned_topics: "Maximale Anzahl an Themen, die einem Benutzer zugeordnet werden können."
+ assign_allowed_on_groups: "Benutzer in diesen Gruppen dürfen Themen zuordnen und können Themen zugeordnet werden."
+ enable_assign_status: "Füge zu jeder Zuordnung ein anpassbares Statusfeld hinzu."
+ assign_statuses: "Liste der Status, die für jede Zuordnung verfügbar sind. Der erste Status ist der Standardstatus, der für jede neue Zuordnung verwendet wird."
+ errors:
+ assign_statuses:
+ too_few: "Es müssen mindestens zwei verschiedene Status verfügbar sein."
+ duplicate: "Es gibt doppelte Statuswerte."
+ removed_in_use: "Ein Status kann nicht aus der Liste entfernt werden, wenn es bereits Zuordnungen mit diesem Status gibt."
+ discourse_assign:
+ assigned_to: "Thema zugeordnet zu @%{username}"
+ unassigned: "Zuordnung zum Thema wurde aufgehoben"
+ already_claimed: "Dieses Thema wurde bereits übernommen."
+ already_assigned: "Thema ist bereits @%{username} zugeordnet"
+ too_many_assigns: "@%{username} hat bereits die maximale Anzahl der zugeordneten Themen erreicht (%{max})."
+ too_many_assigns_for_topic: "Das Limit von %{limit} Zuordnungen pro Thema wurde erreicht."
+ forbidden_assign_to: "@%{username} kann nicht zugeordnet werden, da die Person nicht zu den zugeordneten zulässigen Gruppen gehört."
+ forbidden_assignee_not_pm_participant: "@%{username} kann nicht zugeordnet werden, da die Person keinen Zugriff auf diese PN hat. Du kannst @%{username} Zugriff gewähren, indem du die Person zu dieser PN einlädst."
+ forbidden_assignee_cant_see_topic: "@%{username} kann nicht zugeordnet werden, da die Person keinen Zugriff auf dieses Thema hat."
+ group_already_assigned: "Thema ist bereits @%{group} zugeordnet"
+ forbidden_group_assign_to: "@%{group} kann nicht zugeordnet werden, da die Gruppe nicht zu den zugeordneten zulässigen Gruppen gehört."
+ forbidden_group_assignee_not_pm_participant: "@%{group} kann nicht zugeordnet werden, da nicht alle Mitglieder Zugriff auf diese PN haben."
+ forbidden_group_assignee_cant_see_topic: "@%{group} kann nicht zugeordnet werden, da nicht alle Mitglieder Zugriff auf dieses Thema haben."
+ flag_assigned: "Entschuldige, das Thema dieser Meldung ist einem anderen Benutzer zugeordnet"
+ flag_unclaimed: "Du musst dieses Thema übernehmen, bevor du die Meldung behandeln kannst"
+ topic_assigned_excerpt: "hat dir das Thema „%{title}“ zugeordnet"
+ topic_group_assigned_excerpt: "hat das Thema „%{title}“ @%{group} zugeordnet"
+ reminders_frequency:
+ never: "nie"
+ daily: "täglich"
+ weekly: "wöchentlich"
+ monthly: "monatlich"
+ quarterly: "vierteljährlich"
+ assign_mailer:
+ title: "Mailer zuordnen"
+ subject_template: "[%{email_prefix}] %{assignee_name} hat dir „%{topic_title}“ zugeordnet!"
+ text_body_template: |
+ Hey, %{assignee_name} hat dich einer Diskussion **zugeordnet**
+ > **%{topic_title}**
+ >
+ > %{topic_excerpt}
+
+ Wenn dich das interessiert, klicke auf den folgenden Link:
+ [%{topic_link}](%{topic_link})
+ pending_assigns_reminder:
+ title: "Du hast %{pending_assignments} ausstehende Zuordnungen"
+ body: |
+ Du hast aktuell [%{pending_assignments} ausstehende Zuordnungen](%{assignments_link}).
+
+ %{newest_assignments}
+ %{oldest_assignments}
+
+ Diese Erinnerung wird %{frequency} zugesandt, wenn du mehr als ein zugeordnetes Thema hast.
+ newest: |
+ ### Neuestes
+ %{topic_0}
+ %{topic_1}
+ %{topic_2}
+ oldest: |
+ ### Ältestes
+ %{topic_0}
+ %{topic_1}
+ %{topic_2}
+ discourse_automation:
+ scriptables:
+ random_assign:
+ title: Zufällig zuordnen
+ no_one: "Es wurde versucht, ein Mitglied von `@%{group}` zufällig zuzuordnen, aber es war niemand verfügbar."
+ discourse_push_notifications:
+ popup:
+ assigned: "@%{username} hat dich zugeordnet"
+ activerecord:
+ errors:
+ models:
+ assignment:
+ attributes:
+ status:
+ invalid: "Der ausgewählte Status ist ungültig (er ist nicht in der Website-Einstellung assigned_status enthalten)."
diff --git a/plugins/discourse-assign/config/locales/server.el.yml b/plugins/discourse-assign/config/locales/server.el.yml
new file mode 100644
index 00000000000..d59f05ba15a
--- /dev/null
+++ b/plugins/discourse-assign/config/locales/server.el.yml
@@ -0,0 +1,14 @@
+# WARNING: Never edit this file.
+# It will be overwritten when translations are pulled from Crowdin.
+#
+# To work with us on translations, join this project:
+# https://translate.discourse.org/
+
+el:
+ discourse_assign:
+ reminders_frequency:
+ never: "ποτέ"
+ daily: "καθημερινά"
+ weekly: "κάθε εβδομάδα"
+ monthly: "μηνιαίες"
+ quarterly: "τριμηνιαία"
diff --git a/plugins/discourse-assign/config/locales/server.en.yml b/plugins/discourse-assign/config/locales/server.en.yml
new file mode 100644
index 00000000000..166cf527586
--- /dev/null
+++ b/plugins/discourse-assign/config/locales/server.en.yml
@@ -0,0 +1,95 @@
+en:
+ site_settings:
+ assign_enabled: "Enable the assign plugin"
+ assigns_public: "Allow general public to see topic assignments"
+ assigns_user_url_path: "Path to users assigned topics (use: {username} to substitute username)"
+ assigns_by_staff_mention: "If a staff member mentions another staff member, topic is automatically assigned"
+ unassign_creates_tracking_post: "If you unassign a topic a whisper or small action will be created to track change"
+ assign_self_regex: "Regex that needs to pass for self assign. Example 'my list'"
+ assign_other_regex: "Regex that needs to pass for assigning topics to others via mention. Example 'your list'."
+ unassign_on_group_archive: "When a message is archived by a group, unassign message (reassign if moved back to inbox)"
+ unassign_on_close: "When a topic is closed unassign topic"
+ reassign_on_open: "When a topic is opened reassign previously assigned users/groups"
+ invite_on_assign: "When a personal message is assigned to a user or group, invite them to the PM if they are not already a participant."
+ assign_mailer: "When to send notification email for assignments"
+ remind_assigns: "Remind users about pending assigns."
+ remind_assigns_frequency: "Frequency for reminding users about assigned topics."
+ pending_assign_reminder_threshold: "Number of pending assignments that triggers a reminder notification."
+ max_assigned_topics: "Maximum number of topics that can be assigned to a user."
+ assign_allowed_on_groups: "Users in these groups are allowed to assign topics and can be assigned topics."
+ enable_assign_status: "Add a customizable status field to every assignment."
+ assign_statuses: "List of statuses available to each assignment. The first status is the default status applied to every new assignment."
+ errors:
+ assign_statuses:
+ too_few: "There must be at least two different statuses available."
+ duplicate: "There are duplicate status values."
+ removed_in_use: "Can't remove a status from the list if there are existing assignments using this status."
+ discourse_assign:
+ assigned_to: "Topic assigned to @%{username}"
+ unassigned: "Topic was unassigned"
+ already_claimed: "That topic has already been claimed."
+ already_assigned: "Topic is already assigned to @%{username}"
+ too_many_assigns: "@%{username} has already reached the maximum number of assigned topics (%{max})."
+ too_many_assigns_for_topic: "Limit of %{limit} assignments per topic has been reached."
+ forbidden_assign_to: "@%{username} can't be assigned since they don't belong to assigned allowed groups."
+ forbidden_assignee_not_pm_participant: "@%{username} can't be assigned because they don't have access to this PM. You can grant @%{username} access by inviting them to this PM."
+ forbidden_assignee_cant_see_topic: "@%{username} can't be assigned because they don't have access to this topic."
+ group_already_assigned: "Topic is already assigned to @%{group}"
+ forbidden_group_assign_to: "@%{group} can't be assigned since they don't belong to assigned allowed groups."
+ forbidden_group_assignee_not_pm_participant: "@%{group} can't be assigned because not all members have access to this PM."
+ forbidden_group_assignee_cant_see_topic: "@%{group} can't be assigned because not all members have access to this topic."
+ flag_assigned: "Sorry, that flag's topic is assigned to another user"
+ flag_unclaimed: "You must claim that topic before acting on the flag"
+ topic_assigned_excerpt: "assigned you the topic '%{title}'"
+ topic_group_assigned_excerpt: "assigned the topic '%{title}' to @%{group}"
+ reminders_frequency:
+ never: "never"
+ daily: "daily"
+ weekly: "weekly"
+ monthly: "monthly"
+ quarterly: "quarterly"
+ assign_mailer:
+ title: "Assign Mailer"
+ subject_template: "[%{email_prefix}] %{assignee_name} assigned you to '%{topic_title}'!"
+ text_body_template: |
+ Hey, %{assignee_name} **assigned** you to a discussion
+ > **%{topic_title}**
+ >
+ > %{topic_excerpt}
+
+ If you're interested, click the link below:
+ [%{topic_link}](%{topic_link})
+ pending_assigns_reminder:
+ title: "You have %{pending_assignments} pending assignments"
+ body: |
+ You currently have [%{pending_assignments} pending assignments](%{assignments_link}).
+
+ %{newest_assignments}
+ %{oldest_assignments}
+
+ This reminder will be sent %{frequency} if you have more than one assigned topic.
+ newest: |
+ ### Newest
+ %{topic_0}
+ %{topic_1}
+ %{topic_2}
+ oldest: |
+ ### Oldest
+ %{topic_0}
+ %{topic_1}
+ %{topic_2}
+ discourse_automation:
+ scriptables:
+ random_assign:
+ title: Random assign
+ no_one: "Attempted randomly assign a member of `@%{group}`, but no one was available."
+ discourse_push_notifications:
+ popup:
+ assigned: "@%{username} assigned you"
+ activerecord:
+ errors:
+ models:
+ assignment:
+ attributes:
+ status:
+ invalid: "Selected status is invalid (it is not included in the assigned_status site setting)."
diff --git a/plugins/discourse-assign/config/locales/server.en_GB.yml b/plugins/discourse-assign/config/locales/server.en_GB.yml
new file mode 100644
index 00000000000..2d4fa180ec7
--- /dev/null
+++ b/plugins/discourse-assign/config/locales/server.en_GB.yml
@@ -0,0 +1,7 @@
+# WARNING: Never edit this file.
+# It will be overwritten when translations are pulled from Crowdin.
+#
+# To work with us on translations, join this project:
+# https://translate.discourse.org/
+
+en_GB:
diff --git a/plugins/discourse-assign/config/locales/server.es.yml b/plugins/discourse-assign/config/locales/server.es.yml
new file mode 100644
index 00000000000..90398fe83a7
--- /dev/null
+++ b/plugins/discourse-assign/config/locales/server.es.yml
@@ -0,0 +1,101 @@
+# WARNING: Never edit this file.
+# It will be overwritten when translations are pulled from Crowdin.
+#
+# To work with us on translations, join this project:
+# https://translate.discourse.org/
+
+es:
+ site_settings:
+ assign_enabled: "Habilitar el complemento de asignación"
+ assigns_public: "Permitir que el público en general vea las asignaciones de temas"
+ assigns_user_url_path: "Ruta a los temas asignados a los usuarios (usa: {username} para sustituir el nombre de usuario)"
+ assigns_by_staff_mention: "Si un miembro del staff menciona a otro miembro del staff, el tema se asigna automáticamente"
+ unassign_creates_tracking_post: "Si anulas la asignación de un tema, se creará un susurro o una pequeña acción para hacer seguimiento del cambio."
+ assign_self_regex: "Expresión regular que necesita pasar para asignar a sí mismo. Ejemplo «mi lista»"
+ assign_other_regex: "Expresión regular que necesita pasar para asignar temas a otros a través de una mención. Ejemplo «tu lista»."
+ unassign_on_group_archive: "Cuando un mensaje es archivado por un grupo, anula la asignación del mensaje (reasigna si se mueve nuevamente a la bandeja de entrada)"
+ unassign_on_close: "Cuando se cierra un tema, anular la asignación del tema"
+ reassign_on_open: "Cuando se abre un tema se reasignan los usuarios/grupos previamente asignados"
+ invite_on_assign: "Cuando se asigna un mensaje personal a un usuario o grupo, invítale al MP si aún no es participante."
+ assign_mailer: "Cuándo enviar notificaciones por correo electrónico de asignaciones."
+ remind_assigns: "Recordar a los usuarios sobre asignaciones pendientes."
+ remind_assigns_frequency: "Frecuencia para recordar a los usuarios sobre los temas asignados."
+ pending_assign_reminder_threshold: "Número de asignaciones pendientes que activa una notificación de recordatorio."
+ max_assigned_topics: "Número máximo de temas que se pueden asignar a un usuario."
+ assign_allowed_on_groups: "Los usuarios de estos grupos pueden asignar temas y se les pueden asignar temas."
+ enable_assign_status: "Añade un campo de estado personalizable a cada asignación."
+ assign_statuses: "Lista de estados disponibles para cada asignación. El primer estado es el que se aplica por defecto a cada nueva asignación."
+ errors:
+ assign_statuses:
+ too_few: "Debe haber al menos dos estados diferentes disponibles."
+ duplicate: "Hay valores de estado duplicados."
+ removed_in_use: "No se puede eliminar un estado de la lista si hay asignaciones existentes que usan este estado."
+ discourse_assign:
+ assigned_to: "Tema asignado a @%{username}"
+ unassigned: "Se anuló la asignación del tema"
+ already_claimed: "Ese tema ya ha sido reclamado."
+ already_assigned: "El tema ya está asignado a @%{username}"
+ too_many_assigns: "@%{username} ya ha alcanzado el número máximo de temas asignados (%{max})."
+ too_many_assigns_for_topic: "Se ha alcanzado el límite de %{limit} asignaciones por tema."
+ forbidden_assign_to: "No se puede asignar a @%{username} porque no pertenecen a los grupos permitidos para asignaciones."
+ forbidden_assignee_not_pm_participant: "@%{username} no puede ser asignado porque no tiene acceso a este MP. Puedes concederle acceso a @%{username} invitándole a este MP."
+ forbidden_assignee_cant_see_topic: "@%{username} no puede ser asignado porque no tiene acceso a este tema."
+ group_already_assigned: "El tema ya está asignado a @%{group}"
+ forbidden_group_assign_to: "No se puede asignar a @%{group} porque no pertenecen a los grupos permitidos para asignaciones."
+ forbidden_group_assignee_not_pm_participant: "No se puede asignar @%{group} porque no todos los miembros tienen acceso a este PM."
+ forbidden_group_assignee_cant_see_topic: "No se puede asignar @%{group} porque no todos los miembros tienen acceso a este tema."
+ flag_assigned: "Lo sentimos, el tema de esa denuncia está asignado a otro usuario."
+ flag_unclaimed: "Debes reclamar este tema antes de actuar sobre la denuncia"
+ topic_assigned_excerpt: "te asignó el tema «%{title}»"
+ topic_group_assigned_excerpt: "asignó el tema '%{title}' a @%{group}"
+ reminders_frequency:
+ never: "nunca"
+ daily: "diariamente"
+ weekly: "semanalmente"
+ monthly: "mensualmente"
+ quarterly: "trimestralmente"
+ assign_mailer:
+ title: "Asignar correo"
+ subject_template: "¡[%{email_prefix}] %{assignee_name} te ha asignado a «%{topic_title}»!"
+ text_body_template: |
+ Hola, %{assignee_name}, **te ha asignado** a una discusión
+ > **%{topic_title}**
+ >
+ > %{topic_excerpt}
+
+ Si estás interesado, haz clic en el siguiente enlace:
+ [%{topic_link}](%{topic_link})
+ pending_assigns_reminder:
+ title: "Tienes %{pending_assignments} asignaciones pendientes"
+ body: |
+ Actualmente tienes [%{pending_assignments} asignaciones pendientes](%{assignments_link}).
+
+ %{newest_assignments}
+ %{oldest_assignments}
+
+ Este recordatorio se enviará %{frequency} si tienes más de un tema asignado.
+ newest: |
+ ### Lo más nuevo
+ %{topic_0}
+ %{topic_1}
+ %{topic_2}
+ oldest: |
+ ### Lo más antiguo
+ %{topic_0}
+ %{topic_1}
+ %{topic_2}
+ discourse_automation:
+ scriptables:
+ random_assign:
+ title: Asignación aleatoria
+ no_one: "Se intentó asignar aleatoriamente un miembro de «@%{group}», pero no había nadie disponible."
+ discourse_push_notifications:
+ popup:
+ assigned: "@%{username} te asignó"
+ activerecord:
+ errors:
+ models:
+ assignment:
+ attributes:
+ status:
+ invalid: "El estado seleccionado no es válido (no está incluido en la configuración del sitio assigned_status)."
diff --git a/plugins/discourse-assign/config/locales/server.et.yml b/plugins/discourse-assign/config/locales/server.et.yml
new file mode 100644
index 00000000000..4395093251a
--- /dev/null
+++ b/plugins/discourse-assign/config/locales/server.et.yml
@@ -0,0 +1,15 @@
+# WARNING: Never edit this file.
+# It will be overwritten when translations are pulled from Crowdin.
+#
+# To work with us on translations, join this project:
+# https://translate.discourse.org/
+
+et:
+ discourse_assign:
+ unassigned: "Teema määramine on tühistatud"
+ reminders_frequency:
+ never: "mitte kunagi"
+ daily: "iga päev"
+ weekly: "iga nädal"
+ monthly: "igakuiselt"
+ quarterly: "kvartaalselt"
diff --git a/plugins/discourse-assign/config/locales/server.fa_IR.yml b/plugins/discourse-assign/config/locales/server.fa_IR.yml
new file mode 100644
index 00000000000..705203cc419
--- /dev/null
+++ b/plugins/discourse-assign/config/locales/server.fa_IR.yml
@@ -0,0 +1,14 @@
+# WARNING: Never edit this file.
+# It will be overwritten when translations are pulled from Crowdin.
+#
+# To work with us on translations, join this project:
+# https://translate.discourse.org/
+
+fa_IR:
+ discourse_assign:
+ reminders_frequency:
+ never: "هیچ‌وقت"
+ daily: "روزانه"
+ weekly: "هفتگی"
+ monthly: "ماهیانه"
+ quarterly: "فصلی"
diff --git a/plugins/discourse-assign/config/locales/server.fi.yml b/plugins/discourse-assign/config/locales/server.fi.yml
new file mode 100644
index 00000000000..234d6ea5b49
--- /dev/null
+++ b/plugins/discourse-assign/config/locales/server.fi.yml
@@ -0,0 +1,101 @@
+# WARNING: Never edit this file.
+# It will be overwritten when translations are pulled from Crowdin.
+#
+# To work with us on translations, join this project:
+# https://translate.discourse.org/
+
+fi:
+ site_settings:
+ assign_enabled: "Ota osoituslisäosa käyttöön"
+ assigns_public: "Salli tavallisen kansan nähdä ketjujen osoitukset"
+ assigns_user_url_path: "Polku, joka näyttää kaikki käyttäjälle osoitetut (käytä: {username} käyttäjänimen paikalla)"
+ assigns_by_staff_mention: "Jos henkilökunnan jäsen mainitsee toisen henkilökunnan jäsenen, ketju osoitetaan automaattisesti"
+ unassign_creates_tracking_post: "Jos perut ketjun osoituksen, kuiskaus tai pieni merkintä luodaan pitämään kirjaa muutoksesta"
+ assign_self_regex: "Säännöllinen lauseke, jolla osoitetaan itselle. Esimerkiksi 'minun listalle'"
+ assign_other_regex: "Säännöllinen lauseke, jolla osoitetaan toiselle maininnan avulla. Esimerkiksi 'sinun listalle'."
+ unassign_on_group_archive: "Kun ryhmä arkistoi yksityiskeskustelun, peru viestin osoitus (osoitetaan uudelleen, jos siirretään takaisin saapuneisiin)"
+ unassign_on_close: "Peru ketjun osoitus, kun ketju suljetaan"
+ reassign_on_open: "Kun ketju avataan, osoita aikaisemmin osoitetut käyttäjät/ryhmät uudelleen"
+ invite_on_assign: "Kun henkilökohtainen viesti osoitetaan käyttäjälle tai ryhmälle, kutsu hänet yksityisviestiin, jos hän ei vielä ole osallistuja."
+ assign_mailer: "Milloin lähetetään ilmoituksia osoituksista"
+ remind_assigns: "Muistuta käyttäjiä odottavista osoituksista."
+ remind_assigns_frequency: "Osoitettujen ketjujen muistutusten toistuvuus."
+ pending_assign_reminder_threshold: "Odottavien osoitusten määrä, joka laukaisee muistutusilmoituksen."
+ max_assigned_topics: "Käyttäjälle osoitettavien ketjujen enimmäismäärä."
+ assign_allowed_on_groups: "Näiden ryhmien käyttäjät voivat osoittaa aiheita, ja heille voidaan osoittaa aiheita."
+ enable_assign_status: "Lisää mukautettava tilakenttä jokaiseen osoitukseen."
+ assign_statuses: "Luettelo kullekin osoitukselle käytettävissä olevista tiloista. Ensimmäinen tila on oletustila, jota käytetään jokaiselle uudelle osoitukselle."
+ errors:
+ assign_statuses:
+ too_few: "Käytettävissä täytyy olla vähintään kaksi eri tilaa."
+ duplicate: "Jotkin tilojen arvot ovat päällekkäisiä."
+ removed_in_use: "Tilaa ei voi poistaa luettelosta, jos jokin osoitus käyttää tätä tilaa."
+ discourse_assign:
+ assigned_to: "Ketju osoitettu käyttäjälle @%{username}"
+ unassigned: "Ketjun osoitus peruttiin"
+ already_claimed: "Ketju on jo omittu."
+ already_assigned: "Ketju on jo osoitettu käyttäjälle %{username}"
+ too_many_assigns: "@%{username} on jo saavuttanut osoitettujen ketjujen enimmäismäärän (%{max})."
+ too_many_assigns_for_topic: "%{limit} osoituksen ketjukohtainen raja on saavutettu."
+ forbidden_assign_to: "Käyttäjää @%{username} ei voi osoittaa, koska hän ei kuulu sallittuihin osoitusryhmiin."
+ forbidden_assignee_not_pm_participant: "Käyttäjää @%{username} ei voi osoittaa, koska hänellä ei ole tämän yksityisviestin käyttöoikeutta. Voit antaa käyttäjälle @%{username} käyttöoikeuden kutsumalla hänet tähän yksityisviestiin."
+ forbidden_assignee_cant_see_topic: "Käyttäjää @%{username} ei voi osoittaa, koska hänellä ei ole tämän ketjun käyttöoikeutta."
+ group_already_assigned: "Ketju on jo osoitettu ryhmälle %{group}"
+ forbidden_group_assign_to: "Ryhmää @%{group} ei voi osoittaa, koska se ei kuulu sallittuihin osoitusryhmiin."
+ forbidden_group_assignee_not_pm_participant: "Ryhmää @%{group} ei voi osoittaa, koska kaikilla jäsenillä ei ole tämän yksityisviestin käyttöoikeutta."
+ forbidden_group_assignee_cant_see_topic: "Ryhmää @%{group} ei voi osoittaa, koska kaikilla jäsenillä ei ole tämän ketjun käyttöoikeutta."
+ flag_assigned: "Pahoittelut, lipun ketju on osoitettu toiselle käyttäjälle"
+ flag_unclaimed: "Ketju täytyy omia ennen lipun käsittelyä"
+ topic_assigned_excerpt: "osoitti sinulle ketjun \"%{title}\""
+ topic_group_assigned_excerpt: "osoitti ketjun %{title} ryhmälle @%{group}"
+ reminders_frequency:
+ never: "ei koskaan"
+ daily: "päivittäin"
+ weekly: "viikottain"
+ monthly: "kuukausittain"
+ quarterly: "vuosineljännettäin"
+ assign_mailer:
+ title: "Osoitus"
+ subject_template: "[%{email_prefix}] %{assignee_name} osoitti sinulle ketjun \"%{topic_title}\"!"
+ text_body_template: |
+ Hei, %{assignee_name} **osoitti** sinulle keskustelun
+ > **%{topic_title}**
+ >
+ > %{topic_excerpt}
+
+ Jos olet kiinnostunut, klikkaa linkkiä alla:
+ [%{topic_link}](%{topic_link})
+ pending_assigns_reminder:
+ title: "Sinulla on %{pending_assignments} odottavaa tehtävää"
+ body: |
+ Sinulla on [%{pending_assignments} odottavaa tehtävää] (%{assignments_link}).
+
+ %{newest_assignments}
+ %{oldest_assignments}
+
+ Tämä muistutus lähetetään%{frequency}, jos sinulla on useampi kuin yksi osoitettu ketju.
+ newest: |
+ ### Uusin
+ %{topic_0}
+ %{topic_1}
+ %{topic_2}
+ oldest: |
+ ### Vanhin
+ %{topic_0}
+ %{topic_1}
+ %{topic_2}
+ discourse_automation:
+ scriptables:
+ random_assign:
+ title: Satunnainen osoitus
+ no_one: "Ryhmän @%{group} jäsentä yritettiin osoittaa satunnaisesti, mutta kukaan ei ollut saatavilla."
+ discourse_push_notifications:
+ popup:
+ assigned: "@%{username} osoitti sinut"
+ activerecord:
+ errors:
+ models:
+ assignment:
+ attributes:
+ status:
+ invalid: "Valittu tila on virheellinen (se ei sisälly assigned_status-sivustoasetukseen)."
diff --git a/plugins/discourse-assign/config/locales/server.fr.yml b/plugins/discourse-assign/config/locales/server.fr.yml
new file mode 100644
index 00000000000..c709702630e
--- /dev/null
+++ b/plugins/discourse-assign/config/locales/server.fr.yml
@@ -0,0 +1,101 @@
+# WARNING: Never edit this file.
+# It will be overwritten when translations are pulled from Crowdin.
+#
+# To work with us on translations, join this project:
+# https://translate.discourse.org/
+
+fr:
+ site_settings:
+ assign_enabled: "Activer l'extension d'attribution"
+ assigns_public: "Autoriser le grand public à voir les attributions des sujets"
+ assigns_user_url_path: "Chemin vers les sujets attribués aux utilisateurs (utilisez {username} pour remplacer le nom d'utilisateur)"
+ assigns_by_staff_mention: "Si un membre du personnel mentionne un autre membre du personnel, le sujet est automatiquement attribué"
+ unassign_creates_tracking_post: "Si vous annulez l'attribution d'un sujet, un murmure ou une petite action sera créée pour suivre le changement"
+ assign_self_regex: "Expression régulière qui doit être validée pour permettre l'attribution d'un sujet à soi-même. Par exemple : « ma liste »"
+ assign_other_regex: "Expression régulière qui doit être validée pour permettre l'attribution d'un sujet à d'autres utilisateurs via une mention. Par exemple : « votre liste »"
+ unassign_on_group_archive: "Quand un message est archivé par un groupe, annuler l'attribution du message (réattribué s'il est à nouveau déplacé dans la boîte de réception)"
+ unassign_on_close: "Quand un sujet est fermé, annuler l'attribution du sujet"
+ reassign_on_open: "Lorsqu'un sujet est ouvert, réattribuer les utilisateurs/groupes précédemment attribués"
+ invite_on_assign: "Lorsqu'un message personnel est attribué à un utilisateur ou à un groupe, invitez-le dans le MD s'il n'est pas déjà participant."
+ assign_mailer: "Quand envoyer un e-mail de notification pour les attributions"
+ remind_assigns: "Rappelle aux utilisateurs les attributions en attente."
+ remind_assigns_frequency: "Fréquence à laquelle rappeler les attributions aux utilisateurs."
+ pending_assign_reminder_threshold: "Nombre d'attributions en attente qui déclenchent une notification de rappel."
+ max_assigned_topics: "Nombre maximal de sujets qui peuvent être attribués à un utilisateur."
+ assign_allowed_on_groups: "Les utilisateurs de ces groupes sont autorisés à attribuer des sujets et peuvent se voir attribuer des sujets."
+ enable_assign_status: "Ajouter un champ de statut personnalisable à chaque attribution."
+ assign_statuses: "Liste des statuts disponibles pour chaque attribution. Le premier statut est le statut par défaut appliqué à chaque nouvelle attribution."
+ errors:
+ assign_statuses:
+ too_few: "Il doit y avoir au moins deux statuts différents disponibles."
+ duplicate: "Il existe des valeurs de statut dupliquées."
+ removed_in_use: "Impossible de supprimer un statut de la liste si des attributions existantes utilisent ce statut."
+ discourse_assign:
+ assigned_to: "Sujet attribué à @%{username}"
+ unassigned: "L'attribution du sujet a été annulée"
+ already_claimed: "Le sujet a déjà été réservé."
+ already_assigned: "Le sujet est déjà attribué à @%{username}"
+ too_many_assigns: "@%{username} a atteint le nombre maximal de sujets attribués (%{max})."
+ too_many_assigns_for_topic: "La limite de %{limit} attributions par sujet a été atteinte."
+ forbidden_assign_to: "@%{username} ne peut pas recevoir d'attribution, car il ou elle n'appartient pas aux groupes autorisés attribués."
+ forbidden_assignee_not_pm_participant: "@%{username} ne peut pas recevoir d'attribution, car il ou elle n'a pas accès à ce MD. Vous pouvez accorder l'accès à %{username} en l'invitant dans ce MD."
+ forbidden_assignee_cant_see_topic: "@%{username} ne peut pas recevoir d'attribution, car il ou elle n'a pas accès à ce sujet."
+ group_already_assigned: "Le sujet est déjà attribué à @%{group}"
+ forbidden_group_assign_to: "@%{group} ne peut pas recevoir d'attribution, car ce groupe n'appartient pas aux groupes autorisés attribués."
+ forbidden_group_assignee_not_pm_participant: "@%{group} ne peut pas recevoir d'attribution, car tous les membres n'ont pas accès à ce MD."
+ forbidden_group_assignee_cant_see_topic: "@%{group} ne peut pas recevoir d'attribution, car tous les membres n'ont pas accès à ce sujet."
+ flag_assigned: "Nous sommes désolés, le sujet de ce signalement est attribué à un autre utilisateur."
+ flag_unclaimed: "Vous devez réserver ce sujet avant d'agir sur le signalement"
+ topic_assigned_excerpt: "vous a attribué le sujet « %{title} »"
+ topic_group_assigned_excerpt: "a attribué le sujet « %{title} » à @%{group}"
+ reminders_frequency:
+ never: "jamais"
+ daily: "chaque jour"
+ weekly: "chaque semaine"
+ monthly: "chaque mois"
+ quarterly: "chaque trimestre"
+ assign_mailer:
+ title: "Attribuer un expéditeur"
+ subject_template: "[%{email_prefix}] %{assignee_name} vous a attribué le sujet « %{topic_title} » !"
+ text_body_template: |
+ Hey, %{assignee_name} vous a **attribué** une discussion
+ > **%{topic_title}**
+ >
+ > %{topic_excerpt}
+
+ Si vous êtes intéressé(e), cliquez sur le lien suivant :
+ [%{topic_link}](%{topic_link})
+ pending_assigns_reminder:
+ title: "Vous avez %{pending_assignments} attribution(s) en attente"
+ body: |
+ Vous avez actuellement [%{pending_assignments} attribution(s) en attente](%{assignments_link}).
+
+ %{newest_assignments}
+ %{oldest_assignments}
+
+ Ce rappel vous sera envoyé %{frequency} si vous avez plus d'un sujet attribué.
+ newest: |
+ ### Plus récente(s)
+ %{topic_0}
+ %{topic_1}
+ %{topic_2}
+ oldest: |
+ ### Plus ancienne(s)
+ %{topic_0}
+ %{topic_1}
+ %{topic_2}
+ discourse_automation:
+ scriptables:
+ random_assign:
+ title: Attribution aléatoire
+ no_one: "A tenté d'attribuer aléatoirement un membre du groupe @%{group}, mais personne n'était disponible."
+ discourse_push_notifications:
+ popup:
+ assigned: "@%{username} vous a attribué"
+ activerecord:
+ errors:
+ models:
+ assignment:
+ attributes:
+ status:
+ invalid: "Le statut sélectionné n'est pas valide (il n'est pas inclus dans le paramètre du site assigned_status)."
diff --git a/plugins/discourse-assign/config/locales/server.gl.yml b/plugins/discourse-assign/config/locales/server.gl.yml
new file mode 100644
index 00000000000..ebf1e50e8b2
--- /dev/null
+++ b/plugins/discourse-assign/config/locales/server.gl.yml
@@ -0,0 +1,14 @@
+# WARNING: Never edit this file.
+# It will be overwritten when translations are pulled from Crowdin.
+#
+# To work with us on translations, join this project:
+# https://translate.discourse.org/
+
+gl:
+ discourse_assign:
+ reminders_frequency:
+ never: "nunca"
+ daily: "diariamente"
+ weekly: "semanalmente"
+ monthly: "mensual"
+ quarterly: "trimestral"
diff --git a/plugins/discourse-assign/config/locales/server.he.yml b/plugins/discourse-assign/config/locales/server.he.yml
new file mode 100644
index 00000000000..ffd9d2cf114
--- /dev/null
+++ b/plugins/discourse-assign/config/locales/server.he.yml
@@ -0,0 +1,100 @@
+# WARNING: Never edit this file.
+# It will be overwritten when translations are pulled from Crowdin.
+#
+# To work with us on translations, join this project:
+# https://translate.discourse.org/
+
+he:
+ site_settings:
+ assign_enabled: "הפעלת תוסף רישום על"
+ assigns_public: "לאפשר לציבור לצפות בהקצאות נושאים"
+ assigns_user_url_path: "נתיב לנושאים שמוקצים למשתמשים (יש להשתמש ב־{username} כחלופה לשם המשתמש)"
+ assigns_by_staff_mention: "אם חבר סגל מאוזכר על ידי חבר סגל אחר, הנושא מוקצה אוטומטית"
+ unassign_creates_tracking_post: "בעת ביטול הקצאת נושא תיווצר לחישה או פעולה קטנה כדי לעקוב אחר השינוי"
+ assign_self_regex: "ביטוי רגולרי שיש לצלוח כדי להקצות עצמית. למשל: ‚רשימה שלי’"
+ assign_other_regex: "ביטוי רגולרי שיש לצלוח כדי להקצות נושאים לאחרים דרך אזור. למשל: ‚רשימה שלך’"
+ unassign_on_group_archive: "כאשר הודעה מועברת לארכיון על ידי קבוצה, הקצאת ההודעה תבוטל (ההקצאה תחודש במקרה של החזרה לדואר הנכנס)"
+ unassign_on_close: "כאשר נושא נסגר יש לבטל את הקצאתו"
+ reassign_on_open: "כאשר נושא נפתח יש להקצות מחדש משתמשים/קבוצות שהוקצו בעבר"
+ invite_on_assign: "כשהודעה פרטית מוקצית למשתמש או לקבוצה, תישלח הזמנה להודעה הפרטית אם אינם חברים בה עדיין."
+ assign_mailer: "מתי לשלוח התראות בדוא״ל על הקצאות"
+ remind_assigns: "להזכיר למשתמשים בנוגע להקצאות מתאימות."
+ remind_assigns_frequency: "תדירות לשליחת תזכורת למשתמשים בנוגע לנושאים מוקצים."
+ max_assigned_topics: "מספר הנושאים המרבי שניתן להקצות למשתמש."
+ assign_allowed_on_groups: "משתמשים בקבוצות אלה רשאים להקצות נושאים וניתן להקצות להם נושאים."
+ enable_assign_status: "הוספת שדה מצב מותאם לכל משימה."
+ assign_statuses: "רשימת המצבים הזמינים לכל משימה. המצב הראשון הוא מצב ברירת המחדל שחל על כל משימה חדשה."
+ errors:
+ assign_statuses:
+ too_few: "חייבים להיות לפחות שני מצבים זמינים."
+ duplicate: "יש ערכי מצב כפולים."
+ removed_in_use: "אי אפשר להסיר מצב מהרשימה אם יש משימות קיימות שנמצאות במצב הזה."
+ discourse_assign:
+ assigned_to: "הנושא רשום ל@%{username}"
+ unassigned: "הקצאת הנושא בוטלה"
+ already_claimed: "נושא זה כבר נדרש."
+ already_assigned: "הנושא כבר מוקצה לטובת ‎@%{username}"
+ too_many_assigns: "‎@%{username}‎ כבר הגיע לכמות הנושאים המרבית שניתן להקצות לטובתו (%{max})."
+ too_many_assigns_for_topic: "המגבלה של %{limit} הקצאות לנושא הושגה."
+ forbidden_assign_to: "אין אפשרות להקצות את ‎@%{username}‎ כיוון שאין להם שייכות לקבוצות מורשות מוקצות."
+ forbidden_assignee_not_pm_participant: "אין אפשרות להקצות את ‎@%{username} כיוון שאין לו/לה גישה להודעה הפרטית הזאת. ניתן להעניק ל־‎@%{username} גישה על ידי שליחת הזמנה להודעה הפרטית הזאת."
+ forbidden_assignee_cant_see_topic: "אין אפשרות להקצות את ‎@%{username} כיוון שאין לו/לה גישה לנושא הזה."
+ group_already_assigned: "הנושא כבר מוקצה לטובת ‎@%{group}"
+ forbidden_group_assign_to: "אין אפשרות להקצות את ‎@%{group}‎ כיוון שאין להם שייכות לקבוצות מורשות מוקצות."
+ forbidden_group_assignee_not_pm_participant: "לא ניתן להקצות את ‎@%{group} כיוון שלא לכל החברים יש גישה להודעה הפרטית הזאת."
+ forbidden_group_assignee_cant_see_topic: "לא ניתן להקצות את ‎@%{group} כיוון שלא לכל החברים יש גישה לנושא הזה."
+ flag_assigned: "הנושא של דגל זה מוקצה למשתמש אחר, עמך הסליחה"
+ flag_unclaimed: "עליך לדרוש את הנושא הזה בטרם ביצוע פעילות על הדגל"
+ topic_assigned_excerpt: "הקצאה של הנושא ‚%{title}’ אליך"
+ topic_group_assigned_excerpt: "הנושא ‚%{title}’ הוקצה ל־‎@%{group}"
+ reminders_frequency:
+ never: "אף פעם"
+ daily: "יומית"
+ weekly: "שבועית"
+ monthly: "חודשית"
+ quarterly: "רבעונית"
+ assign_mailer:
+ title: "הקצאת שולח דוא״ל"
+ subject_template: "[%{email_prefix}] ‚%{topic_title}’ הוקצה אליך על ידי %{assignee_name} !"
+ text_body_template: |
+ היי, **הוקצה** אליך דיון על ידי %{assignee_name}
+ > **%{topic_title}**
+ >
+ > %{topic_excerpt}
+
+ אם זה מעניין אותך, עליך ללחוץ על הקישור שלהלן:
+ [%{topic_link}](%{topic_link})
+ pending_assigns_reminder:
+ title: "יש לך %{pending_assignments} הקצאות ממתינות"
+ body: |
+ כרגע יש לך [%{pending_assignments} מטלות ממתינות](%{assignments_link}).
+
+ %{newest_assignments}
+ %{oldest_assignments}
+
+ תזכורת זו תישלח %{frequency} אם מוקצה אליך יותר מנושא אחד.
+ newest: |
+ ### החדשים ביותר
+ %{topic_0}
+ %{topic_1}
+ %{topic_2}
+ oldest: |
+ ### הישנים ביותר
+ %{topic_0}
+ %{topic_1}
+ %{topic_2}
+ discourse_automation:
+ scriptables:
+ random_assign:
+ title: הקצאה אקראית
+ no_one: "היה ניסיון להקצות אחד מחברי הקבוצה ‎`@%{group}`‎ באקראי, אך אף אחד מהם לא היה זמין."
+ discourse_push_notifications:
+ popup:
+ assigned: "הוקצה אליך על ידי ‎@%{username}"
+ activerecord:
+ errors:
+ models:
+ assignment:
+ attributes:
+ status:
+ invalid: "המצב הנבחר שגוי (אינו כלול בהגדרת האתר assigned_status - מצב מוקצה)."
diff --git a/plugins/discourse-assign/config/locales/server.hr.yml b/plugins/discourse-assign/config/locales/server.hr.yml
new file mode 100644
index 00000000000..df88c584d98
--- /dev/null
+++ b/plugins/discourse-assign/config/locales/server.hr.yml
@@ -0,0 +1,14 @@
+# WARNING: Never edit this file.
+# It will be overwritten when translations are pulled from Crowdin.
+#
+# To work with us on translations, join this project:
+# https://translate.discourse.org/
+
+hr:
+ discourse_assign:
+ reminders_frequency:
+ never: "nikad"
+ daily: "dnevno"
+ weekly: "tjedno"
+ monthly: "mjesečno"
+ quarterly: "tromjesečno"
diff --git a/plugins/discourse-assign/config/locales/server.hu.yml b/plugins/discourse-assign/config/locales/server.hu.yml
new file mode 100644
index 00000000000..af51272200b
--- /dev/null
+++ b/plugins/discourse-assign/config/locales/server.hu.yml
@@ -0,0 +1,33 @@
+# WARNING: Never edit this file.
+# It will be overwritten when translations are pulled from Crowdin.
+#
+# To work with us on translations, join this project:
+# https://translate.discourse.org/
+
+hu:
+ site_settings:
+ assign_enabled: "Az assign bővítmény engedélyezése"
+ assigns_public: "Engedélyezés, hogy a nagyközönség is láthassa a témák kiosztását"
+ discourse_assign:
+ reminders_frequency:
+ never: "soha"
+ daily: "naponta"
+ weekly: "hetente"
+ monthly: "havi"
+ quarterly: "negyedéves"
+ pending_assigns_reminder:
+ title: "%{pending_assignments} függőben lévő feladata van"
+ newest: |
+ ### Legújabb
+ %{topic_0}
+ %{topic_1}
+ %{topic_2}
+ oldest: |
+ ### Legrégebbi
+ %{topic_0}
+ %{topic_1}
+ %{topic_2}
+ discourse_automation:
+ scriptables:
+ random_assign:
+ title: Véletlenszerű kiosztás
diff --git a/plugins/discourse-assign/config/locales/server.hy.yml b/plugins/discourse-assign/config/locales/server.hy.yml
new file mode 100644
index 00000000000..05a4da87b08
--- /dev/null
+++ b/plugins/discourse-assign/config/locales/server.hy.yml
@@ -0,0 +1,43 @@
+# WARNING: Never edit this file.
+# It will be overwritten when translations are pulled from Crowdin.
+#
+# To work with us on translations, join this project:
+# https://translate.discourse.org/
+
+hy:
+ site_settings:
+ assign_enabled: "Միացնել պլագինի վերագրումը"
+ assigns_public: "Թույլատրել հանրությանը տեսնել թեմայի վերագրումները"
+ assigns_user_url_path: "Օգտատերերին վերագրված թեմաների ուղի (օգտագործեք {օգտանուն} ՝ օգտանունը փոխարինելու համար)"
+ assigns_by_staff_mention: "Եթե անձնակազմի որևէ անդամ ում է մեկ այլ անդամի, թեման ավտոմատ կերպով վերագրվում է"
+ unassign_creates_tracking_post: "Եթե Դուք ետ եք կանչում թեմայի վերագրումը, կստեղծվի շշուկ կամ փոքրիկ գործողություն՝ փոփոխությանը հետևելու համար"
+ assign_self_regex: "Կարգավորում, որը պետք է անցնի ինքնավերագրում: Օրինակ՝ 'իմ ցանկը'"
+ assign_other_regex: "Կարգավորում, որը պետք է թեմաների վերագրման համար անցնի այլոց նշման շնորհիվ: Օրինակ՝ 'Ձեր ցանկը'"
+ unassign_on_group_archive: "Երբ հաղորդագրությունը արխիվացվում է խմբի կողմից, ետ կանչել հաղորդագրության վերագրումը (վերականգնել այն, եթե վերադարձվում է մուտքային արկղ)"
+ unassign_on_close: "Երբ թեման փակվում է, ետ կանչել թեմայի վերագրումը"
+ discourse_assign:
+ assigned_to: "Թեման վերագրված է՝ @%{username}"
+ unassigned: "Թեմայի վերագրումը ետկանչված է"
+ already_claimed: "Այդ թեման արդեն պահանջված է:"
+ already_assigned: "Թեման արդեն վերագրված է @%{username} -ին"
+ group_already_assigned: "Թեման արդեն վերագրված է @%{group} -ին"
+ flag_assigned: "Ներողություն, այդ դրոշակի թեման վերագրված է մեկ այլ օգտատիրոջ"
+ flag_unclaimed: "Դուք պետք է պահանջեք այդ թեման՝ մինչ դրոշի հետ որևէ գործողություն ձեռնարկելը:"
+ topic_assigned_excerpt: "վերագրել է Ձեզ '%{title}' թեմային"
+ reminders_frequency:
+ never: "երբեք"
+ daily: "օրը մեկ"
+ weekly: "շաբաթական"
+ monthly: "ամսվա Ընթացքում"
+ quarterly: "եռամսյակի Ընթացքում"
+ assign_mailer:
+ title: "Վերագրել Ուղարկողին"
+ subject_template: "[%{email_prefix}] %{assignee_name} -ը վերագրել է Ձեզ '%{topic_title}'!"
+ text_body_template: |
+ Հեյ, %{assignee_name} -ը **վերագրել է** Ձեզ քննարկում
+ > **%{topic_title}**
+ >
+ > %{topic_excerpt}
+
+ Եթե Դուք հետաքրքրված եք, սեղմեք ներքևում գտնվող հղումը՝
+ [%{topic_link}](%{topic_link})
diff --git a/plugins/discourse-assign/config/locales/server.id.yml b/plugins/discourse-assign/config/locales/server.id.yml
new file mode 100644
index 00000000000..cb7141bab86
--- /dev/null
+++ b/plugins/discourse-assign/config/locales/server.id.yml
@@ -0,0 +1,12 @@
+# WARNING: Never edit this file.
+# It will be overwritten when translations are pulled from Crowdin.
+#
+# To work with us on translations, join this project:
+# https://translate.discourse.org/
+
+id:
+ discourse_assign:
+ reminders_frequency:
+ never: "tidak pernah"
+ daily: "harian"
+ weekly: "mingguan"
diff --git a/plugins/discourse-assign/config/locales/server.it.yml b/plugins/discourse-assign/config/locales/server.it.yml
new file mode 100644
index 00000000000..42334847b0e
--- /dev/null
+++ b/plugins/discourse-assign/config/locales/server.it.yml
@@ -0,0 +1,101 @@
+# WARNING: Never edit this file.
+# It will be overwritten when translations are pulled from Crowdin.
+#
+# To work with us on translations, join this project:
+# https://translate.discourse.org/
+
+it:
+ site_settings:
+ assign_enabled: "Abilita il plugin di assegnazione"
+ assigns_public: "Consenti a chiunque di visualizzare le assegnazioni di un argomento"
+ assigns_user_url_path: "Percorso degli argomenti assegnati agli utenti (usa: {username} per sostituire un nome utente)"
+ assigns_by_staff_mention: "Se un membro dello staff menziona un altro membro dello staff, l'argomento è assegnato automaticamente"
+ unassign_creates_tracking_post: "Se annulli l'assegnazione di un argomento, verrà creato un sussurro o una piccola azione per tenere traccia delle modifiche"
+ assign_self_regex: "L'espressione regolare che dovrà essere soddisfatta per l'auto-assegnazione. Ad esempio 'la mia lista'"
+ assign_other_regex: "L'espressione regolare che dovrà essere soddisfatta per assegnare argomenti ad altri utenti tramite menzione. Ad esempio 'la tua lista'."
+ unassign_on_group_archive: "Quando un messaggio viene archiviato da un gruppo, annullare l'assegnazione (riassegnare se viene spostato nuovamente nella posta in arrivo)"
+ unassign_on_close: "Quando un argomento viene chiuso annullare l'assegnazione"
+ reassign_on_open: "Quando viene riaperto un argomento, riassegna utenti/gruppi assegnati in precedenza"
+ invite_on_assign: "Quando un messaggio personale viene assegnato a un utente o gruppo, invitalo ai MP se non è già un partecipante."
+ assign_mailer: "Quando inviare email di notifica per le assegnazioni"
+ remind_assigns: "Ricorda agli utenti le assegnazioni in sospeso."
+ remind_assigns_frequency: "Frequenza per ricordare agli utenti gli argomenti assegnati."
+ pending_assign_reminder_threshold: "Numero di assegnazioni in sospeso che attivano una notifica di promemoria."
+ max_assigned_topics: "Numero massimo di argomenti che possono essere assegnati a un utente."
+ assign_allowed_on_groups: "Gli utenti in questi gruppi possono assegnare argomenti ed essere assegnati ad argomenti."
+ enable_assign_status: "Aggiungi un campo di stato personalizzabile a ogni assegnazione."
+ assign_statuses: "Elenco degli stati disponibili per ogni assegnazione. Il primo stato è quello predefinito applicato a ogni nuova assegnazione."
+ errors:
+ assign_statuses:
+ too_few: "Devono essere disponibili almeno due stati diversi."
+ duplicate: "Sono presenti valori di stato duplicati."
+ removed_in_use: "Impossibile rimuovere uno stato dall'elenco se ci sono assegnazioni che utilizzano questo stato."
+ discourse_assign:
+ assigned_to: "Argomento assegnato a @%{username}"
+ unassigned: "L'argomento non è stato assegnato"
+ already_claimed: "Quell'argomento è stato già rivendicato."
+ already_assigned: "Questo argomento è già stato assegnato a @%{username}"
+ too_many_assigns: "@%{username} ha già raggiunto il numero massimo di argomenti assegnabili (%{max})."
+ too_many_assigns_for_topic: "È stato raggiunto il limite di %{limit} assegnazioni per argomento."
+ forbidden_assign_to: "@%{username} non può essere assegnato poiché non appartiene a gruppi che possono essere assegnati."
+ forbidden_assignee_not_pm_participant: "@%{username} non può essere assegnato perché non ha accesso a questo MP. Puoi concedere l'accesso a @%{username} invitandolo a questo MP."
+ forbidden_assignee_cant_see_topic: "@%{username} non può essere assegnato perché non ha accesso a questo argomento."
+ group_already_assigned: "Questo argomento è già stato assegnato a @%{group}"
+ forbidden_group_assign_to: "@%{group} non può essere assegnato poiché non appartiene a gruppi che possono essere assegnati."
+ forbidden_group_assignee_not_pm_participant: "@%{group} non può essere assegnato perché non tutti i suoi membri hanno accesso a questo MP."
+ forbidden_group_assignee_cant_see_topic: "@%{group} non può essere assegnato perché non tutti i suoi membri hanno accesso a questo argomento."
+ flag_assigned: "Spiacenti, l'argomento segnalato è già assegnato a un altro utente"
+ flag_unclaimed: "Devi rivendicare l'argomento prima di lavorare sulla segnalazione"
+ topic_assigned_excerpt: "ti ha assegnato l'argomento '%{title}'"
+ topic_group_assigned_excerpt: "assegnato l'argomento \"%{title}\" a @%{group}"
+ reminders_frequency:
+ never: "mai"
+ daily: "giornalmente"
+ weekly: "ogni settimana"
+ monthly: "mensilmente"
+ quarterly: "ogni tre mesi"
+ assign_mailer:
+ title: "Mailer Assegnazioni"
+ subject_template: "[%{email_prefix}] %{assignee_name} ti ha assegnato '%{topic_title}'!"
+ text_body_template: |
+ Ciao, %{assignee_name} **ti ha assegnato** una discussione
+ > ** %{topic_title} **
+ >
+ > %{topic_excerpt}
+
+ Se sei interessato, fai clic sul seguente collegamento:
+ [%{topic_link}](%{topic_link})
+ pending_assigns_reminder:
+ title: "Hai %{pending_assignments} assegnazioni in sospeso"
+ body: |
+ Al momento hai [%{pending_assignments} assegnazioni in sospeso](%{assignments_link}).
+
+ %{newest_assignments}
+ %{oldest_assignments}
+
+ Questo promemoria verrà inviato %{frequency} se hai più di un argomento assegnato.
+ newest: |
+ ### I più recenti
+ %{topic_0}
+ %{topic_1}
+ %{topic_2}
+ oldest: |
+ ### I più vecchi
+ %{topic_0}
+ %{topic_1}
+ %{topic_2}
+ discourse_automation:
+ scriptables:
+ random_assign:
+ title: Assegnazione casuale
+ no_one: "Tentativo di assegnare casualmente un membro di `@%{group}`, ma nessuno era disponibile."
+ discourse_push_notifications:
+ popup:
+ assigned: "@%{username} ti ha assegnato"
+ activerecord:
+ errors:
+ models:
+ assignment:
+ attributes:
+ status:
+ invalid: "Lo stato selezionato non è valido (non è incluso nell'impostazione del sito assigned_status)."
diff --git a/plugins/discourse-assign/config/locales/server.ja.yml b/plugins/discourse-assign/config/locales/server.ja.yml
new file mode 100644
index 00000000000..8df467798a1
--- /dev/null
+++ b/plugins/discourse-assign/config/locales/server.ja.yml
@@ -0,0 +1,101 @@
+# WARNING: Never edit this file.
+# It will be overwritten when translations are pulled from Crowdin.
+#
+# To work with us on translations, join this project:
+# https://translate.discourse.org/
+
+ja:
+ site_settings:
+ assign_enabled: "割り当てプラグインを有効化"
+ assigns_public: "一般ユーザーがトピックの割り当てを表示することを許可する"
+ assigns_user_url_path: "ユーザー割り当てトピックへのパス({username} でユーザー名を置き換えます)"
+ assigns_by_staff_mention: "スタッフメンバーが別のスタッフメンバーをメンションすると、トピックは自動的に割り当てられる"
+ unassign_creates_tracking_post: "トピックの割り当てを解除すると、変更を槌焼するためのささやきまたは小さなアクションが作成される"
+ assign_self_regex: "自己割り当てのために渡す必要のある正規表現。例「マイリスト」"
+ assign_other_regex: "メンションによってトピックを別のユーザーに割り当てるために渡す必要のある正規表現。例「あなたのリスト」"
+ unassign_on_group_archive: "メッセージがグループによってアーカイブされると、メッセージの割り当てを解除する(受信トレイに戻されると再割り当てされる)"
+ unassign_on_close: "トピックがクローズされると、トピックの割り当てを解除する"
+ reassign_on_open: "トピックがオープンになると、前に割り当てられたユーザー/グループに再割り当てする"
+ invite_on_assign: "個人メッセージがユーザーまたはグループに割り当てられたときに、それらのユーザーまたはグループがすでに PM に参加していない場合は、PM に招待します。"
+ assign_mailer: "割り当ての通知メールを送信するタイミング"
+ remind_assigns: "保留中の割り当てについてユーザーに通知します。"
+ remind_assigns_frequency: "割り当てられたトピックについてユーザーに通知する頻度です。"
+ pending_assign_reminder_threshold: "リマインダー通知をトリガーする保留中の割り当ての数。"
+ max_assigned_topics: "ユーザーに割り当てられるトピックの最大数。"
+ assign_allowed_on_groups: "これらのグループのユーザーはトピックを割り当てたり、割り当てられたりすることができます。"
+ enable_assign_status: "カスタマイズ可能なステータスフィールドをすべての割り当てに追加します。"
+ assign_statuses: "各割り当てに利用できるステータスのリスト。最初のステータスは、すべての新しい割り当てに適用されるデフォルトのステータスです。"
+ errors:
+ assign_statuses:
+ too_few: "少なくとも 2 つのステータスが利用可能である必要があります。"
+ duplicate: "ステータス値が重複しています。"
+ removed_in_use: "このステータスを使用する割り当てがすでに存在する場合、リストからそのステータスを削除できません。"
+ discourse_assign:
+ assigned_to: "@%{username} に割り当てられたトピック"
+ unassigned: "トピックの割り当てが解除されました"
+ already_claimed: "そのトピックはすでに引き受けられています。"
+ already_assigned: "トピックはすでに @%{username} に割り当てられています"
+ too_many_assigns: "@%{username} はすでに割り当てられるトピックの最大数(%{max})に達しています。"
+ too_many_assigns_for_topic: "トピック当たり %{limit} 件の割り当て制限に達しています。"
+ forbidden_assign_to: "@%{username} は割り当て可能なグループに属していないため、割り当てられません。"
+ forbidden_assignee_not_pm_participant: "@%{username} にはこの PM へのアクセス権がないため、割り当てられません。@%{username} をこの PM に招待することで、アクセス権を付与できます。"
+ forbidden_assignee_cant_see_topic: "@%{username} にはこのトピックへのアクセス権がないため、割り当てられません。"
+ group_already_assigned: "トピックはすでに @%{group} に割り当てられています"
+ forbidden_group_assign_to: "@%{group} は割り当て可能なグループに属していないため、割り当てられません。"
+ forbidden_group_assignee_not_pm_participant: "@%{group} の一部のメンバーにこの PM へのアクセス権がないため、割り当てられません。"
+ forbidden_group_assignee_cant_see_topic: "@%{group} の一部のメンバーにこのトピックへのアクセス権がないため、割り当てられません。"
+ flag_assigned: "申し訳ありませんが、その通報のトピックは別のユーザーに割り当てられています"
+ flag_unclaimed: "通報に対応する前にそのトピックを引き受ける必要があります"
+ topic_assigned_excerpt: "あなたにトピック「%{title}」を割り当てました"
+ topic_group_assigned_excerpt: "がトピック '%{title}' を @%{group} に割り当てました"
+ reminders_frequency:
+ never: "通知しない"
+ daily: "毎日"
+ weekly: "毎週"
+ monthly: "毎月"
+ quarterly: "3 か月ごとに"
+ assign_mailer:
+ title: "割り当てメール"
+ subject_template: "[%{email_prefix}] %{assignee_name} があなたを「%{topic_title}」に割り当てました!"
+ text_body_template: |
+ %{assignee_name} があなたをディスカッションに**割り当て**ました
+ > **%{topic_title}**
+ >
+ > %{topic_excerpt}
+
+ 興味があれば、下のリンクをクリックしてください。
+ [%{topic_link}](%{topic_link})
+ pending_assigns_reminder:
+ title: "保留中の割り当てが %{pending_assignments} 件あります"
+ body: |
+ [保留中の割り当てが %{pending_assignments} 件]あります(%{assignments_link})。
+
+ %{newest_assignments}
+ %{oldest_assignments}
+
+ これは、割り当てられたトピックが 2 件以上ある場合に、%{frequency}送信されるリマインダーです。
+ newest: |
+ ### 最新
+ %{topic_0}
+ %{topic_1}
+ %{topic_2}
+ oldest: |
+ ### 最古
+ %{topic_0}
+ %{topic_1}
+ %{topic_2}
+ discourse_automation:
+ scriptables:
+ random_assign:
+ title: ランダム割り当て
+ no_one: "`@%{group}` のメンバーをランダムに割り当てようとしましたが、割り当て可能なメンバーがいませんでした。"
+ discourse_push_notifications:
+ popup:
+ assigned: "@%{username} があなたを割り当てました"
+ activerecord:
+ errors:
+ models:
+ assignment:
+ attributes:
+ status:
+ invalid: "選択されたステータスは無効です(assigned_status サイト設定に含まれていません)。"
diff --git a/plugins/discourse-assign/config/locales/server.ko.yml b/plugins/discourse-assign/config/locales/server.ko.yml
new file mode 100644
index 00000000000..05718058337
--- /dev/null
+++ b/plugins/discourse-assign/config/locales/server.ko.yml
@@ -0,0 +1,42 @@
+# WARNING: Never edit this file.
+# It will be overwritten when translations are pulled from Crowdin.
+#
+# To work with us on translations, join this project:
+# https://translate.discourse.org/
+
+ko:
+ site_settings:
+ assign_enabled: "할당 플러그인 사용"
+ assigns_public: "일반 대중이 주제 할당을 볼 수 있도록 허용"
+ assigns_user_url_path: "사용자에게 할당 된 주제의 경로 (사용자 이름을 대체하기 위해 {username} 사용)"
+ assigns_by_staff_mention: "직원이 다른 직원을 언급하면 주제가 자동으로 할당됩니다."
+ unassign_creates_tracking_post: "주제를 할당 해제하면 변경 사항을 추적하기 위해 속삭임 또는 작은 동작이 생성됩니다."
+ assign_self_regex: "자체 할당을 위해 통과해야하는 정규식. &#39;내 목록&#39;예"
+ assign_other_regex: "언급을 통해 다른 사람에게 주제를 할당하기 위해 전달해야하는 정규식. 예를 들어 &#39;내 목록&#39;입니다."
+ unassign_on_group_archive: "메시지가 그룹에 의해 보관 된 경우 메시지를 할당 해제합니다 (받은 편지함으로 다시 이동하면 재 할당)"
+ unassign_on_close: "주제를 닫을 때 주제를 할당 해제"
+ assign_mailer: "과제를 위해 알림 이메일을 보내는시기"
+ remind_assigns: "보류중인 할당에 대해 사용자에게 알립니다."
+ remind_assigns_frequency: "할당 된 주제에 대해 사용자에게 알리는 빈도입니다."
+ max_assigned_topics: "사용자에게 할당 할 수있는 최대 주제 수입니다."
+ discourse_assign:
+ assigned_to: "@ %{username}에 할당 된 주제"
+ unassigned: "주제가 할당되지 않았습니다"
+ already_claimed: "그 주제는 이미 주장되었습니다."
+ already_assigned: "주제가 이미 @ %{username}에 할당되었습니다."
+ too_many_assigns: "@ %{username}이 (가) 이미 지정된 최대 주제 수 (%{max})에 도달했습니다."
+ group_already_assigned: "주제가 이미 @ %{group}에 할당되었습니다."
+ flag_assigned: "해당 플래그의 주제가 다른 사용자에게 할당되었습니다."
+ flag_unclaimed: "깃발에 행동하기 전에 그 주제를 주장해야합니다"
+ topic_assigned_excerpt: "&#39;%{title}&#39;주제를 지정했습니다"
+ reminders_frequency:
+ never: "하지않음"
+ daily: "매일"
+ weekly: "매주"
+ monthly: "월간 간행물"
+ quarterly: "계간지"
+ assign_mailer:
+ title: "메일러 할당"
+ subject_template: "[%{email_prefix}] %{assignee_name}가 &#39;%{topic_title}&#39;에 당신을 할당했습니다!"
+ pending_assigns_reminder:
+ title: "보류중인 할당이 %{pending_assignments}입니다."
diff --git a/plugins/discourse-assign/config/locales/server.lt.yml b/plugins/discourse-assign/config/locales/server.lt.yml
new file mode 100644
index 00000000000..ec2ae42bdec
--- /dev/null
+++ b/plugins/discourse-assign/config/locales/server.lt.yml
@@ -0,0 +1,16 @@
+# WARNING: Never edit this file.
+# It will be overwritten when translations are pulled from Crowdin.
+#
+# To work with us on translations, join this project:
+# https://translate.discourse.org/
+
+lt:
+ site_settings:
+ assign_enabled: "Įgalinti priskirtą įskiepį"
+ discourse_assign:
+ reminders_frequency:
+ never: "niekada"
+ daily: "kas dieną"
+ weekly: "kas savaitę"
+ monthly: "kas mėnesį"
+ quarterly: "kas ketvirtį"
diff --git a/plugins/discourse-assign/config/locales/server.lv.yml b/plugins/discourse-assign/config/locales/server.lv.yml
new file mode 100644
index 00000000000..d799a76a09d
--- /dev/null
+++ b/plugins/discourse-assign/config/locales/server.lv.yml
@@ -0,0 +1,14 @@
+# WARNING: Never edit this file.
+# It will be overwritten when translations are pulled from Crowdin.
+#
+# To work with us on translations, join this project:
+# https://translate.discourse.org/
+
+lv:
+ discourse_assign:
+ reminders_frequency:
+ never: "nekad"
+ daily: "katru dienu"
+ weekly: "katru nedēļu"
+ monthly: "mēneša"
+ quarterly: "ceturkšņa"
diff --git a/plugins/discourse-assign/config/locales/server.nb_NO.yml b/plugins/discourse-assign/config/locales/server.nb_NO.yml
new file mode 100644
index 00000000000..94407de20b3
--- /dev/null
+++ b/plugins/discourse-assign/config/locales/server.nb_NO.yml
@@ -0,0 +1,14 @@
+# WARNING: Never edit this file.
+# It will be overwritten when translations are pulled from Crowdin.
+#
+# To work with us on translations, join this project:
+# https://translate.discourse.org/
+
+nb_NO:
+ discourse_assign:
+ reminders_frequency:
+ never: "aldri"
+ daily: "daglig"
+ weekly: "ukentlig"
+ monthly: "månedlig"
+ quarterly: "kvartalsvis"
diff --git a/plugins/discourse-assign/config/locales/server.nl.yml b/plugins/discourse-assign/config/locales/server.nl.yml
new file mode 100644
index 00000000000..8874c70c782
--- /dev/null
+++ b/plugins/discourse-assign/config/locales/server.nl.yml
@@ -0,0 +1,101 @@
+# WARNING: Never edit this file.
+# It will be overwritten when translations are pulled from Crowdin.
+#
+# To work with us on translations, join this project:
+# https://translate.discourse.org/
+
+nl:
+ site_settings:
+ assign_enabled: "Toewijsplug-in inschakelen"
+ assigns_public: "Algemeen publiek toestaan topictoewijzingen te zien"
+ assigns_user_url_path: "Pad naar aan gebruikers toegewezen topics (gebruik {username} om gebruikersnaam te vervangen)"
+ assigns_by_staff_mention: "Als een medewerker een andere medewerker noemt, wordt het topic automatisch toegewezen"
+ unassign_creates_tracking_post: "Als je een toewijzing van een topic opheft, wordt een fluisterbericht of kleine actie gemaakt om de wijziging te volgen"
+ assign_self_regex: "Reguliere expressie die geldig moet zijn voor zelftoewijzing. Voorbeeld: 'mijn lijst'"
+ assign_other_regex: "Reguliere expressie die geldig moet zijn voor het toewijzen van topics aan anderen door vermelding. Voorbeeld: 'je lijst'."
+ unassign_on_group_archive: "Wanneer een bericht wordt gearchiveerd door een groep, toewijzing van bericht opheffen (opnieuw toewijzen bij terug plaatsen naar inbox)"
+ unassign_on_close: "Wanneer een topic wordt gesloten, toewijzing van topic opheffen"
+ reassign_on_open: "Wanneer een topic wordt geopend, eerder toegewezen gebruikers/groepen opnieuw toewijzen"
+ invite_on_assign: "Wanneer een persoonlijk bericht is toegewezen aan een gebruiker of groep, nodig deze dan uit voor het PB als deze nog geen deelnemer is."
+ assign_mailer: "Wanneer een e-mailmelding sturen voor toewijzingen"
+ remind_assigns: "Gebruikers aan wachtende toewijzingen herinneren"
+ remind_assigns_frequency: "Frequentie voor het herinneren van gebruikers aan toegewezen topics."
+ pending_assign_reminder_threshold: "Aantal wachtende toewijzingen dat een herinneringsmelding activeert."
+ max_assigned_topics: "Maximaal aantal topics dat aan een gebruiker kan worden toegewezen."
+ assign_allowed_on_groups: "Gebruikers in deze groepen mogen topics toewijzen en kunnen topics toegewezen krijgen."
+ enable_assign_status: "Voeg een aanpasbaar statusveld toe aan elke toewijzing."
+ assign_statuses: "Lijst van beschikbare statussen voor elke toewijzing. De eerste status is de standaardstatus die wordt toegepast op elke nieuwe toewijzing."
+ errors:
+ assign_statuses:
+ too_few: "Er moeten minimaal twee verschillende statussen beschikbaar zijn."
+ duplicate: "Er zijn dubbele statuswaarden."
+ removed_in_use: "Een status kan niet niet uit de lijst worden verwijderd als er bestaande toewijzingen zijn die deze status gebruiken."
+ discourse_assign:
+ assigned_to: "Topic toegewezen aan @%{username}"
+ unassigned: "Toewijzing van topic is opgeheven"
+ already_claimed: "Dat topic is al geclaimd."
+ already_assigned: "Topic is al toegewezen aan @%{username}"
+ too_many_assigns: "@%{username} heeft het maximale aantal toegewezen topics (%{max}) al bereikt."
+ too_many_assigns_for_topic: "Limiet van %{limit} toewijzingen per topic is bereikt."
+ forbidden_assign_to: "@%{username} kan niet worden toegewezen, omdat deze niet tot voor toewijzen toegestane groepen behoort."
+ forbidden_assignee_not_pm_participant: "@%{username} kan niet worden toegewezen, omdat deze geen toegang heeft tot dit PB. Je kunt @%{username} toegang geven door deze uit te nodigen voor dit PB."
+ forbidden_assignee_cant_see_topic: "@%{username} kan niet worden toegewezen, omdat deze geen toegang heeft tot dit topic."
+ group_already_assigned: "Topic is al toegewezen aan @%{group}"
+ forbidden_group_assign_to: "@%{group} kan niet worden toegewezen, omdat deze niet tot voor toewijzen toegestane groepen behoort."
+ forbidden_group_assignee_not_pm_participant: "@%{group} kan niet worden toegewezen, omdat niet alle leden toegang hebben tot dit PB."
+ forbidden_group_assignee_cant_see_topic: "@%{group} kan niet worden toegewezen, omdat niet alle leden toegang hebben tot dit topic."
+ flag_assigned: "Sorry, het topic van die markering is aan een andere gebruiker toegewezen"
+ flag_unclaimed: "Je moet dat topic claimen voordat je actie onderneemt op de markering"
+ topic_assigned_excerpt: "heeft het topic '%{title}' aan jou toegewezen"
+ topic_group_assigned_excerpt: "Topic '%{title}' toegewezen aan @%{group}"
+ reminders_frequency:
+ never: "nooit"
+ daily: "dagelijks"
+ weekly: "wekelijks"
+ monthly: "maandelijks"
+ quarterly: "driemaandelijks"
+ assign_mailer:
+ title: "Toewijzingsmailer"
+ subject_template: "[%{email_prefix}] %{assignee_name} heeft je toegewezen aan '%{topic_title}'!"
+ text_body_template: |
+ Hallo, %{assignee_name} heeft je **toegewezen** aan een discussie
+ > **%{topic_title}**
+ >
+ > %{topic_excerpt}
+
+ Als je interesse hebt, klik dan op de onderstaande link:
+ [%{topic_link}](%{topic_link})
+ pending_assigns_reminder:
+ title: "Je hebt %{pending_assignments} wachtende toewijzingen"
+ body: |
+ Je hebt momenteel [%{pending_assignments} wachtende toewijzingen](%{assignments_link}).
+
+ %{newest_assignments}
+ %{oldest_assignments}
+
+ Deze herinnering wordt %{frequency} gestuurd als je meer dan één toegewezen topic hebt.
+ newest: |
+ ### Nieuwste
+ %{topic_0}
+ %{topic_1}
+ %{topic_2}
+ oldest: |
+ ### Oudste
+ %{topic_0}
+ %{topic_1}
+ %{topic_2}
+ discourse_automation:
+ scriptables:
+ random_assign:
+ title: Willekeurig toewijzen
+ no_one: "Geprobeerd willekeurig een lid van '@%{group}' toe te wijzen, maar er was niemand beschikbaar."
+ discourse_push_notifications:
+ popup:
+ assigned: "@%{username} heeft je toegewezen"
+ activerecord:
+ errors:
+ models:
+ assignment:
+ attributes:
+ status:
+ invalid: "Geselecteerde status is ongeldig (deze is niet opgenomen in de site-instelling assigned_status)."
diff --git a/plugins/discourse-assign/config/locales/server.pl_PL.yml b/plugins/discourse-assign/config/locales/server.pl_PL.yml
new file mode 100644
index 00000000000..a33b1c7f035
--- /dev/null
+++ b/plugins/discourse-assign/config/locales/server.pl_PL.yml
@@ -0,0 +1,98 @@
+# WARNING: Never edit this file.
+# It will be overwritten when translations are pulled from Crowdin.
+#
+# To work with us on translations, join this project:
+# https://translate.discourse.org/
+
+pl_PL:
+ site_settings:
+ assign_enabled: "Włącz wtyczkę przypisywania"
+ assigns_public: "Zezwól wszystkim na widzenie, komu przydzielono dany temat"
+ assigns_user_url_path: "Ścieżka do tematów przypisanych użytkownikom (użyj {username} zamiast nazwy użytkownika)"
+ assigns_by_staff_mention: "Jeśli członek zespołu wzmiankuje innego członka zespołu, temat jest automatycznie przypisywany"
+ unassign_creates_tracking_post: "Jeśli cofniesz przypisanie tematu, szept lub mała akcja zostanie utworzona, by śledzić zmianę"
+ assign_self_regex: "Regex, który musi przejść, by możliwe było przypisanie tematu samemu sobie. Przykład: ’moja lista’"
+ assign_other_regex: "Regex, który musi przejść, by możliwe było przypisanie tematów innym użytkownikom dzięki wzmiankom. Przykład: ’twoja lista’"
+ unassign_on_group_archive: "Kiedy wpis jest archiwizowany przez grupę, cofnij przypisanie wiadomości (po ponowieniu przypisania jest ona przenoszona z powrotem do skrzynki odbiorczej)"
+ unassign_on_close: "Kiedy temat zostaje zamknięty, cofnij jego przypisanie"
+ reassign_on_open: "Kiedy temat jest otwierany, przydziel ponownie poprzednio przypisanych użytkowników/grupy"
+ invite_on_assign: "Gdy osobista wiadomość jest przypisana do użytkownika lub grupy, zaproś ich na PW, jeśli nie są jeszcze uczestnikami."
+ assign_mailer: "Kiedy wysyłać powiadomienia e-mail dotyczące przypisań"
+ remind_assigns: "Przypominaj użytkownikom o oczekujących przypisaniach."
+ remind_assigns_frequency: "Częstotliwość przypominania użytkownikom o przypisanych tematach."
+ max_assigned_topics: "Maksymalna liczba tematów, które można przypisać użytkownikowi."
+ assign_allowed_on_groups: "Użytkownicy w tych grupach mają prawo do przypisywania tematów i mogą być przypisani do tematów."
+ enable_assign_status: "Dodaj konfigurowalne pole stanu do każdego przypisania."
+ errors:
+ assign_statuses:
+ duplicate: "Istnieją zduplikowane wartości statusu."
+ discourse_assign:
+ assigned_to: "Temat przypisany do @%{username}"
+ unassigned: "Cofnięto przypisanie tematu"
+ already_claimed: "Ten temat został już przejęty."
+ already_assigned: "Temat jest już przypisany do @%{username}"
+ too_many_assigns: "@%{username} osiągnął już maksimum przypisanych tematów (%{max})."
+ too_many_assigns_for_topic: "Osiągnięto limit %{limit} przypisań na temat."
+ forbidden_assign_to: "Nie można przypisać @%{username}, ponieważ nie należy do przypisanych dozwolonych grup."
+ forbidden_assignee_not_pm_participant: "@%{username} nie może być przypisany, ponieważ nie ma dostępu do tej prywatnej wiadomości. Możesz przyznać dostęp @%{username}, zapraszając go do tej prywatnej wiadomości."
+ forbidden_assignee_cant_see_topic: "Nie można przypisać @%{username}, ponieważ nie ma dostępu do tego tematu."
+ group_already_assigned: "Temat jest już przypisany do @%{group}"
+ forbidden_group_assign_to: "Nie można przypisać @%{group}, ponieważ nie należy do przypisanych dozwolonych grup."
+ forbidden_group_assignee_not_pm_participant: "Nie można przypisać @%{group}, ponieważ nie wszyscy członkowie mają dostęp do tej prywatnej wiadomości."
+ forbidden_group_assignee_cant_see_topic: "Nie można przypisać @%{group}, ponieważ nie wszyscy członkowie mają dostęp do tego tematu."
+ flag_assigned: "Przepraszamy, temat, w którym jest ta flaga, został przypisany do innego użytkownika."
+ flag_unclaimed: "Musisz przejąć ten temat, zanim zaczniesz działać na fladze."
+ topic_assigned_excerpt: "przypisano ci temat '%{title}'"
+ topic_group_assigned_excerpt: "przypisano temat '%{title}' do @%{group}"
+ reminders_frequency:
+ never: "nigdy"
+ daily: "dziennie"
+ weekly: "co tydzień"
+ monthly: "miesięcznie"
+ quarterly: "kwartalnie"
+ assign_mailer:
+ title: "Przypisz mailera"
+ subject_template: "[%{email_prefix}] %{assignee_name} przypisał cię do '%{topic_title}'!"
+ text_body_template: |
+ Hej, %{assignee_name} **przypisał** cię do dyskusji
+ > **%{topic_title}**
+ >
+ > %{topic_excerpt}
+
+ Jeśli jesteś zainteresowany, kliknij poniższy link:
+
+ [%{topic_link}](%{topic_link})
+ pending_assigns_reminder:
+ title: "Masz %{pending_assignments} oczekujących przypisań"
+ body: |
+ Masz [%{pending_assignments} oczekujących przypisań](%{assignments_link}).
+
+ %{newest_assignments}
+ %{oldest_assignments}
+
+ To przypomnienie będzie wysyłane %{frequency} jeśli masz więcej niż jeden przypisany temat.
+ newest: |
+ ### Najnowsze
+ %{topic_0}
+ %{topic_1}
+ %{topic_2}
+ oldest: |
+ ### Najstarszy
+ %{topic_0}
+ %{topic_1}
+ %{topic_2}
+ discourse_automation:
+ scriptables:
+ random_assign:
+ title: Przypisanie losowe
+ no_one: "Próbowano losowo przypisać członka `@%{group}`, ale nikt nie był dostępny."
+ discourse_push_notifications:
+ popup:
+ assigned: "@%{username} przypisał Ciebie"
+ activerecord:
+ errors:
+ models:
+ assignment:
+ attributes:
+ status:
+ invalid: "Wybrany status jest nieprawidłowy (nie jest zawarty w ustawieniu witryny assigned_status)."
diff --git a/plugins/discourse-assign/config/locales/server.pt.yml b/plugins/discourse-assign/config/locales/server.pt.yml
new file mode 100644
index 00000000000..cf4ac31dcad
--- /dev/null
+++ b/plugins/discourse-assign/config/locales/server.pt.yml
@@ -0,0 +1,100 @@
+# WARNING: Never edit this file.
+# It will be overwritten when translations are pulled from Crowdin.
+#
+# To work with us on translations, join this project:
+# https://translate.discourse.org/
+
+pt:
+ site_settings:
+ assign_enabled: "Ativar o plug-in de atribuição"
+ assigns_public: "Permitir que o público geral veja atribuições de tópico"
+ assigns_user_url_path: "Caminho para os tópicos atribuídos dos(as) usuários(as) (usar: {username} para substuir o nome do(a) usuário(a))"
+ assigns_by_staff_mention: "Se um membro da equipe mencionar o tópico de outro membro da equipe, o tópico será atribuído automaticamente"
+ unassign_creates_tracking_post: "Se você cancelar a atribuição de um tópico, um sussurro ou pequena ação será criada para acompanhar a alteração"
+ assign_self_regex: "Regex que é preciso passar para autoatribuição. Por exemplo: \"minha lista\""
+ assign_other_regex: "Regex que é preciso passar para atribuir tópicos aos(às) outros(as) através de menção. Por exemplo: \"sua lista\"."
+ unassign_on_group_archive: "Quando uma mensagem for arquivada por grupo, cancelar atribuição da mensagem (reatribuir se for movida de volta para a caixa de entrada)"
+ unassign_on_close: "Quando um tópico for fechado, cancelar atribuição do tópico"
+ reassign_on_open: "Quando um tópico for aberto, reatribuir grupos/usuários(as) atribuídos(as) anteriormente"
+ invite_on_assign: "Quando uma mensagem pessoal for atribuída a um(a) usuário(a) ou gurpo, convidar para MP caos ainda não seja um(a) participante."
+ assign_mailer: "Quadno enviar e-mail de notificação para atribuições"
+ remind_assigns: "Lembrar usuários(as) sobre atribuições pendentes."
+ remind_assigns_frequency: "Frequência para lembrar usuários(as) sobre tópicos atribuídos."
+ max_assigned_topics: "Quantidade máxima de tópicos que podem ser atribuídos a um(a) usuário(a)."
+ assign_allowed_on_groups: "Usuários(as) nestes grupos têm permissão para atribuir tópicos e podem receber atribuições de tópicos."
+ enable_assign_status: "Adicionar um campo de status personalizável para cada atribuição."
+ assign_statuses: "Lista de status disponíveis para cada atribuição. O primeiro status é o status aplicado a toda atribuição nova."
+ errors:
+ assign_statuses:
+ too_few: "Deve haver pelo menos dois status diferentes disponíveis."
+ duplicate: "Há valores de status repetidos."
+ removed_in_use: "Não é possível remover um status da lista se houver atribuições existentes usando este status."
+ discourse_assign:
+ assigned_to: "Tópico atribuído a @%{username}"
+ unassigned: "A atribuição do tópico foi cancelada"
+ already_claimed: "Este tópico já foi solicitado."
+ already_assigned: "O tópico já foi atribuído a @%{username}"
+ too_many_assigns: "@%{username} já atingiu o máximo de tópicos atribuídos (%{max})."
+ too_many_assigns_for_topic: "O limite de %{limit} atribuições por tópico foi atingido"
+ forbidden_assign_to: "Não é possível atribuir @%{username}, pois não pertence aos grupos permitidos atribuídos."
+ forbidden_assignee_not_pm_participant: "Não é possível atribiur @%{username}, pois não tem acesso a esta MP. Você pode atribuir acesso a @%{username} convidando para esta MP."
+ forbidden_assignee_cant_see_topic: "Não é possível atribuir @%{username}, pois não tem acesso a este tópico."
+ group_already_assigned: "O tópico já foi atribuído a @%{group}"
+ forbidden_group_assign_to: "Não é possível atribuir @%{group}, pois não pertence aos grupos permitidos atribuídos."
+ forbidden_group_assignee_not_pm_participant: "Não é possível atribuir @%{group}, pois nem todos os membros têm acesso a esta MP."
+ forbidden_group_assignee_cant_see_topic: "Não é possível atribuir @%{group}, pois nem todos os membros têm acesso a este tópico."
+ flag_assigned: "Desculpe, o tópico dessa sinalização já foi atribuído a outro(a) usuário(a)"
+ flag_unclaimed: "Você deve solicitar esse tópico antes de agir no sinalizador"
+ topic_assigned_excerpt: "tópico \"%{title}\" atribuído a você"
+ topic_group_assigned_excerpt: "tópico \"%{title}\" atribuído a @%{group}"
+ reminders_frequency:
+ never: "nunca"
+ daily: "diariamente"
+ weekly: "semanalmente"
+ monthly: "mensal"
+ quarterly: "trimestral"
+ assign_mailer:
+ title: "Atribuir mensageiro(a)"
+ subject_template: "[%{email_prefix}] Você foi atribuído(a) por %{assignee_name} a \"%{topic_title}\"!"
+ text_body_template: |
+ Olá, você foi **atribuído(a)** por %{assignee_name} a uma discussão
+ > **%{topic_title}**
+ >
+ > %{topic_excerpt}
+
+ Se tiver interesse, clique no link abaixo:
+ [%{topic_link}](%{topic_link})
+ pending_assigns_reminder:
+ title: "Você tem %{pending_assignments} atribuições pendentes"
+ body: |
+ Atualmente você tem [%{pending_assignments} atribuições pendentes](%{assignments_link}).
+
+ %{newest_assignments}
+ %{oldest_assignments}
+
+ Este lembrete será enviado %{frequency} se você tiver mais de um tópico atribuído.
+ newest: |
+ ### Mais recentes
+ %{topic_0}
+ %{topic_1}
+ %{topic_2}
+ oldest: |
+ ### Mais antigos
+ %{topic_0}
+ %{topic_1}
+ %{topic_2}
+ discourse_automation:
+ scriptables:
+ random_assign:
+ title: Atribuição aleatória
+ no_one: "Tentativa de atribuir aleatoriamente um mebro de \"@%{group}\", mas ninguém estava disponível."
+ discourse_push_notifications:
+ popup:
+ assigned: "@%{username} atribuiu você"
+ activerecord:
+ errors:
+ models:
+ assignment:
+ attributes:
+ status:
+ invalid: "O status selecionado é inválido (não está incuso as configurações do site assigned_status)."
diff --git a/plugins/discourse-assign/config/locales/server.pt_BR.yml b/plugins/discourse-assign/config/locales/server.pt_BR.yml
new file mode 100644
index 00000000000..c57b38af1f5
--- /dev/null
+++ b/plugins/discourse-assign/config/locales/server.pt_BR.yml
@@ -0,0 +1,94 @@
+# WARNING: Never edit this file.
+# It will be overwritten when translations are pulled from Crowdin.
+#
+# To work with us on translations, join this project:
+# https://translate.discourse.org/
+
+pt_BR:
+ site_settings:
+ assign_enabled: "Ativar plugin de atribuição"
+ assigns_public: "Permitir que o público em geral veja as atribuições de tópico"
+ assigns_user_url_path: "Caminho para os tópicos atribuídos a usuários(as) (use: {username} para substituir o nome de usuário(a))"
+ assigns_by_staff_mention: "Se um membro da equipe mencionar outro membro da equipe, o tópico é atribuído automaticamente"
+ unassign_creates_tracking_post: "Se você remover a atribuição de um tópico, um sussurro ou uma pequena ação será criada para registrar a mudança"
+ assign_self_regex: "Regex que precisa passar para autoatribuição. Exemplo: \"minha lista\""
+ assign_other_regex: "Regex que precisa passar para atribuir tópicos a outras pessoas por menção. Exemplo: \"sua lista\"."
+ unassign_on_group_archive: "Quando uma mensagem é arquivada por um grupo, remover a atribuição da mensagem (reatribuir se for movida de volta para a caixa de entrada)"
+ unassign_on_close: "Quando um tópico for fechado, remover a atribuição do tópico"
+ reassign_on_open: "Quando um tópico for aberto, reatribuir grupos/usuários(as) atribuídos anteriormente"
+ invite_on_assign: "Quando uma mensagem pessoal for atribuída a um(a) usuário(a) ou grupo, convide para a MP caso ainda seja um(a) participante."
+ assign_mailer: "Quando enviar e-mail de notificação por atribuições"
+ remind_assigns: "Lembrar usuários sobre atribuições pendentes."
+ remind_assigns_frequency: "Frequência para lembrar usuários sobre tópicos atribuídos."
+ pending_assign_reminder_threshold: "Quantidade de atribuições pendentes para acionar notificação de lembrete."
+ max_assigned_topics: "Número máximo de tópicos que podem ser atribuídos a um(a) usuário(a)."
+ assign_allowed_on_groups: "Usuários(as) nestes grupos têm permissão para atribuir tópicos e podem receber atribuição de tópicos."
+ enable_assign_status: "Adicione um campo de status personalizável a cada atribuição."
+ assign_statuses: "Lista de status disponíveis para cada atribuição. O primeiro é o status padrão aplicado a cada nova atribuição."
+ errors:
+ assign_statuses:
+ too_few: "Deve haver pelo menos dois status diferentes disponíveis."
+ duplicate: "Existem valores de status duplicados."
+ removed_in_use: "Não é possível remover um status da lista se houver atribuições existentes usando esse status."
+ discourse_assign:
+ assigned_to: "Tópico atribuído a @%{username}"
+ unassigned: "A atribuição do tópico foi removida"
+ already_claimed: "Esse tópico já foi reivindicado."
+ already_assigned: "O tópico já foi atribuído a @%{username}"
+ too_many_assigns: "@%{username} já atingiu o número máximo de tópicos atribuídos (%{max})."
+ too_many_assigns_for_topic: "O limite de %{limit} atribuições por tópico foi atingido."
+ forbidden_assign_to: "@%{username} não pode receber atribuição porque não pertence ao grupo com permissão para receber atribuição."
+ forbidden_assignee_not_pm_participant: "@%{username} não pode receber atribuição porque não tem acesso a esta PM. Você pode conceder acesso a @%{username} ao convidar para esta PM."
+ forbidden_assignee_cant_see_topic: "@%{username} não pode receber atribuição porque não tem acesso a este tópico."
+ group_already_assigned: "O tópico já foi atribuído a @%{group}"
+ forbidden_group_assign_to: "@%{group} não pode receber atribuição porque não pertence aos grupos com permissão para receber atribuição."
+ forbidden_group_assignee_not_pm_participant: "@%{group} não pode receber atribuição porque nem todos os membros têm acesso a esta PM."
+ forbidden_group_assignee_cant_see_topic: "@%{group} não pode receber atribuição porque nem todos os membros têm acesso a este tópico."
+ flag_assigned: "Desculpe, aquele tópico da sinalização está designado à outro usuário"
+ flag_unclaimed: "Você precisa reivindicar aquele tópico antes de atuar na sinalização"
+ topic_assigned_excerpt: "Você foi atribuído(a) ao tópico \"%{title}\""
+ topic_group_assigned_excerpt: "tópico \"%{title}\" atribuído a @%{group}"
+ reminders_frequency:
+ never: "nunca"
+ daily: "diariamente"
+ weekly: "semanalmente"
+ monthly: "mensalmente"
+ quarterly: "trimestralmente"
+ assign_mailer:
+ title: "Atribuir mensageiro"
+ subject_template: "[%{email_prefix}] %{assignee_name} atribuiu \"%{topic_title}\" a você!"
+ text_body_template: "Ei, %{assignee_name} **atribuiu ** uma discussão a você \n> **%{topic_title}**\n>\n> %{topic_excerpt}\n\nSe você tiver interesse, clique no link abaixo:\n[%{topic_link}](%{topic_link})\n"
+ pending_assigns_reminder:
+ title: "Você tem %{pending_assignments} atribuições pendentes"
+ body: |
+ Atualmente você tem [%{pending_assignments} atribuições pendentes](%{assignments_link}).
+
+ %{newest_assignments}
+ %{oldest_assignments}
+
+ Este lembrete será enviado %{frequency} se você tiver mais de um tópico atribuído.
+ newest: |
+ ### Mais recentes
+ %{topic_0}
+ %{topic_1}
+ %{topic_2}
+ oldest: |
+ ### Mais antigos
+ %{topic_0}
+ %{topic_1}
+ %{topic_2}
+ discourse_automation:
+ scriptables:
+ random_assign:
+ title: Atribuição aleatória
+ no_one: "Tentativa de atribuir aleatoriamente a um membro de `@%{group}`, mas ninguém estava disponível."
+ discourse_push_notifications:
+ popup:
+ assigned: "@%{username} atribuiu a você"
+ activerecord:
+ errors:
+ models:
+ assignment:
+ attributes:
+ status:
+ invalid: "O status selecionado é inválido (não está incluído na configuração do site assign_status)."
diff --git a/plugins/discourse-assign/config/locales/server.ro.yml b/plugins/discourse-assign/config/locales/server.ro.yml
new file mode 100644
index 00000000000..2bd542d5fb2
--- /dev/null
+++ b/plugins/discourse-assign/config/locales/server.ro.yml
@@ -0,0 +1,14 @@
+# WARNING: Never edit this file.
+# It will be overwritten when translations are pulled from Crowdin.
+#
+# To work with us on translations, join this project:
+# https://translate.discourse.org/
+
+ro:
+ discourse_assign:
+ reminders_frequency:
+ never: "niciodată"
+ daily: "Zilnic"
+ weekly: "Săptămânal"
+ monthly: "lunar"
+ quarterly: "trimestrial"
diff --git a/plugins/discourse-assign/config/locales/server.ru.yml b/plugins/discourse-assign/config/locales/server.ru.yml
new file mode 100644
index 00000000000..c25190d1b42
--- /dev/null
+++ b/plugins/discourse-assign/config/locales/server.ru.yml
@@ -0,0 +1,95 @@
+# WARNING: Never edit this file.
+# It will be overwritten when translations are pulled from Crowdin.
+#
+# To work with us on translations, join this project:
+# https://translate.discourse.org/
+
+ru:
+ site_settings:
+ assign_enabled: "Включить возможность назначать ответственного за тему"
+ assigns_public: "Разрешить обычным пользователям видеть на кого назначена тема"
+ assigns_user_url_path: "Путь к назначенным темам (используйте {username} для подстановки имени)"
+ assigns_by_staff_mention: "Когда кто-то из персонала упоминает другого сотрудника в теме, то тема закрепляется за тем сотрудником"
+ unassign_creates_tracking_post: "При снятии ответственного с темы создается скрытое сообщение, чтобы можно было отследить изменения в теме"
+ assign_self_regex: "Шаблон, по которому тема будет автоматически закрепляться за текущим пользователем. Например, 'мой список'"
+ assign_other_regex: "Шаблон, по которому назначение будет происходить автоматически на пользователя при его упоминании. Например, 'твой список'"
+ unassign_on_group_archive: "Отменить назначение сообщения, когда сообщение архивируется группой (переназначить, если оно возвращено обратно из архива)"
+ unassign_on_close: "Снимать ответственного с темы при её закрытии"
+ reassign_on_open: "При открытии темы переназначать ранее назначенных пользователей (группы)"
+ invite_on_assign: "Если личное сообщение назначено пользователю или группе, пригласить их, если они еще не являются участниками."
+ assign_mailer: "Когда отправлять уведомления по электронной почте для назначений"
+ remind_assigns: "Напоминать пользователям об ожидающих назначениях."
+ remind_assigns_frequency: "Частота напоминания пользователям о назначенных темах."
+ pending_assign_reminder_threshold: "Количество запланированных назначений для срабатывания напоминания."
+ max_assigned_topics: "Максимальное количество тем, которые могут быть назначены пользователю."
+ assign_allowed_on_groups: "Пользователи в указанных группах могут назначать ответственного в тему и быть назначенными."
+ enable_assign_status: "Добавить настраиваемое поле статуса к каждому назначению."
+ assign_statuses: "Список статусов, доступных для каждого назначения. Первый статус — это статус по умолчанию, применяемый к каждому новому назначению."
+ errors:
+ assign_statuses:
+ too_few: "Должно быть доступно как минимум два разных статуса."
+ duplicate: "Имеются повторяющиеся значения статуса."
+ removed_in_use: "Невозможно удалить статус из списка, если есть назначения, использующие этот статус."
+ discourse_assign:
+ assigned_to: "Тема назначена пользователю @%{username}"
+ unassigned: "Ответственный снят"
+ already_claimed: "Эта тема уже зарезервирована."
+ already_assigned: "Эта тема уже назначена пользователю @%{username}"
+ too_many_assigns: "Пользователю @%{username} уже назначено максимально возможное количество тем (%{max})."
+ too_many_assigns_for_topic: "Достигнут лимит в %{limit} назначений на одну тему."
+ forbidden_assign_to: "Пользователя @%{username} нельзя назначить, поскольку он не состоит в группах, которым разрешено назначать темы."
+ forbidden_assignee_not_pm_participant: "@%{username} не могут быть назначены, поскольку они не имеют доступа к этому личному сообщению. Вы можете предоставить доступ @%{username}, пригласив их к обсуждению в этом личном сообщении."
+ forbidden_assignee_cant_see_topic: "@%{username} не могут быть назначены, поскольку у них нет доступа к этой теме."
+ group_already_assigned: "Эта тема уже назначена группе @%{group}"
+ forbidden_group_assign_to: "Группы @%{group} не могут быть назначены, поскольку они не принадлежат к группам, которым разрешено назначение."
+ forbidden_group_assignee_not_pm_participant: "Группа @%{group} не может быть назначена, поскольку не все её участники имеют доступ к этому личному сообщению."
+ forbidden_group_assignee_cant_see_topic: "Группа @%{group} не может быть назначена, поскольку не все её участники имеют доступ к этой теме."
+ flag_assigned: "Извините, эта тема с жалобой назначена другому пользователю"
+ flag_unclaimed: "Вы должны зарезервировать эту тему прежде чем рассматривать жалобу."
+ topic_assigned_excerpt: "назначил вам тему '%{title}'"
+ topic_group_assigned_excerpt: "назначил(а) тему «%{title}» группе «@%{group}»"
+ reminders_frequency:
+ never: "никогда"
+ daily: "ежедневно"
+ weekly: "еженедельно"
+ monthly: "ежемесячно"
+ quarterly: "ежеквартально"
+ assign_mailer:
+ title: "Уведомление о назначении"
+ subject_template: "[%{email_prefix}] %{assignee_name} назначил(а) Вас ответственным в теме '%{topic_title}'!"
+ text_body_template: |
+ Привет, %{assignee_name} **назначил(а)** Вас ответственным в теме
+ > **%{topic_title}**
+ >
+ > %{topic_excerpt}
+
+ Подробности по ссылке ниже:
+ [%{topic_link}](%{topic_link})
+ pending_assigns_reminder:
+ title: "У вас есть отложенные назначения: %{pending_assignments}"
+ body: "В настоящее время у вас есть [%{pending_assignments} отложенных назначений] (%{assignments_link}).\n\n%{newest_assignments}\n%{oldest_assignments} \n\nЭто напоминание будет отправляться %{frequency}, если у вас более одной назначенной темы.\n"
+ newest: |
+ ### Самые новые
+ %{topic_0}
+ %{topic_1}
+ %{topic_2}
+ oldest: |
+ ### Самые старые
+ %{topic_0}
+ %{topic_1}
+ %{topic_2}
+ discourse_automation:
+ scriptables:
+ random_assign:
+ title: Случайное назначение
+ no_one: "Нет доступных пользователей при попытке назначить случайного пользователя из группы `@%{group}`."
+ discourse_push_notifications:
+ popup:
+ assigned: "@%{username} назначил(а) вас"
+ activerecord:
+ errors:
+ models:
+ assignment:
+ attributes:
+ status:
+ invalid: "Выбранный статус недействителен (он отсутствует в списке статусов)."
diff --git a/plugins/discourse-assign/config/locales/server.sk.yml b/plugins/discourse-assign/config/locales/server.sk.yml
new file mode 100644
index 00000000000..bb3a6b2d8e3
--- /dev/null
+++ b/plugins/discourse-assign/config/locales/server.sk.yml
@@ -0,0 +1,14 @@
+# WARNING: Never edit this file.
+# It will be overwritten when translations are pulled from Crowdin.
+#
+# To work with us on translations, join this project:
+# https://translate.discourse.org/
+
+sk:
+ discourse_assign:
+ reminders_frequency:
+ never: "nikdy"
+ daily: "denne"
+ weekly: "týždenne"
+ monthly: "mesačne"
+ quarterly: "štvrťročne"
diff --git a/plugins/discourse-assign/config/locales/server.sl.yml b/plugins/discourse-assign/config/locales/server.sl.yml
new file mode 100644
index 00000000000..2efba979bf8
--- /dev/null
+++ b/plugins/discourse-assign/config/locales/server.sl.yml
@@ -0,0 +1,14 @@
+# WARNING: Never edit this file.
+# It will be overwritten when translations are pulled from Crowdin.
+#
+# To work with us on translations, join this project:
+# https://translate.discourse.org/
+
+sl:
+ discourse_assign:
+ reminders_frequency:
+ never: "nikoli"
+ daily: "dnevno"
+ weekly: "tedensko"
+ monthly: "mesečno"
+ quarterly: "v četrtletju"
diff --git a/plugins/discourse-assign/config/locales/server.sq.yml b/plugins/discourse-assign/config/locales/server.sq.yml
new file mode 100644
index 00000000000..f66c19257e0
--- /dev/null
+++ b/plugins/discourse-assign/config/locales/server.sq.yml
@@ -0,0 +1,14 @@
+# WARNING: Never edit this file.
+# It will be overwritten when translations are pulled from Crowdin.
+#
+# To work with us on translations, join this project:
+# https://translate.discourse.org/
+
+sq:
+ discourse_assign:
+ reminders_frequency:
+ never: "asnjëherë"
+ daily: "çdo ditë"
+ weekly: "çdo javë"
+ monthly: "mujore"
+ quarterly: "tremujorsh"
diff --git a/plugins/discourse-assign/config/locales/server.sr.yml b/plugins/discourse-assign/config/locales/server.sr.yml
new file mode 100644
index 00000000000..f2ef6509bad
--- /dev/null
+++ b/plugins/discourse-assign/config/locales/server.sr.yml
@@ -0,0 +1,14 @@
+# WARNING: Never edit this file.
+# It will be overwritten when translations are pulled from Crowdin.
+#
+# To work with us on translations, join this project:
+# https://translate.discourse.org/
+
+sr:
+ discourse_assign:
+ reminders_frequency:
+ never: "nikada"
+ daily: "svakodnevno"
+ weekly: "nedeljno"
+ monthly: "top mesečne"
+ quarterly: "top kvartalne"
diff --git a/plugins/discourse-assign/config/locales/server.sv.yml b/plugins/discourse-assign/config/locales/server.sv.yml
new file mode 100644
index 00000000000..c588d8e03d0
--- /dev/null
+++ b/plugins/discourse-assign/config/locales/server.sv.yml
@@ -0,0 +1,98 @@
+# WARNING: Never edit this file.
+# It will be overwritten when translations are pulled from Crowdin.
+#
+# To work with us on translations, join this project:
+# https://translate.discourse.org/
+
+sv:
+ site_settings:
+ assign_enabled: "Aktivera Tilldela-tillägget"
+ assigns_public: "Tillåt att allmänheten ser ämnestilldelningar"
+ assigns_user_url_path: "Sökväg till användares tilldelade ämnen (använd: {username} för att ersätta användarnamn)"
+ assigns_by_staff_mention: "Om personal nämner någon annan ur personalen tilldelas ämnet automatiskt"
+ unassign_creates_tracking_post: "Om du tar bort ett ämnes tilldelning skapas det en viskning eller liten åtgärd för att spåra ändringen"
+ assign_self_regex: "Regex som måste godkännas för självtilldelning. T.ex. 'min lista'"
+ assign_other_regex: "Regex som måste godkännas för att tilldela ämnen till andra via omnämnande. T.ex. 'din lista'."
+ unassign_on_group_archive: "När ett meddelande arkiveras av en grupp tas meddelandets tilldelning bort (tilldela igen om det flyttas tillbaka till inkorgen)"
+ unassign_on_close: "När ett ämne stängs tas ämnets tilldelning bort"
+ reassign_on_open: "När ett ämne öppnas, återanvisa till tidigare tilldelade användare/grupper"
+ assign_mailer: "När ett e-postmeddelande om tilldelningar ska skickas"
+ remind_assigns: "Påminn användare om väntande tilldelningar."
+ remind_assigns_frequency: "Hur ofta användare påminns om tilldelade ämnen."
+ max_assigned_topics: "Maximalt antal ämnen som kan tilldelas en användare."
+ assign_allowed_on_groups: "Användare i dessa grupper får tilldela ämnen och kan tilldelas ämnen."
+ enable_assign_status: "Lägg till ett anpassningsbart statusfält för varje uppgift."
+ assign_statuses: "Lista över statusar som är tillgängliga för varje uppgift. Den första är standardstatusen för varje ny uppgift."
+ errors:
+ assign_statuses:
+ too_few: "Det måste finnas minst två olika statusar tillgängliga."
+ duplicate: "Det finns dubbletter av statusvärden."
+ removed_in_use: "Kan inte ta bort en status från listan om det finns befintliga tilldelningar med denna status."
+ discourse_assign:
+ assigned_to: "Ämne tilldelat @%{username}"
+ unassigned: "Ämnets tilldelning togs bort"
+ already_claimed: "Det har redan gjorts anspråk på det ämnet."
+ already_assigned: "Ämnet har redan tilldelats till @%{username}"
+ too_many_assigns: "@%{username} har redan nått maximalt antal tilldelade ämnen (%{max})."
+ too_many_assigns_for_topic: "Gränsen på %{limit} tilldelningar per ämne har nåtts."
+ forbidden_assign_to: "@%{username} kan inte tilldelas eftersom hen inte tillhör någon tillåten grupp för tilldelning."
+ forbidden_assignee_not_pm_participant: "@%{username} kan inte tilldelas eftersom hen inte har tillgång till detta PM. Du kan bevilja @%{username} åtkomst genom att bjuda in hen till detta PM."
+ forbidden_assignee_cant_see_topic: "@%{username} kan inte tilldelas eftersom hen inte har tillgång till detta ämne."
+ group_already_assigned: "Ämnet har redan tilldelats till @%{group}"
+ forbidden_group_assign_to: "@%{group} kan inte tilldelas eftersom de inte tillhör tilldelade tillåtna grupper."
+ forbidden_group_assignee_not_pm_participant: "@%{group} kan inte tilldelas eftersom inte alla medlemmar har tillgång till detta PM."
+ forbidden_group_assignee_cant_see_topic: "@%{group} kan inte tilldelas eftersom inte alla medlemmar har tillgång till detta ämne."
+ flag_assigned: "Tyvärr har den flaggans ämne tilldelats en annan användare"
+ flag_unclaimed: "Du måste göra anspråk på det ämnet innan du gör något åt flaggan"
+ topic_assigned_excerpt: "tilldelade ämnet '%{title}' till dig"
+ reminders_frequency:
+ never: "aldrig"
+ daily: "dagligen"
+ weekly: "veckovis"
+ monthly: "månadsvis"
+ quarterly: "kvartalsvis"
+ assign_mailer:
+ title: "Tilldela e-postskrivare"
+ subject_template: "[%{email_prefix}] %{assignee_name} tilldelade dig till '%{topic_title}'!"
+ text_body_template: |
+ Hallå där, %{assignee_name} **tilldelade** dig till en diskussion
+ > **%{topic_title}**
+ >
+ > %{topic_excerpt}
+
+ Om du är intresserad kan du klicka på länken nedan:
+ [%{topic_link}](%{topic_link})
+ pending_assigns_reminder:
+ title: "Du har %{pending_assignments} väntande tilldelningar"
+ body: |
+ Du har för närvarande [%{pending_assignments} väntande tilldelningar](%{assignments_link}).
+
+ %{newest_assignments}
+ %{oldest_assignments}
+
+ Den här påminnelsen kommer att skickas %{frequency} om du har mer än ett tilldelat ämne.
+ newest: |
+ ### Nyaste
+ %{topic_0}
+ %{topic_1}
+ %{topic_2}
+ oldest: |
+ ### Äldsta
+ %{topic_0}
+ %{topic_1}
+ %{topic_2}
+ discourse_automation:
+ scriptables:
+ random_assign:
+ title: Tilldela slumpmässigt
+ no_one: "Försökte slumpmässigt tilldela en medlem i `@%{group}`, men ingen var tillgänglig."
+ discourse_push_notifications:
+ popup:
+ assigned: "@%{username} tilldelade dig"
+ activerecord:
+ errors:
+ models:
+ assignment:
+ attributes:
+ status:
+ invalid: "Den valda statusen är ogiltig (den ingår inte i webbplatsinställningen assigned_status)."
diff --git a/plugins/discourse-assign/config/locales/server.sw.yml b/plugins/discourse-assign/config/locales/server.sw.yml
new file mode 100644
index 00000000000..9b485aaf0a5
--- /dev/null
+++ b/plugins/discourse-assign/config/locales/server.sw.yml
@@ -0,0 +1,37 @@
+# WARNING: Never edit this file.
+# It will be overwritten when translations are pulled from Crowdin.
+#
+# To work with us on translations, join this project:
+# https://translate.discourse.org/
+
+sw:
+ site_settings:
+ assign_enabled: "Ruhusu Programu Jalizi ya Ukabidhi"
+ assigns_public: "Ruhusu watu waone mada zilizotolewa"
+ assigns_user_url_path: "Njia kwenda kwa mada za watumiaji ambazo hazijakabidhiwa (tumia: {jina la mtumiaji} kuchukua nafasi ya jina la mtumiaji)"
+ assigns_by_staff_mention: "Kama msaidizi akimtaja mfanyakazi mwenzake, mada inakabidhiwa"
+ unassign_creates_tracking_post: "Mada zote ambazo hazijakabidhiwa kwa mtu, mabadiliko yake yanafuatiliwa."
+ unassign_on_group_archive: "Kama ujumbe umefanywa kuwa nyaraka kwenye kikundi, ondoa ukabidhi wa ujumbe (kabidhi kama ukirudishwa kisanduku pokezi)"
+ unassign_on_close: "Mada haitakabidhiwa kwa mtu kama ikiwa imefungwa"
+ discourse_assign:
+ assigned_to: "%{username} amepewa mada"
+ unassigned: "Hakuna mtu aliepewa hii mada"
+ already_claimed: "Hiyo mada imeshamilikiwa."
+ flag_assigned: "Samahani nembo hii ya mada imegawiwa kwa mtu mwingine"
+ flag_unclaimed: "Miliki mada kabla ya kutumia nembo"
+ reminders_frequency:
+ never: "kamwe"
+ daily: "kila siku"
+ weekly: "kila wiki"
+ monthly: "klla mwezi"
+ quarterly: "kila baada ya miezi mitatu"
+ assign_mailer:
+ subject_template: "[%{email_prefix}] %{assignee_name} amekukabidhi '%{topic_title}'!"
+ text_body_template: |
+ Habari, %{assignee_name} **amekuweka** kwenye majadiliano
+ > **%{topic_title}**
+ >
+ > %{topic_excerpt}
+
+ Kama umevutiwa, bonyeza kiunganisho:
+ [%{topic_link}](%{topic_link})
diff --git a/plugins/discourse-assign/config/locales/server.te.yml b/plugins/discourse-assign/config/locales/server.te.yml
new file mode 100644
index 00000000000..201dac92c36
--- /dev/null
+++ b/plugins/discourse-assign/config/locales/server.te.yml
@@ -0,0 +1,14 @@
+# WARNING: Never edit this file.
+# It will be overwritten when translations are pulled from Crowdin.
+#
+# To work with us on translations, join this project:
+# https://translate.discourse.org/
+
+te:
+ discourse_assign:
+ reminders_frequency:
+ never: "ఎప్పటికీ వద్దు"
+ daily: "ప్రతిరోజూ"
+ weekly: "ప్రతీవారం"
+ monthly: "నెలవారీ"
+ quarterly: "త్రైమాసిక"
diff --git a/plugins/discourse-assign/config/locales/server.th.yml b/plugins/discourse-assign/config/locales/server.th.yml
new file mode 100644
index 00000000000..1698e089758
--- /dev/null
+++ b/plugins/discourse-assign/config/locales/server.th.yml
@@ -0,0 +1,14 @@
+# WARNING: Never edit this file.
+# It will be overwritten when translations are pulled from Crowdin.
+#
+# To work with us on translations, join this project:
+# https://translate.discourse.org/
+
+th:
+ discourse_assign:
+ reminders_frequency:
+ never: "ไม่เลย"
+ daily: "ทุกวัน"
+ weekly: "รายสัปดาห์"
+ monthly: "เดือน"
+ quarterly: "สามเดือน"
diff --git a/plugins/discourse-assign/config/locales/server.tr_TR.yml b/plugins/discourse-assign/config/locales/server.tr_TR.yml
new file mode 100644
index 00000000000..064d5c750b3
--- /dev/null
+++ b/plugins/discourse-assign/config/locales/server.tr_TR.yml
@@ -0,0 +1,101 @@
+# WARNING: Never edit this file.
+# It will be overwritten when translations are pulled from Crowdin.
+#
+# To work with us on translations, join this project:
+# https://translate.discourse.org/
+
+tr_TR:
+ site_settings:
+ assign_enabled: "Atama eklentisini etkinleştir"
+ assigns_public: "Bütün kullanıcıların konu atamalarını görmesine izin ver"
+ assigns_user_url_path: "Konuya atanan kullanıcılar (kullanıcı adını değiştirmek için {kullanıcıadı} kullanın)"
+ assigns_by_staff_mention: "Bir moderatör başka bir moderatörden bahsederse, konu otomatik olarak atanır"
+ unassign_creates_tracking_post: "Bir konunun atamasını kaldırırsanız değişikliği izlemek için bir fısıltı veya küçük bir eylem oluşturulur"
+ assign_self_regex: "Kendi kendine atama için geçmesi gereken regex. Örnek \"listem\""
+ assign_other_regex: "Konuları bahsetme yoluyla başkalarına atamak için geçmesi gereken regex. Örnek \"listeniz\"."
+ unassign_on_group_archive: "Bir mesaj bir grup tarafından arşivlendiğinde, mesajın atamasını kaldırın (gelen kutusuna geri taşınırsa yeniden atayın)"
+ unassign_on_close: "Bir konu kapatıldığında konu atamasını kaldırın"
+ reassign_on_open: "Bir konu açıldığında önceden atanmış kullanıcıları/grupları yeniden atayın"
+ invite_on_assign: "Bir kullanıcıya veya gruba kişisel bir mesaj atandığında, zaten katılımcı değillerse onları Kişisel Mesaja davet edin."
+ assign_mailer: "Atamalar için bildirim e-postasının ne zaman gönderileceği"
+ remind_assigns: "Kullanıcılara bekleyen atamaları hatırlatın."
+ remind_assigns_frequency: "Kullanıcılara atanan konuları hatırlatma sıklığı."
+ pending_assign_reminder_threshold: "Anımsatıcı bildirimini tetikleyen bekleyen atamaların sayısı."
+ max_assigned_topics: "Bir kullanıcıya atanabilecek maksimum konu sayısı."
+ assign_allowed_on_groups: "Bu gruplardaki kullanıcılar konu atayabilir ve kendilerine konu atanabilir."
+ enable_assign_status: "Her atamaya özelleştirilebilir bir durum alanı ekleyin."
+ assign_statuses: "Her atama için kullanılabilir durumların listesi. İlk durum, her yeni atamaya uygulanan varsayılan durumdur."
+ errors:
+ assign_statuses:
+ too_few: "En az iki farklı durum mevcut olmalı."
+ duplicate: "Yinelenen durum değerleri mevcut."
+ removed_in_use: "Bu durumu kullanan mevcut atamalar varsa durum, listeden kaldırılamaz."
+ discourse_assign:
+ assigned_to: "@%{username} olarak atanan konu"
+ unassigned: "Konu atanmadı"
+ already_claimed: "Bu konu zaten alındı."
+ already_assigned: "Konu zaten @%{username} adlı kullanıcıya atanmış"
+ too_many_assigns: "@%{username} zaten maksimum atanmış konu sayısına ulaşmış (%{max})."
+ too_many_assigns_for_topic: "Konu başına %{limit} atama sınırına ulaşıldı."
+ forbidden_assign_to: "%{username} atanmış izin verilen gruplara ait olmadıkları için atanamaz."
+ forbidden_assignee_not_pm_participant: "@%{username} bu özel mesaja erişimi olmadığı için atanamaz. Bu özel mesaja davet ederek @%{username} erişim izni verebilirsiniz."
+ forbidden_assignee_cant_see_topic: "%{username} bu konuya erişimi olmadığı için atanamaz."
+ group_already_assigned: "Konu zaten @%{group} grubuna atanmış"
+ forbidden_group_assign_to: "%{group} atanan izin verilen gruplara ait olmadığı için atanamaz."
+ forbidden_group_assignee_not_pm_participant: "Tüm üyelerin bu kişisel mesaja erişimi olmadığından @%{group} atanamıyor."
+ forbidden_group_assignee_cant_see_topic: "Tüm üyelerin bu konuya erişimi olmadığından @%{group} atanamıyor."
+ flag_assigned: "Üzgünüz, bu bayrağın konusu başka bir kullanıcıya atanmış"
+ flag_unclaimed: "Bayrak üzerinde işlem yapmadan önce o konuyu talep etmelisiniz"
+ topic_assigned_excerpt: "size \"%{title}\" konusunu atadı."
+ topic_group_assigned_excerpt: "\"%{title}\" konusunu @%{group} adlı gruba atadı"
+ reminders_frequency:
+ never: "asla"
+ daily: "günlük"
+ weekly: "haftalık"
+ monthly: "aylık"
+ quarterly: "üç aylık"
+ assign_mailer:
+ title: "E-posta Göndericisi Ata"
+ subject_template: "[%{email_prefix}] %{assignee_name} sizi \"%{topic_title}\" konusuna atadı!"
+ text_body_template: |
+ Merhaba, %{assignee_name} sizi bir tartışmaya **atadı**
+ > **%{topic_title}**
+ >
+ > %{topic_excerpt}
+
+ İlgileniyorsanız aşağıdaki bağlantıya tıklayın:
+ [%{topic_link}](%{topic_link})
+ pending_assigns_reminder:
+ title: "%{pending_assignments} bekleyen atamanız var"
+ body: |
+ Şu anda [%{pending_assignments} bekleyen atamanız var](%{assignments_link}).
+
+ %{newest_assignments}
+ %{oldest_assignments}
+
+ Birden fazla atanmış konunuz varsa bu hatırlatma %{frequency} adresine gönderilir.
+ newest: |
+ ### En yeni
+ %{topic_0}
+ %{topic_1}
+ %{topic_2}
+ oldest: |
+ ### En eski
+ %{topic_0}
+ %{topic_1}
+ %{topic_2}
+ discourse_automation:
+ scriptables:
+ random_assign:
+ title: Rastgele ata
+ no_one: "Rastgele bir \"@%{group}\" üyesi atanmaya çalışıldı, ancak kimse uygun değildi."
+ discourse_push_notifications:
+ popup:
+ assigned: "@%{username} sizi atadı"
+ activerecord:
+ errors:
+ models:
+ assignment:
+ attributes:
+ status:
+ invalid: "Seçilen durum geçersiz (assigned_status site ayarına dahil edilmedi)."
diff --git a/plugins/discourse-assign/config/locales/server.ug.yml b/plugins/discourse-assign/config/locales/server.ug.yml
new file mode 100644
index 00000000000..d8be9278739
--- /dev/null
+++ b/plugins/discourse-assign/config/locales/server.ug.yml
@@ -0,0 +1,14 @@
+# WARNING: Never edit this file.
+# It will be overwritten when translations are pulled from Crowdin.
+#
+# To work with us on translations, join this project:
+# https://translate.discourse.org/
+
+ug:
+ discourse_assign:
+ reminders_frequency:
+ never: "ھەرگىز"
+ daily: "كۈندىلىك"
+ weekly: "ھەپتىلىك"
+ monthly: "ئايلىق"
+ quarterly: "پەسىللىك"
diff --git a/plugins/discourse-assign/config/locales/server.uk.yml b/plugins/discourse-assign/config/locales/server.uk.yml
new file mode 100644
index 00000000000..b8d09113db5
--- /dev/null
+++ b/plugins/discourse-assign/config/locales/server.uk.yml
@@ -0,0 +1,67 @@
+# WARNING: Never edit this file.
+# It will be overwritten when translations are pulled from Crowdin.
+#
+# To work with us on translations, join this project:
+# https://translate.discourse.org/
+
+uk:
+ site_settings:
+ assign_enabled: "Увімкніть плагін призначення"
+ assigns_public: "Дозвольте широкій громадськості переглянути призначення в темах"
+ assigns_user_url_path: "Шлях до призначених користувачам тем (використовуйте: {ім’я користувача} для заміни імені користувача)"
+ assigns_by_staff_mention: "Якщо співробітник згадує іншого співробітника, тема автоматично призначається"
+ unassign_creates_tracking_post: "Якщо ви не скасуєте тему, для відстеження змін буде створено шепіт або невелику дію"
+ assign_self_regex: "Regex, який потрібно пройти для самостійного призначення. Приклад 'my list'"
+ assign_other_regex: "Regex, який потрібно пройти для присвоєння тем іншим шляхом згадування. Приклад 'your list'."
+ unassign_on_group_archive: "Коли повідомлення заархівоване групою, скасуйте повідомлення (перепризначте, якщо перенести назад у папку 'Вхідні')"
+ unassign_on_close: "Коли тема закрита, скасуйте тему"
+ assign_mailer: "Коли надсилати повідомлення електронної пошти про виконання завдань"
+ remind_assigns: "Нагадуйте користувачам про очікувані призначення."
+ remind_assigns_frequency: "Частота нагадування користувачам про призначені теми."
+ max_assigned_topics: "Максимальна кількість тем, які можна призначити користувачеві."
+ discourse_assign:
+ assigned_to: "Тема призначена для @ %{username}"
+ unassigned: "Тема не була призначена"
+ already_claimed: "Цю тему вже заявлено."
+ already_assigned: "Тема вже призначена для @ %{username}"
+ too_many_assigns: "@ %{username} вже досяг максимальної кількості призначених тем (%{max})."
+ group_already_assigned: "Тема вже призначена для @ %{group}"
+ flag_assigned: "На жаль, тема з цим прапором призначена іншому користувачеві"
+ flag_unclaimed: "Ви повинні претендувати на цю тему, перш ніж діяти за прапором"
+ topic_assigned_excerpt: "призначив вам тему '%{title}'"
+ reminders_frequency:
+ never: "ніколи"
+ daily: "щодня"
+ weekly: "щотижня"
+ monthly: "щомісяця"
+ quarterly: "щоквартально"
+ assign_mailer:
+ title: "Assign Mailer"
+ subject_template: "[%{email_prefix}] %{assignee_name} призначив вас за '%{topic_title}'!"
+ text_body_template: |
+ Вітаю, %{assignee_name} **призначив** вас до обговорення
+ > **%{topic_title}**
+ >
+ > %{topic_excerpt}
+
+ Якщо ви зацікавлені, натисніть посилання нижче:
+ [%{topic_link}](%{topic_link})
+ pending_assigns_reminder:
+ title: "Вас очікує завдання %{pending_assignments}"
+ body: |
+ На даний момент у вас є [%{pending_assignments} очікувані завдання](%{assignments_link}).
+
+ %{newest_assignments}
+ %{oldest_assignments}
+
+ Це нагадування буде надіслано%{frequency} якщо у вас більше однієї призначеної теми.
+ newest: |
+ ### Найновіше
+ %{topic_0}
+ %{topic_1}
+ %{topic_2}
+ oldest: |
+ ### Найстаріше
+ %{topic_0}
+ %{topic_1}
+ %{topic_2}
diff --git a/plugins/discourse-assign/config/locales/server.ur.yml b/plugins/discourse-assign/config/locales/server.ur.yml
new file mode 100644
index 00000000000..09cabbc3870
--- /dev/null
+++ b/plugins/discourse-assign/config/locales/server.ur.yml
@@ -0,0 +1,70 @@
+# WARNING: Never edit this file.
+# It will be overwritten when translations are pulled from Crowdin.
+#
+# To work with us on translations, join this project:
+# https://translate.discourse.org/
+
+ur:
+ site_settings:
+ assign_enabled: "اسائین پلگ اِن فعال کریں"
+ assigns_public: "عام عوام کو ٹاپک اسائنمنٹس کو دیکھنے کی اجازت دیں"
+ assigns_user_url_path: "صارفین کو اسائین کردہ ٹاپک کا یوآرایل (صارف نام کے متبادل {صارف نام} اِستعمال کریں)"
+ assigns_by_staff_mention: "اگر ایک اسٹاف ممبر کسی دوسرے اسٹاف ممبر کا ذکر کرے، تو ٹاپک خود بخود اسائین کر دیا جاتا ہے"
+ unassign_creates_tracking_post: "اگر آپ کسی ٹاپک کو غیر اسائین کردہ بناتے ہیں تو تبدیلی کو ٹریک کرنے کے لیے ایک وِھسپر یا چھوٹی کارروائی بنائی جائے گی"
+ assign_self_regex: "رَیج اَیکس جو خود اسائین کے لیے پاس ہونا لاذمی ہے۔ مثال 'میری فہرست'"
+ assign_other_regex: "رَیج اَیکس جو دوسروں کو، ذکر کے ذریعے، ٹاپک اسائین کرنے کیلیے پاس ہونا لاذمی ہے۔ مثال 'میری فہرست'۔"
+ unassign_on_group_archive: "جب کسی گروپ کی طرف سے ایک پیغام آرکائو کیا حائے تو اسے غیر اسائین کر دیا جائے (اگر اِنباکس میں واپس منتقل ہو تو دوبارہ اسائین کیا جائے)"
+ unassign_on_close: "جب ٹاپک بند کیا جائے تواسے غیراسائین کر دیں"
+ assign_mailer: "تفویض کے لئے اطلاعات ای میل کب بھیجیں"
+ remind_assigns: "زیر التواء اسائین کردہ کے بارے میں صارفین کو یاد دہانی کرائیں۔"
+ remind_assigns_frequency: "اسائین کردہ ٹاپکس کے بارے میں صارفین کو یاد دہانی کرانے کی فریکوئینسی۔"
+ max_assigned_topics: "ٹاپکس کی زیادہ سے زیادہ تعداد جو ایک صارف کو اسائین کیے جاسکتے ہیں۔"
+ assign_allowed_on_groups: "ان گروپوں میں صارفین کو عنوانات تفویض کرنے کی اجازت ہے اور انہیں عنوانات تفویض کیے جاسکتے ہیں۔"
+ discourse_assign:
+ assigned_to: "ٹاپک @%{username} کو اسائین کر دیا گیا"
+ unassigned: "ٹاپک اسائین شدہ نہیں تھا"
+ already_claimed: "وہ ٹاپک پہلے سے ہی کََلیم کر لیا گیا ہے۔"
+ already_assigned: "ٹاپک پہلے سے ہی @%{username} کو اسائین کیا ہوا ہے"
+ too_many_assigns: "@%{username} پہلے سے ہی اسائین کردہ ٹاپکس کی زیادہ سے زیادہ حد تک پہنچ چکا ہے (%{max})۔"
+ forbidden_assign_to: "@%{username} کو تفویض نہیں کیا جاسکتا ہے کیونکہ وہ تفویض کردہ گروپوں سے تعلق نہیں رکھتے ہیں۔"
+ forbidden_assignee_cant_see_topic: "@%{username} کو تفویض نہیں کیا جاسکتا کیونکہ ان کے پاس اس موضوع تک رسائی نہیں ہے۔"
+ group_already_assigned: "ٹاپک پہلے سے ہی @%{group} کو اسائین کیا ہوا ہے"
+ forbidden_group_assign_to: "@%{group} کو تفویض نہیں کیا جاسکتا ہے کیونکہ وہ تفویض کردہ گروپوں سے تعلق نہیں رکھتے ہیں۔"
+ flag_assigned: "معذرت، اُس فلَیگ کا ٹاپک ایک دوسرے صارف کو آسائین ہواوا ہے"
+ flag_unclaimed: "فلَیگ پر عمل کرنے سے پہلے آپ کا یہ ٹاپک کلَیم کرنا ضروری ہے"
+ topic_assigned_excerpt: "نے ٹاپک '%{title}' اسائین کیا"
+ reminders_frequency:
+ never: "کبھی نہیں "
+ daily: "روزانہ "
+ weekly: "ہفتہ وار"
+ monthly: "ماہانہ"
+ quarterly: "سہ ماہی"
+ assign_mailer:
+ title: "مَیلر اسائین کریں"
+ subject_template: "[%{email_prefix}] %{assignee_name} نے آپ کو '%{topic_title}' اسائین کیا! "
+ text_body_template: |
+ ارے، %{assignee_name} نے آپ کو ایک بحث **اسائین** کی ہے
+ > **%{topic_title}**
+ >
+ > %{topic_excerpt}
+
+ اگر آپ دلچسپی رکھتے ہیں تو، نیچے دیئے گئے لنک پر کلک کریں:
+ [%{topic_link}](%{topic_link})
+ pending_assigns_reminder:
+ title: "آپ کے پاس %{pending_assignments} زیر التواء اسائنمنٹس ہیں"
+ body: |
+ آپ کے پاس فی الحال [%{pending_assignments} زیر التواء اسائنمنٹس](%{assignments_link}) ہیں۔
+
+ %{newest_assignments}
+ %{oldest_assignments}
+ اگر آپ کے پاس ایک سے زائد اسائین کردہ ٹاپک موجود ہوں گے تو یہ یاد دہانی %{frequency} بھیجی جائے گی۔
+ newest: |
+ ### تازہ ترین
+ %{topic_0}
+ %{topic_1}
+ %{topic_2}
+ oldest: |
+ ### قدیم ترین
+ %{topic_0}
+ %{topic_1}
+ %{topic_2}
diff --git a/plugins/discourse-assign/config/locales/server.vi.yml b/plugins/discourse-assign/config/locales/server.vi.yml
new file mode 100644
index 00000000000..ef6c2648e24
--- /dev/null
+++ b/plugins/discourse-assign/config/locales/server.vi.yml
@@ -0,0 +1,15 @@
+# WARNING: Never edit this file.
+# It will be overwritten when translations are pulled from Crowdin.
+#
+# To work with us on translations, join this project:
+# https://translate.discourse.org/
+
+vi:
+ discourse_assign:
+ assigned_to: "Chủ đề được gán cho @%{username}"
+ reminders_frequency:
+ never: "không bao giờ"
+ daily: "hàng ngày"
+ weekly: "hàng tuần"
+ monthly: "hàng tháng"
+ quarterly: "hàng quý"
diff --git a/plugins/discourse-assign/config/locales/server.zh_CN.yml b/plugins/discourse-assign/config/locales/server.zh_CN.yml
new file mode 100644
index 00000000000..231540fd38b
--- /dev/null
+++ b/plugins/discourse-assign/config/locales/server.zh_CN.yml
@@ -0,0 +1,101 @@
+# WARNING: Never edit this file.
+# It will be overwritten when translations are pulled from Crowdin.
+#
+# To work with us on translations, join this project:
+# https://translate.discourse.org/
+
+zh_CN:
+ site_settings:
+ assign_enabled: "启用指定插件"
+ assigns_public: "允许公众查看话题指定"
+ assigns_user_url_path: "指定给用户的话题的路径(使用 :{username} 替换用户名)"
+ assigns_by_staff_mention: "如果一个管理人员指定给另一个管理人员,话题将被自动指定。"
+ unassign_creates_tracking_post: "如果您取消指定话题,将创建一个密语或操作来跟踪更改"
+ assign_self_regex: "需要为自指定传递的正则表达式。例如,“我的名单”"
+ assign_other_regex: "通过提及将话题指定给其他人需要传递的正则表达式。例如,“您的名单”"
+ unassign_on_group_archive: "当消息被群组归档时,取消指定消息(如果移回收件箱则重新指定)"
+ unassign_on_close: "当话题被关闭时取消指定话题"
+ reassign_on_open: "当话题被打开后,重新指定给之前指定的用户/群组"
+ invite_on_assign: "将个人消息指定给用户或群组时,如果他们还不是参与者,请邀请他们加入 PM。"
+ assign_mailer: "何时发送任务指定的通知电子邮件"
+ remind_assigns: "提醒用户存在待处理的指定。"
+ remind_assigns_frequency: "就已指定的话题提醒用户的频率。"
+ pending_assign_reminder_threshold: "触发提醒通知的待处理指定数量。"
+ max_assigned_topics: "可以指定给用户的最大话题数。"
+ assign_allowed_on_groups: "这些群组中的用户可以指定话题,也可以向他们指定话题。"
+ enable_assign_status: "向每个指定添加可自定义的状态字段。"
+ assign_statuses: "每个指定可用的状态列表。第一个状态是应用于每个新指定的默认状态。"
+ errors:
+ assign_statuses:
+ too_few: "必须至少有两种不同的状态。"
+ duplicate: "存在重复的状态值。"
+ removed_in_use: "如果存在使用此状态的现有指定,则无法从列表中移除该状态。"
+ discourse_assign:
+ assigned_to: "指定给 @%{username} 的话题"
+ unassigned: "话题已被取消指定"
+ already_claimed: "该话题已被认领。"
+ already_assigned: "主题已被指定给 @%{username}"
+ too_many_assigns: "@%{username} 已达到指定话题的最大数量 (%{max})。"
+ too_many_assigns_for_topic: "已达到每个话题 %{limit} 个任务指定的限制。"
+ forbidden_assign_to: "无法指定 @%{username},因为他们不属于指定的允许群组。"
+ forbidden_assignee_not_pm_participant: "无法指定 @%{username},因为他们无权访问此私信。您可以通过邀请 @%{username} 加入此私信来授予其权限。"
+ forbidden_assignee_cant_see_topic: "无法指定 @%{username},因为他们无权访问此话题。"
+ group_already_assigned: "话题已被指定给 @%{group}"
+ forbidden_group_assign_to: "无法指定 @%{group},因为他们不属于指定的允许群组。"
+ forbidden_group_assignee_not_pm_participant: "无法指定 @%{group},因为并非所有成员都有权访问此私信。"
+ forbidden_group_assignee_cant_see_topic: "无法指定 @%{group},因为并非所有成员都有权访问此话题。"
+ flag_assigned: "抱歉,该举报的话题已被指定给其他用户"
+ flag_unclaimed: "在对举报采取行动之前,您必须先认领该话题。"
+ topic_assigned_excerpt: "向您指定了话题 '%{title}'"
+ topic_group_assigned_excerpt: "将话题“%{title}”指定给 @%{group}"
+ reminders_frequency:
+ never: "永不"
+ daily: "每天"
+ weekly: "每周"
+ monthly: "每月"
+ quarterly: "每季度"
+ assign_mailer:
+ title: "指定邮件程序"
+ subject_template: "[%{email_prefix}] %{assignee_name} 将您指定至 '%{topic_title}'!"
+ text_body_template: |
+ 嘿,%{assignee_name} 将您**指定**至讨论
+ > **%{topic_title}**
+ >
+ > %{topic_excerpt}
+
+ 如果您感兴趣,点击下方的链接:
+ [%{topic_link}](%{topic_link})
+ pending_assigns_reminder:
+ title: "您有 %{pending_assignments} 个待处理任务指定"
+ body: |
+ 您目前有 [%{pending_assignments} 个待处理的任务指定](%{assignments_link})。
+
+ %{newest_assignments}
+ %{oldest_assignments}
+
+ 如果您有多个指定的话题,将%{frequency}发送此提醒。
+ newest: |
+ ### 最新
+ %{topic_0}
+ %{topic_1}
+ %{topic_2}
+ oldest: |
+ ### 最旧
+ %{topic_0}
+ %{topic_1}
+ %{topic_2}
+ discourse_automation:
+ scriptables:
+ random_assign:
+ title: 随机指定
+ no_one: "尝试随机指定 `@%{group}` 的成员,但没有人可用。"
+ discourse_push_notifications:
+ popup:
+ assigned: "@%{username} 已为您指定"
+ activerecord:
+ errors:
+ models:
+ assignment:
+ attributes:
+ status:
+ invalid: "所选状态无效(它未包含在 assigned_status 站点设置中)。"
diff --git a/plugins/discourse-assign/config/locales/server.zh_TW.yml b/plugins/discourse-assign/config/locales/server.zh_TW.yml
new file mode 100644
index 00000000000..d39b961784c
--- /dev/null
+++ b/plugins/discourse-assign/config/locales/server.zh_TW.yml
@@ -0,0 +1,14 @@
+# WARNING: Never edit this file.
+# It will be overwritten when translations are pulled from Crowdin.
+#
+# To work with us on translations, join this project:
+# https://translate.discourse.org/
+
+zh_TW:
+ discourse_assign:
+ reminders_frequency:
+ never: "永不"
+ daily: "每天"
+ weekly: "每週"
+ monthly: "月"
+ quarterly: "季度"
diff --git a/plugins/discourse-assign/config/routes.rb b/plugins/discourse-assign/config/routes.rb
new file mode 100644
index 00000000000..ef974f3d876
--- /dev/null
+++ b/plugins/discourse-assign/config/routes.rb
@@ -0,0 +1,32 @@
+# frozen_string_literal: true
+
+DiscourseAssign::Engine.routes.draw do
+ put "/claim/:topic_id" => "assign#claim"
+ put "/assign" => "assign#assign"
+ put "/unassign" => "assign#unassign"
+ get "/suggestions" => "assign#suggestions"
+ get "/assigned" => "assign#assigned"
+ get "/members/:group_name" => "assign#group_members"
+end
+
+Discourse::Application.routes.draw do
+ mount ::DiscourseAssign::Engine, at: "/assign"
+
+ get "topics/private-messages-assigned/:username" => "list#private_messages_assigned",
+ :as => "topics_private_messages_assigned",
+ :constraints => {
+ username: ::RouteFormat.username,
+ }
+ get "/topics/messages-assigned/:username" => "list#messages_assigned",
+ :constraints => {
+ username: ::RouteFormat.username,
+ },
+ :as => "messages_assigned"
+ get "/topics/group-topics-assigned/:groupname" => "list#group_topics_assigned",
+ :constraints => {
+ username: ::RouteFormat.username,
+ },
+ :as => "group_topics_assigned"
+ get "/g/:id/assigned" => "groups#index"
+ get "/g/:id/assigned/:route_type" => "groups#index"
+end
diff --git a/plugins/discourse-assign/config/settings.yml b/plugins/discourse-assign/config/settings.yml
new file mode 100644
index 00000000000..795e0f0f2ab
--- /dev/null
+++ b/plugins/discourse-assign/config/settings.yml
@@ -0,0 +1,49 @@
+discourse_assign:
+ assign_enabled:
+ default: false
+ client: true
+ assigns_by_staff_mention: false
+ unassign_creates_tracking_post: true
+ assigns_public:
+ default: false
+ client: true
+ assign_self_regex: ""
+ assign_other_regex: ""
+ unassign_on_close: false
+ unassign_on_group_archive: false
+ reassign_on_open: false
+ invite_on_assign: false
+ assigns_user_url_path:
+ client: true
+ default: "/u/{username}/activity/assigned"
+ assign_mailer:
+ default: "never"
+ enum: "AssignMailerSiteSettings"
+ remind_assigns_frequency:
+ client: true
+ enum: "RemindAssignsFrequencySiteSettings"
+ default: 0
+ pending_assign_reminder_threshold:
+ client: true
+ default: 2
+ min: 1
+ max_assigned_topics:
+ client: true
+ default: 10
+ min: 1
+ assign_allowed_on_groups:
+ client: true
+ type: group_list
+ list_type: compact
+ default: ""
+ allow_any: false
+ refresh: true
+ enable_assign_status:
+ default: false
+ client: true
+ assign_statuses:
+ client: true
+ type: list
+ default: "New|In Progress|Done"
+ allow_any: true
+ validator: AssignStatusesValidator
diff --git a/plugins/discourse-assign/db/migrate/20190422200243_add_last_reminded_at_index.rb b/plugins/discourse-assign/db/migrate/20190422200243_add_last_reminded_at_index.rb
new file mode 100644
index 00000000000..36583c930bc
--- /dev/null
+++ b/plugins/discourse-assign/db/migrate/20190422200243_add_last_reminded_at_index.rb
@@ -0,0 +1,11 @@
+# frozen_string_literal: true
+
+class AddLastRemindedAtIndex < ActiveRecord::Migration[5.2]
+ def change
+ add_index :user_custom_fields,
+ %i[name user_id],
+ name: :idx_user_custom_fields_last_reminded_at,
+ unique: true,
+ where: "name = 'last_reminded_at'"
+ end
+end
diff --git a/plugins/discourse-assign/db/migrate/20190503145428_add_reminds_assign_frequency_index.rb b/plugins/discourse-assign/db/migrate/20190503145428_add_reminds_assign_frequency_index.rb
new file mode 100644
index 00000000000..edfec1d4d5f
--- /dev/null
+++ b/plugins/discourse-assign/db/migrate/20190503145428_add_reminds_assign_frequency_index.rb
@@ -0,0 +1,11 @@
+# frozen_string_literal: true
+
+class AddRemindsAssignFrequencyIndex < ActiveRecord::Migration[5.2]
+ def change
+ add_index :user_custom_fields,
+ %i[name user_id],
+ name: :idx_user_custom_fields_remind_assigns_frequency,
+ unique: true,
+ where: "name = 'remind_assigns_frequency'"
+ end
+end
diff --git a/plugins/discourse-assign/db/migrate/20190718144722_set_assign_allowed_on_groups_default.rb b/plugins/discourse-assign/db/migrate/20190718144722_set_assign_allowed_on_groups_default.rb
new file mode 100644
index 00000000000..1a62fb38bb5
--- /dev/null
+++ b/plugins/discourse-assign/db/migrate/20190718144722_set_assign_allowed_on_groups_default.rb
@@ -0,0 +1,27 @@
+# frozen_string_literal: true
+
+class SetAssignAllowedOnGroupsDefault < ActiveRecord::Migration[5.2]
+ def up
+ current_values =
+ DB.query_single(
+ "SELECT value FROM site_settings WHERE name = 'assign_allowed_on_groups'",
+ ).first
+
+ # Dynamically sets the default value, supports older versions.
+ if current_values.nil?
+ min_version = 201_907_171_337_43
+ migrated_site_setting =
+ DB.query_single(
+ "SELECT schema_migrations.version FROM schema_migrations WHERE schema_migrations.version = '#{min_version}'",
+ ).first
+ default = migrated_site_setting.present? ? Group::AUTO_GROUPS[:staff] : "staff"
+
+ execute "INSERT INTO site_settings (name, data_type, value, created_at, updated_at)
+ VALUES ('assign_allowed_on_groups', #{SiteSettings::TypeSupervisor.types[:group_list]}, '#{default}', now(), now())"
+ end
+ end
+
+ def down
+ raise ActiveRecord::IrreversibleMigration
+ end
+end
diff --git a/plugins/discourse-assign/db/migrate/20191119174425_rename_site_setting_assign_emailer.rb b/plugins/discourse-assign/db/migrate/20191119174425_rename_site_setting_assign_emailer.rb
new file mode 100644
index 00000000000..19ae6feede1
--- /dev/null
+++ b/plugins/discourse-assign/db/migrate/20191119174425_rename_site_setting_assign_emailer.rb
@@ -0,0 +1,17 @@
+# frozen_string_literal: true
+
+class RenameSiteSettingAssignEmailer < ActiveRecord::Migration[5.2]
+ def up
+ execute "UPDATE site_settings
+ SET name = 'assign_mailer', value = '#{AssignMailer.levels[:always]}', data_type = #{SiteSettings::TypeSupervisor.types[:enum]}
+ WHERE name = 'assign_mailer_enabled' AND value = 't' AND data_type = #{SiteSettings::TypeSupervisor.types[:enum]}"
+
+ execute "UPDATE site_settings
+ SET name = 'assign_mailer', value = '#{AssignMailer.levels[:never]}', data_type = #{SiteSettings::TypeSupervisor.types[:enum]}
+ WHERE name = 'assign_mailer_enabled' AND value = 'f' AND data_type = #{SiteSettings::TypeSupervisor.types[:enum]}"
+ end
+
+ def down
+ raise ActiveRecord::IrreversibleMigration
+ end
+end
diff --git a/plugins/discourse-assign/db/migrate/20210429154319_remove_nil_custom_fields_from_assign.rb b/plugins/discourse-assign/db/migrate/20210429154319_remove_nil_custom_fields_from_assign.rb
new file mode 100644
index 00000000000..a9c187a358b
--- /dev/null
+++ b/plugins/discourse-assign/db/migrate/20210429154319_remove_nil_custom_fields_from_assign.rb
@@ -0,0 +1,19 @@
+# frozen_string_literal: true
+
+class RemoveNilCustomFieldsFromAssign < ActiveRecord::Migration[6.0]
+ def up
+ execute <<~SQL
+ DELETE FROM topic_custom_fields
+ WHERE name = 'assigned_to_id' AND value IS NULL
+ SQL
+
+ execute <<~SQL
+ DELETE FROM topic_custom_fields
+ WHERE name = 'assigned_by_id' AND value IS NULL
+ SQL
+ end
+
+ def down
+ raise ActiveRecord::IrreversibleMigration
+ end
+end
diff --git a/plugins/discourse-assign/db/migrate/20210627100932_create_assignments.rb b/plugins/discourse-assign/db/migrate/20210627100932_create_assignments.rb
new file mode 100644
index 00000000000..0eb71446095
--- /dev/null
+++ b/plugins/discourse-assign/db/migrate/20210627100932_create_assignments.rb
@@ -0,0 +1,15 @@
+# frozen_string_literal: true
+
+class CreateAssignments < ActiveRecord::Migration[6.1]
+ def change
+ create_table :assignments do |t|
+ t.integer :topic_id, null: false
+ t.integer :assigned_to_id, null: false
+ t.integer :assigned_by_user_id, null: false
+
+ t.timestamps
+ end
+
+ add_index :assignments, :topic_id, unique: true
+ end
+end
diff --git a/plugins/discourse-assign/db/migrate/20210709101534_move_assignments_from_custom_fields_to_a_table.rb b/plugins/discourse-assign/db/migrate/20210709101534_move_assignments_from_custom_fields_to_a_table.rb
new file mode 100644
index 00000000000..a7a58db3f8f
--- /dev/null
+++ b/plugins/discourse-assign/db/migrate/20210709101534_move_assignments_from_custom_fields_to_a_table.rb
@@ -0,0 +1,11 @@
+# frozen_string_literal: true
+
+class MoveAssignmentsFromCustomFieldsToATable < ActiveRecord::Migration[6.1]
+ def up
+ # No-op, this migration was invalid
+ end
+
+ def down
+ raise ActiveRecord::IrreversibleMigration
+ end
+end
diff --git a/plugins/discourse-assign/db/migrate/20210714173022_correctly_move_assignments_from_custom_fields_to_a_table.rb b/plugins/discourse-assign/db/migrate/20210714173022_correctly_move_assignments_from_custom_fields_to_a_table.rb
new file mode 100644
index 00000000000..5bf6ce09964
--- /dev/null
+++ b/plugins/discourse-assign/db/migrate/20210714173022_correctly_move_assignments_from_custom_fields_to_a_table.rb
@@ -0,0 +1,66 @@
+# frozen_string_literal: true
+
+class CorrectlyMoveAssignmentsFromCustomFieldsToATable < ActiveRecord::Migration[6.1]
+ def up
+ # An old version of 20210709101534 incorrectly imported `assignments` with
+ # the topic_id and assigned_to_id columns flipped. This query deletes those invalid records.
+
+ if column_exists?(:assignments, :target_id)
+ execute <<~SQL
+ INSERT INTO assignments (assigned_to_id, assigned_by_user_id, topic_id, created_at, updated_at, assigned_to_type, target_id, target_type)
+ SELECT
+ assigned_to.value::integer,
+ assigned_by.value::integer,
+ assigned_by.topic_id,
+ assigned_by.created_at,
+ assigned_by.updated_at,
+ 'User',
+ assigned_by.topic_id,
+ 'Topic'
+ FROM topic_custom_fields assigned_by
+ INNER JOIN topic_custom_fields assigned_to ON assigned_to.topic_id = assigned_by.topic_id
+ WHERE assigned_by.name = 'assigned_by_id'
+ AND assigned_to.name = 'assigned_to_id'
+ ORDER BY assigned_by.created_at DESC
+ ON CONFLICT DO NOTHING
+ SQL
+ elsif column_exists?(:assignments, :assigned_to_type)
+ execute <<~SQL
+ INSERT INTO assignments (assigned_to_id, assigned_by_user_id, topic_id, created_at, updated_at, assigned_to_type)
+ SELECT
+ assigned_to.value::integer,
+ assigned_by.value::integer,
+ assigned_by.topic_id,
+ assigned_by.created_at,
+ assigned_by.updated_at,
+ 'User',
+ FROM topic_custom_fields assigned_by
+ INNER JOIN topic_custom_fields assigned_to ON assigned_to.topic_id = assigned_by.topic_id
+ WHERE assigned_by.name = 'assigned_by_id'
+ AND assigned_to.name = 'assigned_to_id'
+ ORDER BY assigned_by.created_at DESC
+ ON CONFLICT DO NOTHING
+ SQL
+ else
+ execute <<~SQL
+ INSERT INTO assignments (assigned_to_id, assigned_by_user_id, topic_id, created_at, updated_at)
+ SELECT
+ assigned_to.value::integer,
+ assigned_by.value::integer,
+ assigned_by.topic_id,
+ assigned_by.created_at,
+ assigned_by.updated_at
+ FROM topic_custom_fields assigned_by
+ INNER JOIN topic_custom_fields assigned_to ON assigned_to.topic_id = assigned_by.topic_id
+ WHERE assigned_by.name = 'assigned_by_id'
+ AND assigned_to.name = 'assigned_to_id'
+ ORDER BY assigned_by.created_at DESC
+ ON CONFLICT DO NOTHING
+ SQL
+ end
+ end
+
+ def down
+ raise ActiveRecord::IrreversibleMigration
+ end
+end
diff --git a/plugins/discourse-assign/db/migrate/20210724143804_add_assigned_to_type_to_assignments.rb b/plugins/discourse-assign/db/migrate/20210724143804_add_assigned_to_type_to_assignments.rb
new file mode 100644
index 00000000000..5a3c2289cf5
--- /dev/null
+++ b/plugins/discourse-assign/db/migrate/20210724143804_add_assigned_to_type_to_assignments.rb
@@ -0,0 +1,19 @@
+# frozen_string_literal: true
+
+class AddAssignedToTypeToAssignments < ActiveRecord::Migration[6.1]
+ def up
+ add_column :assignments, :assigned_to_type, :string
+
+ execute <<~SQL
+ UPDATE assignments
+ SET assigned_to_type = 'User'
+ WHERE assigned_to_type IS NULL
+ SQL
+
+ change_column :assignments, :assigned_to_type, :string, null: false
+ end
+
+ def down
+ remove_column :assignments, :assigned_to_type
+ end
+end
diff --git a/plugins/discourse-assign/db/migrate/20210830024453_add_assignable_level_to_groups.rb b/plugins/discourse-assign/db/migrate/20210830024453_add_assignable_level_to_groups.rb
new file mode 100644
index 00000000000..01118ef5c84
--- /dev/null
+++ b/plugins/discourse-assign/db/migrate/20210830024453_add_assignable_level_to_groups.rb
@@ -0,0 +1,7 @@
+# frozen_string_literal: true
+
+class AddAssignableLevelToGroups < ActiveRecord::Migration[6.1]
+ def change
+ add_column :groups, :assignable_level, :integer, default: 0, null: false
+ end
+end
diff --git a/plugins/discourse-assign/db/migrate/20210908060141_add_index_to_assigned_to_id_and_type.rb b/plugins/discourse-assign/db/migrate/20210908060141_add_index_to_assigned_to_id_and_type.rb
new file mode 100644
index 00000000000..bde5074e763
--- /dev/null
+++ b/plugins/discourse-assign/db/migrate/20210908060141_add_index_to_assigned_to_id_and_type.rb
@@ -0,0 +1,7 @@
+# frozen_string_literal: true
+
+class AddIndexToAssignedToIdAndType < ActiveRecord::Migration[6.1]
+ def change
+ add_index :assignments, %i[assigned_to_id assigned_to_type]
+ end
+end
diff --git a/plugins/discourse-assign/db/migrate/20211006223156_add_target_to_assignments.rb b/plugins/discourse-assign/db/migrate/20211006223156_add_target_to_assignments.rb
new file mode 100644
index 00000000000..00555f8232c
--- /dev/null
+++ b/plugins/discourse-assign/db/migrate/20211006223156_add_target_to_assignments.rb
@@ -0,0 +1,27 @@
+# frozen_string_literal: true
+
+class AddTargetToAssignments < ActiveRecord::Migration[6.1]
+ def up
+ add_column :assignments, :target_id, :integer
+ add_column :assignments, :target_type, :string
+
+ execute <<~SQL
+ UPDATE assignments
+ SET target_type = 'Topic', target_id = topic_id
+ WHERE target_type IS NULL
+ SQL
+
+ change_column :assignments, :target_id, :integer, null: false
+ change_column :assignments, :target_type, :string, null: false
+
+ add_index :assignments, %i[target_id target_type], unique: true
+ add_index :assignments,
+ %i[assigned_to_id assigned_to_type target_id target_type],
+ unique: true,
+ name: "unique_target_and_assigned"
+ end
+
+ def down
+ remove_columns :assignments, :target_id, :target_type
+ end
+end
diff --git a/plugins/discourse-assign/db/migrate/20211014043735_remove_topic_id_index.rb b/plugins/discourse-assign/db/migrate/20211014043735_remove_topic_id_index.rb
new file mode 100644
index 00000000000..f29bf8fa845
--- /dev/null
+++ b/plugins/discourse-assign/db/migrate/20211014043735_remove_topic_id_index.rb
@@ -0,0 +1,7 @@
+# frozen_string_literal: true
+
+class RemoveTopicIdIndex < ActiveRecord::Migration[6.1]
+ def change
+ remove_index :assignments, :topic_id
+ end
+end
diff --git a/plugins/discourse-assign/db/migrate/20211108023921_change_action_code_href_to_action_code_path.rb b/plugins/discourse-assign/db/migrate/20211108023921_change_action_code_href_to_action_code_path.rb
new file mode 100644
index 00000000000..024a0cae109
--- /dev/null
+++ b/plugins/discourse-assign/db/migrate/20211108023921_change_action_code_href_to_action_code_path.rb
@@ -0,0 +1,19 @@
+# frozen_string_literal: true
+
+class ChangeActionCodeHrefToActionCodePath < ActiveRecord::Migration[6.1]
+ def up
+ DB.exec(<<~SQL)
+ UPDATE post_custom_fields
+ SET name = 'action_code_path'
+ WHERE name = 'action_code_href'
+ SQL
+ end
+
+ def down
+ DB.exec(<<~SQL)
+ UPDATE post_custom_fields
+ SET name = 'action_code_href'
+ WHERE name = 'action_code_path'
+ SQL
+ end
+end
diff --git a/plugins/discourse-assign/db/migrate/20211206060512_add_active_to_assignments.rb b/plugins/discourse-assign/db/migrate/20211206060512_add_active_to_assignments.rb
new file mode 100644
index 00000000000..497e404e31c
--- /dev/null
+++ b/plugins/discourse-assign/db/migrate/20211206060512_add_active_to_assignments.rb
@@ -0,0 +1,8 @@
+# frozen_string_literal: true
+
+class AddActiveToAssignments < ActiveRecord::Migration[6.1]
+ def change
+ add_column :assignments, :active, :boolean, default: true
+ add_index :assignments, :active
+ end
+end
diff --git a/plugins/discourse-assign/db/migrate/20211206081254_move_prev_assigned_custom_fields_to_assignments.rb b/plugins/discourse-assign/db/migrate/20211206081254_move_prev_assigned_custom_fields_to_assignments.rb
new file mode 100644
index 00000000000..d8e772367bc
--- /dev/null
+++ b/plugins/discourse-assign/db/migrate/20211206081254_move_prev_assigned_custom_fields_to_assignments.rb
@@ -0,0 +1,29 @@
+# frozen_string_literal: true
+
+class MovePrevAssignedCustomFieldsToAssignments < ActiveRecord::Migration[6.1]
+ def up
+ execute <<~SQL
+ INSERT INTO assignments (assigned_to_id, assigned_to_type, assigned_by_user_id, topic_id, target_id, target_type, created_at, updated_at, active)
+ SELECT
+ prev_assigned_to_id.value::integer,
+ prev_assigned_to_type.value,
+ #{Discourse::SYSTEM_USER_ID},
+ prev_assigned_to_type.topic_id,
+ prev_assigned_to_type.topic_id,
+ 'Topic',
+ prev_assigned_to_type.created_at,
+ prev_assigned_to_type.updated_at,
+ false
+ FROM topic_custom_fields prev_assigned_to_type
+ INNER JOIN topic_custom_fields prev_assigned_to_id ON prev_assigned_to_type.topic_id = prev_assigned_to_id.topic_id
+ WHERE prev_assigned_to_type.name = 'prev_assigned_to_type'
+ AND prev_assigned_to_id.name = 'prev_assigned_to_id'
+ ORDER BY prev_assigned_to_type.created_at DESC
+ ON CONFLICT DO NOTHING
+ SQL
+ end
+
+ def down
+ raise ActiveRecord::IrreversibleMigration
+ end
+end
diff --git a/plugins/discourse-assign/db/migrate/20220429110203_add_note_to_assignments.rb b/plugins/discourse-assign/db/migrate/20220429110203_add_note_to_assignments.rb
new file mode 100644
index 00000000000..52c2267a2e0
--- /dev/null
+++ b/plugins/discourse-assign/db/migrate/20220429110203_add_note_to_assignments.rb
@@ -0,0 +1,7 @@
+# frozen_string_literal: true
+
+class AddNoteToAssignments < ActiveRecord::Migration[6.1]
+ def change
+ add_column :assignments, :note, :string, null: true
+ end
+end
diff --git a/plugins/discourse-assign/db/migrate/20220728171436_add_status_to_assignments.rb b/plugins/discourse-assign/db/migrate/20220728171436_add_status_to_assignments.rb
new file mode 100644
index 00000000000..19c259a3761
--- /dev/null
+++ b/plugins/discourse-assign/db/migrate/20220728171436_add_status_to_assignments.rb
@@ -0,0 +1,7 @@
+# frozen_string_literal: true
+
+class AddStatusToAssignments < ActiveRecord::Migration[6.1]
+ def change
+ add_column :assignments, :status, :text, null: true
+ end
+end
diff --git a/plugins/discourse-assign/db/migrate/20230112033741_add_topic_id_index_to_assignments.rb b/plugins/discourse-assign/db/migrate/20230112033741_add_topic_id_index_to_assignments.rb
new file mode 100644
index 00000000000..ca5d17aeac6
--- /dev/null
+++ b/plugins/discourse-assign/db/migrate/20230112033741_add_topic_id_index_to_assignments.rb
@@ -0,0 +1,7 @@
+# frozen_string_literal: true
+
+class AddTopicIdIndexToAssignments < ActiveRecord::Migration[7.0]
+ def change
+ add_index :assignments, :topic_id
+ end
+end
diff --git a/plugins/discourse-assign/db/migrate/20230113025043_deactivate_assignments_to_deleted_targets.rb b/plugins/discourse-assign/db/migrate/20230113025043_deactivate_assignments_to_deleted_targets.rb
new file mode 100644
index 00000000000..2e60a85ff8c
--- /dev/null
+++ b/plugins/discourse-assign/db/migrate/20230113025043_deactivate_assignments_to_deleted_targets.rb
@@ -0,0 +1,29 @@
+# frozen_string_literal: true
+
+class DeactivateAssignmentsToDeletedTargets < ActiveRecord::Migration[7.0]
+ def up
+ execute <<~SQL
+ UPDATE assignments
+ SET active = false
+ FROM posts
+ WHERE posts.id = assignments.target_id
+ AND assignments.target_type = 'Post'
+ AND posts.deleted_at IS NOT NULL
+ AND assignments.active = true
+ SQL
+
+ execute <<~SQL
+ UPDATE assignments
+ SET active = false
+ FROM topics
+ WHERE topics.id = assignments.target_id
+ AND assignments.target_type = 'Topic'
+ AND topics.deleted_at IS NOT NULL
+ AND assignments.active = true
+ SQL
+ end
+
+ def down
+ raise ActiveRecord::IrreversibleMigration
+ end
+end
diff --git a/plugins/discourse-assign/db/migrate/20231011152903_ensure_notifications_consistency.rb b/plugins/discourse-assign/db/migrate/20231011152903_ensure_notifications_consistency.rb
new file mode 100644
index 00000000000..bf9efc5b7da
--- /dev/null
+++ b/plugins/discourse-assign/db/migrate/20231011152903_ensure_notifications_consistency.rb
@@ -0,0 +1,81 @@
+# frozen_string_literal: true
+
+class EnsureNotificationsConsistency < ActiveRecord::Migration[7.0]
+ def up
+ DB.exec(<<~SQL)
+ DELETE FROM notifications
+ WHERE id IN (
+ SELECT notifications.id FROM notifications
+ LEFT OUTER JOIN assignments ON assignments.id = ((notifications.data::jsonb)->'assignment_id')::int
+ WHERE (notification_type = 34 AND assignments.id IS NULL OR assignments.active = FALSE)
+ )
+ SQL
+
+ DB.exec(<<~SQL)
+ WITH tmp AS (
+ SELECT
+ assignments.assigned_to_id AS user_id,
+ assignments.created_at,
+ assignments.updated_at,
+ assignments.topic_id,
+ (
+ CASE WHEN assignments.target_type = 'Topic' THEN 1
+ ELSE (SELECT posts.post_number FROM posts WHERE posts.id = assignments.target_id)
+ END
+ ) AS post_number,
+ json_strip_nulls(json_build_object(
+ 'message', 'discourse_assign.assign_notification',
+ 'display_username', (SELECT users.username FROM users WHERE users.id = assignments.assigned_by_user_id),
+ 'topic_title', topics.title,
+ 'assignment_id', assignments.id
+ ))::text AS data
+ FROM assignments
+ LEFT OUTER JOIN topics ON topics.deleted_at IS NULL AND topics.id = assignments.topic_id
+ LEFT OUTER JOIN users ON users.id = assignments.assigned_to_id AND assignments.assigned_to_type = 'User'
+ LEFT OUTER JOIN notifications ON ((data::jsonb)->'assignment_id')::int = assignments.id
+ WHERE assignments.active = TRUE
+ AND NOT (topics.id IS NULL OR users.id IS NULL)
+ AND assignments.assigned_to_type = 'User'
+ AND notifications.id IS NULL
+ )
+ INSERT INTO notifications (notification_type, high_priority, read, user_id, created_at, updated_at, topic_id, post_number, data)
+ SELECT 34, TRUE, TRUE, tmp.* FROM tmp
+ SQL
+
+ DB.exec(<<~SQL)
+ WITH tmp AS (
+ SELECT
+ users.id AS user_id,
+ assignments.created_at,
+ assignments.updated_at,
+ assignments.topic_id,
+ (
+ CASE WHEN assignments.target_type = 'Topic' THEN 1
+ ELSE (SELECT posts.post_number FROM posts WHERE posts.id = assignments.target_id)
+ END
+ ) AS post_number,
+ json_strip_nulls(json_build_object(
+ 'message', 'discourse_assign.assign_group_notification',
+ 'display_username', (SELECT groups.name FROM groups WHERE groups.id = assignments.assigned_to_id),
+ 'topic_title', topics.title,
+ 'assignment_id', assignments.id
+ ))::text AS data
+ FROM assignments
+ LEFT OUTER JOIN topics ON topics.deleted_at IS NULL AND topics.id = assignments.topic_id
+ LEFT OUTER JOIN groups ON groups.id = assignments.assigned_to_id AND assignments.assigned_to_type = 'Group'
+ LEFT OUTER JOIN group_users ON groups.id = group_users.group_id
+ LEFT OUTER JOIN users ON users.id = group_users.user_id
+ LEFT OUTER JOIN notifications ON ((data::jsonb)->'assignment_id')::int = assignments.id AND notifications.user_id = users.id
+ WHERE assignments.active = TRUE
+ AND NOT (topics.id IS NULL OR groups.id IS NULL)
+ AND assignments.assigned_to_type = 'Group'
+ AND notifications.id IS NULL
+ )
+ INSERT INTO notifications (notification_type, high_priority, read, user_id, created_at, updated_at, topic_id, post_number, data)
+ SELECT 34, TRUE, TRUE, tmp.* FROM tmp
+ SQL
+ end
+
+ def down
+ end
+end
diff --git a/plugins/discourse-assign/db/migrate/20241212113000_create_silenced_assignments.rb b/plugins/discourse-assign/db/migrate/20241212113000_create_silenced_assignments.rb
new file mode 100644
index 00000000000..8c0129e8ce1
--- /dev/null
+++ b/plugins/discourse-assign/db/migrate/20241212113000_create_silenced_assignments.rb
@@ -0,0 +1,14 @@
+# frozen_string_literal: true
+class CreateSilencedAssignments < ActiveRecord::Migration[7.2]
+ def up
+ create_table :silenced_assignments do |t|
+ t.bigint :assignment_id, null: false
+ t.timestamps
+ end
+ add_index :silenced_assignments, :assignment_id, unique: true
+ end
+
+ def down
+ drop_table :silenced_assignments
+ end
+end
diff --git a/plugins/discourse-assign/db/migrate/20250115130542_add_notification_level_when_assigned_user_option.rb b/plugins/discourse-assign/db/migrate/20250115130542_add_notification_level_when_assigned_user_option.rb
new file mode 100644
index 00000000000..fde424b752b
--- /dev/null
+++ b/plugins/discourse-assign/db/migrate/20250115130542_add_notification_level_when_assigned_user_option.rb
@@ -0,0 +1,6 @@
+# frozen_string_literal: true
+class AddNotificationLevelWhenAssignedUserOption < ActiveRecord::Migration[7.2]
+ def change
+ add_column :user_options, :notification_level_when_assigned, :integer, null: false, default: 3 # watch topic
+ end
+end
diff --git a/plugins/discourse-assign/lib/assigner.rb b/plugins/discourse-assign/lib/assigner.rb
new file mode 100644
index 00000000000..71c05d8f1f3
--- /dev/null
+++ b/plugins/discourse-assign/lib/assigner.rb
@@ -0,0 +1,587 @@
+# frozen_string_literal: true
+
+require "email/sender"
+require "nokogiri"
+
+class ::Assigner
+ ASSIGNMENTS_PER_TOPIC_LIMIT = 5
+
+ def self.backfill_auto_assign
+ staff_mention =
+ User
+ .assign_allowed
+ .pluck("username")
+ .map { |name| "p.cooked ILIKE '%mention%@#{name}%'" }
+ .join(" OR ")
+
+ sql = <<~SQL
+ SELECT p.topic_id, MAX(post_number) post_number
+ FROM posts p
+ JOIN topics t ON t.id = p.topic_id
+ LEFT JOIN assignments a ON a.target_id = p.topic_id AND a.target_type = 'Topic'
+ WHERE p.user_id IN (SELECT id FROM users WHERE moderator OR admin)
+ AND (#{staff_mention})
+ AND a.assigned_to_id IS NULL
+ AND NOT t.closed
+ AND t.deleted_at IS NULL
+ GROUP BY p.topic_id
+ SQL
+
+ puts
+ assigned = 0
+
+ ActiveRecord::Base
+ .connection
+ .raw_connection
+ .exec(sql)
+ .to_a
+ .each do |row|
+ post = Post.find_by(post_number: row["post_number"].to_i, topic_id: row["topic_id"].to_i)
+ assigned += 1 if post && auto_assign(post)
+ putc "."
+ end
+
+ puts
+ puts "#{assigned} topics where automatically assigned to staff members"
+ end
+
+ def self.assigned_self?(text)
+ return false if text.blank? || SiteSetting.assign_self_regex.blank?
+ regex =
+ begin
+ Regexp.new(SiteSetting.assign_self_regex)
+ rescue StandardError
+ nil
+ end
+ !!(regex && text[regex])
+ end
+
+ def self.assigned_other?(text)
+ return false if text.blank? || SiteSetting.assign_other_regex.blank?
+ regex =
+ begin
+ Regexp.new(SiteSetting.assign_other_regex)
+ rescue StandardError
+ nil
+ end
+ !!(regex && text[regex])
+ end
+
+ def self.auto_assign(post, force: false)
+ return unless SiteSetting.assigns_by_staff_mention
+
+ if post.user && post.topic && post.user.can_assign?
+ return if post.topic.assignment.present? && !force
+
+ # remove quotes, oneboxes and code blocks
+ doc = Nokogiri::HTML5.fragment(post.cooked)
+ doc.css(".quote, .onebox, pre, code").remove
+ text = doc.text.strip
+
+ assign_other = assigned_other?(text) && mentioned_staff(post)
+ assign_self = assigned_self?(text) && post.user
+ return unless assign_other || assign_self
+
+ if is_last_staff_post?(post)
+ assigner = new(post.topic, post.user)
+ if assign_other
+ assigner.assign(assign_other, skip_small_action_post: true)
+ elsif assign_self
+ assigner.assign(assign_self, skip_small_action_post: true)
+ end
+ end
+ end
+ end
+
+ def self.is_last_staff_post?(post)
+ allowed_user_ids = User.assign_allowed.pluck(:id).join(",")
+
+ sql = <<~SQL
+ SELECT 1
+ FROM posts p
+ JOIN users u ON u.id = p.user_id
+ WHERE p.deleted_at IS NULL
+ AND p.topic_id = :topic_id
+ AND u.id IN (#{allowed_user_ids})
+ HAVING MAX(post_number) = :post_number
+ SQL
+
+ args = { topic_id: post.topic_id, post_number: post.post_number }
+
+ DB.exec(sql, args) == 1
+ end
+
+ def self.mentioned_staff(post)
+ mentions = post.raw_mentions
+ if mentions.present?
+ User.human_users.assign_allowed.where("username_lower IN (?)", mentions.map(&:downcase)).first
+ end
+ end
+
+ def self.publish_topic_tracking_state(topic, user_id)
+ if topic.private_message?
+ MessageBus.publish("/private-messages/assigned", { topic_id: topic.id }, user_ids: [user_id])
+ end
+ end
+
+ def initialize(target, user)
+ @assigned_by = user
+ @target = target
+ end
+
+ def allowed_user_ids
+ @allowed_user_ids ||= User.assign_allowed.pluck(:id)
+ end
+
+ def allowed_group_ids
+ @allowed_group_ids ||= Group.assignable(@assigned_by).pluck(:id)
+ end
+
+ def can_assign_to?(assign_to)
+ return true if assign_to.is_a?(Group)
+ return true if @assigned_by.id == assign_to.id
+
+ assigned_total =
+ Assignment
+ .joins_with_topics
+ .where(topics: { deleted_at: nil })
+ .where(assigned_to_id: assign_to.id, active: true)
+ .count
+
+ assigned_total < SiteSetting.max_assigned_topics
+ end
+
+ def can_be_assigned?(assign_to)
+ if assign_to.is_a?(User)
+ allowed_user_ids.include?(assign_to.id)
+ else
+ allowed_group_ids.include?(assign_to.id)
+ end
+ end
+
+ def topic_target?
+ @topic_target ||= @target.is_a?(Topic)
+ end
+
+ def post_target?
+ @post_target ||= @target.is_a?(Post)
+ end
+
+ def private_message_allowed_user_ids
+ @private_message_allowed_user_ids ||= topic.all_allowed_users.pluck(:id)
+ end
+
+ def can_assignee_see_target?(assignee)
+ if (topic_target? || post_target?) && topic.private_message? &&
+ !private_message_allowed_user_ids.include?(assignee.id)
+ return false
+ end
+ return Guardian.new(assignee).can_see_topic?(@target) if topic_target?
+ return Guardian.new(assignee).can_see_post?(@target) if post_target?
+
+ raise Discourse::InvalidAccess
+ end
+
+ def topic
+ return @topic if @topic
+ @topic = @target if topic_target?
+ @topic = @target.topic if post_target?
+
+ raise Discourse::InvalidParameters if !@topic
+ @topic
+ end
+
+ def first_post
+ topic.posts.where(post_number: 1).first
+ end
+
+ def forbidden_reasons(assign_to:, type:, note:, status:, allow_self_reassign:)
+ case
+ when assign_to.is_a?(User) && !can_assignee_see_target?(assign_to)
+ if topic.private_message?
+ :forbidden_assignee_not_pm_participant
+ else
+ :forbidden_assignee_cant_see_topic
+ end
+ when assign_to.is_a?(Group) && assign_to.users.any? { |user| !can_assignee_see_target?(user) }
+ if topic.private_message?
+ :forbidden_group_assignee_not_pm_participant
+ else
+ :forbidden_group_assignee_cant_see_topic
+ end
+ when !can_be_assigned?(assign_to)
+ assign_to.is_a?(User) ? :forbidden_assign_to : :forbidden_group_assign_to
+ when !allow_self_reassign && already_assigned?(assign_to, type, note, status)
+ assign_to.is_a?(User) ? :already_assigned : :group_already_assigned
+ when Assignment.where(topic: topic, active: true).count >= ASSIGNMENTS_PER_TOPIC_LIMIT &&
+ !reassign?
+ :too_many_assigns_for_topic
+ when !can_assign_to?(assign_to)
+ :too_many_assigns
+ end
+ end
+
+ def update_details(assign_to, note, status, skip_small_action_post: false, should_notify: true)
+ case
+ when note.present? && status.present? && @target.assignment.note != note &&
+ @target.assignment.status != status
+ small_action_text = <<~TEXT
+ Status: #{@target.assignment.status} → #{status}
+
+ #{note}
+ TEXT
+ change_type = "details"
+ when note.present? && @target.assignment.note != note
+ small_action_text = note
+ change_type = "note"
+ when @target.assignment.status != status
+ small_action_text = "#{@target.assignment.status} → #{status}"
+ change_type = "status"
+ end
+
+ @target.assignment.update!(note: note, status: status)
+ queue_notification(@target.assignment) if should_notify
+ publish_assignment(@target.assignment, assign_to, note, status)
+
+ # email is skipped, for now
+
+ unless skip_small_action_post
+ action_code = "#{change_type}_change"
+ add_small_action_post(action_code, assign_to, small_action_text)
+ end
+
+ { success: true }
+ end
+
+ def assign(
+ assign_to,
+ note: nil,
+ skip_small_action_post: false,
+ status: nil,
+ allow_self_reassign: false,
+ should_notify: true
+ )
+ assigned_to_type = assign_to.is_a?(User) ? "User" : "Group"
+
+ if topic.private_message? && SiteSetting.invite_on_assign
+ if assigned_to_type == "Group"
+ invite_group(assign_to, should_notify)
+ else
+ invite_user(assign_to)
+ end
+ end
+
+ forbidden_reason =
+ forbidden_reasons(
+ assign_to: assign_to,
+ type: assigned_to_type,
+ note: note,
+ status: status,
+ allow_self_reassign: allow_self_reassign,
+ )
+ return { success: false, reason: forbidden_reason } if forbidden_reason
+
+ if no_assignee_change?(assign_to) && details_change?(note, status)
+ return(
+ update_details(
+ assign_to,
+ note,
+ status,
+ skip_small_action_post: skip_small_action_post,
+ should_notify: should_notify,
+ )
+ )
+ end
+
+ action_code = {}
+ action_code[:user] = topic.assignment.present? ? "reassigned" : "assigned"
+ action_code[:group] = topic.assignment.present? ? "reassigned_group" : "assigned_group"
+
+ skip_small_action_post =
+ skip_small_action_post || (!allow_self_reassign && no_assignee_change?(assign_to))
+
+ if @target.assignment
+ Jobs.enqueue(
+ :unassign_notification,
+ topic_id: topic.id,
+ assigned_to_id: @target.assignment.assigned_to_id,
+ assigned_to_type: @target.assignment.assigned_to_type,
+ assignment_id: @target.assignment.id,
+ )
+ @target.assignment.destroy!
+ end
+
+ assignment =
+ @target.create_assignment!(
+ assigned_to: assign_to,
+ assigned_by_user: @assigned_by,
+ topic: topic,
+ note: note,
+ status: status,
+ )
+
+ first_post.publish_change_to_clients!(:revised, reload_topic: true)
+ queue_notification(assignment) if should_notify
+
+ # This assignment should never be notified
+ SilencedAssignment.create!(assignment_id: assignment.id) if !should_notify
+
+ publish_assignment(assignment, assign_to, note, status)
+
+ if assignment.assigned_to_user?
+ if !assign_to.user_option.do_nothing_when_assigned?
+ notification_level =
+ if assign_to.user_option.track_topic_when_assigned?
+ TopicUser.notification_levels[:tracking]
+ else
+ TopicUser.notification_levels[:watching]
+ end
+
+ topic_user = TopicUser.find_by(user_id: assign_to.id, topic:)
+ if !topic_user || topic_user.notification_level < notification_level
+ notifications_reason_id = TopicUser.notification_reasons[:plugin_changed]
+ TopicUser.change(assign_to.id, topic.id, notification_level:, notifications_reason_id:)
+ end
+ end
+
+ if SiteSetting.assign_mailer == AssignMailer.levels[:always] ||
+ (
+ SiteSetting.assign_mailer == AssignMailer.levels[:different_users] &&
+ @assigned_by.id != assign_to.id
+ )
+ if !topic.muted?(assign_to)
+ message = AssignMailer.send_assignment(assign_to.email, topic, @assigned_by)
+ Email::Sender.new(message, :assign_message).send
+ end
+ end
+ end
+
+ unless skip_small_action_post
+ post_action_code = moderator_post_assign_action_code(assignment, action_code)
+ add_small_action_post(post_action_code, assign_to, note)
+ end
+
+ # Create a webhook event
+ if WebHook.active_web_hooks(:assigned).exists?
+ assigned_to_type = :assigned
+ payload = {
+ type: assigned_to_type,
+ topic_id: topic.id,
+ topic_title: topic.title,
+ assigned_by_id: @assigned_by.id,
+ assigned_by_username: @assigned_by.username,
+ }
+ if assignment.assigned_to_user?
+ payload.merge!({ assigned_to_id: assign_to.id, assigned_to_username: assign_to.username })
+ else
+ payload.merge!(
+ { assigned_to_group_id: assign_to.id, assigned_to_group_name: assign_to.name },
+ )
+ end
+ WebHook.enqueue_assign_hooks(assigned_to_type, payload.to_json)
+ end
+
+ { success: true }
+ end
+
+ def unassign(silent: false, deactivate: false)
+ if assignment = @target.assignment
+ deactivate ? assignment.update!(active: false) : assignment.destroy!
+
+ return if first_post.blank?
+
+ first_post.publish_change_to_clients!(:revised, reload_topic: true)
+
+ Jobs.enqueue(
+ :unassign_notification,
+ topic_id: topic.id,
+ assigned_to_id: assignment.assigned_to.id,
+ assigned_to_type: assignment.assigned_to_type,
+ assignment_id: assignment.id,
+ )
+
+ assigned_to = assignment.assigned_to
+
+ if SiteSetting.unassign_creates_tracking_post && !silent
+ post_type = SiteSetting.assigns_public ? Post.types[:small_action] : Post.types[:whisper]
+
+ custom_fields = small_action_username_or_name(assigned_to)
+
+ if post_target?
+ custom_fields.merge!("action_code_path" => "/p/#{@target.id}")
+ custom_fields.merge!("action_code_post_id" => @target.id)
+ end
+
+ topic.add_moderator_post(
+ @assigned_by,
+ nil,
+ bump: false,
+ post_type: post_type,
+ custom_fields: custom_fields,
+ action_code: moderator_post_unassign_action_code(assignment),
+ )
+ end
+
+ # Create a webhook event
+ if WebHook.active_web_hooks(:unassigned).exists?
+ type = :unassigned
+ payload = {
+ type: type,
+ topic_id: topic.id,
+ topic_title: topic.title,
+ unassigned_by_id: @assigned_by.id,
+ unassigned_by_username: @assigned_by.username,
+ }
+ if assignment.assigned_to_user?
+ payload.merge!(
+ { unassigned_to_id: assigned_to.id, unassigned_to_username: assigned_to.username },
+ )
+ else
+ payload.merge!(
+ { unassigned_to_group_id: assigned_to.id, unassigned_to_group_name: assigned_to.name },
+ )
+ end
+ WebHook.enqueue_assign_hooks(type, payload.to_json)
+ end
+
+ MessageBus.publish(
+ "/staff/topic-assignment",
+ {
+ type: "unassigned",
+ topic_id: topic.id,
+ post_id: post_target? && @target.id,
+ post_number: post_target? && @target.post_number,
+ assigned_type: assignment.assigned_to.is_a?(User) ? "User" : "Group",
+ assignment_note: nil,
+ assignment_status: nil,
+ },
+ user_ids: allowed_user_ids,
+ )
+ end
+ end
+
+ private
+
+ def invite_user(user)
+ return if topic.all_allowed_users.exists?(id: user.id)
+
+ guardian.ensure_can_invite_to!(topic)
+ topic.invite(@assigned_by, user.username)
+ end
+
+ def invite_group(group, should_notify)
+ return if topic.topic_allowed_groups.exists?(group_id: group.id)
+ if topic
+ .all_allowed_users
+ .joins("RIGHT JOIN group_users ON group_users.user_id = users.id")
+ .where("group_users.group_id = ? AND users.id IS NULL", group.id)
+ .empty?
+ return # all group members can already see the topic
+ end
+
+ guardian.ensure_can_invite_group_to_private_message!(group, topic)
+ topic.invite_group(@assigned_by, group, should_notify: should_notify)
+ end
+
+ def guardian
+ @guardian ||= Guardian.new(@assigned_by)
+ end
+
+ def queue_notification(assignment)
+ Jobs.enqueue(:assign_notification, assignment_id: assignment.id)
+ end
+
+ def small_action_username_or_name(assign_to)
+ if (assign_to.is_a?(User) && SiteSetting.prioritize_full_name_in_ux) ||
+ !assign_to.try(:username)
+ custom_fields = { "action_code_who" => assign_to.name || assign_to.username }
+ else
+ custom_fields = {
+ "action_code_who" => assign_to.is_a?(User) ? assign_to.username : assign_to.name,
+ }
+ end
+ custom_fields
+ end
+
+ def add_small_action_post(action_code, assign_to, text)
+ custom_fields = small_action_username_or_name(assign_to)
+
+ if post_target?
+ custom_fields.merge!(
+ { "action_code_path" => "/p/#{@target.id}", "action_code_post_id" => @target.id },
+ )
+ end
+
+ topic.add_moderator_post(
+ @assigned_by,
+ text,
+ bump: false,
+ auto_track: false,
+ post_type: SiteSetting.assigns_public ? Post.types[:small_action] : Post.types[:whisper],
+ action_code: action_code,
+ custom_fields: custom_fields,
+ )
+ end
+
+ def publish_assignment(assignment, assign_to, note, status)
+ serializer = assignment.assigned_to_user? ? BasicUserSerializer : BasicGroupSerializer
+ MessageBus.publish(
+ "/staff/topic-assignment",
+ {
+ type: "assigned",
+ topic_id: topic.id,
+ post_id: post_target? && @target.id,
+ post_number: post_target? && @target.post_number,
+ assigned_type: assignment.assigned_to_type,
+ assigned_to: serializer.new(assign_to, scope: Guardian.new, root: false).as_json,
+ assignment_note: note,
+ assignment_status: status,
+ },
+ user_ids: allowed_user_ids,
+ )
+ end
+
+ def moderator_post_assign_action_code(assignment, action_code)
+ if assignment.target.is_a?(Post)
+ # posts do not have to handle conditions of 'assign' or 'reassign'
+ assignment.assigned_to_user? ? "assigned_to_post" : "assigned_group_to_post"
+ elsif assignment.target.is_a?(Topic)
+ assignment.assigned_to_user? ? "#{action_code[:user]}" : "#{action_code[:group]}"
+ end
+ end
+
+ def moderator_post_unassign_action_code(assignment)
+ suffix =
+ if assignment.target.is_a?(Post)
+ "_from_post"
+ elsif assignment.target.is_a?(Topic)
+ ""
+ end
+ return "unassigned#{suffix}" if assignment.assigned_to_user?
+ "unassigned_group#{suffix}" if assignment.assigned_to_group?
+ end
+
+ def already_assigned?(assign_to, type, note, status)
+ assignment_eq?(@target.assignment, assign_to, type, note, status)
+ end
+
+ def reassign?
+ Assignment.exists?(target: @target, active: true)
+ end
+
+ def no_assignee_change?(assignee)
+ @target.assignment&.assigned_to_id == assignee.id
+ end
+
+ def details_change?(note, status)
+ note.present? || @target.assignment&.status != status
+ end
+
+ def assignment_eq?(assignment, assign_to, type, note, status)
+ return false if !assignment&.active
+ return false if assignment.assigned_to_id != assign_to.id
+ return false if assignment.assigned_to_type != type
+ return false if assignment.note != note
+ assignment.status == status || !status && assignment.status == Assignment.default_status
+ end
+end
diff --git a/plugins/discourse-assign/lib/discourse_assign/create_notification.rb b/plugins/discourse-assign/lib/discourse_assign/create_notification.rb
new file mode 100644
index 00000000000..a645067f29f
--- /dev/null
+++ b/plugins/discourse-assign/lib/discourse_assign/create_notification.rb
@@ -0,0 +1,104 @@
+# frozen_string_literal: true
+
+module DiscourseAssign
+ class CreateNotification
+ class UserAssignment
+ attr_reader :assignment
+
+ def initialize(assignment)
+ @assignment = assignment
+ end
+
+ def excerpt_key
+ "discourse_assign.topic_assigned_excerpt"
+ end
+
+ def notification_message
+ "discourse_assign.assign_notification"
+ end
+
+ def display_username
+ assignment.assigned_by_user.username
+ end
+ end
+
+ class GroupAssignment < UserAssignment
+ def excerpt_key
+ "discourse_assign.topic_group_assigned_excerpt"
+ end
+
+ def notification_message
+ "discourse_assign.assign_group_notification"
+ end
+
+ def display_username
+ assignment.assigned_to.name
+ end
+ end
+
+ def self.call(...)
+ new(...).call
+ end
+
+ attr_reader :assignment, :user, :mark_as_read, :assignment_type
+ alias mark_as_read? mark_as_read
+
+ delegate :topic,
+ :post,
+ :assigned_by_user,
+ :assigned_to,
+ :created_at,
+ :updated_at,
+ :assigned_to_user?,
+ :id,
+ to: :assignment,
+ private: true
+ delegate :excerpt_key,
+ :notification_message,
+ :display_username,
+ to: :assignment_type,
+ private: true
+
+ def initialize(assignment:, user:, mark_as_read:)
+ @assignment = assignment
+ @user = user
+ @mark_as_read = mark_as_read
+ @assignment_type =
+ "#{self.class}::#{assignment.assigned_to.class}Assignment".constantize.new(assignment)
+ end
+
+ def call
+ return if topic.nil?
+ Assigner.publish_topic_tracking_state(topic, user.id)
+ unless mark_as_read?
+ PostAlerter.new(post).create_notification_alert(
+ user: user,
+ post: post,
+ username: assigned_by_user.username,
+ notification_type: Notification.types[:assigned],
+ excerpt:
+ I18n.t(
+ excerpt_key,
+ title: topic.title,
+ group: assigned_to.name,
+ locale: user.effective_locale,
+ ),
+ )
+ end
+ user.notifications.assigned.create!(
+ created_at: created_at,
+ updated_at: updated_at,
+ topic: topic,
+ post_number: post.post_number,
+ high_priority: true,
+ read: mark_as_read?,
+ data: {
+ message: notification_message,
+ display_username: display_username,
+ topic_title: topic.title,
+ assignment_id: id,
+ }.to_json,
+ )
+ end
+ end
+end
diff --git a/plugins/discourse-assign/lib/discourse_assign/discourse_calendar.rb b/plugins/discourse-assign/lib/discourse_assign/discourse_calendar.rb
new file mode 100644
index 00000000000..f36a4f4e5da
--- /dev/null
+++ b/plugins/discourse-assign/lib/discourse_assign/discourse_calendar.rb
@@ -0,0 +1,7 @@
+# frozen_string_literal: true
+
+module DiscourseAssign
+ module DiscourseCalendar
+ HOLIDAY_CUSTOM_FIELD = "on_holiday"
+ end
+end
diff --git a/plugins/discourse-assign/lib/discourse_assign/engine.rb b/plugins/discourse-assign/lib/discourse_assign/engine.rb
new file mode 100644
index 00000000000..29cff854917
--- /dev/null
+++ b/plugins/discourse-assign/lib/discourse_assign/engine.rb
@@ -0,0 +1,9 @@
+# frozen_string_literal: true
+
+module ::DiscourseAssign
+ class Engine < ::Rails::Engine
+ engine_name PLUGIN_NAME
+ isolate_namespace DiscourseAssign
+ config.autoload_paths << File.join(config.root, "lib")
+ end
+end
diff --git a/plugins/discourse-assign/lib/discourse_assign/group_extension.rb b/plugins/discourse-assign/lib/discourse_assign/group_extension.rb
new file mode 100644
index 00000000000..99b529d80f2
--- /dev/null
+++ b/plugins/discourse-assign/lib/discourse_assign/group_extension.rb
@@ -0,0 +1,27 @@
+# frozen_string_literal: true
+
+module DiscourseAssign
+ module GroupExtension
+ extend ActiveSupport::Concern
+
+ prepended do
+ has_many :assignments, as: :assigned_to
+
+ scope :assignable,
+ ->(user) do
+ where(
+ "groups.assignable_level in (:levels) OR
+ (
+ groups.assignable_level = #{Group::ALIAS_LEVELS[:members_mods_and_admins]} AND groups.id in (
+ SELECT group_id FROM group_users AS gu WHERE gu.user_id = :user_id)
+ ) OR (
+ groups.assignable_level = #{Group::ALIAS_LEVELS[:owners_mods_and_admins]} AND groups.id in (
+ SELECT group_id FROM group_users as gu WHERE gu.user_id = :user_id AND gu.owner IS TRUE)
+ )",
+ levels: alias_levels(user),
+ user_id: user&.id,
+ )
+ end
+ end
+ end
+end
diff --git a/plugins/discourse-assign/lib/discourse_assign/helpers.rb b/plugins/discourse-assign/lib/discourse_assign/helpers.rb
new file mode 100644
index 00000000000..04ec09b24ff
--- /dev/null
+++ b/plugins/discourse-assign/lib/discourse_assign/helpers.rb
@@ -0,0 +1,55 @@
+# frozen_string_literal: true
+
+module DiscourseAssign
+ module Helpers
+ def self.build_assigned_to_user(user, topic)
+ return if !user
+ { username: user.username, name: user.name, avatar_template: user.avatar_template }
+ end
+
+ def self.build_assigned_to_group(group, topic)
+ return if !group
+
+ {
+ name: group.name,
+ flair_bg_color: group.flair_bg_color,
+ flair_color: group.flair_color,
+ flair_icon: group.flair_icon,
+ flair_upload_id: group.flair_upload_id,
+ }
+ end
+
+ def self.build_indirectly_assigned_to(post_assignments, topic)
+ post_assignments
+ .map do |post_id, assigned_map|
+ assigned_to = assigned_map[:assigned_to]
+ note = assigned_map[:assignment_note]
+ status = assigned_map[:assignment_status]
+ post_number = assigned_map[:post_number]
+
+ if (assigned_to.is_a?(User))
+ [
+ post_id,
+ {
+ assigned_to: build_assigned_to_user(assigned_to, topic),
+ post_number: post_number,
+ assignment_note: note,
+ assignment_status: status,
+ },
+ ]
+ elsif assigned_to.is_a?(Group)
+ [
+ post_id,
+ {
+ assigned_to: build_assigned_to_group(assigned_to, topic),
+ post_number: post_number,
+ assignment_note: note,
+ assignment_status: status,
+ },
+ ]
+ end
+ end
+ .to_h
+ end
+ end
+end
diff --git a/plugins/discourse-assign/lib/discourse_assign/list_controller_extension.rb b/plugins/discourse-assign/lib/discourse_assign/list_controller_extension.rb
new file mode 100644
index 00000000000..88908aa85ae
--- /dev/null
+++ b/plugins/discourse-assign/lib/discourse_assign/list_controller_extension.rb
@@ -0,0 +1,9 @@
+# frozen_string_literal: true
+
+module DiscourseAssign
+ module ListControllerExtension
+ extend ActiveSupport::Concern
+
+ prepended { generate_message_route(:private_messages_assigned) }
+ end
+end
diff --git a/plugins/discourse-assign/lib/discourse_assign/notification_extension.rb b/plugins/discourse-assign/lib/discourse_assign/notification_extension.rb
new file mode 100644
index 00000000000..c8100fa33c2
--- /dev/null
+++ b/plugins/discourse-assign/lib/discourse_assign/notification_extension.rb
@@ -0,0 +1,15 @@
+# frozen_string_literal: true
+
+module DiscourseAssign
+ module NotificationExtension
+ extend ActiveSupport::Concern
+
+ prepended do
+ scope :assigned, -> { where(notification_type: Notification.types[:assigned]) }
+ scope :for_assignment,
+ ->(assignment) do
+ assigned.where("((data::jsonb)->'assignment_id')::bigint IN (?)", assignment)
+ end
+ end
+ end
+end
diff --git a/plugins/discourse-assign/lib/discourse_assign/post_extension.rb b/plugins/discourse-assign/lib/discourse_assign/post_extension.rb
new file mode 100644
index 00000000000..014b1a86c75
--- /dev/null
+++ b/plugins/discourse-assign/lib/discourse_assign/post_extension.rb
@@ -0,0 +1,9 @@
+# frozen_string_literal: true
+
+module DiscourseAssign
+ module PostExtension
+ extend ActiveSupport::Concern
+
+ prepended { has_one :assignment, as: :target, dependent: :destroy }
+ end
+end
diff --git a/plugins/discourse-assign/lib/discourse_assign/topic_extension.rb b/plugins/discourse-assign/lib/discourse_assign/topic_extension.rb
new file mode 100644
index 00000000000..6221eeacb8d
--- /dev/null
+++ b/plugins/discourse-assign/lib/discourse_assign/topic_extension.rb
@@ -0,0 +1,9 @@
+# frozen_string_literal: true
+
+module DiscourseAssign
+ module TopicExtension
+ extend ActiveSupport::Concern
+
+ prepended { has_one :assignment, as: :target, dependent: :destroy }
+ end
+end
diff --git a/plugins/discourse-assign/lib/discourse_assign/user_option_extension.rb b/plugins/discourse-assign/lib/discourse_assign/user_option_extension.rb
new file mode 100644
index 00000000000..68bbda42676
--- /dev/null
+++ b/plugins/discourse-assign/lib/discourse_assign/user_option_extension.rb
@@ -0,0 +1,13 @@
+# frozen_string_literal: true
+
+module DiscourseAssign
+ module UserOptionExtension
+ extend ActiveSupport::Concern
+
+ prepended do
+ enum :notification_level_when_assigned,
+ { do_nothing: 1, track_topic: 2, watch_topic: 3 },
+ suffix: "when_assigned"
+ end
+ end
+end
diff --git a/plugins/discourse-assign/lib/discourse_assign/web_hook_extension.rb b/plugins/discourse-assign/lib/discourse_assign/web_hook_extension.rb
new file mode 100644
index 00000000000..377c11a1297
--- /dev/null
+++ b/plugins/discourse-assign/lib/discourse_assign/web_hook_extension.rb
@@ -0,0 +1,14 @@
+# frozen_string_literal: true
+
+module DiscourseAssign
+ module WebHookExtension
+ extend ActiveSupport::Concern
+
+ class_methods do
+ def enqueue_assign_hooks(event, payload)
+ return unless active_web_hooks(event).exists?
+ enqueue_hooks(:assign, event, payload: payload)
+ end
+ end
+ end
+end
diff --git a/plugins/discourse-assign/lib/pending_assigns_reminder.rb b/plugins/discourse-assign/lib/pending_assigns_reminder.rb
new file mode 100644
index 00000000000..49db18c7860
--- /dev/null
+++ b/plugins/discourse-assign/lib/pending_assigns_reminder.rb
@@ -0,0 +1,142 @@
+# frozen_string_literal: true
+
+class PendingAssignsReminder
+ REMINDED_AT = "last_reminded_at"
+ REMINDERS_FREQUENCY = "remind_assigns_frequency"
+ CUSTOM_FIELD_NAME = "assigns_reminder"
+
+ def remind(user)
+ newest_topics = assigned_topics(user, order: :desc)
+ return if newest_topics.size < SiteSetting.pending_assign_reminder_threshold
+
+ delete_previous_reminders(user)
+
+ oldest_topics = assigned_topics(user, order: :asc).where.not(id: newest_topics.map(&:id))
+ assigned_topics_count = assigned_count_for(user)
+ title = I18n.t("pending_assigns_reminder.title", pending_assignments: assigned_topics_count)
+
+ PostCreator.create!(
+ Discourse.system_user,
+ title: title,
+ raw: reminder_body(user, assigned_topics_count, newest_topics, oldest_topics),
+ archetype: Archetype.private_message,
+ subtype: TopicSubtype.system_message,
+ target_usernames: user.username,
+ custom_fields: {
+ CUSTOM_FIELD_NAME => true,
+ },
+ )
+
+ update_last_reminded(user)
+ end
+
+ private
+
+ def delete_previous_reminders(user)
+ posts =
+ Post
+ .joins(topic: { topic_allowed_users: :user })
+ .where(
+ topic: {
+ posts_count: 1,
+ user_id: Discourse.system_user,
+ archetype: Archetype.private_message,
+ subtype: TopicSubtype.system_message,
+ topic_allowed_users: {
+ users: {
+ id: user.id,
+ },
+ },
+ },
+ )
+ .joins(topic: :_custom_fields)
+ .where(topic_custom_fields: { name: CUSTOM_FIELD_NAME })
+
+ posts.find_each { |post| PostDestroyer.new(Discourse.system_user, post).destroy }
+ end
+
+ def visible_topics(user)
+ Topic.listable_topics.secured(Guardian.new(user)).or(Topic.private_messages_for_user(user))
+ end
+
+ def assigned_count_for(user)
+ assignments =
+ Assignment
+ .joins_with_topics
+ .where(assigned_to_id: user.id, assigned_to_type: "User", active: true)
+ .merge(visible_topics(user))
+ assignments =
+ DiscoursePluginRegistry.apply_modifier(:assigned_count_for_user_query, assignments, user)
+ assignments.count
+ end
+
+ def assigned_topics(user, order:)
+ secure = visible_topics(user)
+
+ topics =
+ Topic
+ .joins(:assignment)
+ .select(:slug, :id, :title, :fancy_title, "assignments.created_at AS assigned_at")
+ .where(
+ "assignments.assigned_to_id = ? AND assignments.assigned_to_type = 'User' AND assignments.active",
+ user.id,
+ )
+ topics = DiscoursePluginRegistry.apply_modifier(:assigns_reminder_assigned_topics_query, topics)
+ topics.merge(secure).order("assignments.created_at #{order}").limit(3)
+ end
+
+ def reminder_body(user, assigned_topics_count, first_three_topics, last_three_topics)
+ newest_list = build_list_for(:newest, first_three_topics)
+ oldest_list = build_list_for(:oldest, last_three_topics)
+
+ I18n.t(
+ "pending_assigns_reminder.body",
+ pending_assignments: assigned_topics_count,
+ assignments_link: "#{Discourse.base_url}/u/#{user.username_lower}/activity/assigned",
+ newest_assignments: newest_list,
+ oldest_assignments: oldest_list,
+ frequency: frequency_in_words(user),
+ )
+ end
+
+ def build_list_for(key, topics)
+ return "" if topics.empty?
+ initial_list = { "topic_0" => "", "topic_1" => "", "topic_2" => "" }
+ items =
+ topics
+ .each_with_index
+ .reduce(initial_list) do |memo, (t, index)|
+ memo[
+ "topic_#{index}"
+ ] = "- [#{Emoji.gsub_emoji_to_unicode(t.fancy_title)}](#{t.relative_url}) - assigned #{time_in_words_for(t)}"
+ memo
+ end
+
+ I18n.t("pending_assigns_reminder.#{key}", items.symbolize_keys!)
+ end
+
+ def time_in_words_for(topic)
+ AgeWords.distance_of_time_in_words(
+ Time.zone.now,
+ topic.assigned_at.to_time,
+ false,
+ scope: "datetime.distance_in_words_verbose",
+ )
+ end
+
+ def frequency_in_words(user)
+ frequency =
+ if user.custom_fields&.has_key?(REMINDERS_FREQUENCY)
+ user.custom_fields[REMINDERS_FREQUENCY]
+ else
+ SiteSetting.remind_assigns_frequency
+ end
+
+ ::RemindAssignsFrequencySiteSettings.frequency_for(frequency)
+ end
+
+ def update_last_reminded(user)
+ update_last_reminded = { REMINDED_AT => DateTime.now }
+ user.upsert_custom_fields(update_last_reminded)
+ end
+end
diff --git a/plugins/discourse-assign/lib/random_assign_utils.rb b/plugins/discourse-assign/lib/random_assign_utils.rb
new file mode 100644
index 00000000000..470f96af846
--- /dev/null
+++ b/plugins/discourse-assign/lib/random_assign_utils.rb
@@ -0,0 +1,203 @@
+# frozen_string_literal: true
+
+class RandomAssignUtils
+ attr_reader :context, :fields, :automation, :topic, :group
+
+ def self.automation_script!(...)
+ new(...).automation_script!
+ end
+
+ def initialize(context, fields, automation)
+ @context = context
+ @fields = fields
+ @automation = automation
+
+ raise_error("discourse-assign is not enabled") unless SiteSetting.assign_enabled?
+ unless topic_id = fields.dig("assigned_topic", "value")
+ raise_error("`assigned_topic` not provided")
+ end
+ unless @topic = Topic.find_by(id: topic_id)
+ raise_error("Topic(#{topic_id}) not found")
+ end
+
+ unless group_id = fields.dig("assignees_group", "value")
+ raise_error("`assignees_group` not provided")
+ end
+ unless @group = Group.find_by(id: group_id)
+ raise_error("Group(#{group_id}) not found")
+ end
+ end
+
+ def automation_script!
+ return log_info("Topic(#{topic.id}) has already been assigned recently") if assigned_recently?
+ return no_one! unless assigned_user
+ assign_user!
+ end
+
+ def recently_assigned_users_ids(from)
+ usernames =
+ PostCustomField
+ .joins(:post)
+ .where(
+ name: "action_code_who",
+ posts: {
+ topic: topic,
+ action_code: %w[assigned reassigned assigned_to_post],
+ },
+ )
+ .where("posts.created_at > ?", from)
+ .order("posts.created_at DESC")
+ .pluck(:value)
+ .uniq
+ User
+ .where(username: usernames)
+ .joins(
+ "JOIN unnest('{#{usernames.join(",")}}'::text[]) WITH ORDINALITY t(username, ord) USING(username)",
+ )
+ .limit(100)
+ .order("ord")
+ .pluck(:id)
+ end
+
+ private
+
+ def assigned_user
+ @assigned_user ||=
+ begin
+ group_users_ids = group_users.pluck(:id)
+ return if group_users_ids.empty?
+
+ last_assignees_ids = recently_assigned_users_ids(max_recently_assigned_days)
+ users_ids = group_users_ids - last_assignees_ids
+ if users_ids.blank?
+ recently_assigned_users_ids = recently_assigned_users_ids(min_recently_assigned_days)
+ users_ids = group_users_ids - recently_assigned_users_ids
+ end
+ users_ids << last_assignees_ids.intersection(group_users_ids).last if users_ids.blank?
+ if fields.dig("in_working_hours", "value")
+ assign_to_user_id = users_ids.shuffle.detect { |user_id| in_working_hours?(user_id) }
+ end
+ assign_to_user_id ||= users_ids.sample
+
+ User.find(assign_to_user_id)
+ end
+ end
+
+ def assign_user!
+ return create_post_template if post_template
+ Assigner
+ .new(topic, Discourse.system_user)
+ .assign(assigned_user, allow_self_reassign: true)
+ .then do |result|
+ next if result[:success]
+ no_one!
+ end
+ end
+
+ def create_post_template
+ post =
+ PostCreator.new(
+ Discourse.system_user,
+ raw: post_template,
+ skip_validations: true,
+ topic_id: topic.id,
+ ).create!
+ Assigner
+ .new(post, Discourse.system_user)
+ .assign(assigned_user, allow_self_reassign: true)
+ .then do |result|
+ next if result[:success]
+ PostDestroyer.new(Discourse.system_user, post).destroy
+ no_one!
+ end
+ end
+
+ def group_users
+ users =
+ group
+ .users
+ .where(id: User.assign_allowed.select(:id))
+ .where.not(
+ id:
+ User
+ .joins(:_custom_fields)
+ .where(user_custom_fields: { name: "on_holiday", value: "t" })
+ .select(:id),
+ )
+ return users unless skip_new_users_for_days
+ users.where("users.created_at < ?", skip_new_users_for_days)
+ end
+
+ def raise_error(message)
+ raise("[discourse-automation id=#{automation.id}] #{message}.")
+ end
+
+ def log_info(message)
+ Rails.logger.info("[discourse-automation id=#{automation.id}] #{message}.")
+ end
+
+ def no_one!
+ PostCreator.create!(
+ Discourse.system_user,
+ topic_id: topic.id,
+ raw: I18n.t("discourse_automation.scriptables.random_assign.no_one", group: group.name),
+ validate: false,
+ )
+ end
+
+ def assigned_recently?
+ return unless min_hours
+ TopicCustomField
+ .where(name: "assigned_to_id", topic: topic)
+ .where("created_at < ?", min_hours)
+ .exists?
+ end
+
+ def skip_new_users_for_days
+ days = fields.dig("skip_new_users_for_days", "value").presence
+ return unless days
+ days.to_i.days.ago
+ end
+
+ def max_recently_assigned_days
+ @max_days ||= (fields.dig("max_recently_assigned_days", "value").presence || 180).to_i.days.ago
+ end
+
+ def min_recently_assigned_days
+ @min_days ||= (fields.dig("min_recently_assigned_days", "value").presence || 14).to_i.days.ago
+ end
+
+ def post_template
+ @post_template ||= fields.dig("post_template", "value").presence
+ end
+
+ def min_hours
+ hours = fields.dig("minimum_time_between_assignments", "value").presence
+ return unless hours
+ hours.to_i.hours.ago
+ end
+
+ def in_working_hours?(user_id)
+ tzinfo = user_tzinfo(user_id)
+ tztime = tzinfo.now
+
+ !tztime.saturday? && !tztime.sunday? && tztime.hour > 7 && tztime.hour < 11
+ end
+
+ def user_tzinfo(user_id)
+ timezone = UserOption.where(user_id: user_id).pluck(:timezone).first || "UTC"
+
+ tzinfo = nil
+ begin
+ tzinfo = ActiveSupport::TimeZone.find_tzinfo(timezone)
+ rescue TZInfo::InvalidTimezoneIdentifier
+ Rails.logger.warn(
+ "#{User.find_by(id: user_id)&.username} has the timezone #{timezone} set, we do not know how to parse it in Rails (assuming UTC)",
+ )
+ timezone = "UTC"
+ tzinfo = ActiveSupport::TimeZone.find_tzinfo(timezone)
+ end
+
+ tzinfo
+ end
+end
diff --git a/plugins/discourse-assign/lib/topic_assigner.rb b/plugins/discourse-assign/lib/topic_assigner.rb
new file mode 100644
index 00000000000..1bdc903f0b6
--- /dev/null
+++ b/plugins/discourse-assign/lib/topic_assigner.rb
@@ -0,0 +1,46 @@
+# frozen_string_literal: true
+
+class ::TopicAssigner
+ def self.backfill_auto_assign
+ deprecation_note
+ Assigner.backfill_auto_assign
+ end
+
+ def self.assigned_self?(text)
+ deprecation_note
+ Assigner.assigned_self?(text)
+ end
+
+ def self.auto_assign(post, force: false)
+ deprecation_note
+ Assigner.auto_assign(post, force)
+ end
+
+ def self.is_last_staff_post?(post)
+ deprecation_note
+ Assigner.is_last_staff_post?(post)
+ end
+
+ def self.mentioned_staff(post)
+ deprecation_note
+ Assigner.mentioned_staff(post)
+ end
+
+ def self.publish_topic_tracking_state(topic, user_id)
+ deprecation_note
+ Assigner.publish_topic_tracking_state(topic, user_id)
+ end
+
+ def initialize(target, user)
+ self.class.deprecation_note
+ Assigner.new(target, user)
+ end
+
+ def self.deprecation_note
+ Discourse.deprecate(
+ "TopicAssigner class is deprecated, use Assigner",
+ since: "2.8",
+ drop_from: "2.9",
+ )
+ end
+end
diff --git a/plugins/discourse-assign/lib/validators/assign_statuses_validator.rb b/plugins/discourse-assign/lib/validators/assign_statuses_validator.rb
new file mode 100644
index 00000000000..6f37029c90a
--- /dev/null
+++ b/plugins/discourse-assign/lib/validators/assign_statuses_validator.rb
@@ -0,0 +1,29 @@
+# frozen_string_literal: true
+
+class AssignStatusesValidator
+ def initialize(opts = {})
+ @opts = opts
+ end
+
+ def valid_value?(value)
+ statuses = value.split("|")
+
+ case
+ when statuses.size < 2
+ @reason = "too_few"
+ return false
+ when statuses.size != statuses.uniq.size
+ @reason = "duplicate"
+ return false
+ when Assignment.where.not(status: statuses).count > 0
+ @reason = "removed_in_use"
+ return false
+ end
+
+ true
+ end
+
+ def error_message
+ I18n.t("site_settings.errors.assign_statuses.#{@reason}")
+ end
+end
diff --git a/plugins/discourse-assign/plugin.rb b/plugins/discourse-assign/plugin.rb
new file mode 100644
index 00000000000..28291292368
--- /dev/null
+++ b/plugins/discourse-assign/plugin.rb
@@ -0,0 +1,954 @@
+# frozen_string_literal: true
+
+# name: discourse-assign
+# about: Provides the ability to assign topics and individual posts to a user or group.
+# meta_topic_id: 58044
+# version: 1.0.1
+# authors: Sam Saffron
+# url: https://github.com/discourse/discourse/tree/main/plugins/discourse-assign
+
+enabled_site_setting :assign_enabled
+
+register_asset "stylesheets/assigns.scss"
+register_asset "stylesheets/mobile/assigns.scss", :mobile
+
+%w[user-plus user-xmark group-plus group-times].each { |i| register_svg_icon(i) }
+
+module ::DiscourseAssign
+ PLUGIN_NAME = "discourse-assign"
+end
+
+require_relative "lib/discourse_assign/engine"
+require_relative "lib/validators/assign_statuses_validator"
+
+after_initialize do
+ UserUpdater::OPTION_ATTR.push(:notification_level_when_assigned)
+
+ reloadable_patch do |plugin|
+ Group.prepend(DiscourseAssign::GroupExtension)
+ ListController.prepend(DiscourseAssign::ListControllerExtension)
+ Post.prepend(DiscourseAssign::PostExtension)
+ Topic.prepend(DiscourseAssign::TopicExtension)
+ WebHook.prepend(DiscourseAssign::WebHookExtension)
+ Notification.prepend(DiscourseAssign::NotificationExtension)
+ UserOption.prepend(DiscourseAssign::UserOptionExtension)
+ end
+
+ add_to_serializer(:user_option, :notification_level_when_assigned) do
+ object.notification_level_when_assigned
+ end
+
+ add_to_serializer(:current_user_option, :notification_level_when_assigned) do
+ object.notification_level_when_assigned
+ end
+
+ register_group_param(:assignable_level)
+ register_groups_callback_for_users_search_controller_action(:assignable_groups) do |groups, user|
+ groups.assignable(user)
+ end
+
+ frequency_field = PendingAssignsReminder::REMINDERS_FREQUENCY
+ register_editable_user_custom_field frequency_field
+ register_user_custom_field_type(frequency_field, :integer, max_length: 10)
+ DiscoursePluginRegistry.serialized_current_user_fields << frequency_field
+ add_to_serializer(:user, :reminders_frequency) { RemindAssignsFrequencySiteSettings.values }
+
+ add_to_serializer(:group_show, :assignment_count, include_condition: -> { scope.can_assign? }) do
+ Topic.joins(<<~SQL).where(<<~SQL, group_id: object.id).where("topics.deleted_at IS NULL").count
+ JOIN assignments a
+ ON topics.id = a.topic_id AND a.assigned_to_id IS NOT NULL
+ SQL
+ a.active AND
+ ((
+ a.assigned_to_type = 'User' AND a.assigned_to_id IN (
+ SELECT group_users.user_id
+ FROM group_users
+ WHERE group_id = :group_id
+ )
+ ) OR (
+ a.assigned_to_type = 'Group' AND a.assigned_to_id = :group_id
+ ))
+ SQL
+ end
+
+ add_to_serializer(:group_show, :assignable_level) { object.assignable_level }
+
+ add_to_serializer(:group_show, :can_show_assigned_tab?) { object.can_show_assigned_tab? }
+
+ add_model_callback(UserCustomField, :before_save) do
+ self.value = self.value.to_i if self.name == frequency_field
+ end
+
+ add_class_method(:group, :assign_allowed_groups) do
+ allowed_groups = SiteSetting.assign_allowed_on_groups.split("|")
+ where(id: allowed_groups)
+ end
+
+ add_to_class(:user, :can_assign?) do
+ return @can_assign if defined?(@can_assign)
+
+ allowed_groups = SiteSetting.assign_allowed_on_groups.split("|").compact
+ @can_assign = admin? || (allowed_groups.present? && groups.where(id: allowed_groups).exists?)
+ end
+
+ add_to_serializer(:current_user, :never_auto_track_topics) do
+ (
+ user.user_option.auto_track_topics_after_msecs ||
+ SiteSetting.default_other_auto_track_topics_after_msecs
+ ) < 0
+ end
+
+ add_to_class(:group, :can_show_assigned_tab?) do
+ allowed_group_ids = SiteSetting.assign_allowed_on_groups.split("|")
+
+ group_has_disallowed_users =
+ DB.query_single(<<~SQL, allowed_group_ids: allowed_group_ids, current_group_id: self.id)[0]
+ SELECT EXISTS(
+ SELECT 1 FROM users
+ JOIN group_users current_group_users
+ ON current_group_users.user_id=users.id
+ AND current_group_users.group_id = :current_group_id
+ LEFT JOIN group_users allowed_group_users
+ ON allowed_group_users.user_id=users.id
+ AND allowed_group_users.group_id IN (:allowed_group_ids)
+ WHERE allowed_group_users.user_id IS NULL
+ )
+ SQL
+
+ !group_has_disallowed_users
+ end
+
+ add_to_class(:guardian, :can_assign?) { user && user.can_assign? }
+
+ add_class_method(:user, :assign_allowed) do
+ allowed_groups = SiteSetting.assign_allowed_on_groups.split("|")
+
+ # The UNION against admin users is necessary because bot users like the system user are given the admin status but
+ # are not added into the admin group.
+ where(
+ "users.id IN (
+ SELECT
+ user_id
+ FROM group_users
+ WHERE group_users.group_id IN (?)
+
+ UNION
+
+ SELECT id
+ FROM users
+ WHERE users.admin
+ )",
+ allowed_groups,
+ )
+ end
+
+ add_model_callback(Group, :before_update) do
+ if name_changed?
+ SiteSetting.assign_allowed_on_groups =
+ SiteSetting.assign_allowed_on_groups.gsub(name_was, name)
+ end
+ end
+
+ add_model_callback(Group, :before_destroy) do
+ new_setting = SiteSetting.assign_allowed_on_groups.gsub(/#{id}[|]?/, "")
+ new_setting = new_setting.chomp("|") if new_setting.ends_with?("|")
+ SiteSetting.assign_allowed_on_groups = new_setting
+ end
+
+ on(:assign_topic) do |topic, user, assigning_user, force|
+ Assigner.new(topic, assigning_user).assign(user) if force || !Assignment.exists?(target: topic)
+ end
+
+ on(:unassign_topic) { |topic, unassigning_user| Assigner.new(topic, unassigning_user).unassign }
+
+ if respond_to?(:register_preloaded_category_custom_fields)
+ register_preloaded_category_custom_fields("enable_unassigned_filter")
+ else
+ # TODO: Drop the if-statement and this if-branch in Discourse v3.2
+ Site.preloaded_category_custom_fields << "enable_unassigned_filter"
+ end
+
+ BookmarkQuery.on_preload do |bookmarks, _bookmark_query|
+ if SiteSetting.assign_enabled?
+ topics =
+ Bookmark
+ .select_type(bookmarks, "Topic")
+ .map(&:bookmarkable)
+ .concat(Bookmark.select_type(bookmarks, "Post").map { |bm| bm.bookmarkable.topic })
+ .uniq
+ assignments =
+ Assignment
+ .strict_loading
+ .where(topic_id: topics)
+ .includes(:assigned_to)
+ .index_by(&:topic_id)
+
+ topics.each do |topic|
+ assignment = assignments[topic.id]
+ # NOTE: preloading to `nil` is necessary to avoid N+1 queries
+ topic.preload_assigned_to(assignment&.assigned_to)
+ topic.preload_assignment_status(assignment&.status)
+ end
+ end
+ end
+
+ TopicView.on_preload do |topic_view|
+ topic_view.instance_variable_set(:@posts, topic_view.posts.includes(:assignment))
+ end
+
+ TopicList.on_preload do |topics, topic_list|
+ next unless SiteSetting.assign_enabled?
+
+ can_assign = topic_list.current_user&.can_assign?
+ allowed_access = SiteSetting.assigns_public || can_assign
+
+ next if !allowed_access || topics.empty?
+
+ assignments =
+ Assignment.strict_loading.active.where(topic: topics).includes(:target, :assigned_to)
+ assignments_map = assignments.group_by(&:topic_id)
+
+ user_ids = assignments.filter(&:assigned_to_user?).map(&:assigned_to_id)
+ users_map = User.where(id: user_ids).select(UserLookup.lookup_columns).index_by(&:id)
+
+ group_ids = assignments.filter(&:assigned_to_group?).map(&:assigned_to_id)
+ groups_map = Group.where(id: group_ids).index_by(&:id)
+
+ topics.each do |topic|
+ if assignments = assignments_map[topic.id]
+ topic_assignments, post_assignments = assignments.partition { _1.target_type == "Topic" }
+
+ direct_assignment = topic_assignments.find { _1.target_id == topic.id }
+
+ indirectly_assigned_to = {}
+
+ post_assignments.each do |assignment|
+ next unless assignment.target
+
+ if assignment.assigned_to_user?
+ indirectly_assigned_to[assignment.target_id] = {
+ assigned_to: users_map[assignment.assigned_to_id],
+ post_number: assignment.target.post_number,
+ }
+ elsif assignment.assigned_to_group?
+ indirectly_assigned_to[assignment.target_id] = {
+ assigned_to: groups_map[assignment.assigned_to_id],
+ post_number: assignment.target.post_number,
+ }
+ end
+ end
+
+ assigned_to =
+ if direct_assignment&.assigned_to_user?
+ users_map[direct_assignment.assigned_to_id]
+ elsif direct_assignment&.assigned_to_group?
+ groups_map[direct_assignment.assigned_to_id]
+ end
+ end
+
+ # NOTE: preloading to `nil` is necessary to avoid N+1 queries
+ topic.preload_assigned_to(assigned_to)
+ topic.preload_assignment_status(direct_assignment&.status)
+ topic.preload_indirectly_assigned_to(indirectly_assigned_to)
+ end
+ end
+
+ Search.on_preload do |results, search|
+ next unless SiteSetting.assign_enabled?
+
+ can_assign = search.guardian&.can_assign?
+ allowed_access = SiteSetting.assigns_public || can_assign
+
+ next if !allowed_access || results.posts.empty?
+
+ topics = results.posts.map(&:topic)
+
+ assignments =
+ Assignment
+ .strict_loading
+ .active
+ .where(topic: topics)
+ .includes(:assigned_to, :target)
+ .group_by(&:topic_id)
+
+ results.posts.each do |post|
+ if topic_assignments = assignments[post.topic_id]
+ direct_assignment = topic_assignments.find { _1.target_type == "Topic" }
+ indirect_assignments = topic_assignments.select { _1.target_type == "Post" }
+ end
+
+ if indirect_assignments.present?
+ indirect_assignment_map = {}
+
+ indirect_assignments.each do |assignment|
+ next unless assignment.target
+ indirect_assignment_map[assignment.target_id] = {
+ assigned_to: assignment.assigned_to,
+ post_number: assignment.target.post_number,
+ }
+ end
+ end
+
+ # NOTE: preloading to `nil` is necessary to avoid N+1 queries
+ post.topic.preload_assigned_to(direct_assignment&.assigned_to)
+ post.topic.preload_assignment_status(direct_assignment&.status)
+ post.topic.preload_indirectly_assigned_to(indirect_assignment_map)
+ end
+ end
+
+ # TopicQuery
+ TopicQuery.add_custom_filter(:assigned) do |results, topic_query|
+ name = topic_query.options[:assigned]
+ next results if name.blank?
+
+ next results if !topic_query.guardian.can_assign? && !SiteSetting.assigns_public
+
+ if name == "nobody"
+ next(
+ results.joins("LEFT JOIN assignments a ON a.topic_id = topics.id AND active").where(
+ "a.assigned_to_id IS NULL",
+ )
+ )
+ end
+
+ if name == "*"
+ next(
+ results.joins("JOIN assignments a ON a.topic_id = topics.id AND active").where(
+ "a.assigned_to_id IS NOT NULL",
+ )
+ )
+ end
+
+ user_id = topic_query.guardian.user.id if name == "me"
+ user_id ||= User.where(username_lower: name.downcase).pick(:id)
+
+ if user_id
+ next(
+ results.joins("JOIN assignments a ON a.topic_id = topics.id AND active").where(
+ "a.assigned_to_id = ? AND a.assigned_to_type = 'User'",
+ user_id,
+ )
+ )
+ end
+
+ group_id = Group.where(name: name.downcase).pick(:id)
+
+ if group_id
+ next(
+ results.joins("JOIN assignments a ON a.topic_id = topics.id AND active").where(
+ "a.assigned_to_id = ? AND a.assigned_to_type = 'Group'",
+ group_id,
+ )
+ )
+ end
+
+ next results
+ end
+
+ add_to_class(:topic_query, :list_messages_assigned) do |user, ignored_assignment_ids = nil|
+ list = default_results(include_pms: true)
+
+ where_clause = +"("
+ where_clause << "(assigned_to_id = :user_id AND assigned_to_type = 'User' AND active)"
+ if @options[:filter] != :direct
+ where_clause << "OR (assigned_to_id IN (group_users.group_id) AND assigned_to_type = 'Group' AND active)"
+ end
+ where_clause << ")"
+
+ if ignored_assignment_ids.present?
+ where_clause << "AND assignments.id NOT IN (:ignored_assignment_ids)"
+ end
+ topic_ids_sql = +<<~SQL
+ SELECT topic_id FROM assignments
+ LEFT JOIN group_users ON group_users.user_id = :user_id
+ WHERE #{where_clause}
+ SQL
+
+ where_args = { user_id: user.id }
+ where_args[:ignored_assignment_ids] = ignored_assignment_ids if ignored_assignment_ids.present?
+ list = list.where("topics.id IN (#{topic_ids_sql})", **where_args).includes(:allowed_users)
+
+ create_list(:assigned, { unordered: true }, list)
+ end
+
+ add_to_class(:topic_query, :group_topics_assigned_results) do |group|
+ list = default_results(include_all_pms: true)
+
+ topic_ids_sql = +<<~SQL
+ SELECT topic_id FROM assignments
+ WHERE (
+ assigned_to_id = :group_id AND assigned_to_type = 'Group' AND active
+ )
+ SQL
+
+ topic_ids_sql << <<~SQL if @options[:filter] != :direct
+ OR (
+ assigned_to_id IN (SELECT user_id from group_users where group_id = :group_id) AND assigned_to_type = 'User' AND active
+ )
+ SQL
+
+ sql = "topics.id IN (#{topic_ids_sql})"
+
+ list = list.where(sql, group_id: group.id).includes(:allowed_users)
+ end
+
+ add_to_class(:topic_query, :list_group_topics_assigned) do |group|
+ create_list(:assigned, { unordered: true }, group_topics_assigned_results(group))
+ end
+
+ add_to_class(:topic_query, :list_private_messages_assigned) do |user|
+ list = private_messages_assigned_query(user)
+ create_list(:private_messages, {}, list)
+ end
+
+ add_to_class(:topic_query, :private_messages_assigned_query) do |user|
+ list = private_messages_for(user, :all)
+
+ group_ids = user.groups.map(&:id)
+
+ list = list.where(<<~SQL, user_id: user.id, group_ids: group_ids)
+ topics.id IN (
+ SELECT topic_id FROM assignments WHERE
+ active AND
+ ((assigned_to_id = :user_id AND assigned_to_type = 'User') OR
+ (assigned_to_id IN (:group_ids) AND assigned_to_type = 'Group'))
+ )
+ SQL
+ end
+
+ # ListController
+ add_to_class(:list_controller, :messages_assigned) do
+ user = User.find_by_username(params[:username])
+ raise Discourse::NotFound unless user
+ raise Discourse::InvalidAccess unless current_user.can_assign?
+
+ list_opts = build_topic_list_options
+ list_opts.merge!({ filter: :direct }) if params[:direct] == "true"
+ list = generate_list_for("messages_assigned", user, list_opts)
+
+ list.more_topics_url = construct_url_with(:next, list_opts)
+ list.prev_topics_url = construct_url_with(:prev, list_opts)
+
+ respond_with_list(list)
+ end
+
+ add_to_class(:list_controller, :group_topics_assigned) do
+ group = Group.find_by("name = ?", params[:groupname])
+ guardian.ensure_can_see_group_members!(group)
+
+ raise Discourse::NotFound unless group
+ raise Discourse::InvalidAccess unless current_user.can_assign?
+ raise Discourse::InvalidAccess unless group.can_show_assigned_tab?
+
+ list_opts = build_topic_list_options
+ list_opts.merge!({ filter: :direct }) if params[:direct] == "true"
+ list = generate_list_for("group_topics_assigned", group, list_opts)
+
+ list.more_topics_url = construct_url_with(:next, list_opts)
+ list.prev_topics_url = construct_url_with(:prev, list_opts)
+
+ respond_with_list(list)
+ end
+
+ # Topic
+ add_to_class(:topic, :assigned_to) do
+ return @assigned_to if defined?(@assigned_to)
+ @assigned_to = assignment.assigned_to if assignment&.active
+ end
+
+ add_to_class(:topic, :assignment_status) do
+ return @assignment_status if defined?(@assignment_status)
+ @assignment_status = assignment.status if SiteSetting.enable_assign_status && assignment&.active
+ end
+
+ add_to_class(:topic, :indirectly_assigned_to) do
+ return @indirectly_assigned_to if defined?(@indirectly_assigned_to)
+ @indirectly_assigned_to =
+ Assignment
+ .where(topic_id: id, target_type: "Post", active: true)
+ .includes(:target)
+ .inject({}) do |acc, assignment|
+ if assignment.target
+ acc[assignment.target_id] = {
+ assigned_to: assignment.assigned_to,
+ post_number: assignment.target.post_number,
+ assignment_note: assignment.note,
+ }
+ acc[assignment.target_id][
+ :assignment_status
+ ] = assignment.status if SiteSetting.enable_assign_status
+ end
+ acc
+ end
+ end
+
+ add_to_class(:topic, :preload_assigned_to) { |assigned_to| @assigned_to = assigned_to }
+
+ add_to_class(:topic, :preload_assignment_status) do |assignment_status|
+ @assignment_status = assignment_status
+ end
+
+ add_to_class(:topic, :preload_indirectly_assigned_to) do |indirectly_assigned_to|
+ @indirectly_assigned_to = indirectly_assigned_to
+ end
+
+ # TopicList serializer
+ add_to_serializer(
+ :topic_list,
+ :assigned_messages_count,
+ include_condition: -> do
+ options = object.instance_variable_get(:@opts)
+
+ if assigned_user = options.dig(:assigned)
+ scope.can_assign? || assigned_user.downcase == scope.current_user&.username_lower
+ end
+ end,
+ ) do
+ TopicQuery
+ .new(object.current_user, guardian: scope, limit: false)
+ .private_messages_assigned_query(object.current_user)
+ .count
+ end
+
+ # TopicView serializer
+ add_to_serializer(
+ :topic_view,
+ :assigned_to_user,
+ include_condition: -> do
+ (SiteSetting.assigns_public || scope.can_assign?) && object.topic.assigned_to.is_a?(User)
+ end,
+ ) { DiscourseAssign::Helpers.build_assigned_to_user(object.topic.assigned_to, object.topic) }
+
+ add_to_serializer(
+ :topic_view,
+ :assigned_to_group,
+ include_condition: -> do
+ (SiteSetting.assigns_public || scope.can_assign?) && object.topic.assigned_to.is_a?(Group)
+ end,
+ ) { DiscourseAssign::Helpers.build_assigned_to_group(object.topic.assigned_to, object.topic) }
+
+ add_to_serializer(
+ :topic_view,
+ :indirectly_assigned_to,
+ include_condition: -> do
+ (SiteSetting.assigns_public || scope.can_assign?) &&
+ object.topic.indirectly_assigned_to.present?
+ end,
+ ) do
+ DiscourseAssign::Helpers.build_indirectly_assigned_to(
+ object.topic.indirectly_assigned_to,
+ object.topic,
+ )
+ end
+
+ add_to_serializer(
+ :topic_view,
+ :assignment_note,
+ include_condition: -> do
+ (SiteSetting.assigns_public || scope.can_assign?) && object.topic.assignment.present?
+ end,
+ ) { object.topic.assignment.note }
+
+ add_to_serializer(
+ :topic_view,
+ :assignment_status,
+ include_condition: -> do
+ SiteSetting.enable_assign_status && (SiteSetting.assigns_public || scope.can_assign?) &&
+ object.topic.assignment_status.present?
+ end,
+ ) { object.topic.assignment_status }
+
+ # SuggestedTopic serializer
+ add_to_serializer(
+ :suggested_topic,
+ :assigned_to_user,
+ include_condition: -> do
+ (SiteSetting.assigns_public || scope.can_assign?) && object.assigned_to.is_a?(User)
+ end,
+ ) { DiscourseAssign::Helpers.build_assigned_to_user(object.assigned_to, object) }
+
+ add_to_serializer(
+ :suggested_topic,
+ :assigned_to_group,
+ include_condition: -> do
+ (SiteSetting.assigns_public || scope.can_assign?) && object.assigned_to.is_a?(Group)
+ end,
+ ) { DiscourseAssign::Helpers.build_assigned_to_group(object.assigned_to, object) }
+
+ add_to_serializer(
+ :suggested_topic,
+ :indirectly_assigned_to,
+ include_condition: -> do
+ (SiteSetting.assigns_public || scope.can_assign?) && object.indirectly_assigned_to.present?
+ end,
+ ) { DiscourseAssign::Helpers.build_indirectly_assigned_to(object.indirectly_assigned_to, object) }
+
+ # TopicListItem serializer
+ add_to_serializer(
+ :topic_list_item,
+ :indirectly_assigned_to,
+ include_condition: -> do
+ (SiteSetting.assigns_public || scope.can_assign?) && object.indirectly_assigned_to.present?
+ end,
+ ) { DiscourseAssign::Helpers.build_indirectly_assigned_to(object.indirectly_assigned_to, object) }
+
+ add_to_serializer(
+ :topic_list_item,
+ :assigned_to_user,
+ include_condition: -> do
+ (SiteSetting.assigns_public || scope.can_assign?) && object.assigned_to.is_a?(User)
+ end,
+ ) { BasicUserSerializer.new(object.assigned_to, scope: scope, root: false).as_json }
+
+ add_to_serializer(
+ :topic_list_item,
+ :assigned_to_group,
+ include_condition: -> do
+ (SiteSetting.assigns_public || scope.can_assign?) && object.assigned_to.is_a?(Group)
+ end,
+ ) { AssignedGroupSerializer.new(object.assigned_to, scope: scope, root: false).as_json }
+
+ add_to_serializer(
+ :topic_list_item,
+ :assignment_status,
+ include_condition: -> do
+ SiteSetting.enable_assign_status && (SiteSetting.assigns_public || scope.can_assign?) &&
+ object.assignment_status.present?
+ end,
+ ) { object.assignment_status }
+
+ # SearchTopicListItem serializer
+ add_to_serializer(
+ :search_topic_list_item,
+ :assigned_to_user,
+ include_condition: -> do
+ (SiteSetting.assigns_public || scope.can_assign?) && object.assigned_to.is_a?(User)
+ end,
+ ) { DiscourseAssign::Helpers.build_assigned_to_user(object.assigned_to, object) }
+
+ add_to_serializer(
+ :search_topic_list_item,
+ :assigned_to_group,
+ include_condition: -> do
+ (SiteSetting.assigns_public || scope.can_assign?) && object.assigned_to.is_a?(Group)
+ end,
+ ) { AssignedGroupSerializer.new(object.assigned_to, scope: scope, root: false).as_json }
+
+ add_to_serializer(
+ :search_topic_list_item,
+ :indirectly_assigned_to,
+ include_condition: -> do
+ (SiteSetting.assigns_public || scope.can_assign?) && object.indirectly_assigned_to.present?
+ end,
+ ) { DiscourseAssign::Helpers.build_indirectly_assigned_to(object.indirectly_assigned_to, object) }
+
+ # TopicsBulkAction
+ TopicsBulkAction.register_operation("assign") do
+ if @user.can_assign?
+ assign_user = User.find_by_username(@operation[:username])
+ topics.each do |topic|
+ Assigner.new(topic, @user).assign(
+ assign_user,
+ status: @operation[:status],
+ note: @operation[:note],
+ )
+ end
+ end
+ end
+
+ TopicsBulkAction.register_operation("unassign") do
+ if @user.can_assign?
+ topics.each { |topic| Assigner.new(topic, @user).unassign if guardian.can_assign? }
+ end
+ end
+
+ register_permitted_bulk_action_parameter :username
+ register_permitted_bulk_action_parameter :status
+ register_permitted_bulk_action_parameter :note
+
+ add_to_class(:user_bookmark_base_serializer, :assigned_to) do
+ @assigned_to ||=
+ bookmarkable_type == "Topic" ? bookmarkable.assigned_to : bookmarkable.topic.assigned_to
+ end
+
+ add_to_class(:user_bookmark_base_serializer, :can_have_assignment?) do
+ %w[Post Topic].include?(bookmarkable_type)
+ end
+
+ add_to_serializer(
+ :user_bookmark_base,
+ :assigned_to_user,
+ include_condition: -> do
+ return false if !can_have_assignment?
+ (SiteSetting.assigns_public || scope.can_assign?) && assigned_to.is_a?(User)
+ end,
+ ) do
+ return if !can_have_assignment?
+ BasicUserSerializer.new(assigned_to, scope: scope, root: false).as_json
+ end
+
+ add_to_serializer(
+ :user_bookmark_base,
+ :assigned_to_group,
+ include_condition: -> do
+ return false if !can_have_assignment?
+ (SiteSetting.assigns_public || scope.can_assign?) && assigned_to.is_a?(Group)
+ end,
+ ) do
+ return if !can_have_assignment?
+ AssignedGroupSerializer.new(assigned_to, scope: scope, root: false).as_json
+ end
+
+ # PostSerializer
+ add_to_serializer(
+ :post,
+ :assigned_to_user,
+ include_condition: -> do
+ (SiteSetting.assigns_public || scope.can_assign?) &&
+ object.assignment&.assigned_to.is_a?(User) && object.assignment.active
+ end,
+ ) { BasicUserSerializer.new(object.assignment.assigned_to, scope: scope, root: false).as_json }
+
+ add_to_serializer(
+ :post,
+ :assigned_to_group,
+ include_condition: -> do
+ (SiteSetting.assigns_public || scope.can_assign?) &&
+ object.assignment&.assigned_to.is_a?(Group) && object.assignment.active
+ end,
+ ) do
+ AssignedGroupSerializer.new(object.assignment.assigned_to, scope: scope, root: false).as_json
+ end
+
+ add_to_serializer(
+ :post,
+ :assignment_note,
+ include_condition: -> do
+ (SiteSetting.assigns_public || scope.can_assign?) && object.assignment.present?
+ end,
+ ) { object.assignment.note }
+
+ add_to_serializer(
+ :post,
+ :assignment_status,
+ include_condition: -> do
+ SiteSetting.enable_assign_status && (SiteSetting.assigns_public || scope.can_assign?) &&
+ object.assignment.present?
+ end,
+ ) { object.assignment.status }
+
+ # CurrentUser serializer
+ add_to_serializer(:current_user, :can_assign) { object.can_assign? }
+
+ # FlaggedTopic serializer
+ add_to_serializer(
+ :flagged_topic,
+ :assigned_to_user,
+ include_condition: -> { object.assigned_to && object.assigned_to.is_a?(User) },
+ ) { DiscourseAssign::Helpers.build_assigned_to_user(object.assigned_to, object) }
+
+ add_to_serializer(
+ :flagged_topic,
+ :assigned_to_group,
+ include_condition: -> { object.assigned_to && object.assigned_to.is_a?(Group) },
+ ) { DiscourseAssign::Helpers.build_assigned_to_group(object.assigned_to, object) }
+
+ # Reviewable
+ add_custom_reviewable_filter(
+ [
+ :assigned_to,
+ Proc.new do |results, value|
+ results.joins(<<~SQL).where(target_type: Post.name).where("u.username = ?", value)
+ INNER JOIN posts p ON p.id = target_id
+ INNER JOIN topics t ON t.id = p.topic_id
+ INNER JOIN assignments a ON a.topic_id = t.id AND a.assigned_to_type = 'User'
+ INNER JOIN users u ON u.id = a.assigned_to_id
+ SQL
+ end,
+ ],
+ )
+
+ # TopicTrackingState
+ add_class_method(:topic_tracking_state, :publish_assigned_private_message) do |topic, assignee|
+ return unless topic.private_message?
+ opts = (assignee.is_a?(User) ? { user_ids: [assignee.id] } : { group_ids: [assignee.id] })
+
+ MessageBus.publish("/private-messages/assigned", { topic_id: topic.id }, opts)
+ end
+
+ # Event listeners
+ on(:post_created) { |post| ::Assigner.auto_assign(post, force: true) }
+
+ on(:post_edited) { |post, topic_changed| ::Assigner.auto_assign(post, force: true) }
+
+ on(:topic_status_updated) do |topic, status, enabled|
+ if SiteSetting.unassign_on_close && (status == "closed" || status == "autoclosed") && enabled &&
+ Assignment.active.exists?(topic: topic)
+ assigner = ::Assigner.new(topic, Discourse.system_user)
+ assigner.unassign(silent: true, deactivate: true)
+
+ topic
+ .posts
+ .joins(:assignment)
+ .find_each do |post|
+ assigner = ::Assigner.new(post, Discourse.system_user)
+ assigner.unassign(silent: true, deactivate: true)
+ end
+ MessageBus.publish("/topic/#{topic.id}", reload_topic: true, refresh_stream: true)
+ end
+
+ if SiteSetting.reassign_on_open && (status == "closed" || status == "autoclosed") && !enabled &&
+ Assignment.inactive.exists?(topic: topic)
+ Assignment.reactivate!(topic: topic)
+ MessageBus.publish("/topic/#{topic.id}", reload_topic: true, refresh_stream: true)
+ end
+ end
+
+ on(:post_destroyed) do |post|
+ if Assignment.active.exists?(target: post)
+ post.assignment.deactivate!
+ MessageBus.publish("/topic/#{post.topic_id}", reload_topic: true, refresh_stream: true)
+ end
+
+ # small actions have to be destroyed as link is incorrect
+ PostCustomField
+ .where(name: "action_code_post_id", value: post.id)
+ .find_each do |post_custom_field|
+ next if post_custom_field.post == nil
+ if ![Post.types[:small_action], Post.types[:whisper]].include?(
+ post_custom_field.post.post_type,
+ )
+ next
+ end
+ post_custom_field.post.destroy
+ end
+ end
+
+ on(:post_recovered) do |post|
+ if SiteSetting.reassign_on_open && Assignment.inactive.exists?(target: post)
+ post.assignment.reactivate!
+ MessageBus.publish("/topic/#{post.topic_id}", reload_topic: true, refresh_stream: true)
+ end
+ end
+
+ on(:move_to_inbox) do |info|
+ topic = info[:topic]
+
+ if topic.assignment
+ TopicTrackingState.publish_assigned_private_message(topic, topic.assignment.assigned_to)
+ end
+
+ next if !SiteSetting.unassign_on_group_archive
+ next if !info[:group]
+
+ Assignment.reactivate!(topic: topic)
+ end
+
+ on(:archive_message) do |info|
+ topic = info[:topic]
+ next if !topic.assignment
+
+ TopicTrackingState.publish_assigned_private_message(topic, topic.assignment.assigned_to)
+
+ next if !SiteSetting.unassign_on_group_archive
+ next if !info[:group]
+
+ Assignment.deactivate!(topic: topic)
+ end
+
+ on(:user_added_to_group) do |user, group, automatic:|
+ group.assignments.active.find_each do |assignment|
+ Jobs.enqueue(:assign_notification, assignment_id: assignment.id)
+ end
+ end
+
+ on(:user_removed_from_group) do |user, group|
+ user.notifications.for_assignment(group.assignments.select(:id)).destroy_all
+ end
+
+ on(:post_moved) do |post, original_topic_id|
+ assignment =
+ Assignment.where(topic_id: original_topic_id, target_type: "Post", target_id: post.id).first
+ next if !assignment
+ if post.is_first_post?
+ assignment.update!(topic_id: post.topic_id, target_type: "Topic", target_id: post.topic_id)
+ else
+ assignment.update!(topic_id: post.topic_id)
+ end
+ end
+
+ on(:group_destroyed) do |group, user_ids|
+ User
+ .where(id: user_ids)
+ .find_each do |user|
+ user.notifications.for_assignment(group.assignments.select(:id)).destroy_all
+ end
+
+ Assignment.active_for_group(group).destroy_all
+ end
+
+ add_filter_custom_filter("assigned") do |scope, filter_values, guardian|
+ next if !guardian.can_assign? || filter_values.blank?
+
+ user_or_group_name = filter_values.compact.first
+
+ next if user_or_group_name.blank?
+
+ if user_id = User.find_by_username(user_or_group_name)&.id
+ scope.where(<<~SQL, user_id)
+ topics.id IN (SELECT a.topic_id FROM assignments a WHERE a.assigned_to_id = ? AND a.assigned_to_type = 'User' AND a.active)
+ SQL
+ elsif group_id = Group.find_by(name: user_or_group_name)&.id
+ scope.where(<<~SQL, group_id)
+ topics.id IN (SELECT a.topic_id FROM assignments a WHERE a.assigned_to_id = ? AND a.assigned_to_type = 'Group' AND a.active)
+ SQL
+ end
+ end
+
+ register_search_advanced_filter(/in:assigned/) do |posts|
+ next if [email protected]_assign?
+
+ posts.where("topics.id IN (SELECT a.topic_id FROM assignments a WHERE a.active)")
+ end
+
+ register_search_advanced_filter(/in:unassigned/) do |posts|
+ next if [email protected]_assign?
+
+ posts.where("topics.id NOT IN (SELECT a.topic_id FROM assignments a WHERE a.active)")
+ end
+
+ register_search_advanced_filter(/assigned:(.+)$/) do |posts, match|
+ next if [email protected]_assign? || match.blank?
+
+ if user_id = User.find_by_username(match)&.id
+ posts.where(<<~SQL, user_id)
+ topics.id IN (SELECT a.topic_id FROM assignments a WHERE a.assigned_to_id = ? AND a.assigned_to_type = 'User' AND a.active)
+ SQL
+ elsif group_id = Group.find_by(name: match)&.id
+ posts.where(<<~SQL, group_id)
+ topics.id IN (SELECT a.topic_id FROM assignments a WHERE a.assigned_to_id = ? AND a.assigned_to_type = 'Group' AND a.active)
+ SQL
+ end
+ end
+
+ if defined?(DiscourseAutomation)
+ add_automation_scriptable("random_assign") do
+ field :assignees_group, component: :group, required: true
+ field :assigned_topic, component: :text, required: true
+ field :minimum_time_between_assignments, component: :text
+ field :max_recently_assigned_days, component: :text
+ field :min_recently_assigned_days, component: :text
+ field :skip_new_users_for_days, component: :text
+ field :in_working_hours, component: :boolean
+ field :post_template, component: :post
+
+ version 1
+
+ triggerables %i[point_in_time recurring]
+
+ script do |context, fields, automation|
+ RandomAssignUtils.automation_script!(context, fields, automation)
+ end
+ end
+ end
+end
diff --git a/plugins/discourse-assign/spec/components/search_spec.rb b/plugins/discourse-assign/spec/components/search_spec.rb
new file mode 100644
index 00000000000..aae0b399e28
--- /dev/null
+++ b/plugins/discourse-assign/spec/components/search_spec.rb
@@ -0,0 +1,75 @@
+# frozen_string_literal: true
+
+require "rails_helper"
+require_relative "../support/assign_allowed_group"
+
+describe Search do
+ fab!(:user) { Fabricate(:active_user) }
+ fab!(:user2) { Fabricate(:user) }
+
+ before do
+ SearchIndexer.enable
+ SiteSetting.assign_enabled = true
+ end
+
+ describe "Advanced search" do
+ include_context "with group that is allowed to assign"
+
+ let(:post1) { Fabricate(:post) }
+ let(:post2) { Fabricate(:post) }
+ let(:post3) { Fabricate(:post) }
+ let(:post4) { Fabricate(:post) }
+ let(:post5) { Fabricate(:post, topic: post4.topic) }
+ let(:post6) { Fabricate(:post) }
+
+ before do
+ add_to_assign_allowed_group(user)
+ add_to_assign_allowed_group(user2)
+
+ Assigner.new(post1.topic, user).assign(user)
+ Assigner.new(post2.topic, user).assign(user2)
+ Assigner.new(post3.topic, user).assign(user)
+ Assigner.new(post5, user).assign(user)
+ Assignment.create!(
+ assigned_to: user,
+ assigned_by_user: user,
+ target: post6,
+ topic_id: post6.topic.id,
+ active: false,
+ )
+ end
+
+ it "can find by status" do
+ expect(Search.execute("in:assigned", guardian: Guardian.new(user)).posts.length).to eq(4)
+
+ Assigner.new(post3.topic, user).unassign
+
+ expect(Search.execute("in:unassigned", guardian: Guardian.new(user)).posts.length).to eq(2)
+ expect(
+ Search.execute("assigned:#{user.username}", guardian: Guardian.new(user)).posts.length,
+ ).to eq(2)
+ end
+
+ it "serializes results" do
+ guardian = Guardian.new(user)
+ result = Search.execute("in:assigned", guardian: guardian)
+ serializer = GroupedSearchResultSerializer.new(result, scope: guardian)
+ indirectly_assigned_to =
+ serializer.as_json[:topics].find { |topic| topic[:id] == post5.topic.id }[
+ :indirectly_assigned_to
+ ]
+ expect(indirectly_assigned_to).to eq(
+ post5.id => {
+ assigned_to: {
+ avatar_template: user.avatar_template,
+ name: user.name,
+ username: user.username,
+ },
+ post_number: post5.post_number,
+ assignment_note: nil,
+ assignment_status: nil,
+ },
+ )
+ end
+ end
+end
diff --git a/plugins/discourse-assign/spec/components/topic_query_spec.rb b/plugins/discourse-assign/spec/components/topic_query_spec.rb
new file mode 100644
index 00000000000..7ce0690c001
--- /dev/null
+++ b/plugins/discourse-assign/spec/components/topic_query_spec.rb
@@ -0,0 +1,237 @@
+# frozen_string_literal: true
+
+require "rails_helper"
+require_relative "../support/assign_allowed_group"
+
+describe TopicQuery do
+ before { SiteSetting.assign_enabled = true }
+
+ fab!(:user)
+ fab!(:user2) { Fabricate(:user) }
+ fab!(:user3) { Fabricate(:user) }
+ fab!(:user4) { Fabricate(:user) }
+
+ include_context "with group that is allowed to assign"
+
+ before do
+ add_to_assign_allowed_group(user)
+ add_to_assign_allowed_group(user2)
+ end
+
+ describe "#list_messages_assigned" do
+ fab!(:private_message) { Fabricate(:private_message_post, user: user).topic }
+
+ fab!(:topic) { Fabricate(:post, user: user).topic }
+ fab!(:group_topic) { Fabricate(:post, user: user).topic }
+
+ before do
+ assign_to(private_message, user, user)
+ assign_to(topic, user, user)
+ assign_to(group_topic, user, assign_allowed_group)
+ end
+
+ it "Includes topics and PMs assigned to user" do
+ assigned_messages = TopicQuery.new(user, { page: 0 }).list_messages_assigned(user).topics
+
+ expect(assigned_messages).to contain_exactly(private_message, topic, group_topic)
+ end
+
+ it "Excludes inactive assignments" do
+ Assignment.update_all(active: false)
+
+ assigned_messages = TopicQuery.new(user, { page: 0 }).list_messages_assigned(user).topics
+
+ expect(assigned_messages).to eq([])
+ end
+
+ it "Excludes topics and PMs not assigned to user" do
+ assigned_messages = TopicQuery.new(user2, { page: 0 }).list_messages_assigned(user2).topics
+
+ expect(assigned_messages).to contain_exactly(group_topic)
+ end
+
+ it "direct filter excludes group assignment" do
+ assigned_messages =
+ TopicQuery.new(user, { page: 0, filter: :direct }).list_messages_assigned(user).topics
+
+ expect(assigned_messages).to contain_exactly(private_message, topic)
+ end
+
+ it "Returns the results ordered by the bumped_at field" do
+ topic.update(bumped_at: 2.weeks.ago)
+
+ assigned_messages = TopicQuery.new(user, { page: 0 }).list_messages_assigned(user).topics
+
+ expect(assigned_messages).to eq([group_topic, private_message, topic])
+ end
+ end
+
+ describe "#list_group_topics_assigned" do
+ fab!(:private_message) { Fabricate(:private_message_post, user: user).topic }
+
+ fab!(:topic) { Fabricate(:post, user: user).topic }
+
+ fab!(:group_topic) { Fabricate(:post, user: user).topic }
+
+ before do
+ assign_to(private_message, user, user)
+ assign_to(topic, user2, user2)
+ assign_to(group_topic, user, assign_allowed_group)
+ end
+
+ it "Includes topics and PMs assigned to user" do
+ assigned_messages =
+ TopicQuery.new(user, { page: 0 }).list_group_topics_assigned(assign_allowed_group).topics
+
+ expect(assigned_messages).to contain_exactly(private_message, topic, group_topic)
+ end
+
+ it "Returns the results ordered by the bumped_at field" do
+ topic.update(bumped_at: 2.weeks.ago)
+
+ assigned_messages =
+ TopicQuery.new(user, { page: 0 }).list_group_topics_assigned(assign_allowed_group).topics
+
+ expect(assigned_messages).to eq([group_topic, private_message, topic])
+ end
+
+ it "direct filter shows only group assignments" do
+ assigned_messages =
+ TopicQuery
+ .new(user, { page: 0, filter: :direct })
+ .list_group_topics_assigned(assign_allowed_group)
+ .topics
+
+ expect(assigned_messages).to contain_exactly(group_topic)
+ end
+ end
+
+ describe "#list_private_messages_assigned" do
+ let(:user_topic) do
+ topic =
+ create_post(
+ user: user3,
+ target_usernames: [user.username, user2.username],
+ archetype: Archetype.private_message,
+ ).topic
+
+ create_post(topic_id: topic.id, user: user)
+
+ topic
+ end
+
+ let(:assigned_topic) do
+ topic =
+ create_post(
+ user: user4,
+ target_usernames: [user.username, user2.username],
+ archetype: Archetype.private_message,
+ ).topic
+
+ assign_to(topic, user, user)
+ end
+
+ let(:group2) { Fabricate(:group, messageable_level: Group::ALIAS_LEVELS[:everyone]) }
+
+ let(:group_assigned_topic) do
+ topic =
+ create_post(
+ user: user,
+ target_group_names: [assign_allowed_group.name, group2.name],
+ archetype: Archetype.private_message,
+ ).topic
+
+ assign_to(topic, user, user)
+ end
+
+ before do
+ Group.refresh_automatic_groups!
+
+ assign_allowed_group.update!(messageable_level: Group::ALIAS_LEVELS[:everyone])
+
+ user_topic
+ assigned_topic
+ group_assigned_topic
+ end
+
+ it "should return the right topics" do
+ expect(TopicQuery.new(user).list_private_messages_assigned(user).topics).to contain_exactly(
+ assigned_topic,
+ group_assigned_topic,
+ )
+
+ UserArchivedMessage.archive!(user.id, assigned_topic)
+
+ expect(TopicQuery.new(user).list_private_messages_assigned(user).topics).to contain_exactly(
+ assigned_topic,
+ group_assigned_topic,
+ )
+
+ GroupArchivedMessage.archive!(group2.id, group_assigned_topic)
+
+ expect(TopicQuery.new(user).list_private_messages_assigned(user).topics).to contain_exactly(
+ assigned_topic,
+ group_assigned_topic,
+ )
+
+ GroupArchivedMessage.archive!(assign_allowed_group.id, group_assigned_topic)
+
+ expect(TopicQuery.new(user).list_private_messages_assigned(user).topics).to contain_exactly(
+ assigned_topic,
+ group_assigned_topic,
+ )
+ end
+ end
+
+ describe "assigned filter" do
+ it "filters topics assigned to a user" do
+ assigned_topic = Fabricate(:post).topic
+ assigned_topic2 = Fabricate(:post).topic
+
+ Assigner.new(assigned_topic, user).assign(user)
+ Assigner.new(assigned_topic2, user2).assign(user2)
+ query = TopicQuery.new(user, assigned: user.username).list_latest
+
+ expect(query.topics.length).to eq(1)
+ expect(query.topics.first).to eq(assigned_topic)
+ end
+
+ it "filters topics assigned to the current user" do
+ assigned_topic = Fabricate(:post).topic
+ assigned_topic2 = Fabricate(:post).topic
+
+ Assigner.new(assigned_topic, user).assign(user)
+ Assigner.new(assigned_topic2, user2).assign(user2)
+ query = TopicQuery.new(user2, assigned: "me").list_latest
+
+ expect(query.topics.length).to eq(1)
+ expect(query.topics.first).to eq(assigned_topic2)
+ end
+
+ it "filters topics assigned to nobody" do
+ assigned_topic = Fabricate(:post).topic
+ unassigned_topic = Fabricate(:topic)
+
+ Assigner.new(assigned_topic, user).assign(user)
+ query = TopicQuery.new(user, assigned: "nobody").list_latest
+
+ expect(query.topics.length).to eq(1)
+ expect(query.topics.first).to eq(unassigned_topic)
+ end
+
+ it "filters topics assigned to anybody (*)" do
+ assigned_topic = Fabricate(:post).topic
+ Fabricate(:topic)
+
+ Assigner.new(assigned_topic, user).assign(user)
+ query = TopicQuery.new(user, assigned: "*").list_latest
+
+ expect(query.topics.length).to eq(1)
+ expect(query.topics.first).to eq(assigned_topic)
+ end
+ end
+
+ def assign_to(topic, user, assignee)
+ topic.tap { |t| Assigner.new(t, user).assign(assignee) }
+ end
+end
diff --git a/plugins/discourse-assign/spec/components/topics_bulk_action_spec.rb b/plugins/discourse-assign/spec/components/topics_bulk_action_spec.rb
new file mode 100644
index 00000000000..2df3bcc6554
--- /dev/null
+++ b/plugins/discourse-assign/spec/components/topics_bulk_action_spec.rb
@@ -0,0 +1,96 @@
+# frozen_string_literal: true
+
+require "rails_helper"
+require_relative "../support/assign_allowed_group"
+
+describe TopicsBulkAction do
+ fab!(:post)
+ fab!(:post1) { Fabricate(:post) }
+ fab!(:post2) { Fabricate(:post) }
+
+ before { SiteSetting.assign_enabled = true }
+
+ let(:user) { Fabricate(:user) }
+ let(:user2) { Fabricate(:user) }
+
+ include_context "with group that is allowed to assign"
+
+ before { add_to_assign_allowed_group(user) }
+
+ describe "assign_topics" do
+ it "assigns multiple topics to user" do
+ TopicsBulkAction.new(
+ user,
+ [post.topic.id, post1.topic.id],
+ { type: "assign", username: user.username, note: "foobar" },
+ ).perform!
+
+ assigned_topics = TopicQuery.new(user, { page: 0 }).list_messages_assigned(user).topics
+
+ expect(assigned_topics.length).to eq(2)
+
+ expect(assigned_topics).to contain_exactly(post.topic, post1.topic)
+
+ expect(post.topic.assignment.note).to eq "foobar"
+ expect(post1.topic.assignment.note).to eq "foobar"
+ end
+
+ it "doesn't allows to assign to user not in assign_allowed_group" do
+ TopicsBulkAction.new(
+ user,
+ [post.topic.id, post1.topic.id],
+ { type: "assign", username: user2.username },
+ ).perform!
+
+ assigned_topics = TopicQuery.new(user, { page: 0 }).list_messages_assigned(user2).topics
+
+ expect(assigned_topics.length).to eq(0)
+ end
+
+ it "user who is not in assign_allowed_group can't assign topics" do
+ TopicsBulkAction.new(
+ user2,
+ [post.topic.id, post1.topic.id, post2.topic.id],
+ { type: "assign", username: user.username },
+ ).perform!
+
+ assigned_topics = TopicQuery.new(user, { page: 0 }).list_messages_assigned(user).topics
+
+ expect(assigned_topics.length).to eq(0)
+ end
+ end
+
+ describe "unassign_topics" do
+ it "unassigns multiple topics assigned to user" do
+ TopicsBulkAction.new(
+ user,
+ [post.topic.id, post1.topic.id, post2.topic.id],
+ { type: "assign", username: user.username },
+ ).perform!
+
+ TopicsBulkAction.new(user, [post.topic.id, post1.topic.id], type: "unassign").perform!
+
+ assigned_topics = TopicQuery.new(user, { page: 0 }).list_messages_assigned(user).topics
+
+ expect(assigned_topics.length).to eq(1)
+
+ expect(assigned_topics).to contain_exactly(post2.topic)
+ end
+
+ it "user who is not in assign_allowed_group can't unassign topics" do
+ TopicsBulkAction.new(
+ user,
+ [post.topic.id, post1.topic.id, post2.topic.id],
+ { type: "assign", username: user.username },
+ ).perform!
+
+ TopicsBulkAction.new(user2, [post.topic.id, post1.topic.id], type: "unassign").perform!
+
+ assigned_topics = TopicQuery.new(user, { page: 0 }).list_messages_assigned(user).topics
+
+ expect(assigned_topics.length).to eq(3)
+
+ expect(assigned_topics).to contain_exactly(post.topic, post1.topic, post2.topic)
+ end
+ end
+end
diff --git a/plugins/discourse-assign/spec/fabricators/assign_hook_fabricator.rb b/plugins/discourse-assign/spec/fabricators/assign_hook_fabricator.rb
new file mode 100644
index 00000000000..203e374fc60
--- /dev/null
+++ b/plugins/discourse-assign/spec/fabricators/assign_hook_fabricator.rb
@@ -0,0 +1,7 @@
+# frozen_string_literal: true
+
+Fabricator(:assign_web_hook, from: :web_hook) do
+ after_build do |web_hook|
+ web_hook.web_hook_event_types = WebHookEventType.where(name: %w[assigned unassigned])
+ end
+end
diff --git a/plugins/discourse-assign/spec/fabricators/assignment_fabricator.rb b/plugins/discourse-assign/spec/fabricators/assignment_fabricator.rb
new file mode 100644
index 00000000000..9dfa97fd984
--- /dev/null
+++ b/plugins/discourse-assign/spec/fabricators/assignment_fabricator.rb
@@ -0,0 +1,18 @@
+# frozen_string_literal: true
+
+Fabricator(:topic_assignment, class_name: :assignment) do
+ topic
+ target { |attrs| attrs[:topic] }
+ target_type "Topic"
+ assigned_by_user { Fabricate(:user) }
+ assigned_to { Fabricate(:user) }
+end
+
+Fabricator(:post_assignment, class_name: :assignment) do
+ transient :post
+ topic { |attrs| attrs[:post]&.topic || Fabricate(:topic) }
+ target { |attrs| attrs[:post] || Fabricate(:post, topic: attrs[:topic]) }
+ target_type "Post"
+ assigned_by_user { Fabricate(:user) }
+ assigned_to { Fabricate(:user) }
+end
diff --git a/plugins/discourse-assign/spec/fabricators/notification_fabricator.rb b/plugins/discourse-assign/spec/fabricators/notification_fabricator.rb
new file mode 100644
index 00000000000..0ac16a59d89
--- /dev/null
+++ b/plugins/discourse-assign/spec/fabricators/notification_fabricator.rb
@@ -0,0 +1,21 @@
+# frozen_string_literal: true
+
+Fabricator(:assignment_notification, from: :notification) do
+ transient :group
+ notification_type Notification.types[:assigned]
+ post_number 1
+ data do |attrs|
+ {
+ message:
+ (
+ if attrs[:group]
+ "discourse_assign.assign_group_notification"
+ else
+ "discourse_assign.assign_notification"
+ end
+ ),
+ display_username: attrs[:group] ? "group" : "user",
+ assignment_id: rand(1..100),
+ }.to_json
+ end
+end
diff --git a/plugins/discourse-assign/spec/integration/assign_spec.rb b/plugins/discourse-assign/spec/integration/assign_spec.rb
new file mode 100644
index 00000000000..0a12e25d67f
--- /dev/null
+++ b/plugins/discourse-assign/spec/integration/assign_spec.rb
@@ -0,0 +1,202 @@
+# frozen_string_literal: true
+
+require "rails_helper"
+require_relative "../support/assign_allowed_group"
+require_relative "../fabricators/assign_hook_fabricator.rb"
+
+describe "integration tests" do
+ before { SiteSetting.assign_enabled = true }
+
+ it "preloads data in topic list" do
+ admin = Fabricate(:admin)
+ post = create_post
+ list = TopicList.new("latest", admin, [post.topic])
+ TopicList.preload([post.topic], list)
+ # should not explode for now
+ end
+
+ describe "for a private message" do
+ let(:post) { Fabricate(:private_message_post) }
+ let(:pm) { post.topic }
+ let(:user) { pm.allowed_users.first }
+ let(:user2) { pm.allowed_users.last }
+ let(:channel) { "/private-messages/assigned" }
+ fab!(:group) { Fabricate(:group, assignable_level: Group::ALIAS_LEVELS[:everyone]) }
+
+ include_context "with group that is allowed to assign"
+
+ before do
+ add_to_assign_allowed_group(user)
+ add_to_assign_allowed_group(user2)
+ group.add(user)
+ group.add(user2)
+ end
+
+ def assert_publish_topic_state(topic, user: nil, group: nil)
+ messages = MessageBus.track_publish { yield }
+
+ message = messages.find { |m| m.channel == channel }
+
+ expect(message.data[:topic_id]).to eq(topic.id)
+ expect(message.user_ids).to eq([user.id]) if user
+ expect(message.group_ids).to eq([group.id]) if group
+ end
+
+ it "publishes the right message on archive and move to inbox" do
+ assigner = Assigner.new(pm, user)
+ assigner.assign(user)
+
+ assert_publish_topic_state(pm, user: user) do
+ UserArchivedMessage.archive!(user.id, pm.reload)
+ end
+
+ assert_publish_topic_state(pm, user: user) do
+ UserArchivedMessage.move_to_inbox!(user.id, pm.reload)
+ end
+ end
+
+ it "publishes the right message on archive and move to inbox for groups" do
+ assigner = Assigner.new(pm, user)
+ assigner.assign(group)
+
+ assert_publish_topic_state(pm, group: group) do
+ GroupArchivedMessage.archive!(group.id, pm.reload)
+ end
+
+ assert_publish_topic_state(pm, group: group) do
+ GroupArchivedMessage.move_to_inbox!(group.id, pm.reload)
+ end
+ end
+
+ it "unassign and assign user if unassign_on_group_archive" do
+ SiteSetting.unassign_on_group_archive = true
+ assigner = Assigner.new(pm, user)
+ assigner.assign(user)
+
+ GroupArchivedMessage.archive!(group.id, pm.reload)
+ expect(pm.assignment.active).to be false
+
+ GroupArchivedMessage.move_to_inbox!(group.id, pm.reload)
+ expect(pm.assignment.active).to be true
+ expect(pm.assignment.assigned_to).to eq(user)
+ end
+
+ it "unassign and assign group if unassign_on_group_archive" do
+ SiteSetting.unassign_on_group_archive = true
+ assigner = Assigner.new(pm, user)
+ assigner.assign(group)
+
+ GroupArchivedMessage.archive!(group.id, pm.reload)
+ expect(pm.assignment.active).to be false
+
+ GroupArchivedMessage.move_to_inbox!(group.id, pm.reload)
+ expect(pm.assignment.active).to be true
+ expect(pm.assignment.assigned_to).to eq(group)
+ end
+ end
+
+ describe "on assign_topic event" do
+ let(:post) { Fabricate(:post) }
+ let(:topic) { post.topic }
+ let(:admin) { Fabricate(:admin) }
+ let(:user1) { Fabricate(:user) }
+ let(:user2) { Fabricate(:user) }
+
+ include_context "with group that is allowed to assign"
+
+ before do
+ add_to_assign_allowed_group(user1)
+ add_to_assign_allowed_group(user2)
+ end
+
+ it "assigns topic" do
+ expect do DiscourseEvent.trigger(:assign_topic, topic, user1, admin) end.to change {
+ Assignment.where(topic: topic).pick(:assigned_to_id)
+ }.from(nil).to(user1.id)
+
+ expect do DiscourseEvent.trigger(:assign_topic, topic, user2, admin) end.to_not change {
+ Assignment.where(topic: topic).pick(:assigned_to_id)
+ }.from(user1.id)
+
+ expect do DiscourseEvent.trigger(:assign_topic, topic, user2, admin, true) end.to change {
+ Assignment.where(topic: topic).pick(:assigned_to_id)
+ }.from(user1.id).to(user2.id)
+ end
+
+ it "triggers a webhook for assigned and unassigned" do
+ Fabricate(:assign_web_hook)
+ DiscourseEvent.trigger(:assign_topic, topic, user2, admin, true)
+ job_args = Jobs::EmitWebHookEvent.jobs[0]["args"].first
+ expect(job_args["event_name"]).to eq("assigned")
+ payload = JSON.parse(job_args["payload"])
+ expect(payload["topic_id"]).to eq(topic.id)
+ expect(payload["assigned_to_id"]).to eq(user2.id)
+
+ DiscourseEvent.trigger(:unassign_topic, topic, admin)
+ job_args = Jobs::EmitWebHookEvent.jobs[1]["args"].first
+ expect(job_args["event_name"]).to eq("unassigned")
+ payload = JSON.parse(job_args["payload"])
+ expect(payload["topic_id"]).to eq(topic.id)
+ expect(payload["unassigned_to_id"]).to eq(user2.id)
+ end
+ end
+
+ context "when already assigned" do
+ fab!(:post)
+ fab!(:post_2) { Fabricate(:post, topic: post.topic) }
+ let(:topic) { post.topic }
+ fab!(:user)
+
+ include_context "with group that is allowed to assign"
+
+ it "allows to assign topic if post is already assigned" do
+ add_to_assign_allowed_group(user)
+
+ assigner = Assigner.new(post, user)
+ response = assigner.assign(user)
+ expect(response[:success]).to be true
+
+ assigner = Assigner.new(post_2, user)
+ response = assigner.assign(user)
+ expect(response[:success]).to be true
+
+ assigner = Assigner.new(topic, user)
+ response = assigner.assign(user)
+ expect(response[:success]).to be true
+ end
+ end
+
+ describe "move post" do
+ fab!(:old_topic) { Fabricate(:topic) }
+ fab!(:post) { Fabricate(:post, topic: old_topic) }
+ fab!(:user)
+ fab!(:assignment) do
+ Assignment.create!(
+ target_id: post.id,
+ target_type: "Post",
+ topic_id: old_topic.id,
+ assigned_by_user: user,
+ assigned_to: user,
+ )
+ end
+ let(:new_topic) { Fabricate(:topic) }
+
+ it "assignment becomes topic assignment when new topic" do
+ post.update!(topic: new_topic)
+ DiscourseEvent.trigger(:post_moved, post, old_topic.id)
+ assignment.reload
+ expect(assignment.topic_id).to eq(new_topic.id)
+ expect(assignment.target_type).to eq("Topic")
+ expect(assignment.target_id).to eq(new_topic.id)
+ end
+
+ it "assigment is still post assignment when not first post" do
+ post.update!(topic: new_topic, post_number: "3")
+ DiscourseEvent.trigger(:post_moved, post, old_topic.id)
+ assignment.reload
+ expect(assignment.topic_id).to eq(new_topic.id)
+ expect(assignment.target_type).to eq("Post")
+ expect(assignment.target_id).to eq(post.id)
+ end
+ end
+end
diff --git a/plugins/discourse-assign/spec/jobs/regular/assign_notification_spec.rb b/plugins/discourse-assign/spec/jobs/regular/assign_notification_spec.rb
new file mode 100644
index 00000000000..8231cbd5f49
--- /dev/null
+++ b/plugins/discourse-assign/spec/jobs/regular/assign_notification_spec.rb
@@ -0,0 +1,37 @@
+# frozen_string_literal: true
+
+require "rails_helper"
+
+RSpec.describe Jobs::AssignNotification do
+ describe "#execute" do
+ subject(:execute_job) { described_class.new.execute(args) }
+
+ let(:args) { { assignment_id: assignment_id } }
+
+ context "when `assignment_id` is not provided" do
+ let(:args) { {} }
+
+ it "raises an error" do
+ expect { execute_job }.to raise_error(Discourse::InvalidParameters, "assignment_id")
+ end
+ end
+
+ context "when `assignment_id` is provided" do
+ let(:assignment_id) { Fabricate(:topic_assignment).id }
+ let(:assignment) { stub("assignment").responds_like_instance_of(Assignment) }
+
+ before { Assignment.stubs(:find).with(assignment_id).returns(assignment) }
+
+ it "creates missing notifications for the provided assignment" do
+ assignment.expects(:create_missing_notifications!)
+ execute_job
+ end
+
+ it "does not create notifications if assignment is silenced" do
+ SilencedAssignment.stubs(:exists?).with(assignment_id: assignment_id).returns(true)
+ assignment.expects(:create_missing_notifications!).never
+ execute_job
+ end
+ end
+ end
+end
diff --git a/plugins/discourse-assign/spec/jobs/regular/remind_user_spec.rb b/plugins/discourse-assign/spec/jobs/regular/remind_user_spec.rb
new file mode 100644
index 00000000000..34e3596a92b
--- /dev/null
+++ b/plugins/discourse-assign/spec/jobs/regular/remind_user_spec.rb
@@ -0,0 +1,11 @@
+# frozen_string_literal: true
+
+require "rails_helper"
+
+RSpec.describe Jobs::RemindUser do
+ describe "#execute" do
+ it "should raise the right error when user_id is invalid" do
+ expect do described_class.new.execute({}) end.to raise_error(Discourse::InvalidParameters)
+ end
+ end
+end
diff --git a/plugins/discourse-assign/spec/jobs/regular/unassign_notification_spec.rb b/plugins/discourse-assign/spec/jobs/regular/unassign_notification_spec.rb
new file mode 100644
index 00000000000..9d7f4ff804f
--- /dev/null
+++ b/plugins/discourse-assign/spec/jobs/regular/unassign_notification_spec.rb
@@ -0,0 +1,90 @@
+# frozen_string_literal: true
+
+require "rails_helper"
+
+RSpec.describe Jobs::UnassignNotification do
+ describe "#execute" do
+ fab!(:user1) { Fabricate(:user) }
+ fab!(:user2) { Fabricate(:user) }
+ fab!(:topic)
+ fab!(:post) { Fabricate(:post, topic: topic) }
+ fab!(:pm_post) { Fabricate(:private_message_post) }
+ fab!(:pm) { pm_post.topic }
+ fab!(:assign_allowed_group) { Group.find_by(name: "staff") }
+
+ before { assign_allowed_group.add(user1) }
+
+ def assert_publish_topic_state(topic, user)
+ message = MessageBus.track_publish("/private-messages/assigned") { yield }.first
+
+ expect(message.data[:topic_id]).to eq(topic.id)
+ expect(message.user_ids).to eq([user.id])
+ end
+
+ describe "User" do
+ fab!(:assignment) { Fabricate(:topic_assignment, topic: topic, assigned_to: user2) }
+
+ before { assignment.create_missing_notifications! }
+
+ it "deletes notifications" do
+ expect {
+ described_class.new.execute(
+ {
+ topic_id: topic.id,
+ post_id: post.id,
+ assigned_to_id: user2.id,
+ assigned_to_type: "User",
+ assignment_id: assignment.id,
+ },
+ )
+ }.to change { user2.notifications.count }.by(-1)
+ end
+
+ it "should publish the right message when private message" do
+ user = pm.allowed_users.first
+ assign_allowed_group.add(user)
+
+ assert_publish_topic_state(pm, user) do
+ described_class.new.execute(
+ {
+ topic_id: pm.id,
+ post_id: pm_post.id,
+ assigned_to_id: pm.allowed_users.first.id,
+ assigned_to_type: "User",
+ assignment_id: 4519,
+ },
+ )
+ end
+ end
+ end
+
+ describe "Group" do
+ fab!(:assign_allowed_group) { Group.find_by(name: "staff") }
+ fab!(:user3) { Fabricate(:user) }
+ fab!(:group)
+ fab!(:assignment) do
+ Fabricate(:topic_assignment, topic: topic, assigned_to: group, assigned_by_user: user1)
+ end
+
+ before do
+ group.add(user2)
+ group.add(user3)
+ assignment.create_missing_notifications!
+ end
+
+ it "deletes notifications" do
+ expect {
+ described_class.new.execute(
+ {
+ topic_id: topic.id,
+ post_id: post.id,
+ assigned_to_id: group.id,
+ assigned_to_type: "Group",
+ assignment_id: assignment.id,
+ },
+ )
+ }.to change { Notification.count }.by(-2)
+ end
+ end
+ end
+end
diff --git a/plugins/discourse-assign/spec/jobs/scheduled/enqueue_reminders_spec.rb b/plugins/discourse-assign/spec/jobs/scheduled/enqueue_reminders_spec.rb
new file mode 100644
index 00000000000..63d0173ecaf
--- /dev/null
+++ b/plugins/discourse-assign/spec/jobs/scheduled/enqueue_reminders_spec.rb
@@ -0,0 +1,131 @@
+# frozen_string_literal: true
+
+require "rails_helper"
+
+RSpec.describe Jobs::EnqueueReminders do
+ fab!(:assign_allowed_group) { Fabricate(:group) }
+ fab!(:user) { Fabricate(:user, groups: [assign_allowed_group]) }
+
+ before do
+ SiteSetting.remind_assigns_frequency = RemindAssignsFrequencySiteSettings::MONTHLY_MINUTES
+ SiteSetting.assign_enabled = true
+ SiteSetting.assign_allowed_on_groups = "#{assign_allowed_group.id}"
+ end
+
+ describe "#execute" do
+ it "does not enqueue reminders when there are no assigned tasks" do
+ assert_reminders_enqueued(0)
+ end
+
+ it "does not enqueue reminders when no groups are allowed to assign" do
+ SiteSetting.assign_allowed_on_groups = ""
+
+ assign_multiple_tasks_to(user)
+
+ assert_reminders_enqueued(0)
+ end
+
+ it "enqueues a reminder when the user has more than one task" do
+ assign_multiple_tasks_to(user)
+
+ assert_reminders_enqueued(1)
+ end
+
+ it "does not enqueue a reminder when the user has fewer assignments than `pending_assign_reminder_threshold`" do
+ assign_one_task_to(user)
+
+ assert_reminders_enqueued(0)
+ end
+
+ it "enqueues a reminder when the user has one assignement if `pending_assign_reminder_threshold` is set to one" do
+ assign_one_task_to(user)
+
+ SiteSetting.pending_assign_reminder_threshold = 1
+
+ assert_reminders_enqueued(1)
+ end
+
+ it "doesn't count assigns from deleted topics" do
+ deleted_post = Fabricate(:post)
+ assign_one_task_to(user, post: deleted_post)
+ (SiteSetting.pending_assign_reminder_threshold - 1).times { assign_one_task_to(user) }
+
+ deleted_post.topic.trash!
+
+ assert_reminders_enqueued(0)
+ end
+
+ describe "assignment frequency" do
+ it "enqueues a reminder if the user reminder frequency is 1 day and the last reminded at is almost 1 day" do
+ user.custom_fields[
+ PendingAssignsReminder::REMINDERS_FREQUENCY
+ ] = RemindAssignsFrequencySiteSettings::DAILY_MINUTES
+ user.custom_fields[PendingAssignsReminder::REMINDED_AT] = 1.days.ago +
+ (Jobs::EnqueueReminders::REMINDER_BUFFER_MINUTES - 1)
+ user.save
+
+ assign_multiple_tasks_to(user, assigned_on: 2.day.ago)
+
+ assert_reminders_enqueued(1)
+ end
+
+ it "does not enqueue a reminder if it's too soon" do
+ user.upsert_custom_fields(
+ PendingAssignsReminder::REMINDED_AT =>
+ 1.days.ago + Jobs::EnqueueReminders::REMINDER_BUFFER_MINUTES,
+ )
+ assign_multiple_tasks_to(user)
+
+ assert_reminders_enqueued(0)
+ end
+
+ it "enqueues a reminder if the user was reminded more than a month ago" do
+ user.upsert_custom_fields(PendingAssignsReminder::REMINDED_AT => 31.days.ago)
+ assign_multiple_tasks_to(user)
+
+ assert_reminders_enqueued(1)
+ end
+
+ it "does not enqueue reminders if the remind frequency is set to never" do
+ SiteSetting.remind_assigns_frequency = 0
+ assign_multiple_tasks_to(user)
+
+ assert_reminders_enqueued(0)
+ end
+
+ it "does not enqueue reminders if the topic was just assigned to the user" do
+ just_assigned = DateTime.now
+ assign_multiple_tasks_to(user, assigned_on: just_assigned)
+
+ assert_reminders_enqueued(0)
+ end
+
+ it "enqueues a reminder when the user overrides the global frequency" do
+ SiteSetting.remind_assigns_frequency = 0
+ user.custom_fields.merge!(
+ PendingAssignsReminder::REMINDERS_FREQUENCY =>
+ RemindAssignsFrequencySiteSettings::DAILY_MINUTES,
+ )
+ user.save_custom_fields
+
+ assign_multiple_tasks_to(user)
+
+ assert_reminders_enqueued(1)
+ end
+ end
+
+ def assert_reminders_enqueued(expected_amount)
+ expect { subject.execute({}) }.to change(Jobs::RemindUser.jobs, :size).by(expected_amount)
+ end
+
+ def assign_one_task_to(user, assigned_on: 3.months.ago, post: Fabricate(:post))
+ freeze_time(assigned_on) { Assigner.new(post.topic, user).assign(user) }
+ end
+
+ def assign_multiple_tasks_to(user, assigned_on: 3.months.ago)
+ SiteSetting.pending_assign_reminder_threshold.times do
+ assign_one_task_to(user, assigned_on: assigned_on)
+ end
+ end
+ end
+end
diff --git a/plugins/discourse-assign/spec/lib/assigner_spec.rb b/plugins/discourse-assign/spec/lib/assigner_spec.rb
new file mode 100644
index 00000000000..3fa5dc6e852
--- /dev/null
+++ b/plugins/discourse-assign/spec/lib/assigner_spec.rb
@@ -0,0 +1,924 @@
+# frozen_string_literal: true
+
+require "rails_helper"
+
+RSpec.describe Assigner do
+ before do
+ SiteSetting.assign_enabled = true
+ SiteSetting.enable_assign_status = true
+ end
+
+ let(:assign_allowed_group) { Group.find_by(name: "staff") }
+ let(:pm_post) { Fabricate(:private_message_post) }
+ let(:pm) { pm_post.topic }
+
+ describe "assigning and unassigning" do
+ let(:post) { Fabricate(:post) }
+ let(:topic) { post.topic }
+ let(:secure_category) { Fabricate(:private_category, group: Fabricate(:group)) }
+ let(:secure_topic) { Fabricate(:post).topic.tap { |t| t.update(category: secure_category) } }
+ let(:moderator) { Fabricate(:moderator) }
+ let(:moderator_2) { Fabricate(:moderator) }
+ let(:admin) { Fabricate(:admin) }
+ let(:assigner) { described_class.new(topic, moderator_2) }
+ let(:assigner_self) { described_class.new(topic, moderator) }
+
+ it "can assign and unassign correctly" do
+ expect_enqueued_with(job: :assign_notification) { assigner.assign(moderator) }
+
+ expect(TopicQuery.new(moderator, assigned: moderator.username).list_latest.topics).to eq(
+ [topic],
+ )
+
+ expect(TopicUser.find_by(user: moderator).notification_level).to eq(
+ TopicUser.notification_levels[:watching],
+ )
+
+ expect_enqueued_with(job: :unassign_notification) { assigner.unassign }
+
+ expect(TopicQuery.new(moderator, assigned: moderator.username).list_latest.topics).to eq([])
+
+ expect(TopicUser.find_by(user: moderator).notification_level).to eq(
+ TopicUser.notification_levels[:watching],
+ )
+ end
+
+ describe "when user watchs topic when assigned" do
+ before { moderator.user_option.watch_topic_when_assigned! }
+
+ it "respects 'when assigned' user preference" do
+ expect(TopicUser.find_by(user: moderator)).to be(nil)
+
+ assigner.assign(moderator)
+
+ expect(TopicUser.find_by(user: moderator).notification_level).to eq(
+ TopicUser.notification_levels[:watching],
+ )
+ end
+ end
+
+ describe "when user tracks topic when assigned" do
+ before { moderator.user_option.track_topic_when_assigned! }
+
+ it "respects 'when assigned' user preference" do
+ expect(TopicUser.find_by(user: moderator)).to be(nil)
+
+ assigner.assign(moderator)
+
+ expect(TopicUser.find_by(user: moderator).notification_level).to eq(
+ TopicUser.notification_levels[:tracking],
+ )
+ end
+ end
+
+ describe "when user wants to do nothing when assigned" do
+ before { moderator.user_option.do_nothing_when_assigned! }
+
+ it "respects 'when assigned' user preference" do
+ expect(TopicUser.find_by(user: moderator)).to be(nil)
+
+ assigner.assign(moderator)
+
+ expect(TopicUser.find_by(user: moderator)).to be(nil)
+ end
+ end
+
+ it "deletes notification for original assignee when reassigning" do
+ Jobs.run_immediately!
+
+ expect { described_class.new(topic, admin).assign(moderator) }.to change {
+ moderator.notifications.count
+ }.by(1)
+
+ expect { described_class.new(topic, admin).assign(moderator_2) }.to change {
+ moderator.notifications.count
+ }.by(-1).and change { moderator_2.notifications.count }.by(1)
+ end
+
+ it "can assign with note" do
+ assigner.assign(moderator, note: "tomtom best mom")
+
+ expect(topic.assignment.note).to eq "tomtom best mom"
+ end
+
+ it "assign with note adds moderator post with note" do
+ expect { assigner.assign(moderator, note: "tomtom best mom") }.to change {
+ topic.posts.count
+ }.by(1)
+ expect(topic.posts.last.raw).to eq "tomtom best mom"
+ end
+
+ it "can assign with status" do
+ assigner.assign(moderator, status: "In Progress")
+
+ expect(topic.assignment.status).to eq "In Progress"
+ end
+
+ it "publishes topic assignment after assign and unassign" do
+ messages =
+ MessageBus.track_publish("/staff/topic-assignment") do
+ assigner = described_class.new(topic, moderator_2)
+ assigner.assign(moderator, note: "tomtom best mom", status: "In Progress")
+ assigner.unassign
+ end
+
+ expect(messages[0].channel).to eq "/staff/topic-assignment"
+ expect(messages[0].data).to include(
+ {
+ type: "assigned",
+ topic_id: topic.id,
+ post_id: false,
+ post_number: false,
+ assigned_type: "User",
+ assigned_to: BasicUserSerializer.new(moderator, scope: Guardian.new, root: false).as_json,
+ assignment_note: "tomtom best mom",
+ assignment_status: "In Progress",
+ },
+ )
+
+ expect(messages[1].channel).to eq "/staff/topic-assignment"
+ expect(messages[1].data).to include(
+ {
+ type: "unassigned",
+ topic_id: topic.id,
+ post_id: false,
+ post_number: false,
+ assigned_type: "User",
+ assignment_note: nil,
+ assignment_status: nil,
+ },
+ )
+ end
+
+ it "does not update notification level if already watching" do
+ TopicUser.change(
+ moderator.id,
+ topic.id,
+ notification_level: TopicUser.notification_levels[:watching],
+ )
+
+ expect do assigner_self.assign(moderator) end.to_not change {
+ TopicUser.last.notifications_reason_id
+ }
+ end
+
+ it "does not update notification level when unassigned" do
+ assigner.assign(moderator)
+
+ expect(TopicUser.find_by(user: moderator).notification_level).to eq(
+ TopicUser.notification_levels[:watching],
+ )
+
+ assigner.unassign
+
+ expect(TopicUser.find_by(user: moderator, topic: topic).notification_level).to eq(
+ TopicUser.notification_levels[:watching],
+ )
+ end
+
+ context "when assigns_by_staff_mention is set to true" do
+ let(:system_user) { Discourse.system_user }
+ let(:moderator) { Fabricate(:admin, username: "modi") }
+ let(:post) { Fabricate(:post, raw: "Hey you @system, stay unassigned", user: moderator) }
+ let(:topic) { post.topic }
+
+ before do
+ SiteSetting.assigns_by_staff_mention = true
+ SiteSetting.assign_other_regex = "\\byour (list|todo)\\b"
+ end
+
+ it "doesn't assign system user" do
+ described_class.auto_assign(post)
+
+ expect(topic.assignment).to eq(nil)
+ end
+
+ it "assigns first mentioned staff user after system user" do
+ post.update(raw: "Don't assign @system. @modi, can you add this to your list?")
+ described_class.auto_assign(post)
+
+ expect(topic.assignment.assigned_to_id).to eq(moderator.id)
+ end
+ end
+
+ it "doesn't assign the same user more than once" do
+ SiteSetting.assign_mailer = AssignMailer.levels[:always]
+ another_mod = Fabricate(:moderator)
+
+ Email::Sender.any_instance.expects(:send).once
+ expect(assigned_to?(moderator)).to eq(true)
+
+ Email::Sender.any_instance.expects(:send).never
+ expect(assigned_to?(moderator)).to eq(false)
+
+ Email::Sender.any_instance.expects(:send).once
+ expect(assigned_to?(another_mod)).to eq(true)
+ end
+
+ def assigned_to?(assignee)
+ assigner.assign(assignee).fetch(:success)
+ end
+
+ describe "forbidden reasons" do
+ it "doesn't assign if the topic has more than 5 assignments" do
+ other_post = nil
+
+ status = described_class.new(topic, admin).assign(Fabricate(:moderator))
+ expect(status[:success]).to eq(true)
+
+ # Assign many posts to reach the limit
+ 1.upto(described_class::ASSIGNMENTS_PER_TOPIC_LIMIT - 1) do
+ other_post = Fabricate(:post, topic: topic)
+ user = Fabricate(:moderator)
+ status = described_class.new(other_post, admin).assign(user)
+ expect(status[:success]).to eq(true)
+ end
+
+ # Assigning one more post is not allowed
+ post = Fabricate(:post, topic: topic)
+ status = described_class.new(post, admin).assign(moderator)
+ expect(status[:success]).to eq(false)
+ expect(status[:reason]).to eq(:too_many_assigns_for_topic)
+
+ # Allows to reassign Topic
+ status = described_class.new(topic, admin).assign(Fabricate(:moderator))
+ expect(status[:success]).to eq(true)
+
+ # Delete a post to mark the assignment as inactive
+ PostDestroyer.new(admin, other_post).destroy
+
+ # Try assigning again
+ status = described_class.new(post, admin).assign(moderator)
+ expect(status[:success]).to eq(true)
+ end
+
+ it "doesn't assign if the user has too many assigned topics" do
+ SiteSetting.max_assigned_topics = 1
+ another_post = Fabricate(:post)
+ assigner.assign(moderator)
+
+ second_assign = described_class.new(another_post.topic, moderator_2).assign(moderator)
+
+ expect(second_assign[:success]).to eq(false)
+ expect(second_assign[:reason]).to eq(:too_many_assigns)
+ end
+
+ it "doesn't enforce the limit when self-assigning" do
+ SiteSetting.max_assigned_topics = 1
+ another_post = Fabricate(:post)
+ assigner.assign(moderator)
+
+ second_assign = described_class.new(another_post.topic, moderator).assign(moderator)
+
+ expect(second_assign[:success]).to eq(true)
+ end
+
+ it "doesn't count self-assigns when enforcing the limit" do
+ SiteSetting.max_assigned_topics = 1
+ another_post = Fabricate(:post)
+
+ first_assign = assigner.assign(moderator)
+
+ # reached limit so stop
+ second_assign = described_class.new(Fabricate(:topic), moderator_2).assign(moderator)
+
+ # self assign has a bypass
+ third_assign = described_class.new(another_post.topic, moderator).assign(moderator)
+
+ expect(first_assign[:success]).to eq(true)
+ expect(second_assign[:success]).to eq(false)
+ expect(third_assign[:success]).to eq(true)
+ end
+
+ it "doesn't count inactive assigns when enforcing the limit" do
+ SiteSetting.max_assigned_topics = 1
+ SiteSetting.unassign_on_close = true
+ another_post = Fabricate(:post)
+
+ first_assign = assigner.assign(moderator)
+ topic.update_status("closed", true, Discourse.system_user)
+
+ second_assign = described_class.new(another_post.topic, moderator_2).assign(moderator)
+
+ expect(first_assign[:success]).to eq(true)
+ expect(second_assign[:success]).to eq(true)
+ end
+
+ it "reassigns a post even when at the assignments limit" do
+ posts =
+ (described_class::ASSIGNMENTS_PER_TOPIC_LIMIT).times.map do
+ Fabricate(:post, topic: topic)
+ end
+
+ posts.each do |post|
+ user = Fabricate(:moderator)
+ described_class.new(post, admin).assign(user)
+ end
+
+ status = described_class.new(posts.first, admin).assign(Fabricate(:moderator))
+ expect(status[:success]).to eq(true)
+ end
+
+ context "when 'allow_self_reassign' is false" do
+ subject(:assign) do
+ assigner.assign(moderator, note: other_note, allow_self_reassign: self_reassign)
+ end
+
+ let(:self_reassign) { false }
+ let(:assigner) { described_class.new(topic, moderator_2) }
+ let(:note) { "note me down" }
+
+ before { assigner.assign(moderator, note: note) }
+
+ context "when the assigned user and the note is the same" do
+ let(:other_note) { note }
+
+ it "fails to assign" do
+ expect(assign).to match(success: false, reason: :already_assigned)
+ end
+ end
+
+ context "when the assigned user is the same but the note is different" do
+ let(:other_note) { "note me down again" }
+
+ it "allows assignment" do
+ expect(assign).to match(success: true)
+ end
+ end
+ end
+
+ context "when 'allow_self_reassign' is true" do
+ subject(:assign) { assigner.assign(moderator, allow_self_reassign: self_reassign) }
+
+ let(:self_reassign) { true }
+ let(:assigner) { described_class.new(topic, moderator_2) }
+
+ context "when the assigned user is the same" do
+ before { assigner.assign(moderator) }
+
+ it "allows assignment" do
+ expect(assign).to match(success: true)
+ end
+ end
+ end
+
+ it "fails to assign when the assigned user cannot view the pm" do
+ assign = described_class.new(pm, moderator_2).assign(moderator)
+
+ expect(assign[:success]).to eq(false)
+ expect(assign[:reason]).to eq(:forbidden_assignee_not_pm_participant)
+ end
+
+ it "fails to assign when the assigned admin cannot view the pm" do
+ assign = described_class.new(pm, moderator_2).assign(admin)
+
+ expect(assign[:success]).to eq(false)
+ expect(assign[:reason]).to eq(:forbidden_assignee_not_pm_participant)
+ end
+
+ it "fails to assign when not all group members has access to pm" do
+ assign = described_class.new(pm, moderator_2).assign(moderator.groups.first)
+
+ expect(assign[:success]).to eq(false)
+ expect(assign[:reason]).to eq(:forbidden_group_assignee_not_pm_participant)
+
+ # even when admin
+ assign = described_class.new(pm, moderator_2).assign(admin.groups.first)
+
+ expect(assign[:success]).to eq(false)
+ expect(assign[:reason]).to eq(:forbidden_group_assignee_not_pm_participant)
+ end
+
+ it "fails to assign when the assigned user cannot view the topic" do
+ assign = described_class.new(secure_topic, moderator_2).assign(moderator)
+
+ expect(assign[:success]).to eq(false)
+ expect(assign[:reason]).to eq(:forbidden_assignee_cant_see_topic)
+ end
+
+ it "fails to assign when the not all group members can view the topic" do
+ assign = described_class.new(secure_topic, moderator_2).assign(moderator.groups.first)
+
+ expect(assign[:success]).to eq(false)
+ expect(assign[:reason]).to eq(:forbidden_group_assignee_cant_see_topic)
+ end
+ end
+
+ it "assigns the PM to the moderator when it's included in the list of allowed users" do
+ pm.allowed_users << moderator
+
+ assign = described_class.new(pm, moderator_2).assign(moderator)
+
+ expect(assign[:success]).to eq(true)
+ end
+
+ it "assigns the PM to the moderator when it's a member of an allowed group" do
+ pm.allowed_groups << assign_allowed_group
+
+ assign = described_class.new(pm, moderator_2).assign(moderator)
+
+ expect(assign[:success]).to eq(true)
+ end
+
+ it "triggers error for incorrect type" do
+ expect do
+ described_class.new(secure_category, moderator).assign(moderator)
+ end.to raise_error(Discourse::InvalidParameters)
+ end
+
+ describe "updating notes" do
+ it "does not recreate assignment if no assignee change" do
+ assigner.assign(moderator)
+
+ expect do assigner.assign(moderator, note: "new notes!") end.to_not change {
+ Assignment.last.id
+ }
+ end
+
+ it "updates notes" do
+ assigner.assign(moderator)
+
+ assigner.assign(moderator, note: "new notes!")
+
+ expect(Assignment.last.note).to eq "new notes!"
+ end
+
+ it "queues notification" do
+ assigner.assign(moderator)
+
+ expect_enqueued_with(job: :assign_notification) do
+ assigner.assign(moderator, note: "new notes!")
+ end
+ end
+
+ it "publishes topic assignment with note" do
+ assigner.assign(moderator)
+
+ messages =
+ MessageBus.track_publish("/staff/topic-assignment") do
+ assigner = described_class.new(topic, moderator_2)
+ assigner.assign(moderator, note: "new notes!")
+ end
+
+ expect(messages[0].channel).to eq "/staff/topic-assignment"
+ expect(messages[0].data).to include(
+ {
+ type: "assigned",
+ topic_id: topic.id,
+ post_id: false,
+ post_number: false,
+ assigned_type: "User",
+ assigned_to:
+ BasicUserSerializer.new(moderator, scope: Guardian.new, root: false).as_json,
+ assignment_note: "new notes!",
+ },
+ )
+ end
+
+ it "adds a note_change small action post" do
+ assigner.assign(moderator)
+
+ assigner.assign(moderator, note: "new notes!")
+
+ small_action_post = topic.posts.last
+ expect(small_action_post.action_code).to eq "note_change"
+ end
+ end
+
+ describe "updating status" do
+ it "does not recreate assignment if no assignee change" do
+ assigner.assign(moderator)
+
+ expect do assigner.assign(moderator, status: "Done") end.to_not change {
+ Assignment.last.id
+ }
+ end
+
+ it "updates status" do
+ assigner.assign(moderator)
+
+ assigner.assign(moderator, status: "Done")
+
+ expect(Assignment.last.status).to eq "Done"
+ end
+
+ it "queues notification" do
+ assigner.assign(moderator)
+
+ expect(job_enqueued?(job: :assign_notification)).to eq(true)
+ expect_enqueued_with(job: :assign_notification) do
+ assigner.assign(moderator, status: "Done")
+ end
+ end
+
+ it "does not queue notification if should_notify is set to false" do
+ assigner.assign(moderator, status: "Done", should_notify: false)
+ expect(job_enqueued?(job: :assign_notification)).to eq(false)
+ end
+
+ it "publishes topic assignment with note" do
+ assigner.assign(moderator)
+
+ messages =
+ MessageBus.track_publish("/staff/topic-assignment") do
+ assigner = described_class.new(topic, moderator_2)
+ assigner.assign(moderator, status: "Done")
+ end
+
+ expect(messages[0].channel).to eq "/staff/topic-assignment"
+ expect(messages[0].data).to include(
+ {
+ type: "assigned",
+ topic_id: topic.id,
+ post_id: false,
+ post_number: false,
+ assigned_type: "User",
+ assigned_to:
+ BasicUserSerializer.new(moderator, scope: Guardian.new, root: false).as_json,
+ assignment_status: "Done",
+ },
+ )
+ end
+
+ it "adds a note_change small action post" do
+ assigner.assign(moderator)
+
+ assigner.assign(moderator, status: "Done")
+
+ small_action_post = topic.posts.last
+ expect(small_action_post.action_code).to eq "status_change"
+ end
+ end
+
+ describe "updating note and status at the same time" do
+ it "adds a note_change small action post" do
+ assigner.assign(moderator)
+
+ assigner.assign(moderator, note: "This is a note!", status: "Done")
+
+ small_action_post = topic.posts.last
+ expect(small_action_post.action_code).to eq "details_change"
+ end
+ end
+ end
+
+ describe "assign_self_regex" do
+ fab!(:me) { Fabricate(:admin) }
+ fab!(:op) { Fabricate(:post) }
+ fab!(:reply) do
+ Fabricate(:post, topic: op.topic, user: me, raw: "Will fix. Added to my list ;)")
+ end
+
+ before do
+ SiteSetting.assigns_by_staff_mention = true
+ SiteSetting.assign_self_regex = "\\bmy list\\b"
+ end
+
+ it "automatically assigns to myself" do
+ expect(described_class.auto_assign(reply)).to eq(success: true)
+ expect(op.topic.assignment.assigned_to_id).to eq(me.id)
+ expect(op.topic.assignment.assigned_by_user_id).to eq(me.id)
+ end
+
+ it "does not automatically assign to myself" do
+ admin = Fabricate(:admin)
+ raw = <<~MD
+ [quote]
+ Will fix. Added to my list ;)
+ [/quote]
+
+ `my list`
+
+ ```text
+ my list
+ ```
+
+ my list
+
+ Excellent :clap: Can't wait!
+ MD
+
+ another_reply = Fabricate(:post, topic: op.topic, user: admin, raw: raw)
+ expect(described_class.auto_assign(another_reply)).to eq(nil)
+ end
+ end
+
+ describe "assign_other_regex" do
+ fab!(:me) { Fabricate(:admin) }
+ fab!(:other) { Fabricate(:admin) }
+ fab!(:op) { Fabricate(:post) }
+ fab!(:reply) do
+ Fabricate(
+ :post,
+ topic: op.topic,
+ user: me,
+ raw: "can you add this to your list, @#{other.username}",
+ )
+ end
+
+ before do
+ SiteSetting.assigns_by_staff_mention = true
+ SiteSetting.assign_other_regex = "\\byour (list|todo)\\b"
+ end
+
+ it "automatically assigns to other" do
+ expect(described_class.auto_assign(reply)).to eq(success: true)
+ expect(op.topic.assignment.assigned_to_id).to eq(other.id)
+ expect(op.topic.assignment.assigned_by_user_id).to eq(me.id)
+ end
+ end
+
+ describe "unassign_on_close" do
+ let(:post) { Fabricate(:post) }
+ let(:topic) { post.topic }
+ let(:moderator) { Fabricate(:moderator) }
+
+ context "with topic" do
+ let(:assigner) { described_class.new(topic, moderator) }
+
+ before do
+ SiteSetting.unassign_on_close = true
+ assigner.assign(moderator)
+ end
+
+ it "unassigns on topic closed" do
+ topic.update_status("closed", true, moderator)
+ expect(
+ TopicQuery.new(moderator, assigned: moderator.username).list_latest.topics,
+ ).to be_blank
+ end
+
+ it "unassigns on topic autoclosed" do
+ topic.update_status("autoclosed", true, moderator)
+ expect(
+ TopicQuery.new(moderator, assigned: moderator.username).list_latest.topics,
+ ).to be_blank
+ end
+
+ it "does not unassign on topic open" do
+ topic.update_status("closed", false, moderator)
+ expect(TopicQuery.new(moderator, assigned: moderator.username).list_latest.topics).to eq(
+ [topic],
+ )
+ end
+
+ it "does not unassign on automatic topic open" do
+ topic.update_status("autoclosed", false, moderator)
+ expect(TopicQuery.new(moderator, assigned: moderator.username).list_latest.topics).to eq(
+ [topic],
+ )
+ end
+ end
+
+ context "with post" do
+ let(:post_2) { Fabricate(:post, topic: topic) }
+ let(:assigner) { described_class.new(post_2, moderator) }
+ let(:post_3) { Fabricate(:post, topic: topic) }
+ let(:assigner_2) { described_class.new(post_3, moderator) }
+
+ before do
+ SiteSetting.unassign_on_close = true
+ SiteSetting.reassign_on_open = true
+
+ assigner.assign(moderator)
+ end
+
+ it "deactivates post assignments when topic is closed" do
+ assigner.assign(moderator)
+
+ expect(post_2.assignment.active).to be true
+
+ topic.update_status("closed", true, moderator)
+ expect(post_2.assignment.reload.active).to be false
+ end
+
+ it "deactivates post assignments when post is deleted and activate when recovered" do
+ assigner.assign(moderator)
+
+ expect(post_2.assignment.active).to be true
+
+ PostDestroyer.new(moderator, post_2).destroy
+ expect(post_2.assignment.reload.active).to be false
+
+ PostDestroyer.new(moderator, post_2).recover
+ expect(post_2.assignment.reload.active).to be true
+ end
+
+ it "deletes post small action for deleted post" do
+ assigner.assign(moderator)
+ small_action_post = PostCustomField.where(name: "action_code_post_id").first.post
+
+ PostDestroyer.new(moderator, post_2).destroy
+ expect { small_action_post.reload }.to raise_error(ActiveRecord::RecordNotFound)
+ end
+
+ it "deletes post successfully when small action is already deleted" do
+ assigner_2.assign(moderator)
+ small_action_post = PostCustomField.where(name: "action_code_post_id").first.post
+
+ PostDestroyer.new(moderator, small_action_post).destroy
+ PostDestroyer.new(moderator, post_3).destroy
+
+ expect(small_action_post.reload.deleted_at).to be_present
+ expect(post_3.reload.deleted_at).to be_present
+ end
+ end
+ end
+
+ describe "reassign_on_open" do
+ let(:post) { Fabricate(:post) }
+ let(:topic) { post.topic }
+ let(:moderator) { Fabricate(:moderator) }
+
+ describe "topic" do
+ let(:assigner) { described_class.new(topic, moderator) }
+
+ before do
+ SiteSetting.unassign_on_close = true
+ SiteSetting.reassign_on_open = true
+ assigner.assign(moderator)
+ end
+
+ it "reassigns on topic open" do
+ topic.update_status("closed", true, moderator)
+ expect(
+ TopicQuery.new(moderator, assigned: moderator.username).list_latest.topics,
+ ).to be_blank
+
+ topic.update_status("closed", false, moderator)
+ expect(TopicQuery.new(moderator, assigned: moderator.username).list_latest.topics).to eq(
+ [topic],
+ )
+ end
+ end
+
+ context "with post" do
+ let(:post_2) { Fabricate(:post, topic: topic) }
+ let(:assigner) { described_class.new(post_2, moderator) }
+
+ before do
+ SiteSetting.unassign_on_close = true
+ SiteSetting.reassign_on_open = true
+
+ assigner.assign(moderator)
+ end
+
+ it "reassigns post on topic open" do
+ assigner.assign(moderator)
+
+ expect(post_2.assignment.active).to be true
+
+ topic.update_status("closed", true, moderator)
+ expect(post_2.assignment.reload.active).to be false
+
+ topic.update_status("closed", false, moderator)
+ expect(post_2.assignment.reload.active).to be true
+ end
+ end
+ end
+
+ describe "invite_on_assign" do
+ let(:admin) { Fabricate(:admin) }
+ let(:topic) { Fabricate(:private_message_topic) }
+ let(:post) { Fabricate(:post, topic: topic) }
+ let(:assigner) { described_class.new(topic, admin) }
+
+ before do
+ SiteSetting.invite_on_assign = true
+ post
+ end
+
+ it "invites user to the PM" do
+ user = Fabricate(:user)
+ assigner.assign(user)
+ expect(topic.allowed_users).to include(user)
+ end
+
+ it "doesn't invite user to the PM when already a member of an allowed group" do
+ user = Fabricate(:user)
+ assign_allowed_group.add(user)
+ topic.allowed_groups << assign_allowed_group
+ assigner.assign(user)
+ expect(topic.allowed_users).not_to include(user)
+ end
+
+ it "invites group to the PM and notifies users" do
+ group =
+ Fabricate(
+ :group,
+ assignable_level: Group::ALIAS_LEVELS[:only_admins],
+ messageable_level: Group::ALIAS_LEVELS[:only_admins],
+ )
+ group.add(Fabricate(:user))
+
+ Notification.delete_all
+ Jobs.run_immediately!
+
+ assigner.assign(group)
+ expect(topic.allowed_groups).to include(group)
+ expect(Notification.count).to be > 0
+ end
+
+ it "invites group to the PM and does not notifies users if should_notify is false" do
+ group =
+ Fabricate(
+ :group,
+ assignable_level: Group::ALIAS_LEVELS[:only_admins],
+ messageable_level: Group::ALIAS_LEVELS[:only_admins],
+ )
+ group.add(Fabricate(:user))
+
+ Notification.delete_all
+ Jobs.run_immediately!
+
+ assigner.assign(group, should_notify: false)
+ expect(topic.allowed_groups).to include(group)
+ expect(Notification.count).to eq(0)
+ expect(SilencedAssignment.count).to eq(1)
+
+ group.add(Fabricate(:user))
+ expect(Notification.count).to eq(0) # no one is ever notified about this assignment
+ end
+
+ it "doesn't invite group if all members have access to the PM already" do
+ user1, user2, user3 = 3.times.collect { Fabricate(:user) }
+ group1, group2, group3 =
+ 3.times.collect do
+ Fabricate(
+ :group,
+ assignable_level: Group::ALIAS_LEVELS[:only_admins],
+ messageable_level: Group::ALIAS_LEVELS[:only_admins],
+ )
+ end
+ group1.add(user1)
+ group1.add(user3)
+ group2.add(user2)
+ group2.add(user3)
+ group3.add(user3)
+ topic.allowed_groups << group1
+
+ assigner.assign(group2)
+ assigner.assign(group3)
+
+ expect(topic.allowed_groups).to match_array([group1, group2])
+ end
+
+ it "doesn't invite group to the PM if it's not messageable" do
+ group =
+ Fabricate(
+ :group,
+ assignable_level: Group::ALIAS_LEVELS[:only_admins],
+ messageable_level: Group::ALIAS_LEVELS[:nobody],
+ )
+ group.add(Fabricate(:user))
+ expect { assigner.assign(group) }.to raise_error(Discourse::InvalidAccess)
+ end
+ end
+
+ describe "assign_emailer" do
+ let(:post) { Fabricate(:post) }
+ let(:topic) { post.topic }
+ let(:moderator) { Fabricate(:moderator) }
+ let(:moderator_2) { Fabricate(:moderator) }
+
+ it "send an email if set to 'always'" do
+ SiteSetting.assign_mailer = AssignMailer.levels[:always]
+
+ expect { described_class.new(topic, moderator).assign(moderator) }.to change {
+ ActionMailer::Base.deliveries.size
+ }.by(1)
+ end
+
+ it "doesn't send an email if assignee is a group" do
+ SiteSetting.assign_mailer = AssignMailer.levels[:always]
+
+ expect { described_class.new(topic, moderator).assign(assign_allowed_group) }.not_to change {
+ ActionMailer::Base.deliveries.size
+ }
+ end
+
+ it "doesn't send an email if the assigner and assignee are not different" do
+ SiteSetting.assign_mailer = AssignMailer.levels[:different_users]
+
+ expect { described_class.new(topic, moderator).assign(moderator_2) }.to change {
+ ActionMailer::Base.deliveries.size
+ }.by(1)
+ end
+
+ it "doesn't send an email if the assigner and assignee are not different" do
+ SiteSetting.assign_mailer = AssignMailer.levels[:different_users]
+
+ expect { described_class.new(topic, moderator).assign(moderator) }.not_to change {
+ ActionMailer::Base.deliveries.size
+ }
+ end
+
+ it "doesn't send an email" do
+ SiteSetting.assign_mailer = AssignMailer.levels[:never]
+
+ expect { described_class.new(topic, moderator).assign(moderator_2) }.not_to change {
+ ActionMailer::Base.deliveries.size
+ }
+ end
+ end
+end
diff --git a/plugins/discourse-assign/spec/lib/discourse_assign/create_notification_spec.rb b/plugins/discourse-assign/spec/lib/discourse_assign/create_notification_spec.rb
new file mode 100644
index 00000000000..3225a36fa80
--- /dev/null
+++ b/plugins/discourse-assign/spec/lib/discourse_assign/create_notification_spec.rb
@@ -0,0 +1,154 @@
+# frozen_string_literal: true
+
+require "rails_helper"
+
+RSpec.describe DiscourseAssign::CreateNotification do
+ describe ".call" do
+ subject(:create_notification) do
+ described_class.call(assignment: assignment, user: user, mark_as_read: mark_as_read)
+ end
+
+ let(:assignment) { Fabricate(:topic_assignment, topic: post.topic, assigned_to: assigned_to) }
+ let(:post) { Fabricate(:post) }
+ let(:mark_as_read) { false }
+ let(:alerter) { stub_everything("alerter").responds_like_instance_of(PostAlerter) }
+
+ before { PostAlerter.stubs(:new).returns(alerter) }
+
+ context "when assigned to a single user" do
+ let(:assigned_to) { Fabricate(:user) }
+ let(:user) { assigned_to }
+
+ it "publishes topic tracking state" do
+ Assigner.expects(:publish_topic_tracking_state).with(assignment.topic, user.id)
+ create_notification
+ end
+
+ context "when topic is not found" do
+ before { assignment.topic = nil }
+
+ it "does not publish topic tracking state" do
+ Assigner.expects(:publish_topic_tracking_state).never
+ create_notification
+ end
+
+ it "does not create a notification alert" do
+ alerter.expects(:create_notification_alert).never
+ create_notification
+ end
+ end
+
+ context "when `mark_as_read` is false" do
+ let(:excerpt) do
+ I18n.t(
+ "discourse_assign.topic_assigned_excerpt",
+ title: post.topic.title,
+ group: user.name,
+ locale: user.effective_locale,
+ )
+ end
+
+ it "creates a notification alert" do
+ alerter.expects(:create_notification_alert).with(
+ user: user,
+ post: post,
+ username: assignment.assigned_by_user.username,
+ notification_type: Notification.types[:assigned],
+ excerpt: excerpt,
+ )
+ create_notification
+ end
+ end
+
+ context "when `mark_as_read` is true" do
+ let(:mark_as_read) { true }
+
+ it "does not create a notification alert" do
+ alerter.expects(:create_notification_alert).never
+ create_notification
+ end
+ end
+
+ it "creates a notification" do
+ expect { create_notification }.to change { Notification.count }.by(1)
+ expect(Notification.assigned.last).to have_attributes(
+ created_at: assignment.created_at,
+ updated_at: assignment.updated_at,
+ user: user,
+ topic: post.topic,
+ post_number: post.post_number,
+ high_priority: true,
+ read: mark_as_read,
+ data_hash: {
+ message: "discourse_assign.assign_notification",
+ display_username: assignment.assigned_by_user.username,
+ topic_title: post.topic.title,
+ assignment_id: assignment.id,
+ },
+ )
+ end
+ end
+
+ context "when assigned to a group" do
+ let(:assigned_to) { Fabricate(:group) }
+ let(:user) { Fabricate(:user) }
+
+ before { assigned_to.users << user }
+
+ it "publishes topic tracking state" do
+ Assigner.expects(:publish_topic_tracking_state).with(assignment.topic, user.id)
+ create_notification
+ end
+
+ context "when `mark_as_read` is false" do
+ let(:excerpt) do
+ I18n.t(
+ "discourse_assign.topic_group_assigned_excerpt",
+ title: post.topic.title,
+ group: assigned_to.name,
+ locale: user.effective_locale,
+ )
+ end
+
+ it "creates a notification alert" do
+ alerter.expects(:create_notification_alert).with(
+ user: user,
+ post: post,
+ username: assignment.assigned_by_user.username,
+ notification_type: Notification.types[:assigned],
+ excerpt: excerpt,
+ )
+ create_notification
+ end
+ end
+
+ context "when `mark_as_read` is true" do
+ let(:mark_as_read) { true }
+
+ it "does not create a notification alert" do
+ alerter.expects(:create_notification_alert).never
+ create_notification
+ end
+ end
+
+ it "creates a notification" do
+ expect { create_notification }.to change { Notification.count }.by(1)
+ expect(Notification.assigned.last).to have_attributes(
+ created_at: assignment.created_at,
+ updated_at: assignment.updated_at,
+ user: user,
+ topic: post.topic,
+ post_number: post.post_number,
+ high_priority: true,
+ read: mark_as_read,
+ data_hash: {
+ message: "discourse_assign.assign_group_notification",
+ display_username: assigned_to.name,
+ topic_title: post.topic.title,
+ assignment_id: assignment.id,
+ },
+ )
+ end
+ end
+ end
+end
diff --git a/plugins/discourse-assign/spec/lib/pending_assigns_reminder_spec.rb b/plugins/discourse-assign/spec/lib/pending_assigns_reminder_spec.rb
new file mode 100644
index 00000000000..8574591dbff
--- /dev/null
+++ b/plugins/discourse-assign/spec/lib/pending_assigns_reminder_spec.rb
@@ -0,0 +1,214 @@
+# frozen_string_literal: true
+
+require "rails_helper"
+require_relative "../support/assign_allowed_group"
+
+def assert_reminder_not_created
+ expect { reminder.remind(user) }.not_to change { Post.count }
+end
+
+RSpec.describe PendingAssignsReminder do
+ subject(:reminder) { described_class.new }
+
+ before { SiteSetting.assign_enabled = true }
+
+ let(:user) { Fabricate(:user) }
+
+ it "does not create a reminder if the user has 0 assigned topics" do
+ assert_reminder_not_created
+ end
+
+ it "does not create a reminder if the user only has one task" do
+ post = Fabricate(:post)
+ Assigner.new(post.topic, user).assign(user)
+
+ assert_reminder_not_created
+ end
+
+ describe "when the user has multiple tasks" do
+ let(:system) { Discourse.system_user }
+
+ include_context "with group that is allowed to assign"
+
+ before do
+ add_to_assign_allowed_group(user)
+
+ secure_category = Fabricate(:private_category, group: Fabricate(:group))
+
+ @post1 = Fabricate(:post)
+ @post2 = Fabricate(:post)
+ @post2.topic.update_column(:fancy_title, nil)
+ @post3 = Fabricate(:post)
+ @post4 = Fabricate(:post)
+ Assigner.new(@post1.topic, user).assign(user)
+ Assigner.new(@post2.topic, user).assign(user)
+ Assigner.new(@post3.topic, user).assign(user)
+ Assigner.new(@post4.topic, user).assign(user)
+ @post3.topic.trash!
+ @post4.topic.update(category: secure_category)
+ end
+
+ it "creates a reminder for a particular user and sets the timestamp of the last reminder" do
+ freeze_time
+ reminder.remind(user)
+
+ post = Post.last
+
+ topic = post.topic
+ expect(topic.user).to eq(system)
+ expect(topic.archetype).to eq(Archetype.private_message)
+
+ expect(topic.topic_allowed_users.pluck(:user_id)).to contain_exactly(system.id, user.id)
+
+ expect(topic.title).to eq(I18n.t("pending_assigns_reminder.title", pending_assignments: 2))
+
+ expect(post.raw).to include(@post1.topic.fancy_title)
+ expect(post.raw).to include(@post2.topic.fancy_title)
+ expect(post.raw).to_not include(@post3.topic.fancy_title)
+ expect(post.raw).to_not include(@post4.topic.fancy_title)
+
+ expect(user.reload.custom_fields[described_class::REMINDED_AT].to_datetime).to eq_time(
+ DateTime.now,
+ )
+ end
+
+ it "deletes previous reminders when creating a new one" do
+ reminder.remind(user)
+ reminder.remind(user)
+
+ reminders_count =
+ Topic
+ .joins(:_custom_fields)
+ .where(topic_custom_fields: { name: described_class::CUSTOM_FIELD_NAME })
+ .count
+
+ expect(reminders_count).to eq(1)
+ end
+
+ it "doesn't delete reminders from a different user" do
+ reminder.remind(user)
+ another_user = Fabricate(:user)
+ add_to_assign_allowed_group(another_user)
+ 3.times do
+ post = Fabricate(:post)
+ Assigner.new(post.topic, user).assign(another_user)
+ end
+
+ reminder.remind(another_user)
+
+ reminders_count =
+ Topic
+ .joins(:_custom_fields)
+ .where(topic_custom_fields: { name: described_class::CUSTOM_FIELD_NAME })
+ .count
+
+ expect(reminders_count).to eq(2)
+ end
+
+ it "doesn't delete reminders if they have replies" do
+ reminder.remind(user)
+ Fabricate(:post, topic: Topic.last)
+ reminder.remind(user)
+
+ reminders_count =
+ Topic
+ .joins(:_custom_fields)
+ .where(topic_custom_fields: { name: described_class::CUSTOM_FIELD_NAME })
+ .count
+
+ expect(reminders_count).to eq(2)
+ end
+
+ it "doesn't leak assigned topics that were moved to PM" do
+ # we already add a fail to assign when the assigned user cannot view the pm
+ # so we don't need to test that here
+ # but if we move a topic to a PM that the user can't see, we should not
+ # include it in the reminder
+ post = Fabricate(:post)
+ Assigner.new(post.topic, user).assign(user)
+ post.topic.update(archetype: Archetype.private_message, category: nil)
+ reminder.remind(user)
+
+ post = Post.last
+ topic = post.topic
+ expect(topic.title).to eq(I18n.t("pending_assigns_reminder.title", pending_assignments: 2))
+ expect(post.raw).to include(@post1.topic.fancy_title)
+ expect(post.raw).to include(@post2.topic.fancy_title)
+
+ expect(post.raw).to_not include(post.topic.fancy_title)
+ end
+
+ it "reminds about PMs" do
+ pm = Fabricate(:private_message_topic, user: user)
+ Fabricate(:post, topic: pm)
+
+ Assigner.new(pm, user).assign(user)
+ reminder.remind(user)
+
+ post = Post.last
+ topic = post.topic
+
+ expect(topic.title).to eq(I18n.t("pending_assigns_reminder.title", pending_assignments: 3))
+ expect(post.raw).to include(@post1.topic.fancy_title)
+ expect(post.raw).to include(@post2.topic.fancy_title)
+ expect(post.raw).to include(pm.fancy_title)
+ end
+
+ it "closed topics aren't included as active assigns" do
+ SiteSetting.unassign_on_close = true
+
+ @post5 = Fabricate(:post)
+ Assigner.new(@post5.topic, user).assign(user)
+
+ reminder.remind(user)
+
+ post = Post.last
+ topic = post.topic
+
+ expect(topic.title).to eq(I18n.t("pending_assigns_reminder.title", pending_assignments: 3))
+
+ @post5.topic.update_status("closed", true, Discourse.system_user)
+ expect(@post5.topic.closed).to eq(true)
+
+ reminder.remind(user)
+
+ post = Post.last
+ topic = post.topic
+
+ expect(topic.title).to eq(I18n.t("pending_assigns_reminder.title", pending_assignments: 2))
+ end
+
+ context "with assigns_reminder_assigned_topics_query modifier" do
+ let(:modifier_block) { Proc.new { |query| query.where.not(id: @post1.topic_id) } }
+ it "updates the query correctly" do
+ plugin_instance = Plugin::Instance.new
+ plugin_instance.register_modifier(:assigns_reminder_assigned_topics_query, &modifier_block)
+ topics = reminder.send(:assigned_topics, user, order: :asc)
+ expect(topics).not_to include(@post1.topic)
+ ensure
+ DiscoursePluginRegistry.unregister_modifier(
+ plugin_instance,
+ :assigns_reminder_assigned_topics_query,
+ &modifier_block
+ )
+ end
+ end
+
+ context "with assigned_count_for_user_query modifier" do
+ let(:modifier_block) { Proc.new { |query, user| query.where.not(assigned_to_id: user.id) } }
+ it "updates the query correctly" do
+ expect(reminder.send(:assigned_count_for, user)).to eq(2)
+
+ plugin_instance = Plugin::Instance.new
+ plugin_instance.register_modifier(:assigned_count_for_user_query, &modifier_block)
+ expect(reminder.send(:assigned_count_for, user)).to eq(0)
+ ensure
+ DiscoursePluginRegistry.unregister_modifier(
+ plugin_instance,
+ :assigned_count_for_user_query,
+ &modifier_block
+ )
+ end
+ end
+ end
+end
diff --git a/plugins/discourse-assign/spec/lib/random_assign_utils_spec.rb b/plugins/discourse-assign/spec/lib/random_assign_utils_spec.rb
new file mode 100644
index 00000000000..993d326bac7
--- /dev/null
+++ b/plugins/discourse-assign/spec/lib/random_assign_utils_spec.rb
@@ -0,0 +1,370 @@
+# frozen_string_literal: true
+
+require "rails_helper"
+require_relative "../support/assign_allowed_group"
+
+RSpec.describe RandomAssignUtils do
+ FakeAutomation = Struct.new(:id)
+
+ let!(:automation) { FakeAutomation.new(1) }
+ let(:fake_logger) { FakeLogger.new }
+
+ before do
+ SiteSetting.assign_enabled = true
+ Rails.logger.broadcast_to(fake_logger)
+ end
+
+ after { Rails.logger.stop_broadcasting_to(fake_logger) }
+
+ describe ".automation_script!" do
+ subject(:auto_assign) { described_class.automation_script!(ctx, fields, automation) }
+
+ fab!(:post_1) { Fabricate(:post) }
+ fab!(:topic_1) { post_1.topic }
+ fab!(:group_1) { Fabricate(:group) }
+ fab!(:user_1) { Fabricate(:user) }
+ fab!(:user_2) { Fabricate(:user) }
+ fab!(:user_3) { Fabricate(:user) }
+
+ let(:ctx) { {} }
+ let(:fields) { {} }
+
+ before do
+ SiteSetting.assign_allowed_on_groups = group_1.id.to_s
+ group_1.add(user_1)
+ end
+
+ context "when all users of group are on holidays" do
+ let(:fields) do
+ {
+ "assignees_group" => {
+ "value" => group_1.id,
+ },
+ "assigned_topic" => {
+ "value" => topic_1.id,
+ },
+ }
+ end
+
+ before { UserCustomField.create!(name: "on_holiday", value: "t", user_id: user_1.id) }
+
+ it "creates post on the topic" do
+ auto_assign
+ expect(topic_1.posts.last.raw).to match(
+ I18n.t("discourse_automation.scriptables.random_assign.no_one", group: group_1.name),
+ )
+ end
+ end
+
+ context "when all users of group have been assigned recently" do
+ let(:fields) do
+ {
+ "assignees_group" => {
+ "value" => group_1.id,
+ },
+ "assigned_topic" => {
+ "value" => topic_1.id,
+ },
+ }
+ end
+
+ before do
+ group_1.add(user_2)
+ group_1.add(user_3)
+ freeze_time(10.days.ago) { Assigner.new(topic_1, Discourse.system_user).assign(user_1) }
+ freeze_time(5.days.ago) { Assigner.new(topic_1, Discourse.system_user).assign(user_3) }
+ Assigner.new(topic_1, Discourse.system_user).assign(user_2)
+ end
+
+ it "assigns the least recently assigned user to the topic" do
+ expect { auto_assign }.to change { topic_1.reload.assignment.assigned_to }.to(user_1)
+ end
+
+ context "when a user is on holiday" do
+ before do
+ user_1.custom_fields["on_holiday"] = true
+ user_1.save!
+ end
+
+ it "doesn't assign them" do
+ expect { auto_assign }.to change { topic_1.reload.assignment.assigned_to }.to(user_3)
+ end
+ end
+ end
+
+ context "when no users can be assigned because none are members of assign_allowed_on_groups groups" do
+ let(:fields) do
+ {
+ "assignees_group" => {
+ "value" => group_1.id,
+ },
+ "assigned_topic" => {
+ "value" => topic_1.id,
+ },
+ }
+ end
+
+ before { SiteSetting.assign_allowed_on_groups = "" }
+
+ it "creates post on the topic" do
+ auto_assign
+ expect(topic_1.posts.last.raw).to match(
+ I18n.t("discourse_automation.scriptables.random_assign.no_one", group: group_1.name),
+ )
+ end
+ end
+
+ context "when user can be assigned" do
+ context "when post_template is set" do
+ let(:fields) do
+ {
+ "post_template" => {
+ "value" => "this is a post template",
+ },
+ "assignees_group" => {
+ "value" => group_1.id,
+ },
+ "assigned_topic" => {
+ "value" => topic_1.id,
+ },
+ }
+ end
+
+ it "creates a post with the template and assign the user" do
+ auto_assign
+ expect(topic_1.posts.second.raw).to match("this is a post template")
+ end
+ end
+
+ context "when post_template is not set" do
+ let(:fields) do
+ {
+ "assignees_group" => {
+ "value" => group_1.id,
+ },
+ "assigned_topic" => {
+ "value" => topic_1.id,
+ },
+ }
+ end
+
+ it "assigns the user to the topic" do
+ auto_assign
+ expect(topic_1.assignment.assigned_to_id).to eq(user_1.id)
+ end
+ end
+ end
+
+ context "when all users are in working hours" do
+ let(:fields) do
+ {
+ "in_working_hours" => {
+ "value" => true,
+ },
+ "assignees_group" => {
+ "value" => group_1.id,
+ },
+ "assigned_topic" => {
+ "value" => topic_1.id,
+ },
+ }
+ end
+
+ before do
+ freeze_time("2022-10-01 02:00")
+ UserOption.find_by(user_id: user_1.id).update(timezone: "Europe/Paris")
+ end
+
+ it "assigns the user to the topic" do
+ auto_assign
+ expect(topic_1.assignment.assigned_to).to eq(user_1)
+ end
+ end
+
+ context "when in a group of one person" do
+ let(:fields) do
+ {
+ "assignees_group" => {
+ "value" => group_1.id,
+ },
+ "assigned_topic" => {
+ "value" => topic_1.id,
+ },
+ }
+ end
+
+ context "when user is already assigned" do
+ before { described_class.automation_script!(ctx, fields, automation) }
+
+ it "reassigns them" do
+ expect { auto_assign }.to change { topic_1.reload.assignment.id }
+ expect(topic_1.assignment.assigned_to).to eq(user_1)
+ end
+ end
+ end
+
+ context "when assignees_group is not provided" do
+ let(:fields) { { "assigned_topic" => { "value" => topic_1.id } } }
+
+ it "raises an error" do
+ expect { auto_assign }.to raise_error(/`assignees_group` not provided/)
+ end
+ end
+
+ context "when assignees_group not found" do
+ let(:fields) do
+ { "assigned_topic" => { "value" => topic_1.id }, "assignees_group" => { "value" => -1 } }
+ end
+
+ it "raises an error" do
+ expect { auto_assign }.to raise_error(/Group\(-1\) not found/)
+ end
+ end
+
+ context "when assigned_topic not provided" do
+ it "raises an error" do
+ expect { auto_assign }.to raise_error(/`assigned_topic` not provided/)
+ end
+ end
+
+ context "when assigned_topic is not found" do
+ let(:fields) do
+ { "assigned_topic" => { "value" => -1 }, "assignees_group" => { "value" => group_1.id } }
+ end
+
+ it "raises an error" do
+ expect { auto_assign }.to raise_error(/Topic\(-1\) not found/)
+ end
+ end
+
+ context "when minimum_time_between_assignments is set" do
+ context "when the topic has been assigned recently" do
+ let(:fields) do
+ {
+ "assignees_group" => {
+ "value" => group_1.id,
+ },
+ "assigned_topic" => {
+ "value" => topic_1.id,
+ },
+ "minimum_time_between_assignments" => {
+ "value" => 10,
+ },
+ }
+ end
+
+ before do
+ freeze_time
+ TopicCustomField.create!(
+ name: "assigned_to_id",
+ topic_id: topic_1.id,
+ created_at: 20.hours.ago,
+ )
+ end
+
+ it "logs a warning" do
+ auto_assign
+ expect(Rails.logger.infos.first).to match(
+ /Topic\(#{topic_1.id}\) has already been assigned recently/,
+ )
+ end
+ end
+ end
+
+ context "when skip_new_users_for_days is set" do
+ let(:fields) do
+ {
+ "assignees_group" => {
+ "value" => group_1.id,
+ },
+ "assigned_topic" => {
+ "value" => topic_1.id,
+ },
+ "skip_new_users_for_days" => {
+ "value" => "10",
+ },
+ }
+ end
+
+ it "creates post on the topic if all users are new" do
+ auto_assign
+ expect(topic_1.posts.last.raw).to match(
+ I18n.t("discourse_automation.scriptables.random_assign.no_one", group: group_1.name),
+ )
+ end
+
+ context "when all users are old" do
+ let(:fields) do
+ {
+ "assignees_group" => {
+ "value" => group_1.id,
+ },
+ "assigned_topic" => {
+ "value" => topic_1.id,
+ },
+ "skip_new_users_for_days" => {
+ "value" => "0",
+ },
+ }
+ end
+
+ it "assigns topic" do
+ auto_assign
+ expect(topic_1.assignment).not_to be_nil
+ end
+ end
+ end
+ end
+
+ describe "#recently_assigned_users_ids" do
+ subject(:assignees) { utils.recently_assigned_users_ids(2.months.ago) }
+
+ let(:utils) { described_class.new({}, fields, automation) }
+ let(:fields) do
+ {
+ "assignees_group" => {
+ "value" => assign_allowed_group.id,
+ },
+ "assigned_topic" => {
+ "value" => post.topic.id,
+ },
+ }
+ end
+ let(:post) { Fabricate(:post) }
+ let(:assign_allowed_group) { Group.find_by(name: "staff") }
+
+ context "when no one has been assigned" do
+ it "returns an empty array" do
+ expect(assignees).to be_empty
+ end
+ end
+
+ context "when users have been assigned" do
+ let(:admin) { Fabricate(:admin) }
+ let!(:user_1) { Fabricate(:user, groups: [assign_allowed_group]) }
+ let!(:user_2) { Fabricate(:user, groups: [assign_allowed_group]) }
+ let!(:user_3) { Fabricate(:user, groups: [assign_allowed_group]) }
+ let!(:user_4) { Fabricate(:user, groups: [assign_allowed_group]) }
+ let(:post_2) { Fabricate(:post, topic: post.topic) }
+
+ before do
+ freeze_time 3.months.ago do
+ Assigner.new(post.topic, admin).assign(user_3)
+ end
+ freeze_time 45.days.ago do
+ Assigner.new(post_2, admin).assign(user_4)
+ end
+ freeze_time 30.days.ago do
+ Assigner.new(post.topic, admin).assign(user_1)
+ end
+ freeze_time 15.days.ago do
+ Assigner.new(post.topic, admin).assign(user_2)
+ end
+ end
+
+ it "returns the recently assigned user ids" do
+ expect(assignees).to eq([user_2, user_1, user_4].map(&:id))
+ end
+ end
+ end
+end
diff --git a/plugins/discourse-assign/spec/lib/topic_query_spec.rb b/plugins/discourse-assign/spec/lib/topic_query_spec.rb
new file mode 100644
index 00000000000..4c152285d97
--- /dev/null
+++ b/plugins/discourse-assign/spec/lib/topic_query_spec.rb
@@ -0,0 +1,44 @@
+# frozen_string_literal: true
+
+require "topic_view"
+
+describe TopicQuery do
+ fab!(:user)
+ fab!(:admin)
+ fab!(:other_admin) { Fabricate(:admin) }
+
+ fab!(:user_pm) { Fabricate(:private_message_topic, user: user) }
+ fab!(:admin_pm) { Fabricate(:private_message_topic, user: admin) }
+ fab!(:other_admin_pm) { Fabricate(:private_message_topic, user: other_admin) }
+
+ fab!(:group)
+
+ describe "#list_group_topics_assigned" do
+ before do
+ SiteSetting.assign_enabled = true
+
+ [user, admin, other_admin].each { |user| group.add(user) }
+
+ [user_pm, admin_pm, other_admin_pm].each { |topic| Fabricate(:post, topic: topic) }
+ Fabricate(:topic_allowed_user, user: admin, topic: user_pm)
+
+ Assigner.new(user_pm, Discourse.system_user).assign(admin)
+ Assigner.new(admin_pm, Discourse.system_user).assign(admin)
+ Assigner.new(other_admin_pm, Discourse.system_user).assign(other_admin)
+ end
+
+ it "includes PMs from all users" do
+ expect(TopicQuery.new(user).list_group_topics_assigned(group).topics).to contain_exactly(
+ user_pm,
+ )
+ expect(TopicQuery.new(admin).list_group_topics_assigned(group).topics).to contain_exactly(
+ user_pm,
+ admin_pm,
+ other_admin_pm,
+ )
+ expect(
+ TopicQuery.new(other_admin).list_group_topics_assigned(group).topics,
+ ).to contain_exactly(user_pm, admin_pm, other_admin_pm)
+ end
+ end
+end
diff --git a/plugins/discourse-assign/spec/models/assignment_spec.rb b/plugins/discourse-assign/spec/models/assignment_spec.rb
new file mode 100644
index 00000000000..f3c4188cbed
--- /dev/null
+++ b/plugins/discourse-assign/spec/models/assignment_spec.rb
@@ -0,0 +1,251 @@
+# frozen_string_literal: true
+
+require "rails_helper"
+
+RSpec.describe Assignment do
+ before { SiteSetting.assign_enabled = true }
+
+ describe ".active_for_group" do
+ subject(:assignments) { described_class.active_for_group(group) }
+
+ let!(:group) { Fabricate(:group) }
+ let!(:user1) { Fabricate(:user) }
+ let!(:user2) { Fabricate(:user) }
+ let!(:group_user1) { Fabricate(:group_user, user: user1, group: group) }
+ let!(:group_user2) { Fabricate(:group_user, user: user2, group: group) }
+ let!(:wrong_group) { Fabricate(:group) }
+ let!(:assignment1) { Fabricate(:topic_assignment, assigned_to: group) }
+ let!(:assignment2) { Fabricate(:post_assignment, assigned_to: group) }
+
+ before do
+ Fabricate(:post_assignment, assigned_to: group, active: false)
+ Fabricate(:post_assignment, assigned_to: user1)
+ Fabricate(:topic_assignment, assigned_to: wrong_group)
+ end
+
+ it "returns active assignments for the group" do
+ expect(assignments).to contain_exactly(assignment1, assignment2)
+ end
+ end
+
+ describe ".deactivate!" do
+ subject(:deactivate!) { described_class.deactivate!(topic: topic) }
+
+ let!(:assignment1) { Fabricate(:topic_assignment) }
+ let!(:assignment2) { Fabricate(:post_assignment, topic: topic) }
+ let!(:assignment3) { Fabricate(:post_assignment) }
+ let(:topic) { assignment1.topic }
+
+ it "deactivates each assignment of the provided topic" do
+ deactivate!
+ expect([assignment1, assignment2].map(&:reload).map(&:active?)).to all eq false
+ expect(assignment3.reload).to be_active
+ end
+ end
+
+ describe ".reactivate!" do
+ subject(:reactivate!) { described_class.reactivate!(topic: topic) }
+
+ let!(:assignment1) { Fabricate(:topic_assignment, active: false) }
+ let!(:assignment2) { Fabricate(:post_assignment, topic: topic, active: false) }
+ let!(:assignment3) { Fabricate(:post_assignment, active: false) }
+ let(:topic) { assignment1.topic }
+
+ it "reactivates each assignment of the provided topic" do
+ reactivate!
+ expect([assignment1, assignment2].map(&:reload)).to all be_active
+ expect(assignment3.reload).not_to be_active
+ end
+ end
+
+ describe "#assigned_users" do
+ subject(:assigned_users) { assignment.assigned_users }
+
+ let(:assignment) { Fabricate.build(:topic_assignment, assigned_to: assigned_to) }
+
+ context "when assigned to a group" do
+ let(:assigned_to) { Fabricate.build(:group) }
+
+ context "when group is empty" do
+ it "returns an empty collection" do
+ expect(assigned_users).to be_empty
+ end
+ end
+
+ context "when group is not empty" do
+ before { assigned_to.users = Fabricate.build_times(2, :user) }
+
+ it "returns users from that group" do
+ expect(assigned_users).to eq(assigned_to.users)
+ end
+ end
+ end
+
+ context "when assigned to a user" do
+ let(:assigned_to) { Fabricate.build(:user) }
+
+ it "returns that user" do
+ expect(assigned_users).to eq([assigned_to])
+ end
+ end
+ end
+
+ describe "#post" do
+ subject(:post) { assignment.post }
+
+ context "when target is a topic" do
+ let!(:initial_post) { Fabricate(:post) }
+ let(:assignment) { Fabricate.build(:topic_assignment, topic: target) }
+ let(:target) { initial_post.topic }
+
+ it "returns the first post of that topic" do
+ expect(post).to eq(initial_post)
+ end
+ end
+
+ context "when target is a post" do
+ let(:assignment) { Fabricate.build(:post_assignment) }
+
+ it "returns that post" do
+ expect(post).to eq(assignment.target)
+ end
+ end
+ end
+
+ describe "#create_missing_notifications!" do
+ subject(:create_missing_notifications) { assignment.create_missing_notifications! }
+
+ let(:assignment) do
+ Fabricate(:topic_assignment, assigned_to: assigned_to, assigned_by_user: assigned_by_user)
+ end
+ let(:assigned_by_user) { Fabricate(:user) }
+
+ context "when assigned to a user" do
+ let(:assigned_to) { Fabricate(:user) }
+
+ context "when notification already exists for that user" do
+ before do
+ Fabricate(
+ :notification,
+ notification_type: Notification.types[:assigned],
+ user: assigned_to,
+ data: { assignment_id: assignment.id }.to_json,
+ )
+ end
+
+ it "does nothing" do
+ DiscourseAssign::CreateNotification.expects(:call).never
+ create_missing_notifications
+ end
+ end
+
+ context "when notification does not exist yet" do
+ context "when user is the one that assigned" do
+ let(:assigned_by_user) { assigned_to }
+
+ it "creates the missing notification" do
+ DiscourseAssign::CreateNotification.expects(:call).with(
+ assignment: assignment,
+ user: assigned_to,
+ mark_as_read: true,
+ )
+ create_missing_notifications
+ end
+ end
+
+ context "when user is not the one that assigned" do
+ it "creates the missing notification" do
+ DiscourseAssign::CreateNotification.expects(:call).with(
+ assignment: assignment,
+ user: assigned_to,
+ mark_as_read: false,
+ )
+ create_missing_notifications
+ end
+ end
+ end
+ end
+
+ context "when assigned to a group" do
+ let(:assigned_to) { Fabricate(:group) }
+ let(:users) { Fabricate.times(3, :user) }
+ let(:assigned_by_user) { users.last }
+
+ before do
+ assigned_to.users = users
+ Fabricate(
+ :notification,
+ notification_type: Notification.types[:assigned],
+ user: users.first,
+ data: { assignment_id: assignment.id }.to_json,
+ )
+ end
+
+ it "creates missing notifications for group users" do
+ DiscourseAssign::CreateNotification
+ .expects(:call)
+ .with(assignment: assignment, user: users.first, mark_as_read: false)
+ .never
+ DiscourseAssign::CreateNotification.expects(:call).with(
+ assignment: assignment,
+ user: users.second,
+ mark_as_read: false,
+ )
+ DiscourseAssign::CreateNotification.expects(:call).with(
+ assignment: assignment,
+ user: users.last,
+ mark_as_read: true,
+ )
+ create_missing_notifications
+ end
+ end
+ end
+
+ describe "#reactivate!" do
+ subject(:reactivate!) { assignment.reactivate! }
+
+ fab!(:assignment) { Fabricate.create(:topic_assignment, active: false) }
+
+ context "when target does not exist" do
+ before { assignment.target.delete }
+
+ it "does nothing" do
+ expect { reactivate! }.not_to change { assignment.reload.active }
+ end
+ end
+
+ context "when target exists" do
+ it "sets the assignment as active" do
+ expect { reactivate! }.to change { assignment.reload.active? }.to true
+ end
+
+ it "enqueues a job to create notifications" do
+ reactivate!
+ expect_job_enqueued(job: Jobs::AssignNotification, args: { assignment_id: assignment.id })
+ end
+ end
+ end
+
+ describe "#deactivate!" do
+ subject(:deactivate!) { assignment.deactivate! }
+
+ fab!(:assignment) { Fabricate.create(:topic_assignment) }
+
+ it "sets the assignment as inactive" do
+ expect { deactivate! }.to change { assignment.reload.active? }.to false
+ end
+
+ it "enqueues a job to delete notifications" do
+ deactivate!
+ expect_job_enqueued(
+ job: Jobs::UnassignNotification,
+ args: {
+ topic_id: assignment.topic_id,
+ assigned_to_id: assignment.assigned_to_id,
+ assigned_to_type: assignment.assigned_to_type,
+ assignment_id: assignment.id,
+ },
+ )
+ end
+ end
+end
diff --git a/plugins/discourse-assign/spec/models/group_spec.rb b/plugins/discourse-assign/spec/models/group_spec.rb
new file mode 100644
index 00000000000..e5926a52617
--- /dev/null
+++ b/plugins/discourse-assign/spec/models/group_spec.rb
@@ -0,0 +1,70 @@
+# frozen_string_literal: true
+
+require "rails_helper"
+require_relative "../support/assign_allowed_group"
+
+RSpec.describe Group do
+ let(:group) { Fabricate(:group) }
+
+ before { SiteSetting.assign_enabled = true }
+
+ describe "Tracking changes that could affect the allow assign on groups site setting" do
+ let(:removed_group_setting) { "3|4" }
+ let(:group_attribute) { group.id }
+
+ it "removes the group from the setting when the group gets destroyed" do
+ SiteSetting.assign_allowed_on_groups = "#{group_attribute}|#{removed_group_setting}"
+
+ group.destroy!
+
+ expect(SiteSetting.assign_allowed_on_groups).to eq removed_group_setting
+ end
+
+ it "removes the group from the setting when this is the last one on the list" do
+ SiteSetting.assign_allowed_on_groups = "#{removed_group_setting}|#{group_attribute}"
+
+ group.destroy!
+
+ expect(SiteSetting.assign_allowed_on_groups).to eq removed_group_setting
+ end
+
+ it "removes the group from the list when it is on the middle of the list" do
+ allowed_groups = "3|#{group_attribute}|4"
+ SiteSetting.assign_allowed_on_groups = allowed_groups
+
+ group.destroy!
+
+ expect(SiteSetting.assign_allowed_on_groups).to eq removed_group_setting
+ end
+ end
+
+ describe "includes can_show_assigned_tab? method" do
+ let(:admin) { Fabricate(:admin) }
+ let(:user) { Fabricate(:user) }
+ let(:user1) { Fabricate(:user) }
+ let(:user2) { Fabricate(:user) }
+
+ include_context "with group that is allowed to assign"
+
+ before do
+ add_to_assign_allowed_group(user)
+ add_to_assign_allowed_group(user1)
+ add_to_assign_allowed_group(admin)
+ end
+
+ it "gives false in can_show_assigned_tab? when all users are not in assigned_allowed_group" do
+ group.add(user)
+ group.add(user1)
+ group.add(user2)
+
+ expect(group.can_show_assigned_tab?).to eq(false)
+ end
+
+ it "gives true in can_show_assigned_tab? when all users are in assigned_allowed_group" do
+ group.add(user)
+ group.add(user1)
+
+ expect(group.can_show_assigned_tab?).to eq(true)
+ end
+ end
+end
diff --git a/plugins/discourse-assign/spec/models/reviewable_spec.rb b/plugins/discourse-assign/spec/models/reviewable_spec.rb
new file mode 100644
index 00000000000..59eed8b494c
--- /dev/null
+++ b/plugins/discourse-assign/spec/models/reviewable_spec.rb
@@ -0,0 +1,31 @@
+# frozen_string_literal: true
+
+describe Reviewable do
+ fab!(:user)
+ fab!(:admin)
+ fab!(:post1) { Fabricate(:post) }
+ fab!(:post2) { Fabricate(:post) }
+ fab!(:reviewable1) { Fabricate(:reviewable_flagged_post, target: post1) }
+ fab!(:reviewable2) { Fabricate(:reviewable_flagged_post, target: post2) }
+
+ before { SiteSetting.assign_enabled = true }
+
+ it "can filter by assigned_to" do
+ Assignment.create!(
+ target: post1,
+ topic_id: post1.topic.id,
+ assigned_by_user: user,
+ assigned_to: user,
+ )
+ Assignment.create!(
+ target: post2,
+ topic_id: post2.topic.id,
+ assigned_by_user: user,
+ assigned_to: admin,
+ )
+
+ expect(Reviewable.list_for(admin, additional_filters: { assigned_to: user.username })).to eq(
+ [reviewable1],
+ )
+ end
+end
diff --git a/plugins/discourse-assign/spec/models/topic_spec.rb b/plugins/discourse-assign/spec/models/topic_spec.rb
new file mode 100644
index 00000000000..9f00deff51e
--- /dev/null
+++ b/plugins/discourse-assign/spec/models/topic_spec.rb
@@ -0,0 +1,38 @@
+# frozen_string_literal: true
+
+require "rails_helper"
+
+describe Topic do
+ let(:user1) { Fabricate(:user) }
+ let(:user2) { Fabricate(:user) }
+ let(:group) { Fabricate(:group) }
+ let(:topic) { Fabricate(:topic) }
+
+ before { SiteSetting.assign_enabled = true }
+
+ describe "#assigned_to" do
+ it "correctly points to a user" do
+ Assignment.create!(
+ target_id: topic.id,
+ target_type: "Topic",
+ topic_id: topic.id,
+ assigned_by_user: user1,
+ assigned_to: user2,
+ )
+
+ expect(topic.reload.assigned_to).to eq(user2)
+ end
+
+ it "correctly points to a group" do
+ Assignment.create!(
+ target_id: topic.id,
+ target_type: "Topic",
+ topic_id: topic.id,
+ assigned_by_user: user1,
+ assigned_to: group,
+ )
+
+ expect(topic.reload.assigned_to).to eq(group)
+ end
+ end
+end
diff --git a/plugins/discourse-assign/spec/models/user_custom_field_spec.rb b/plugins/discourse-assign/spec/models/user_custom_field_spec.rb
new file mode 100644
index 00000000000..61a6834b491
--- /dev/null
+++ b/plugins/discourse-assign/spec/models/user_custom_field_spec.rb
@@ -0,0 +1,19 @@
+# frozen_string_literal: true
+
+require "rails_helper"
+
+RSpec.describe UserCustomField do
+ before { SiteSetting.assign_enabled = true }
+
+ let(:field_name) { PendingAssignsReminder::REMINDERS_FREQUENCY }
+ let(:new_field) { UserCustomField.new(name: field_name, user_id: 1) }
+
+ it "coerces the value to be an integer" do
+ new_field.value = "DROP TABLE USERS;"
+
+ new_field.save!
+ saved_field = new_field.reload
+
+ expect(saved_field.value).to eq("0")
+ end
+end
diff --git a/plugins/discourse-assign/spec/plugin_spec.rb b/plugins/discourse-assign/spec/plugin_spec.rb
new file mode 100644
index 00000000000..e84ed16d1b8
--- /dev/null
+++ b/plugins/discourse-assign/spec/plugin_spec.rb
@@ -0,0 +1,177 @@
+# frozen_string_literal: true
+
+require "rails_helper"
+
+RSpec.describe DiscourseAssign do
+ before { SiteSetting.assign_enabled = true }
+
+ describe "Events" do
+ describe "on 'user_removed_from_group'" do
+ let(:group) { Fabricate(:group) }
+ let(:user) { Fabricate(:user) }
+ let(:first_assignment) { Fabricate(:topic_assignment, assigned_to: group) }
+ let(:second_assignment) { Fabricate(:post_assignment, assigned_to: group) }
+
+ before do
+ group.users << user
+ Fabricate(
+ :notification,
+ notification_type: Notification.types[:assigned],
+ user: user,
+ data: { assignment_id: first_assignment.id }.to_json,
+ )
+ Fabricate(
+ :notification,
+ notification_type: Notification.types[:assigned],
+ user: user,
+ data: { assignment_id: second_assignment.id }.to_json,
+ )
+ end
+
+ it "removes user's notifications related to group assignments" do
+ expect { group.remove(user) }.to change { user.notifications.assigned.count }.by(-2)
+ end
+ end
+
+ describe "on 'user_added_to_group'" do
+ let(:group) { Fabricate(:group) }
+ let(:user) { Fabricate(:user) }
+ let!(:first_assignment) { Fabricate(:topic_assignment, assigned_to: group) }
+ let!(:second_assignment) { Fabricate(:post_assignment, assigned_to: group) }
+ let!(:third_assignment) { Fabricate(:topic_assignment, assigned_to: group, active: false) }
+
+ it "creates missing notifications for added user" do
+ group.add(user)
+ [first_assignment, second_assignment].each do |assignment|
+ expect_job_enqueued(job: Jobs::AssignNotification, args: { assignment_id: assignment.id })
+ end
+ expect(
+ job_enqueued?(
+ job: Jobs::AssignNotification,
+ args: {
+ assignment_id: third_assignment.id,
+ },
+ ),
+ ).to eq(false)
+ end
+ end
+
+ describe "on 'topic_status_updated'" do
+ context "when closing a topic" do
+ let!(:first_assignment) { Fabricate(:topic_assignment) }
+ let!(:second_assignment) { Fabricate(:post_assignment, topic: topic) }
+ let(:topic) { first_assignment.topic }
+
+ before do
+ SiteSetting.unassign_on_close = true
+ topic.update_status("closed", true, Discourse.system_user)
+ end
+
+ it "deactivates existing assignments" do
+ [first_assignment, second_assignment].each do |assignment|
+ assignment.reload
+ expect(assignment).not_to be_active
+ expect_job_enqueued(
+ job: Jobs::UnassignNotification,
+ args: {
+ topic_id: assignment.topic_id,
+ assignment_id: assignment.id,
+ assigned_to_id: assignment.assigned_to_id,
+ assigned_to_type: assignment.assigned_to_type,
+ },
+ )
+ end
+ end
+ end
+
+ context "when reopening a topic" do
+ let!(:topic) { Fabricate(:closed_topic) }
+ let!(:first_assignment) { Fabricate(:topic_assignment, topic: topic, active: false) }
+ let!(:second_assignment) { Fabricate(:post_assignment, topic: topic, active: false) }
+
+ before do
+ SiteSetting.reassign_on_open = true
+ topic.update_status("closed", false, Discourse.system_user)
+ end
+
+ it "reactivates existing assignments" do
+ [first_assignment, second_assignment].each do |assignment|
+ assignment.reload
+ expect(assignment).to be_active
+ expect_job_enqueued(
+ job: Jobs::AssignNotification,
+ args: {
+ assignment_id: assignment.id,
+ },
+ )
+ end
+ end
+ end
+ end
+
+ describe "on 'post_destroyed'" do
+ let!(:assignment) { Fabricate(:post_assignment) }
+ let(:post) { assignment.target }
+
+ before { PostDestroyer.new(Discourse.system_user, post).destroy }
+
+ it "deactivates the existing assignment" do
+ assignment.reload
+ expect(assignment).not_to be_active
+ expect_job_enqueued(
+ job: Jobs::UnassignNotification,
+ args: {
+ topic_id: assignment.topic_id,
+ assignment_id: assignment.id,
+ assigned_to_id: assignment.assigned_to_id,
+ assigned_to_type: assignment.assigned_to_type,
+ },
+ )
+ end
+ end
+
+ describe "on 'post_recovered'" do
+ let!(:assignment) { Fabricate(:post_assignment, active: false) }
+ let(:post) { assignment.target }
+
+ before do
+ SiteSetting.reassign_on_open = true
+ post.trash!
+ PostDestroyer.new(Discourse.system_user, post).recover
+ end
+
+ it "reactivates the existing assignment" do
+ assignment.reload
+ expect(assignment).to be_active
+ expect_job_enqueued(job: Jobs::AssignNotification, args: { assignment_id: assignment.id })
+ end
+ end
+
+ describe "on 'group_destroyed'" do
+ let(:group) { Fabricate(:group) }
+ let(:user) { Fabricate(:user) }
+ let(:first_assignment) { Fabricate(:topic_assignment, assigned_to: group) }
+ let(:second_assignment) { Fabricate(:post_assignment, assigned_to: group) }
+
+ before do
+ group.users << user
+ Fabricate(
+ :notification,
+ notification_type: Notification.types[:assigned],
+ user: user,
+ data: { assignment_id: first_assignment.id }.to_json,
+ )
+ Fabricate(
+ :notification,
+ notification_type: Notification.types[:assigned],
+ user: user,
+ data: { assignment_id: second_assignment.id }.to_json,
+ )
+ end
+
+ it "removes user's notifications related to group assignments" do
+ expect { group.destroy }.to change { user.notifications.assigned.count }.by(-2)
+ end
+ end
+ end
+end
diff --git a/plugins/discourse-assign/spec/requests/assign_controller_spec.rb b/plugins/discourse-assign/spec/requests/assign_controller_spec.rb
new file mode 100644
index 00000000000..bd1aa317e8f
--- /dev/null
+++ b/plugins/discourse-assign/spec/requests/assign_controller_spec.rb
@@ -0,0 +1,520 @@
+# frozen_string_literal: true
+
+require "rails_helper"
+require_relative "../support/assign_allowed_group"
+
+RSpec.describe DiscourseAssign::AssignController do
+ before do
+ SiteSetting.assign_enabled = true
+ SiteSetting.assign_allowed_on_groups = "#{allowed_group.id}|#{staff_group.id}"
+ end
+
+ fab!(:staff_group) { Group.find_by(name: "staff") }
+ fab!(:non_allowed_group) { Fabricate(:group) }
+ fab!(:allowed_group) { Fabricate(:group) }
+
+ fab!(:admin)
+ fab!(:allowed_user) { Fabricate(:user, username: "mads", name: "Mads", groups: [allowed_group]) }
+ fab!(:non_admin_staff) { Fabricate(:user, groups: [staff_group]) }
+ fab!(:user_in_non_allowed_group) { Fabricate(:user, groups: [non_allowed_group]) }
+
+ fab!(:post)
+
+ describe "only allow users from allowed groups to assign" do
+ it "filters requests where current_user is not member of an allowed group" do
+ sign_in(user_in_non_allowed_group)
+
+ put "/assign/assign.json",
+ params: {
+ target_id: post.topic_id,
+ target_type: "Topic",
+ username: admin.username,
+ }
+
+ expect(response.status).to eq(403)
+ end
+
+ it "filters requests where assigned group is not allowed" do
+ sign_in(admin)
+
+ put "/assign/assign.json",
+ params: {
+ target_id: post.topic_id,
+ target_type: "Topic",
+ group_name: non_allowed_group.name,
+ }
+
+ expect(response.status).to eq(400)
+ end
+ end
+
+ describe "#suggestions" do
+ before { sign_in(admin) }
+
+ it "only includes users in allowed groups and not disallowed groups" do
+ Assigner.new(post.topic, admin).assign(allowed_user)
+
+ get "/assign/suggestions.json"
+ suggestions = JSON.parse(response.body)["suggestions"].map { |u| u["username"] }
+
+ expect(suggestions).to contain_exactly(allowed_user.username, admin.username)
+ expect(suggestions).to_not include(user_in_non_allowed_group)
+ end
+
+ it "does include only visible assign_allowed_on_groups" do
+ sign_in(non_admin_staff) # Need to use non-admin to test. Admins can see all groups
+
+ visible_group = Fabricate(:group, visibility_level: Group.visibility_levels[:members])
+ visible_group.add(non_admin_staff)
+ invisible_group = Fabricate(:group, visibility_level: Group.visibility_levels[:members])
+
+ SiteSetting.assign_allowed_on_groups = "#{visible_group.id}|#{invisible_group.id}"
+
+ get "/assign/suggestions.json"
+ assign_allowed_on_groups = JSON.parse(response.body)["assign_allowed_on_groups"]
+
+ expect(assign_allowed_on_groups).to contain_exactly(visible_group.name)
+ end
+
+ it "suggests the current user + the last 5 previously assigned users" do
+ assignees = 6.times.map { |_| assign_user_to_post.username }
+
+ get "/assign/suggestions.json"
+
+ suggestions = response.parsed_body["suggestions"].map { |u| u["username"] }
+ expect(suggestions).to contain_exactly(admin.username, *assignees[1..5])
+ end
+
+ it "doesn't suggest users on holiday" do
+ user_on_vacation = assign_user_to_post
+ user_on_vacation.upsert_custom_fields(
+ DiscourseAssign::DiscourseCalendar::HOLIDAY_CUSTOM_FIELD => "t",
+ )
+
+ get "/assign/suggestions.json"
+
+ suggestions = response.parsed_body["suggestions"].map { |u| u["username"] }
+ expect(suggestions).to_not include(user_on_vacation.username)
+ end
+
+ it "suggests the current user even if they're on holiday" do
+ admin.upsert_custom_fields(DiscourseAssign::DiscourseCalendar::HOLIDAY_CUSTOM_FIELD => "t")
+
+ get "/assign/suggestions.json"
+
+ suggestions = response.parsed_body["suggestions"].map { |u| u["username"] }
+ expect(suggestions).to include(admin.username)
+ end
+
+ it "excludes other users from the suggestions when they already reached the max assigns limit" do
+ SiteSetting.max_assigned_topics = 1
+ another_user = Fabricate(:user)
+ Fabricate(:post_assignment, assigned_to: another_user, assigned_by_user: admin)
+
+ get "/assign/suggestions.json"
+ suggestions = JSON.parse(response.body)["suggestions"].map { |u| u["username"] }
+
+ expect(suggestions).to contain_exactly(admin.username)
+ end
+
+ def assign_user_to_post
+ assignee = Fabricate(:user, groups: [allowed_group])
+ Fabricate(:post_assignment, assigned_to: assignee, assigned_by_user: admin)
+ assignee
+ end
+ end
+
+ describe "#assign" do
+ include_context "with group that is allowed to assign"
+
+ before do
+ sign_in(admin)
+ SiteSetting.enable_assign_status = true
+ end
+
+ it "assigns topic to a user" do
+ put "/assign/assign.json",
+ params: {
+ target_id: post.topic_id,
+ target_type: "Topic",
+ username: allowed_user.username,
+ }
+
+ expect(response.status).to eq(200)
+ expect(post.topic.reload.assignment.assigned_to_id).to eq(allowed_user.id)
+ end
+
+ it "assigns topic with note to a user" do
+ put "/assign/assign.json",
+ params: {
+ target_id: post.topic_id,
+ target_type: "Topic",
+ username: allowed_user.username,
+ note: "do dis pls",
+ }
+
+ expect(post.topic.reload.assignment.note).to eq("do dis pls")
+ end
+
+ it "assigns topic with a set status to a user" do
+ put "/assign/assign.json",
+ params: {
+ target_id: post.topic_id,
+ target_type: "Topic",
+ username: allowed_user.username,
+ status: "In Progress",
+ }
+
+ expect(post.topic.reload.assignment.status).to eq("In Progress")
+ end
+
+ it "assigns topic with default status to a user" do
+ put "/assign/assign.json",
+ params: {
+ target_id: post.topic_id,
+ target_type: "Topic",
+ username: allowed_user.username,
+ }
+
+ expect(post.topic.reload.assignment.status).to eq("New")
+ end
+
+ it "assigns topic to a group" do
+ put "/assign/assign.json",
+ params: {
+ target_id: post.topic_id,
+ target_type: "Topic",
+ group_name: assign_allowed_group.name,
+ }
+
+ expect(response.status).to eq(200)
+ expect(post.topic.reload.assignment.assigned_to).to eq(assign_allowed_group)
+ end
+
+ it "fails to assign topic to the user if its already assigned to the same user" do
+ put "/assign/assign.json",
+ params: {
+ target_id: post.topic_id,
+ target_type: "Topic",
+ username: allowed_user.username,
+ }
+
+ expect(response.status).to eq(200)
+ expect(post.topic.reload.assignment.assigned_to_id).to eq(allowed_user.id)
+
+ put "/assign/assign.json",
+ params: {
+ target_id: post.topic_id,
+ target_type: "Topic",
+ username: allowed_user.username,
+ }
+
+ expect(response.status).to eq(400)
+ expect(JSON.parse(response.body)["error"]).to eq(
+ I18n.t("discourse_assign.already_assigned", username: allowed_user.username),
+ )
+ end
+
+ it "fails to assign topic to the user if they already reached the max assigns limit" do
+ another_user = Fabricate(:user)
+ add_to_assign_allowed_group(another_user)
+ another_post = Fabricate(:post)
+ max_assigns = 1
+ SiteSetting.max_assigned_topics = max_assigns
+ Assigner.new(post.topic, admin).assign(another_user)
+
+ put "/assign/assign.json",
+ params: {
+ target_id: another_post.topic_id,
+ target_type: "Topic",
+ username: another_user.username,
+ }
+
+ expect(response.status).to eq(400)
+ expect(JSON.parse(response.body)["error"]).to eq(
+ I18n.t(
+ "discourse_assign.too_many_assigns",
+ username: another_user.username,
+ max: max_assigns,
+ ),
+ )
+ end
+
+ it "fails with a specific error message if the topic is a PM and the assignee can not see it" do
+ pm = Fabricate(:private_message_post, user: admin).topic
+ another_user = Fabricate(:user)
+ add_to_assign_allowed_group(another_user)
+ put "/assign/assign.json",
+ params: {
+ target_id: pm.id,
+ target_type: "Topic",
+ username: another_user.username,
+ }
+
+ expect(response.parsed_body["error"]).to eq(
+ I18n.t(
+ "discourse_assign.forbidden_assignee_not_pm_participant",
+ username: another_user.username,
+ ),
+ )
+ end
+
+ it "notifies the assignee when the topic is assigned to a group" do
+ admins = Group[:admins]
+ admins.messageable_level = Group::ALIAS_LEVELS[:everyone]
+ admins.assignable_level = Group::ALIAS_LEVELS[:everyone]
+ admins.save!
+
+ SiteSetting.invite_on_assign = true
+ pm = Fabricate(:private_message_post, user: admin).topic
+
+ another_user = Fabricate(:user)
+ admins.add(another_user)
+ admins
+ .group_users
+ .find_by(user_id: another_user.id)
+ .update!(notification_level: NotificationLevels.all[:watching])
+
+ Notification.delete_all
+ Jobs.run_immediately!
+
+ put "/assign/assign.json",
+ params: {
+ target_id: pm.id,
+ target_type: "Topic",
+ group_name: admins.name,
+ }
+
+ expect(Notification.count).to be > 0
+ end
+
+ it "does not notify the assignee when the topic is assigned to a group if should_notify option is set to false" do
+ admins = Group[:admins]
+ admins.messageable_level = Group::ALIAS_LEVELS[:everyone]
+ admins.assignable_level = Group::ALIAS_LEVELS[:everyone]
+ admins.save!
+
+ SiteSetting.invite_on_assign = true
+ pm = Fabricate(:private_message_post, user: admin).topic
+
+ another_user = Fabricate(:user)
+ admins.add(another_user)
+ admins
+ .group_users
+ .find_by(user_id: another_user.id)
+ .update!(notification_level: NotificationLevels.all[:watching])
+
+ Notification.delete_all
+ Jobs.run_immediately!
+
+ put "/assign/assign.json",
+ params: {
+ target_id: pm.id,
+ target_type: "Topic",
+ group_name: admins.name,
+ should_notify: false,
+ }
+ expect(Notification.count).to eq(0)
+ expect(SilencedAssignment.count).to eq(1)
+ end
+
+ it "fails with a specific error message if the topic is not a PM and the assignee can not see it" do
+ topic = Fabricate(:topic, category: Fabricate(:private_category, group: Fabricate(:group)))
+ another_user = Fabricate(:user)
+ add_to_assign_allowed_group(another_user)
+ put "/assign/assign.json",
+ params: {
+ target_id: topic.id,
+ target_type: "Topic",
+ username: another_user.username,
+ }
+
+ expect(response.parsed_body["error"]).to eq(
+ I18n.t(
+ "discourse_assign.forbidden_assignee_cant_see_topic",
+ username: another_user.username,
+ ),
+ )
+ end
+ end
+
+ describe "#assigned" do
+ fab!(:topic1) { Fabricate(:topic, bumped_at: 1.hour.from_now) }
+ fab!(:topic2) { Fabricate(:topic, bumped_at: 2.hour.from_now) }
+ fab!(:topic3) { Fabricate(:topic, bumped_at: 3.hour.from_now) }
+
+ fab!(:assignments) do
+ Fabricate(
+ :topic_assignment,
+ target: topic1,
+ assigned_to: allowed_user,
+ assigned_by_user: admin,
+ )
+ Fabricate(:topic_assignment, target: topic2, assigned_to: admin, assigned_by_user: admin)
+ Fabricate(
+ :topic_assignment,
+ target: topic3,
+ assigned_to: allowed_user,
+ assigned_by_user: admin,
+ )
+ end
+
+ before { sign_in(admin) }
+
+ it "lists topics ordered by user id" do
+ get "/assign/assigned.json"
+ expect(JSON.parse(response.body)["topics"].map { |t| t["id"] }).to match_array(
+ [topic2.id, topic1.id, topic3.id],
+ )
+
+ get "/assign/assigned.json", params: { limit: 2 }
+ expect(JSON.parse(response.body)["topics"].map { |t| t["id"] }).to match_array(
+ [topic3.id, topic2.id],
+ )
+
+ get "/assign/assigned.json", params: { offset: 2 }
+ expect(JSON.parse(response.body)["topics"].map { |t| t["id"] }).to match_array([topic1.id])
+ end
+
+ context "with custom allowed groups" do
+ let(:custom_allowed_group) { Fabricate(:group, name: "my-group") }
+ let(:other_user) { Fabricate(:user, groups: [custom_allowed_group]) }
+
+ before { SiteSetting.assign_allowed_on_groups += "|#{custom_allowed_group.id}" }
+
+ it "works for admins" do
+ get "/assign/assigned.json"
+ expect(response.status).to eq(200)
+ end
+
+ it "does not work for other groups" do
+ sign_in(other_user)
+ get "/assign/assigned.json"
+ expect(response.status).to eq(403)
+ end
+ end
+ end
+
+ describe "#group_members" do
+ fab!(:other_allowed_user) { Fabricate(:user, groups: [allowed_group]) }
+
+ fab!(:topic)
+ fab!(:post_in_same_topic) { Fabricate(:post, topic: topic) }
+
+ fab!(:assignments) do
+ Fabricate(
+ :topic_assignment,
+ assigned_to: other_allowed_user,
+ target: topic,
+ assigned_by_user: admin,
+ )
+
+ Fabricate(
+ :post_assignment,
+ assigned_to: other_allowed_user,
+ target: post_in_same_topic,
+ assigned_by_user: admin,
+ )
+
+ Fabricate(:topic_assignment, assigned_to: allowed_user, assigned_by_user: admin)
+ Fabricate(:topic_assignment, assigned_to: other_allowed_user, assigned_by_user: admin)
+
+ Fabricate(:topic_assignment, assigned_to: allowed_group, assigned_by_user: admin)
+ Fabricate(:post_assignment, assigned_to: allowed_group, assigned_by_user: admin)
+ end
+
+ describe "members" do
+ describe "without filter" do
+ it "list members ordered by the number of assignments" do
+ sign_in(admin)
+
+ get "/assign/members/#{allowed_group.name}.json"
+ members = JSON.parse(response.body)["members"]
+
+ expect(response.status).to eq(200)
+ expect(members[0]).to include({ "id" => other_allowed_user.id, "assignments_count" => 3 })
+ expect(members[1]).to include({ "id" => allowed_user.id, "assignments_count" => 1 })
+ end
+
+ it "doesn't include members with no assignments" do
+ sign_in(admin)
+ allowed_group.users << non_admin_staff
+
+ get "/assign/members/#{allowed_group.name}.json"
+ expect(response.status).to eq(200)
+ expect(JSON.parse(response.body)["members"].map { |m| m["id"] }).to_not include(
+ non_admin_staff.id,
+ )
+ end
+ end
+
+ describe "with filter" do
+ it "returns members as according to filter" do
+ sign_in(admin)
+
+ get "/assign/members/#{allowed_group.name}.json", params: { filter: "a" }
+ expect(response.status).to eq(200)
+ expect(JSON.parse(response.body)["members"].map { |m| m["id"] }).to match_array(
+ [other_allowed_user.id, allowed_user.id],
+ )
+
+ get "/assign/members/#{allowed_group.name}.json",
+ params: {
+ filter: "#{allowed_user.username}",
+ }
+ expect(response.status).to eq(200)
+ expect(JSON.parse(response.body)["members"].map { |m| m["id"] }).to match_array(
+ [allowed_user.id],
+ )
+
+ get "/assign/members/#{allowed_group.name}.json",
+ params: {
+ filter: "#{allowed_user.name}",
+ }
+ expect(response.status).to eq(200)
+ expect(JSON.parse(response.body)["members"].map { |m| m["id"] }).to match_array(
+ [allowed_user.id],
+ )
+ end
+ end
+ end
+
+ describe "assignment_count" do
+ it "returns the total number of assignments for group users and the group" do
+ sign_in(admin)
+
+ get "/assign/members/#{allowed_group.name}.json"
+
+ expect(JSON.parse(response.body)["assignment_count"]).to eq(6)
+ end
+ end
+
+ describe "group_assignment_count" do
+ it "returns the number of assignments assigned to the group" do
+ sign_in(admin)
+
+ get "/assign/members/#{allowed_group.name}.json"
+
+ expect(JSON.parse(response.body)["group_assignment_count"]).to eq(2)
+ end
+ end
+
+ it "404 error to non-group-members" do
+ normal_user = Fabricate(:user)
+
+ sign_in(normal_user)
+
+ get "/assign/members/#{allowed_group.name}.json"
+ expect(response.status).to eq(403)
+ end
+
+ it "allows non-member-admin" do
+ non_member_admin = Fabricate(:admin)
+
+ sign_in(non_member_admin)
+
+ get "/assign/members/#{allowed_group.name}.json"
+ expect(response.status).to eq(200)
+ end
+ end
+end
diff --git a/plugins/discourse-assign/spec/requests/list_controller_spec.rb b/plugins/discourse-assign/spec/requests/list_controller_spec.rb
new file mode 100644
index 00000000000..10bb7edf8fa
--- /dev/null
+++ b/plugins/discourse-assign/spec/requests/list_controller_spec.rb
@@ -0,0 +1,415 @@
+# frozen_string_literal: true
+
+require "rails_helper"
+require_relative "../support/assign_allowed_group"
+
+describe ListController do
+ before do
+ SiteSetting.personal_message_enabled_groups = Group::AUTO_GROUPS[:trust_level_0]
+ SiteSetting.assign_enabled = true
+ end
+
+ fab!(:user) { Fabricate(:active_user) }
+ fab!(:user2) { Fabricate(:user) }
+ let(:admin) { Fabricate(:admin) }
+ let(:post) { Fabricate(:post) }
+
+ describe "only allow users from allowed groups" do
+ include_context "with group that is allowed to assign"
+
+ it "filters requests where current_user is not member of an allowed group" do
+ sign_in(user)
+ SiteSetting.assign_allowed_on_groups = ""
+
+ get "/topics/group-topics-assigned/#{get_assigned_allowed_group_name}.json"
+ expect(response.status).to eq(403)
+
+ get "/topics/messages-assigned/#{user.username_lower}.json"
+ expect(response.status).to eq(403)
+ end
+
+ it "as an anon user" do
+ get "/topics/group-topics-assigned/#{get_assigned_allowed_group_name}.json"
+ expect(response.status).to eq(403)
+
+ get "/topics/messages-assigned/#{user.username_lower}.json"
+ expect(response.status).to eq(403)
+ end
+
+ it "as an admin user" do
+ sign_in(admin)
+ get "/topics/group-topics-assigned/#{get_assigned_allowed_group_name}.json"
+ expect(response.status).to eq(200)
+
+ get "/topics/messages-assigned/#{user.username_lower}.json"
+ expect(response.status).to eq(200)
+ end
+ end
+
+ describe "#group_topics_assigned" do
+ include_context "with group that is allowed to assign"
+
+ fab!(:post1) { Fabricate(:post) }
+ fab!(:post2) { Fabricate(:post) }
+ fab!(:post3) { Fabricate(:post) }
+ fab!(:topic) { post3.topic }
+ fab!(:topic1) { post1.topic }
+ fab!(:topic2) { post2.topic }
+
+ before do
+ add_to_assign_allowed_group(user)
+
+ Assigner.new(topic1, user).assign(user)
+ Assigner.new(topic2, user).assign(user2)
+
+ sign_in(user)
+ end
+
+ it "returns user-assigned-topics-list of users in the assigned_allowed_group and doesnt include deleted topic" do
+ get "/topics/group-topics-assigned/#{get_assigned_allowed_group_name}.json"
+ expect(
+ JSON.parse(response.body)["topic_list"]["topics"].map { |t| t["assigned_to_user"]["id"] },
+ ).to match_array([user.id])
+ end
+
+ it "returns user-assigned-topics-list of users in the assigned_allowed_group and doesnt include inactive topics" do
+ Assignment.where(assigned_to: user, target: topic1).update_all(active: false)
+
+ get "/topics/group-topics-assigned/#{get_assigned_allowed_group_name}.json"
+ expect(response.parsed_body["topic_list"]["topics"]).to be_empty
+ end
+
+ it "returns empty user-assigned-topics-list for users not in the assigned_allowed_group" do
+ ids = []
+ get "/topics/group-topics-assigned/#{get_assigned_allowed_group_name}.json"
+ JSON.parse(response.body)["topic_list"]["topics"].each do |t|
+ ids.push(t["assigned_to_user"]["id"]) if t["assigned_to_user"]["id"] == user2.id
+ end
+ expect(ids).to be_empty
+ end
+
+ it "doesnt returns deleted topics" do
+ sign_in(admin)
+
+ Assigner.new(topic, user).assign(user)
+
+ delete "/t/#{topic.id}.json"
+
+ topic.reload
+
+ id = 0
+ get "/topics/group-topics-assigned/#{get_assigned_allowed_group_name}.json"
+
+ JSON.parse(response.body)["topic_list"]["topics"].each do |t|
+ id = t.id if t["id"] == topic.id
+ end
+
+ expect(id).to eq(0)
+ end
+ end
+
+ describe "#sorting messages_assigned and group_topics_assigned" do
+ include_context "with group that is allowed to assign"
+
+ fab!(:post1) { Fabricate(:post) }
+ fab!(:post2) { Fabricate(:post) }
+ fab!(:post3) { Fabricate(:post) }
+ fab!(:topic1) { post1.topic }
+ fab!(:topic2) { post2.topic }
+ fab!(:topic3) { post3.topic }
+
+ before do
+ add_to_assign_allowed_group(user)
+ add_to_assign_allowed_group(user2)
+
+ Assigner.new(post1.topic, user).assign(user)
+ Assigner.new(post2.topic, user).assign(user2)
+ Assigner.new(post3.topic, user).assign(user)
+
+ sign_in(user)
+ end
+
+ it "group_topics_assigned returns sorted topicsList" do
+ topic1.bumped_at = Time.now
+ topic2.bumped_at = 1.day.ago
+ topic3.bumped_at = 3.day.ago
+
+ topic1.views = 3
+ topic2.views = 5
+ topic3.views = 1
+
+ topic1.posts_count = 3
+ topic2.posts_count = 1
+ topic3.posts_count = 5
+
+ topic1.save!
+ topic2.save!
+ topic3.save!
+
+ get "/topics/group-topics-assigned/#{get_assigned_allowed_group_name}.json?order=posts"
+ expect(JSON.parse(response.body)["topic_list"]["topics"].map { |t| t["id"] }).to match_array(
+ [topic2.id, topic1.id, topic3.id],
+ )
+
+ get "/topics/group-topics-assigned/#{get_assigned_allowed_group_name}.json?order=views"
+ expect(JSON.parse(response.body)["topic_list"]["topics"].map { |t| t["id"] }).to match_array(
+ [topic3.id, topic1.id, topic2.id],
+ )
+
+ get "/topics/group-topics-assigned/#{get_assigned_allowed_group_name}.json?order=activity"
+ expect(JSON.parse(response.body)["topic_list"]["topics"].map { |t| t["id"] }).to match_array(
+ [topic3.id, topic2.id, topic1.id],
+ )
+
+ get "/topics/group-topics-assigned/#{get_assigned_allowed_group_name}.json?order=posts&ascending=true"
+ expect(JSON.parse(response.body)["topic_list"]["topics"].map { |t| t["id"] }).to match_array(
+ [topic3.id, topic1.id, topic2.id],
+ )
+
+ get "/topics/group-topics-assigned/#{get_assigned_allowed_group_name}.json?order=views&ascending=true"
+ expect(JSON.parse(response.body)["topic_list"]["topics"].map { |t| t["id"] }).to match_array(
+ [topic2.id, topic1.id, topic3.id],
+ )
+
+ get "/topics/group-topics-assigned/#{get_assigned_allowed_group_name}.json?order=activity&ascending=true"
+ expect(JSON.parse(response.body)["topic_list"]["topics"].map { |t| t["id"] }).to match_array(
+ [topic1.id, topic2.id, topic3.id],
+ )
+ end
+
+ it "messages_assigned returns sorted topicsList" do
+ topic1.bumped_at = Time.now
+ topic3.bumped_at = 3.day.ago
+
+ topic1.views = 3
+ topic3.views = 1
+
+ topic1.posts_count = 3
+ topic3.posts_count = 5
+
+ topic1.reload
+ topic3.reload
+
+ get "/topics/messages-assigned/#{user.username}.json?order=posts"
+ expect(JSON.parse(response.body)["topic_list"]["topics"].map { |t| t["id"] }).to match_array(
+ [topic1.id, topic3.id],
+ )
+
+ get "/topics/messages-assigned/#{user.username}.json?order=views"
+ expect(JSON.parse(response.body)["topic_list"]["topics"].map { |t| t["id"] }).to match_array(
+ [topic3.id, topic1.id],
+ )
+
+ get "/topics/messages-assigned/#{user.username}.json?order=activity"
+ expect(JSON.parse(response.body)["topic_list"]["topics"].map { |t| t["id"] }).to match_array(
+ [topic3.id, topic1.id],
+ )
+
+ get "/topics/messages-assigned/#{user.username}.json?order=posts&ascending=true"
+ expect(JSON.parse(response.body)["topic_list"]["topics"].map { |t| t["id"] }).to match_array(
+ [topic3.id, topic1.id],
+ )
+
+ get "/topics/messages-assigned/#{user.username}.json?order=views&ascending=true"
+ expect(JSON.parse(response.body)["topic_list"]["topics"].map { |t| t["id"] }).to match_array(
+ [topic1.id, topic3.id],
+ )
+
+ get "/topics/messages-assigned/#{user.username}.json?order=activity&ascending=true"
+ expect(JSON.parse(response.body)["topic_list"]["topics"].map { |t| t["id"] }).to match_array(
+ [topic1.id, topic3.id],
+ )
+ end
+ end
+
+ describe "filtering of topics as per parameter" do
+ include_context "with group that is allowed to assign"
+
+ fab!(:post1) { Fabricate(:post) }
+ fab!(:post2) { Fabricate(:post) }
+ fab!(:post3) { Fabricate(:post) }
+ fab!(:topic1) { post1.topic }
+ fab!(:topic2) { post2.topic }
+ fab!(:topic3) { post3.topic }
+
+ before do
+ SearchIndexer.enable
+
+ add_to_assign_allowed_group(user)
+ add_to_assign_allowed_group(user2)
+
+ Assigner.new(post1.topic, user).assign(user)
+ Assigner.new(post2.topic, user).assign(user2)
+ Assigner.new(post3.topic, user).assign(user)
+
+ sign_in(user)
+ end
+
+ after { SearchIndexer.disable }
+
+ it "returns topics as per filter for #group_topics_assigned" do
+ topic1.title = "QUnit testing is love"
+ topic2.title = "RSpec testing is too fun"
+ topic3.title = "Testing is main part of programming"
+
+ topic1.save!
+ topic2.save!
+ topic3.save!
+
+ get "/topics/group-topics-assigned/#{get_assigned_allowed_group_name}.json",
+ params: {
+ search: "Testing",
+ }
+ expect(JSON.parse(response.body)["topic_list"]["topics"].map { |t| t["id"] }).to match_array(
+ [topic1.id, topic2.id, topic3.id],
+ )
+
+ get "/topics/group-topics-assigned/#{get_assigned_allowed_group_name}.json",
+ params: {
+ search: "RSpec",
+ }
+ expect(JSON.parse(response.body)["topic_list"]["topics"].map { |t| t["id"] }).to match_array(
+ [topic2.id],
+ )
+
+ get "/topics/group-topics-assigned/#{get_assigned_allowed_group_name}.json",
+ params: {
+ search: "love",
+ }
+ expect(JSON.parse(response.body)["topic_list"]["topics"].map { |t| t["id"] }).to match_array(
+ [topic1.id],
+ )
+ end
+
+ it "returns topics as per filter for #group_topics_assigned" do
+ topic1.title = "QUnit testing is love"
+ topic2.title = "RSpec testing is too fun"
+ topic3.title = "Testing is main part of programming"
+
+ topic1.save!
+ topic2.save!
+ topic3.save!
+
+ get "/topics/messages-assigned/#{user.username}.json", params: { search: "Testing" }
+ expect(JSON.parse(response.body)["topic_list"]["topics"].map { |t| t["id"] }).to match_array(
+ [topic1.id, topic3.id],
+ )
+
+ get "/topics/group-topics-assigned/#{get_assigned_allowed_group_name}.json",
+ params: {
+ search: "love",
+ }
+ expect(JSON.parse(response.body)["topic_list"]["topics"].map { |t| t["id"] }).to match_array(
+ [topic1.id],
+ )
+ end
+ end
+
+ describe "#messages_assigned" do
+ include_context "with group that is allowed to assign"
+
+ fab!(:post1) { Fabricate(:post) }
+ fab!(:post2) { Fabricate(:post) }
+
+ before do
+ add_to_assign_allowed_group(user)
+
+ Assigner.new(post1.topic, user).assign(user)
+ Assigner.new(post2.topic, user).assign(user2)
+
+ sign_in(user)
+ end
+
+ it "returns user-assigned-topics-list of given user" do
+ get "/topics/messages-assigned/#{user.username_lower}.json"
+ expect(
+ JSON.parse(response.body)["topic_list"]["topics"].map { |t| t["assigned_to_user"]["id"] },
+ ).to match_array([user.id])
+ end
+
+ it "returns empty user-assigned-topics-list for given user not in the assigned_allowed_group" do
+ get "/topics/messages-assigned/#{user2.username_lower}.json"
+ expect(JSON.parse(response.body)["topic_list"]["topics"]).to be_empty
+ end
+ end
+
+ describe "#private_messages_assigned" do
+ fab!(:group) { Fabricate(:group, users: [user]) }
+ fab!(:pm) { Fabricate(:topic, archetype: Archetype.private_message, category_id: nil) }
+ fab!(:topic) { Fabricate(:topic, user: user) }
+ fab!(:pm_post) { Fabricate(:post, topic: pm) }
+ fab!(:post) { Fabricate(:post, topic: topic) }
+
+ before do
+ SiteSetting.assign_allowed_on_groups = "#{group.id}"
+ Fabricate(:topic_allowed_user, user: user, topic: pm)
+ Assigner.new(pm, user).assign(user)
+ Assigner.new(topic, user).assign(user)
+ end
+
+ it "returns assigned messages for user" do
+ sign_in(user)
+
+ get "/topics/private-messages-assigned/#{user.username_lower}.json"
+
+ expect(JSON.parse(response.body)["topic_list"]["topics"].map { |t| t["id"] }).to eq([pm.id])
+ end
+ end
+
+ describe "#filter" do
+ include_context "with group that is allowed to assign"
+
+ fab!(:group) { Fabricate(:group, assignable_level: Group::ALIAS_LEVELS[:mods_and_admins]) }
+
+ fab!(:topic_1) { Fabricate(:topic) }
+ fab!(:topic_2) { Fabricate(:topic) }
+ fab!(:topic_3) { Fabricate(:topic) }
+
+ fab!(:post_1) { Fabricate(:post, topic: topic_1) }
+ fab!(:post_2) { Fabricate(:post, topic: topic_2) }
+ fab!(:post_3) { Fabricate(:post, topic: topic_3) }
+
+ describe "when user cannot assign" do
+ it "ignores the assign filter" do
+ add_to_assign_allowed_group(user)
+
+ Assigner.new(topic_1, user).assign(user)
+
+ get "/filter", params: { q: "assigned:#{user.username_lower}", format: :json }
+
+ expect(response.status).to eq(200)
+ expect(
+ response.parsed_body.dig("topic_list", "topics").map { _1["id"] },
+ ).to contain_exactly(topic_1.id, topic_2.id, topic_3.id)
+ end
+ end
+
+ describe "when user can assign" do
+ before { sign_in(admin) }
+
+ it "filters topics by assigned user" do
+ add_to_assign_allowed_group(user)
+
+ Assigner.new(topic_1, admin).assign(user)
+
+ get "/filter", params: { q: "assigned:#{user.username_lower}", format: :json }
+
+ expect(response.status).to eq(200)
+ expect(
+ response.parsed_body.dig("topic_list", "topics").map { _1["id"] },
+ ).to contain_exactly(topic_1.id)
+ end
+
+ it "filters topics by assigned group" do
+ Assigner.new(topic_2, admin).assign(group)
+
+ get "/filter", params: { q: "assigned:#{group.name}", format: :json }
+
+ expect(response.status).to eq(200)
+ expect(
+ response.parsed_body.dig("topic_list", "topics").map { _1["id"] },
+ ).to contain_exactly(topic_2.id)
+ end
+ end
+ end
+end
diff --git a/plugins/discourse-assign/spec/requests/search_controller_spec.rb b/plugins/discourse-assign/spec/requests/search_controller_spec.rb
new file mode 100644
index 00000000000..24dab9e1030
--- /dev/null
+++ b/plugins/discourse-assign/spec/requests/search_controller_spec.rb
@@ -0,0 +1,55 @@
+# frozen_string_literal: true
+
+require "rails_helper"
+
+describe SearchController do
+ fab!(:admin)
+ fab!(:group) do
+ Fabricate(
+ :group,
+ assignable_level: Group::ALIAS_LEVELS[:everyone],
+ flair_upload: Fabricate(:upload),
+ )
+ end
+
+ before do
+ SiteSetting.assign_enabled = true
+ sign_in(admin)
+ end
+
+ after { Discourse.redis.flushdb }
+
+ it "include assigned group in search result" do
+ SearchIndexer.enable
+ SiteSetting.use_pg_headlines_for_excerpt = true
+
+ post = Fabricate(:post, topic: Fabricate(:topic, title: "this is an awesome title"))
+
+ Assigner.new(post.topic, admin).assign(group)
+
+ get "/search/query.json", params: { term: "awesome" }
+
+ expect(response.status).to eq(200)
+ assigned_to_group_data = response.parsed_body["topics"][0]["assigned_to_group"]
+
+ expect(assigned_to_group_data["id"]).to eq(group.id)
+ expect(assigned_to_group_data["name"]).to eq(group.name)
+ end
+
+ it "does not result in N+1 queries when search returns multiple results" do
+ SearchIndexer.enable
+ SiteSetting.assigns_public = true
+ post = Fabricate(:post, topic: Fabricate(:topic, title: "this is an awesome title"))
+
+ get "/search/query.json", params: { term: "awesome" }
+
+ initial_sql_queries_count =
+ track_sql_queries { get "/search/query.json", params: { term: "awesome" } }.count
+
+ Fabricate(:post, topic: Fabricate(:topic, title: "this is an awesome title 2"))
+ Fabricate(:post, topic: Fabricate(:topic, title: "this is an awesome title 3"))
+ new_sql_queries_count =
+ track_sql_queries { get "/search/query.json", params: { term: "awesome" } }.count
+ expect(new_sql_queries_count).to eq(initial_sql_queries_count)
+ end
+end
diff --git a/plugins/discourse-assign/spec/serializers/flagged_topic_serializer_spec.rb b/plugins/discourse-assign/spec/serializers/flagged_topic_serializer_spec.rb
new file mode 100644
index 00000000000..2e9db012207
--- /dev/null
+++ b/plugins/discourse-assign/spec/serializers/flagged_topic_serializer_spec.rb
@@ -0,0 +1,80 @@
+# frozen_string_literal: true
+
+require "rails_helper"
+require_relative "../support/assign_allowed_group"
+
+describe FlaggedTopicSerializer do
+ fab!(:user)
+ let(:guardian) { Guardian.new(user) }
+
+ include_context "with group that is allowed to assign"
+
+ before do
+ SiteSetting.assign_enabled = true
+ add_to_assign_allowed_group(user)
+ end
+
+ context "when there are no assignments" do
+ let(:topic) { Fabricate(:topic) }
+
+ it "does not include assignment attributes" do
+ json = FlaggedTopicSerializer.new(topic, scope: guardian).as_json
+
+ expect(json[:flagged_topic]).to_not have_key(:assigned_to_user)
+ expect(json[:flagged_topic]).to_not have_key(:assigned_to_group)
+ end
+ end
+
+ context "when there is a user assignment" do
+ let(:topic) do
+ topic =
+ Fabricate(:topic, topic_allowed_users: [Fabricate.build(:topic_allowed_user, user: user)])
+
+ topic.posts << Fabricate(:post)
+
+ Assigner.new(topic, user).assign(user)
+ topic
+ end
+
+ it "includes the assigned_to_user attribute" do
+ json = FlaggedTopicSerializer.new(topic, scope: guardian).as_json
+
+ expect(json[:flagged_topic][:assigned_to_user]).to match(
+ { username: user.username, name: user.name, avatar_template: /letter_avatar_proxy.*/ },
+ )
+ expect(json[:flagged_topic]).to_not have_key(:assigned_to_group)
+ end
+ end
+
+ context "when there is a group assignment" do
+ let(:topic) do
+ topic =
+ Fabricate(
+ :topic,
+ topic_allowed_groups: [
+ Fabricate.build(:topic_allowed_group, group: assign_allowed_group),
+ ],
+ )
+
+ topic.posts << Fabricate(:post)
+
+ Assigner.new(topic, user).assign(assign_allowed_group)
+ topic
+ end
+
+ it "includes the assigned_to_group attribute" do
+ json = FlaggedTopicSerializer.new(topic, scope: guardian).as_json
+
+ expect(json[:flagged_topic][:assigned_to_group]).to match(
+ {
+ name: assign_allowed_group.name,
+ flair_bg_color: assign_allowed_group.flair_bg_color,
+ flair_color: assign_allowed_group.flair_color,
+ flair_icon: assign_allowed_group.flair_icon,
+ flair_upload_id: assign_allowed_group.flair_upload_id,
+ },
+ )
+ expect(json[:flagged_topic]).to_not have_key(:assigned_to_user)
+ end
+ end
+end
diff --git a/plugins/discourse-assign/spec/serializers/group_show_serializer_spec.rb b/plugins/discourse-assign/spec/serializers/group_show_serializer_spec.rb
new file mode 100644
index 00000000000..68793e1be97
--- /dev/null
+++ b/plugins/discourse-assign/spec/serializers/group_show_serializer_spec.rb
@@ -0,0 +1,28 @@
+# frozen_string_literal: true
+
+require "rails_helper"
+
+RSpec.describe GroupShowSerializer do
+ fab!(:user)
+ fab!(:group) { Fabricate(:group, assignable_level: Group::ALIAS_LEVELS[:everyone]) }
+ fab!(:group_user) { Fabricate(:group_user, group: group, user: user) }
+ fab!(:topic)
+ fab!(:post) { Fabricate(:post, topic: topic) }
+ fab!(:topic2) { Fabricate(:topic) }
+ fab!(:post2) { Fabricate(:post, topic: topic2) }
+ let(:guardian) { Guardian.new(user) }
+ let(:serializer) { described_class.new(group, scope: guardian) }
+
+ before do
+ SiteSetting.assign_enabled = true
+ SiteSetting.assign_allowed_on_groups = group.id.to_s
+ end
+
+ it "counts assigned users and groups" do
+ Assigner.new(topic, user).assign(user)
+ expect(serializer.as_json[:group_show][:assignment_count]).to eq(1)
+
+ Assigner.new(topic2, user).assign(group)
+ expect(serializer.as_json[:group_show][:assignment_count]).to eq(2)
+ end
+end
diff --git a/plugins/discourse-assign/spec/serializers/post_serializer_spec.rb b/plugins/discourse-assign/spec/serializers/post_serializer_spec.rb
new file mode 100644
index 00000000000..8b61d9f795a
--- /dev/null
+++ b/plugins/discourse-assign/spec/serializers/post_serializer_spec.rb
@@ -0,0 +1,60 @@
+# frozen_string_literal: true
+
+require "rails_helper"
+require_relative "../support/assign_allowed_group"
+
+describe PostSerializer do
+ fab!(:user)
+ fab!(:topic)
+ fab!(:post) { Fabricate(:post, topic: topic) }
+ let(:guardian) { Guardian.new(user) }
+
+ include_context "with group that is allowed to assign"
+
+ before do
+ SiteSetting.assign_enabled = true
+ add_to_assign_allowed_group(user)
+ end
+
+ it "includes assigned user in serializer" do
+ Assigner.new(post, user).assign(user)
+ serializer = PostSerializer.new(post, scope: guardian)
+ post = serializer.as_json[:post]
+ expect(post[:assigned_to_user][:id]).to eq(user.id)
+ expect(post[:assigned_to_group]).to be(nil)
+ end
+
+ it "includes assigned group in serializer" do
+ Assigner.new(post, user).assign(assign_allowed_group)
+ serializer = PostSerializer.new(post, scope: guardian)
+ post = serializer.as_json[:post]
+ expect(post[:assigned_to_group][:id]).to eq(assign_allowed_group.id)
+ expect(post[:assigned_to_user]).to be(nil)
+ end
+
+ it "includes note in serializer" do
+ Assigner.new(post, user).assign(user, note: "tomtom best")
+ serializer = PostSerializer.new(post, scope: guardian)
+ expect(serializer.as_json[:post][:assignment_note]).to eq("tomtom best")
+ end
+
+ context "when status is enabled" do
+ before { SiteSetting.enable_assign_status = true }
+
+ it "includes status in serializer" do
+ Assigner.new(post, user).assign(user, status: "Done")
+ serializer = PostSerializer.new(post, scope: guardian)
+ expect(serializer.as_json[:post][:assignment_status]).to eq("Done")
+ end
+ end
+
+ context "when status is disabled" do
+ before { SiteSetting.enable_assign_status = false }
+
+ it "doesn't include status in serializer" do
+ Assigner.new(post, user).assign(user, status: "Done")
+ serializer = PostSerializer.new(post, scope: guardian)
+ expect(serializer.as_json[:post][:assignment_status]).not_to eq("Done")
+ end
+ end
+end
diff --git a/plugins/discourse-assign/spec/serializers/suggested_topic_serializer_spec.rb b/plugins/discourse-assign/spec/serializers/suggested_topic_serializer_spec.rb
new file mode 100644
index 00000000000..c185b56741a
--- /dev/null
+++ b/plugins/discourse-assign/spec/serializers/suggested_topic_serializer_spec.rb
@@ -0,0 +1,29 @@
+# frozen_string_literal: true
+
+require "rails_helper"
+
+RSpec.describe SuggestedTopicSerializer do
+ fab!(:user)
+ fab!(:group) { Fabricate(:group, assignable_level: Group::ALIAS_LEVELS[:everyone]) }
+ fab!(:group_user) { Fabricate(:group_user, group: group, user: user) }
+ fab!(:topic)
+ fab!(:post) { Fabricate(:post, topic: topic) }
+ fab!(:topic2) { Fabricate(:topic) }
+ fab!(:post2) { Fabricate(:post, topic: topic2) }
+ fab!(:guardian) { Guardian.new(user) }
+ fab!(:serializer) { described_class.new(topic, scope: guardian) }
+ fab!(:serializer2) { described_class.new(topic2, scope: guardian) }
+
+ before do
+ SiteSetting.assign_enabled = true
+ SiteSetting.assign_allowed_on_groups = group.id.to_s
+ end
+
+ it "adds information about assignee for users and groups" do
+ Assigner.new(topic, user).assign(user)
+ expect(serializer.as_json[:suggested_topic][:assigned_to_user][:username]).to eq(user.username)
+
+ Assigner.new(topic2, user).assign(group)
+ expect(serializer2.as_json[:suggested_topic][:assigned_to_group][:name]).to eq(group.name)
+ end
+end
diff --git a/plugins/discourse-assign/spec/serializers/topic_list_serializer_spec.rb b/plugins/discourse-assign/spec/serializers/topic_list_serializer_spec.rb
new file mode 100644
index 00000000000..25373277481
--- /dev/null
+++ b/plugins/discourse-assign/spec/serializers/topic_list_serializer_spec.rb
@@ -0,0 +1,100 @@
+# frozen_string_literal: true
+
+require "rails_helper"
+require_relative "../support/assign_allowed_group"
+
+RSpec.describe TopicListSerializer do
+ fab!(:user)
+
+ let(:private_message_topic) do
+ topic =
+ Fabricate(
+ :private_message_topic,
+ topic_allowed_users: [Fabricate.build(:topic_allowed_user, user: user)],
+ )
+ topic.posts << Fabricate(:post)
+ topic
+ end
+
+ let(:assigned_topic) do
+ topic =
+ Fabricate(
+ :private_message_topic,
+ topic_allowed_users: [Fabricate.build(:topic_allowed_user, user: user)],
+ )
+
+ topic.posts << Fabricate(:post)
+
+ Assigner.new(topic, user).assign(user)
+ topic
+ end
+
+ let(:guardian) { Guardian.new(user) }
+ let(:serializer) { TopicListSerializer.new(topic_list, scope: guardian) }
+
+ include_context "with group that is allowed to assign"
+
+ before do
+ SiteSetting.assign_enabled = true
+ add_to_assign_allowed_group(user)
+ end
+
+ describe "#assigned_messages_count" do
+ let(:topic_list) do
+ TopicQuery.new(user, assigned: user.username).list_private_messages_assigned(user)
+ end
+
+ before { assigned_topic }
+
+ it "should include right attribute" do
+ expect(serializer.as_json[:topic_list][:assigned_messages_count]).to eq(1)
+ end
+
+ describe "when not viewing assigned list" do
+ let(:topic_list) { TopicQuery.new(user).list_private_messages_assigned(user) }
+
+ describe "as an admin user" do
+ let(:guardian) { Guardian.new(Fabricate(:admin)) }
+
+ it "should not include the attribute" do
+ expect(serializer.as_json[:topic_list][:assigned_messages_count]).to eq(nil)
+ end
+ end
+
+ describe "as an anon user" do
+ let(:guardian) { Guardian.new }
+
+ it "should not include the attribute" do
+ expect(serializer.as_json[:topic_list][:assigned_messages_count]).to eq(nil)
+ end
+ end
+ end
+
+ describe "viewing another user" do
+ describe "as an anon user" do
+ let(:guardian) { Guardian.new }
+
+ it "should not include the attribute" do
+ expect(serializer.as_json[:topic_list][:assigned_messages_count]).to eq(nil)
+ end
+ end
+
+ describe "as a staff" do
+ let(:admin) { Fabricate(:admin) }
+ let(:guardian) { Guardian.new(admin) }
+
+ it "should include the right attribute" do
+ expect(serializer.as_json[:topic_list][:assigned_messages_count]).to eq(1)
+ end
+ end
+
+ describe "as a normal user" do
+ let(:guardian) { Guardian.new(Fabricate(:user)) }
+
+ it "should not include the attribute" do
+ expect(serializer.as_json[:topic_list][:assigned_messages_count]).to eq(nil)
+ end
+ end
+ end
+ end
+end
diff --git a/plugins/discourse-assign/spec/serializers/topic_view_serializer_spec.rb b/plugins/discourse-assign/spec/serializers/topic_view_serializer_spec.rb
new file mode 100644
index 00000000000..cd8acf9f656
--- /dev/null
+++ b/plugins/discourse-assign/spec/serializers/topic_view_serializer_spec.rb
@@ -0,0 +1,85 @@
+# frozen_string_literal: true
+
+require "rails_helper"
+require_relative "../support/assign_allowed_group"
+
+RSpec.describe TopicViewSerializer do
+ fab!(:user)
+ fab!(:topic)
+ fab!(:post) { Fabricate(:post, topic: topic) }
+ let(:guardian) { Guardian.new(user) }
+
+ include_context "with group that is allowed to assign"
+
+ before do
+ SiteSetting.assign_enabled = true
+ add_to_assign_allowed_group(user)
+ end
+
+ it "includes assigned user in serializer" do
+ Assigner.new(topic, user).assign(user)
+ serializer = TopicViewSerializer.new(TopicView.new(topic), scope: guardian)
+ expect(serializer.as_json[:topic_view][:assigned_to_user][:name]).to eq(user.name)
+ expect(serializer.as_json[:topic_view][:assigned_to_user][:username]).to eq(user.username)
+ expect(serializer.as_json[:topic_view][:assigned_to_group]).to be nil
+ end
+
+ it "includes assigned group in serializer" do
+ Assigner.new(topic, user).assign(assign_allowed_group)
+ serializer = TopicViewSerializer.new(TopicView.new(topic), scope: guardian)
+ expect(serializer.as_json[:topic_view][:assigned_to_group][:name]).to eq(
+ assign_allowed_group.name,
+ )
+ expect(serializer.as_json[:topic_view][:assigned_to_user]).to be nil
+ end
+
+ it "includes note in serializer" do
+ Assigner.new(topic, user).assign(user, note: "note me down")
+ serializer = TopicViewSerializer.new(TopicView.new(topic), scope: guardian)
+ expect(serializer.as_json[:topic_view][:assignment_note]).to eq("note me down")
+ end
+
+ it "includes indirectly_assigned_to notes in serializer" do
+ Assigner.new(post, user).assign(user, note: "note me down")
+ serializer = TopicViewSerializer.new(TopicView.new(topic), scope: guardian)
+ expect(
+ serializer.as_json[:topic_view][:indirectly_assigned_to][post.id][:assignment_note],
+ ).to eq("note me down")
+ end
+
+ context "when status is enabled" do
+ before { SiteSetting.enable_assign_status = true }
+
+ it "includes status in serializer" do
+ Assigner.new(topic, user).assign(user, status: "Done")
+ serializer = TopicViewSerializer.new(TopicView.new(topic), scope: guardian)
+ expect(serializer.as_json[:topic_view][:assignment_status]).to eq("Done")
+ end
+
+ it "includes indirectly_assigned_to status in serializer" do
+ Assigner.new(post, user).assign(user, status: "Done")
+ serializer = TopicViewSerializer.new(TopicView.new(topic), scope: guardian)
+ expect(
+ serializer.as_json[:topic_view][:indirectly_assigned_to][post.id][:assignment_status],
+ ).to eq("Done")
+ end
+ end
+
+ context "when status is disabled" do
+ before { SiteSetting.enable_assign_status = false }
+
+ it "doesn't include status in serializer" do
+ Assigner.new(topic, user).assign(user, status: "Done")
+ serializer = TopicViewSerializer.new(TopicView.new(topic), scope: guardian)
+ expect(serializer.as_json[:topic_view][:assignment_status]).not_to eq("Done")
+ end
+
+ it "doesn't include indirectly_assigned_to status in serializer" do
+ Assigner.new(post, user).assign(user, status: "Done")
+ serializer = TopicViewSerializer.new(TopicView.new(topic), scope: guardian)
+ expect(
+ serializer.as_json[:topic_view][:indirectly_assigned_to][post.id][:assignment_status],
+ ).not_to eq("Done")
+ end
+ end
+end
diff --git a/plugins/discourse-assign/spec/serializers/user_bookmark_base_serializer_spec.rb b/plugins/discourse-assign/spec/serializers/user_bookmark_base_serializer_spec.rb
new file mode 100644
index 00000000000..93a60891753
--- /dev/null
+++ b/plugins/discourse-assign/spec/serializers/user_bookmark_base_serializer_spec.rb
@@ -0,0 +1,60 @@
+# frozen_string_literal: true
+
+require "rails_helper"
+require_relative "../support/assign_allowed_group"
+
+describe UserBookmarkBaseSerializer do
+ include_context "with group that is allowed to assign"
+
+ before do
+ SiteSetting.assign_enabled = true
+ add_to_assign_allowed_group(user)
+ end
+
+ fab!(:user)
+ fab!(:topic)
+ fab!(:post) { Fabricate(:post, topic: topic) }
+ let(:guardian) { Guardian.new(user) }
+
+ context "for Topic bookmarkable" do
+ let!(:bookmark) { Fabricate(:bookmark, user: user, bookmarkable: post.topic) }
+ it "includes assigned user in serializer" do
+ Assigner.new(topic, user).assign(user)
+ serializer = UserTopicBookmarkSerializer.new(bookmark, scope: guardian)
+ bookmark = serializer.as_json[:user_topic_bookmark]
+
+ expect(bookmark[:assigned_to_user][:id]).to eq(user.id)
+ expect(bookmark[:assigned_to_group]).to be(nil)
+ end
+
+ it "includes assigned group in serializer" do
+ Assigner.new(topic, user).assign(assign_allowed_group)
+ serializer = UserTopicBookmarkSerializer.new(bookmark, scope: guardian)
+ bookmark = serializer.as_json[:user_topic_bookmark]
+
+ expect(bookmark[:assigned_to_group][:id]).to eq(assign_allowed_group.id)
+ expect(bookmark[:assigned_to_user]).to be(nil)
+ end
+ end
+
+ context "for Post bookmarkable" do
+ let!(:bookmark) { Fabricate(:bookmark, user: user, bookmarkable: post) }
+ it "includes assigned user in serializer" do
+ Assigner.new(topic, user).assign(user)
+ serializer = UserPostBookmarkSerializer.new(bookmark, scope: guardian)
+ bookmark = serializer.as_json[:user_post_bookmark]
+
+ expect(bookmark[:assigned_to_user][:id]).to eq(user.id)
+ expect(bookmark[:assigned_to_group]).to be(nil)
+ end
+
+ it "includes assigned group in serializer" do
+ Assigner.new(topic, user).assign(assign_allowed_group)
+ serializer = UserPostBookmarkSerializer.new(bookmark, scope: guardian)
+ bookmark = serializer.as_json[:user_post_bookmark]
+
+ expect(bookmark[:assigned_to_group][:id]).to eq(assign_allowed_group.id)
+ expect(bookmark[:assigned_to_user]).to be(nil)
+ end
+ end
+end
diff --git a/plugins/discourse-assign/spec/support/assign_allowed_group.rb b/plugins/discourse-assign/spec/support/assign_allowed_group.rb
new file mode 100644
index 00000000000..2cc249e03e9
--- /dev/null
+++ b/plugins/discourse-assign/spec/support/assign_allowed_group.rb
@@ -0,0 +1,21 @@
+# frozen_string_literal: true
+
+shared_context "with group that is allowed to assign" do
+ fab!(:assign_allowed_group) do
+ Fabricate(:group, assignable_level: Group::ALIAS_LEVELS[:everyone])
+ end
+
+ before { SiteSetting.assign_allowed_on_groups += "|#{assign_allowed_group.id}" }
+
+ def add_to_assign_allowed_group(user)
+ assign_allowed_group.add(user)
+ end
+
+ def get_assigned_allowed_group
+ assign_allowed_group
+ end
+
+ def get_assigned_allowed_group_name
+ assign_allowed_group.name
+ end
+end
diff --git a/plugins/discourse-assign/spec/system/assign_post_spec.rb b/plugins/discourse-assign/spec/system/assign_post_spec.rb
new file mode 100644
index 00000000000..b2cd3340631
--- /dev/null
+++ b/plugins/discourse-assign/spec/system/assign_post_spec.rb
@@ -0,0 +1,186 @@
+# frozen_string_literal: true
+
+describe "Assign | Assigning posts", type: :system do
+ let(:topic_page) { PageObjects::Pages::Topic.new }
+ let(:assign_modal) { PageObjects::Modals::Assign.new }
+ fab!(:staff_user) { Fabricate(:user, groups: [Group[:staff]]) }
+ fab!(:admin)
+ fab!(:topic)
+ fab!(:post1) { Fabricate(:post, topic: topic) }
+ fab!(:post2) { Fabricate(:post, topic: topic) }
+
+ before do
+ skip "Tests are broken and need to be fixed. See https://github.com/discourse/discourse/actions/runs/13890376408/job/38861216842"
+ SiteSetting.assign_enabled = true
+ SiteSetting.prioritize_full_name_in_ux = false
+ # The system tests in this file are flaky and auth token related so turning this on
+ SiteSetting.verbose_auth_token_logging = true
+
+ sign_in(admin)
+ end
+
+ def assign_post(post, assignee)
+ topic_page.click_assign_post(post)
+ assign_modal.assignee = assignee
+ assign_modal.confirm
+ end
+
+ describe "with open topic" do
+ it "can assign and unassign" do
+ visit "/t/#{topic.id}"
+ assign_post(post2, staff_user)
+
+ expect(assign_modal).to be_closed
+
+ expect(topic_page).to have_assigned_post(user: staff_user, at_post: 3)
+
+ expect(topic_page.find_post_assign(post1.post_number)).to have_content(staff_user.username)
+ expect(topic_page.find_post_assign(post2.post_number)).to have_content(staff_user.username)
+
+ visit "/t/#{topic.id}"
+
+ topic_page.click_unassign_post(post2)
+
+ expect(topic_page).to have_unassigned_from_post(user: staff_user, at_post: 4)
+ expect(page).to have_no_css("#topic .assigned-to")
+ end
+
+ it "can submit modal form with shortcuts" do
+ visit "/t/#{topic.id}"
+
+ topic_page.click_assign_post(post2)
+ assign_modal.assignee = staff_user
+
+ find("body").send_keys(:tab)
+ find("body").send_keys(:control, :enter)
+
+ expect(assign_modal).to be_closed
+ expect(topic_page).to have_assigned_post(user: staff_user, at_post: 3)
+ expect(topic_page.find_post_assign(post1.post_number)).to have_content(staff_user.username)
+ expect(topic_page.find_post_assign(post2.post_number)).to have_content(staff_user.username)
+ end
+
+ context "when prioritize_full_name_in_ux setting is enabled" do
+ before { SiteSetting.prioritize_full_name_in_ux = true }
+
+ it "shows the user's name after assign" do
+ visit "/t/#{topic.id}"
+
+ assign_post(post2, staff_user)
+
+ expect(topic_page.find_post_assign(post1.post_number)).to have_content(staff_user.name)
+ expect(topic_page.find_post_assign(post2.post_number)).to have_content(staff_user.name)
+ end
+
+ it "show the user's username if there is no name" do
+ visit "/t/#{topic.id}"
+ staff_user.name = nil
+ staff_user.save
+ staff_user.reload
+
+ assign_post(post2, staff_user)
+
+ expect(topic_page.find_post_assign(post1.post_number)).to have_content(staff_user.username)
+ expect(topic_page.find_post_assign(post2.post_number)).to have_content(staff_user.username)
+ end
+ end
+
+ context "when assigns are not public" do
+ before { SiteSetting.assigns_public = false }
+
+ it "assigned small action post has 'private-assign' in class attribute" do
+ visit "/t/#{topic.id}"
+
+ assign_post(post2, staff_user)
+
+ expect(assign_modal).to be_closed
+ expect(topic_page).to have_assigned_post(
+ user: staff_user,
+ at_post: 3,
+ class_attribute: ".private-assign",
+ )
+ end
+ end
+
+ context "when unassign_on_close is set to true" do
+ before { SiteSetting.unassign_on_close = true }
+
+ it "unassigns the topic on close" do
+ visit "/t/#{topic.id}"
+
+ assign_post(post2, staff_user)
+
+ expect(assign_modal).to be_closed
+ expect(topic_page).to have_assigned_post(user: staff_user, at_post: 3)
+
+ find(".timeline-controls .toggle-admin-menu").click
+ find(".topic-admin-close").click
+
+ expect(find("#post_4")).to have_content(
+ I18n.t("js.action_codes.closed.enabled", when: "just now"),
+ )
+ expect(page).to have_no_css("#post_5")
+ expect(page).to have_no_css("#topic .assigned-to")
+ end
+
+ it "can assign the previous assignee" do
+ visit "/t/#{topic.id}"
+
+ assign_post(post2, staff_user)
+
+ expect(assign_modal).to be_closed
+ expect(topic_page).to have_assigned_post(user: staff_user, at_post: 3)
+
+ find(".timeline-controls .toggle-admin-menu").click
+ find(".topic-admin-close").click
+
+ expect(find("#post_4")).to have_content(
+ I18n.t("js.action_codes.closed.enabled", when: "just now"),
+ )
+ expect(page).to have_no_css("#post_5")
+ expect(page).to have_no_css("#topic .assigned-to")
+
+ assign_post(post2, staff_user)
+
+ expect(page).to have_no_css("#post_5")
+ expect(topic_page.find_post_assign(post1.post_number)).to have_content(staff_user.username)
+ expect(topic_page.find_post_assign(post2.post_number)).to have_content(staff_user.username)
+ end
+
+ context "when reassign_on_open is set to true" do
+ before { SiteSetting.reassign_on_open = true }
+
+ it "reassigns the topic on open" do
+ visit "/t/#{topic.id}"
+
+ assign_post(post2, staff_user)
+ expect(assign_modal).to be_closed
+ expect(topic_page).to have_assigned_post(user: staff_user, at_post: 3)
+
+ find(".timeline-controls .toggle-admin-menu").click
+ find(".topic-admin-close").click
+
+ expect(find("#post_4")).to have_content(
+ I18n.t("js.action_codes.closed.enabled", when: "just now"),
+ )
+ expect(page).to have_no_css("#post_5")
+ expect(page).to have_no_css("#topic .assigned-to")
+
+ find(".timeline-controls .toggle-admin-menu").click
+ find(".topic-admin-open").click
+
+ expect(find("#post_5")).to have_content(
+ I18n.t("js.action_codes.closed.disabled", when: "just now"),
+ )
+ expect(page).to have_no_css("#post_6")
+ expect(topic_page.find_post_assign(post1.post_number)).to have_content(
+ staff_user.username,
+ )
+ expect(topic_page.find_post_assign(post2.post_number)).to have_content(
+ staff_user.username,
+ )
+ end
+ end
+ end
+ end
+end
diff --git a/plugins/discourse-assign/spec/system/assign_topic_spec.rb b/plugins/discourse-assign/spec/system/assign_topic_spec.rb
new file mode 100644
index 00000000000..d3c5c37b81f
--- /dev/null
+++ b/plugins/discourse-assign/spec/system/assign_topic_spec.rb
@@ -0,0 +1,187 @@
+# frozen_string_literal: true
+
+describe "Assign | Assigning topics", type: :system do
+ let(:topic_page) { PageObjects::Pages::Topic.new }
+ let(:assign_modal) { PageObjects::Modals::Assign.new }
+ fab!(:staff_user) { Fabricate(:user, groups: [Group[:staff]]) }
+ fab!(:admin)
+ fab!(:topic)
+ fab!(:post) { Fabricate(:post, topic: topic) }
+
+ before do
+ SiteSetting.assign_enabled = true
+ SiteSetting.prioritize_full_name_in_ux = false
+ # The system tests in this file are flaky and auth token related so turning this on
+ SiteSetting.verbose_auth_token_logging = true
+ SiteSetting.whispers_allowed_groups = [Group[:staff].id]
+
+ sign_in(admin)
+ end
+
+ %w[enabled disabled].each do |value|
+ before { SiteSetting.glimmer_post_stream_mode = value }
+
+ context "when glimmer_post_stream_mode=#{value}" do
+ describe "with open topic" do
+ it "can assign and unassign" do
+ visit "/t/#{topic.id}"
+
+ topic_page.click_assign_topic
+ assign_modal.assignee = staff_user
+ assign_modal.confirm
+
+ expect(assign_modal).to be_closed
+ expect(topic_page).to have_assigned(user: staff_user, at_post: 2)
+ expect(find("#topic .assigned-to")).to have_content(staff_user.username)
+
+ topic_page.click_unassign_topic
+
+ expect(topic_page).to have_unassigned(user: staff_user, at_post: 3)
+ expect(page).to have_no_css("#topic .assigned-to")
+ end
+
+ it "can submit form with shortcut from texatea" do
+ visit "/t/#{topic.id}"
+
+ topic_page.click_assign_topic
+ assign_modal.assignee = staff_user
+
+ find("body").send_keys(:tab)
+ find("body").send_keys(:control, :enter)
+
+ expect(assign_modal).to be_closed
+ expect(topic_page).to have_assigned(user: staff_user, at_post: 2)
+ expect(find("#topic .assigned-to")).to have_content(staff_user.username)
+ end
+
+ context "when prioritize_full_name_in_ux setting is enabled" do
+ before { SiteSetting.prioritize_full_name_in_ux = true }
+
+ it "shows the user's name after assign" do
+ visit "/t/#{topic.id}"
+
+ topic_page.click_assign_topic
+ assign_modal.assignee = staff_user
+ assign_modal.confirm
+ expect(find("#topic .assigned-to")).to have_content(staff_user.name)
+ end
+
+ it "show the user's username if there is no name" do
+ visit "/t/#{topic.id}"
+ staff_user.name = nil
+ staff_user.save
+ staff_user.reload
+
+ topic_page.click_assign_topic
+ assign_modal.assignee = staff_user
+ assign_modal.confirm
+ expect(find("#topic .assigned-to")).to have_content(staff_user.name)
+ end
+ end
+
+ context "when assigns are not public" do
+ before { SiteSetting.assigns_public = false }
+
+ it "assigned small action post has 'private-assign' in class attribute" do
+ visit "/t/#{topic.id}"
+
+ topic_page.click_assign_topic
+ assign_modal.assignee = staff_user
+ assign_modal.confirm
+
+ expect(assign_modal).to be_closed
+ expect(topic_page).to have_assigned(
+ user: staff_user,
+ at_post: 2,
+ class_attribute: ".private-assign",
+ )
+ end
+ end
+
+ context "when unassign_on_close is set to true" do
+ before { SiteSetting.unassign_on_close = true }
+
+ it "unassigns the topic on close" do
+ visit "/t/#{topic.id}"
+
+ topic_page.click_assign_topic
+ assign_modal.assignee = staff_user
+ assign_modal.confirm
+
+ expect(assign_modal).to be_closed
+ expect(topic_page).to have_assigned(user: staff_user, at_post: 2)
+
+ find(".timeline-controls .toggle-admin-menu").click
+ find(".topic-admin-close").click
+
+ expect(find("#post_3")).to have_content(
+ I18n.t("js.action_codes.closed.enabled", when: "just now"),
+ )
+ expect(page).to have_no_css("#post_4")
+ expect(page).to have_no_css("#topic .assigned-to")
+ end
+
+ it "can assign the previous assignee" do
+ visit "/t/#{topic.id}"
+
+ topic_page.click_assign_topic
+ assign_modal.assignee = staff_user
+ assign_modal.confirm
+
+ expect(assign_modal).to be_closed
+ expect(topic_page).to have_assigned(user: staff_user, at_post: 2)
+
+ find(".timeline-controls .toggle-admin-menu").click
+ find(".topic-admin-close").click
+
+ expect(find("#post_3")).to have_content(
+ I18n.t("js.action_codes.closed.enabled", when: "just now"),
+ )
+ expect(page).to have_no_css("#post_4")
+ expect(page).to have_no_css("#topic .assigned-to")
+
+ topic_page.click_assign_topic
+ assign_modal.assignee = staff_user
+ assign_modal.confirm
+
+ expect(page).to have_no_css("#post_4")
+ expect(find("#topic .assigned-to")).to have_content(staff_user.username)
+ end
+
+ context "when reassign_on_open is set to true" do
+ before { SiteSetting.reassign_on_open = true }
+
+ it "reassigns the topic on open" do
+ visit "/t/#{topic.id}"
+
+ topic_page.click_assign_topic
+ assign_modal.assignee = staff_user
+ assign_modal.confirm
+
+ expect(assign_modal).to be_closed
+ expect(topic_page).to have_assigned(user: staff_user, at_post: 2)
+
+ find(".timeline-controls .toggle-admin-menu").click
+ find(".topic-admin-close").click
+
+ expect(find("#post_3")).to have_content(
+ I18n.t("js.action_codes.closed.enabled", when: "just now"),
+ )
+ expect(page).to have_no_css("#post_4")
+ expect(page).to have_no_css("#topic .assigned-to")
+
+ find(".timeline-controls .toggle-admin-menu").click
+ find(".topic-admin-open").click
+
+ expect(find("#post_4")).to have_content(
+ I18n.t("js.action_codes.closed.disabled", when: "just now"),
+ )
+ expect(page).to have_no_css("#post_5")
+ expect(find("#topic .assigned-to")).to have_content(staff_user.username)
+ end
+ end
+ end
+ end
+ end
+ end
+end
diff --git a/plugins/discourse-assign/spec/system/bulk_assign_spec.rb b/plugins/discourse-assign/spec/system/bulk_assign_spec.rb
new file mode 100644
index 00000000000..0f481065376
--- /dev/null
+++ b/plugins/discourse-assign/spec/system/bulk_assign_spec.rb
@@ -0,0 +1,75 @@
+# frozen_string_literal: true
+
+describe "Assign | Bulk Assign", type: :system do
+ let(:topic_page) { PageObjects::Pages::Topic.new }
+ let(:assign_modal) { PageObjects::Modals::Assign.new }
+ let(:topic_list_header) { PageObjects::Components::TopicListHeader.new }
+ let(:topic_list) { PageObjects::Components::TopicList.new }
+ fab!(:staff_user) { Fabricate(:user, groups: [Group[:staff]]) }
+ fab!(:admin)
+ fab!(:topics) { Fabricate.times(10, :post).map(&:topic) }
+
+ before do
+ SiteSetting.assign_enabled = true
+
+ sign_in(admin)
+ end
+
+ describe "from topic list" do
+ it "can assign and unassign topics" do
+ ## Assign
+ visit "/latest"
+ topic = topics.first
+
+ # Select Topic
+ topic_list_header.click_bulk_select_button
+ topic_list.click_topic_checkbox(topic)
+
+ # Click Assign Button
+ topic_list_header.click_bulk_select_topics_dropdown
+ expect(topic_list_header).to have_assign_topics_button
+ topic_list_header.click_assign_topics_button
+ expect(topic_list_header).to have_bulk_select_modal
+
+ # Assign User
+ assignee = staff_user.username
+ select_kit = PageObjects::Components::SelectKit.new("#assignee-chooser")
+
+ # This initial collapse is needed because for some reason the modal is
+ # opening with `is-expanded` property, but it isn't actually expanded.
+ select_kit.collapse
+
+ select_kit.search(assignee)
+ select_kit.select_row_by_value(assignee)
+ select_kit.collapse
+
+ # Click Confirm
+ topic_list_header.click_bulk_topics_confirm
+ expect(assign_modal).to be_closed
+
+ # Reload and check that topic is now assigned
+ visit "/latest"
+ expect(topic_list).to have_assigned_status(topic)
+
+ ## Unassign
+
+ # Select Topic
+ topic_list_header.click_bulk_select_button
+ topic_list.click_topic_checkbox(topic)
+
+ # Click Unassign Button
+ topic_list_header.click_bulk_select_topics_dropdown
+ expect(topic_list_header).to have_unassign_topics_button
+ topic_list_header.click_unassign_topics_button
+ expect(topic_list_header).to have_bulk_select_modal
+
+ # Click Confirm
+ topic_list_header.click_bulk_topics_confirm
+ expect(assign_modal).to be_closed
+
+ # Reload and check that topic is now assigned
+ visit "/latest"
+ expect(topic_list).to have_unassigned_status(topic)
+ end
+ end
+end
diff --git a/plugins/discourse-assign/spec/system/core_features_spec.rb b/plugins/discourse-assign/spec/system/core_features_spec.rb
new file mode 100644
index 00000000000..db86db283bd
--- /dev/null
+++ b/plugins/discourse-assign/spec/system/core_features_spec.rb
@@ -0,0 +1,7 @@
+# frozen_string_literal: true
+
+RSpec.describe "Core features", type: :system do
+ before { enable_current_plugin }
+
+ it_behaves_like "having working core features"
+end
diff --git a/plugins/discourse-assign/spec/system/group_assigned_spec.rb b/plugins/discourse-assign/spec/system/group_assigned_spec.rb
new file mode 100644
index 00000000000..eb3ebb2e40b
--- /dev/null
+++ b/plugins/discourse-assign/spec/system/group_assigned_spec.rb
@@ -0,0 +1,52 @@
+# frozen_string_literal: true
+
+RSpec.describe "Assign | Group assigned", type: :system, js: true do
+ fab!(:admin)
+ fab!(:group)
+ fab!(:topic)
+ fab!(:post) { Fabricate(:post, topic: topic) }
+
+ let(:topic_list) { PageObjects::Components::TopicList.new }
+ let(:topic_list_header) { PageObjects::Components::TopicListHeader.new }
+ let(:topic_bulk_modal) { PageObjects::Modals::TopicBulkActions.new }
+ let(:assign_modal) { PageObjects::Modals::Assign.new }
+
+ before do
+ group.add(admin)
+ SiteSetting.assign_enabled = true
+ SiteSetting.assign_allowed_on_groups = group.id.to_s
+ Assigner.new(topic, Discourse.system_user).assign(admin)
+ sign_in(admin)
+ end
+
+ it "allows to bulk select assigned topics" do
+ visit "/g/#{group.name}/assigned/everyone"
+
+ topic_list_header.click_bulk_select_button
+ topic_list.click_topic_checkbox(topic)
+
+ # Click Assign Button
+ topic_list_header.click_bulk_select_topics_dropdown
+ expect(topic_list_header).to have_assign_topics_button
+ topic_list_header.click_assign_topics_button
+ expect(topic_list_header).to have_bulk_select_modal
+
+ # Assign User
+ assignee = admin.username
+ select_kit = PageObjects::Components::SelectKit.new("#assignee-chooser")
+
+ # This initial collapse is needed because for some reason the modal is
+ # opening with `is-expanded` property, but it isn't actually expanded.
+ select_kit.collapse
+
+ select_kit.search(assignee)
+ select_kit.select_row_by_value(assignee)
+ select_kit.collapse
+
+ # Click Confirm
+ topic_list_header.click_bulk_topics_confirm
+
+ expect(topic_bulk_modal).to be_closed
+ expect(Assignment.find_by(topic: topic).assigned_to).to eq(admin)
+ end
+end
diff --git a/plugins/discourse-assign/spec/system/group_preferences_spec.rb b/plugins/discourse-assign/spec/system/group_preferences_spec.rb
new file mode 100644
index 00000000000..99d5ff9af4e
--- /dev/null
+++ b/plugins/discourse-assign/spec/system/group_preferences_spec.rb
@@ -0,0 +1,28 @@
+# frozen_string_literal: true
+
+RSpec.describe "Assign | Group Preferences", type: :system, js: true do
+ fab!(:admin)
+ fab!(:group)
+
+ before do
+ SiteSetting.assign_enabled = true
+ sign_in(admin)
+ end
+
+ it "allows to change who can assign a group" do
+ visit "/g/#{group.name}/manage/interaction"
+ select_kit = PageObjects::Components::SelectKit.new(".groups-form-assignable-level")
+
+ expect(select_kit).to have_selected_value(0)
+
+ select_kit.expand
+ select_kit.select_row_by_value(99)
+
+ expect(select_kit).to have_selected_value(99)
+
+ page.find(".group-manage-save").click
+ visit "/g/#{group.name}/manage/interaction"
+
+ expect(select_kit).to have_selected_value(99)
+ end
+end
diff --git a/plugins/discourse-assign/spec/system/page_objects/components/topic_list.rb b/plugins/discourse-assign/spec/system/page_objects/components/topic_list.rb
new file mode 100644
index 00000000000..e101f9b29bf
--- /dev/null
+++ b/plugins/discourse-assign/spec/system/page_objects/components/topic_list.rb
@@ -0,0 +1,21 @@
+# frozen_string_literal: true
+
+module PageObjects
+ module Components
+ class TopicList < PageObjects::Components::Base
+ def has_assigned_status?(topic)
+ page.has_css?("#{topic_list_item_assigned(topic)}")
+ end
+
+ def has_unassigned_status?(topic)
+ page.has_no_css?("#{topic_list_item_assigned(topic)}")
+ end
+
+ private
+
+ def topic_list_item_assigned(topic)
+ "#{topic_list_item_class(topic)} .discourse-tags a.assigned-to"
+ end
+ end
+ end
+end
diff --git a/plugins/discourse-assign/spec/system/page_objects/components/topic_list_header.rb b/plugins/discourse-assign/spec/system/page_objects/components/topic_list_header.rb
new file mode 100644
index 00000000000..b0e4b834cc6
--- /dev/null
+++ b/plugins/discourse-assign/spec/system/page_objects/components/topic_list_header.rb
@@ -0,0 +1,23 @@
+# frozen_string_literal: true
+
+module PageObjects
+ module Components
+ class TopicListHeader < PageObjects::Components::Base
+ def has_assign_topics_button?
+ page.has_css?(bulk_select_dropdown_item("assign-topics"))
+ end
+
+ def click_assign_topics_button
+ find(bulk_select_dropdown_item("assign-topics")).click
+ end
+
+ def has_unassign_topics_button?
+ page.has_css?(bulk_select_dropdown_item("unassign-topics"))
+ end
+
+ def click_unassign_topics_button
+ find(bulk_select_dropdown_item("unassign-topics")).click
+ end
+ end
+ end
+end
diff --git a/plugins/discourse-assign/spec/system/page_objects/modals/assign.rb b/plugins/discourse-assign/spec/system/page_objects/modals/assign.rb
new file mode 100644
index 00000000000..91e4fea2b78
--- /dev/null
+++ b/plugins/discourse-assign/spec/system/page_objects/modals/assign.rb
@@ -0,0 +1,26 @@
+# frozen_string_literal: true
+
+module PageObjects
+ module Modals
+ class Assign < PageObjects::Modals::Base
+ def assignee=(assignee)
+ assignee = assignee.is_a?(Group) ? assignee.name : assignee.username
+ find(".control-group input").fill_in(with: assignee)
+ find("li[data-value='#{assignee}']").click
+ end
+
+ def status=(status)
+ find("#assign-status").click
+ find("[data-value='#{status}']").click
+ end
+
+ def note=(note)
+ find("#assign-modal-note").fill_in(with: note)
+ end
+
+ def confirm
+ find(".d-modal__footer .btn-primary").click
+ end
+ end
+ end
+end
diff --git a/plugins/discourse-assign/spec/system/page_objects/pages/topic.rb b/plugins/discourse-assign/spec/system/page_objects/pages/topic.rb
new file mode 100644
index 00000000000..1622e7dcd7d
--- /dev/null
+++ b/plugins/discourse-assign/spec/system/page_objects/pages/topic.rb
@@ -0,0 +1,74 @@
+# frozen_string_literal: true
+
+module PageObjects
+ module Pages
+ class Topic < PageObjects::Pages::Base
+ def click_assign_topic
+ find("#topic-footer-button-assign").click
+ end
+
+ def click_unassign_topic
+ find("#topic-footer-dropdown-reassign").click
+ find("[data-value='unassign']").click
+ end
+
+ def click_unassign_post(post)
+ find("#topic-footer-dropdown-reassign").click
+ data_value = "unassign-from-post-#{post.id}"
+ find("[data-value=\"#{data_value}\"]").click
+ end
+
+ def click_assign_post(post)
+ find_post_action_button(post, :show_more).click
+ assign_post = within_post(post) { find(".post-action-menu__assign-post") }
+ assign_post.click
+ end
+
+ def click_edit_topic_assignment
+ find("#topic-footer-dropdown-reassign").click
+ find("[data-value='reassign']").click
+ end
+
+ def find_post_assign(post_number)
+ within("#post_#{post_number}") { find(".assigned-to") }
+ end
+
+ def has_assigned?(args)
+ has_assignment_action?(action: "assigned", **args)
+ end
+
+ def has_assigned_post?(args)
+ has_assignment_action?(action: "assigned_to_post", **args)
+ end
+
+ def has_unassigned?(args)
+ has_assignment_action?(action: "unassigned", **args)
+ end
+
+ def has_unassigned_from_post?(args)
+ has_assignment_action?(action: "unassigned_from_post", **args)
+ end
+
+ def has_assignment_action?(args)
+ assignee = args[:group]&.name || args[:user]&.username
+
+ container =
+ args[:at_post] ? find("#post_#{args[:at_post]}#{args[:class_attribute] || ""}") : page
+
+ post_content =
+ I18n.t(
+ "js.action_codes.#{args[:action]}",
+ path: "",
+ who: "@#{assignee}",
+ when: "just now",
+ )
+
+ if args[:action] == "assigned_to_post" || args[:action] == "unassigned_from_post"
+ post_content.gsub!(%r{<a[^>]*>(.*?)</a>}, '\1')
+ end
+
+ container.has_content?(:all, post_content)
+ end
+ end
+ end
+end
diff --git a/plugins/discourse-assign/spec/system/page_objects/pages/user_menu.rb b/plugins/discourse-assign/spec/system/page_objects/pages/user_menu.rb
new file mode 100644
index 00000000000..e75f5d5d53a
--- /dev/null
+++ b/plugins/discourse-assign/spec/system/page_objects/pages/user_menu.rb
@@ -0,0 +1,17 @@
+# frozen_string_literal: true
+
+module PageObjects
+ module Components
+ class UserMenu < PageObjects::Components::Base
+ def click_assignments_tab
+ click_link("user-menu-button-assign-list")
+ has_css?("#quick-access-assign-list")
+ self
+ end
+
+ def has_assignments_in_order?(assignments)
+ expect(all(".notification.assigned .item-description").map(&:text)).to eq(assignments)
+ end
+ end
+ end
+end
diff --git a/plugins/discourse-assign/spec/system/user_menu_spec.rb b/plugins/discourse-assign/spec/system/user_menu_spec.rb
new file mode 100644
index 00000000000..ef0ab80bf0c
--- /dev/null
+++ b/plugins/discourse-assign/spec/system/user_menu_spec.rb
@@ -0,0 +1,40 @@
+# frozen_string_literal: true
+
+RSpec.describe "Assign | User Menu", type: :system, js: true do
+ fab!(:admin)
+
+ let(:user_menu) { PageObjects::Components::UserMenu.new }
+
+ before do
+ SiteSetting.assign_enabled = true
+ sign_in(admin)
+ end
+
+ describe "Assign tab ordering" do
+ let!(:unread_user_assign) { Fabricate(:assignment_notification, user: admin) }
+ let!(:unread_user_assign_2) { Fabricate(:assignment_notification, user: admin) }
+ let!(:read_user_assign) { Fabricate(:assignment_notification, user: admin, read: true) }
+ let!(:read_user_assign_2) { Fabricate(:assignment_notification, user: admin, read: true) }
+ let!(:unread_group_assign) { Fabricate(:assignment_notification, user: admin, group: true) }
+ let!(:read_group_assign) do
+ Fabricate(:assignment_notification, user: admin, read: true, group: true)
+ end
+ let(:expected_order) do
+ [
+ unread_user_assign_2,
+ unread_user_assign,
+ unread_group_assign,
+ read_user_assign_2,
+ read_user_assign,
+ read_group_assign,
+ ].map { _1.topic.fancy_title }
+ end
+
+ it "orders the items properly" do
+ visit "/"
+ user_menu.open
+ user_menu.click_assignments_tab
+ expect(user_menu).to have_assignments_in_order(expected_order)
+ end
+ end
+end
diff --git a/plugins/discourse-assign/spec/system/user_preferences_spec.rb b/plugins/discourse-assign/spec/system/user_preferences_spec.rb
new file mode 100644
index 00000000000..595bd95bf74
--- /dev/null
+++ b/plugins/discourse-assign/spec/system/user_preferences_spec.rb
@@ -0,0 +1,43 @@
+# frozen_string_literal: true
+
+describe "Assign | User Preferences", type: :system, js: true do
+ fab!(:user)
+
+ let(:selector) { "[data-setting-name='user-notification-level-when-assigned'] .combobox" }
+
+ before { sign_in(user) }
+
+ describe "when discourse-assign is disabled" do
+ before { SiteSetting.assign_enabled = false }
+
+ it "does not show the 'when assigned' tracking user preference" do
+ visit "/my/preferences/tracking"
+
+ expect(page).not_to have_css(selector)
+ end
+ end
+
+ describe "when discourse-assign is enabled" do
+ before { SiteSetting.assign_enabled = true }
+
+ let(:when_assigned) { PageObjects::Components::SelectKit.new(selector) }
+
+ it "shows the 'when assigned' tracking user preference" do
+ visit "/my/preferences/tracking"
+
+ expect(when_assigned).to have_selected_value("watch_topic")
+ end
+
+ it "supports changing the 'when assigned' tracking user preference" do
+ visit "/my/preferences/tracking"
+
+ when_assigned.expand
+ when_assigned.select_row_by_value("track_topic")
+
+ page.find("button.save-changes").click
+ page.refresh
+
+ expect(when_assigned).to have_selected_value("track_topic")
+ end
+ end
+end
diff --git a/plugins/discourse-assign/svg-icons/plugin-icons.svg b/plugins/discourse-assign/svg-icons/plugin-icons.svg
new file mode 100644
index 00000000000..247d4d11047
--- /dev/null
+++ b/plugins/discourse-assign/svg-icons/plugin-icons.svg
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<svg xmlns="http://www.w3.org/2000/svg" style="display: none;">
+ <symbol id='group-plus' viewBox="0 0 86.62 63.79"><circle cx="37.21" cy="31.89" r="10.63"/><path d="M44.65 45.18h-1.39c-1.84.85-3.9 1.33-6.06 1.33s-4.2-.48-6.06-1.33h-1.39c-6.16 0-11.16 5-11.16 11.16v3.46c0 2.2 1.79 3.99 3.99 3.99h29.24c2.2 0 3.99-1.79 3.99-3.99v-3.46c0-6.16-5-11.16-11.16-11.16Z"/><circle cx="18.61" cy="10.63" r="10.63"/><path d="M21.31 25.24c-2.3-.2-4.49-.54-6.48-1.32h-1.64C5.91 23.92 0 28.92 0 35.08v3.46c0 2.2 2.11 3.99 4.71 3.99H24.3s1.3-.24.55-.96c-5.93-5.74-4.61-12-3.56-14.81 0 0 .85-1.45.02-1.52Zm63.14-.74h-8.7v-8.7c0-1.2-.98-2.17-2.17-2.17h-4.35c-1.2 0-2.17.98-2.17 2.17v8.7h-8.7c-1.2 0-2.17.98-2.17 2.17v4.35c0 1.2.98 2.17 2.17 2.17h8.7v8.7c0 1.2.98 2.17 2.17 2.17h4.35c1.2 0 2.17-.98 2.17-2.17v-8.7h8.7c1.2 0 2.17-.98 2.17-2.17v-4.35c0-1.2-.98-2.17-2.17-2.17Z"/></symbol>
+ <symbol id='group-times' viewBox="0 0 84.34 63.79"><circle cx="37.21" cy="31.89" r="10.63"/><path d="M44.65 45.18h-1.39c-1.84.85-3.9 1.33-6.06 1.33s-4.2-.48-6.06-1.33h-1.39c-6.16 0-11.16 5-11.16 11.16v3.46c0 2.2 1.79 3.99 3.99 3.99h29.24c2.2 0 3.99-1.79 3.99-3.99v-3.46c0-6.16-5-11.16-11.16-11.16Z"/><circle cx="18.61" cy="10.63" r="10.63"/><path d="M21.31 25.24c-2.3-.2-4.49-.54-6.48-1.32h-1.64C5.91 23.92 0 28.92 0 35.08v3.46c0 2.2 2.11 3.99 4.71 3.99H24.3s1.3-.24.55-.96c-5.93-5.74-4.61-12-3.56-14.81 0 0 .85-1.45.02-1.52ZM83.7 35l-6.15-6.15 6.15-6.15c.85-.85.84-2.23 0-3.07l-3.08-3.08c-.85-.85-2.23-.84-3.07 0L71.4 22.7l-6.15-6.15c-.85-.85-2.23-.84-3.07 0l-3.08 3.08c-.85.85-.84 2.23 0 3.07l6.15 6.15L59.1 35c-.85.85-.84 2.23 0 3.07l3.08 3.08c.85.85 2.23.84 3.07 0L71.4 35l6.15 6.15c.85.85 2.23.84 3.07 0l3.08-3.08c.85-.85.84-2.23 0-3.07Z"/></symbol>
+</svg>
diff --git a/plugins/discourse-assign/test/javascripts/acceptance/assign-disabled-test.js b/plugins/discourse-assign/test/javascripts/acceptance/assign-disabled-test.js
new file mode 100644
index 00000000000..95a033531b7
--- /dev/null
+++ b/plugins/discourse-assign/test/javascripts/acceptance/assign-disabled-test.js
@@ -0,0 +1,22 @@
+import { visit } from "@ember/test-helpers";
+import { test } from "qunit";
+import { acceptance } from "discourse/tests/helpers/qunit-helpers";
+
+["enabled", "disabled"].forEach((postStreamMode) => {
+ acceptance(
+ `Discourse Assign | Assign disabled mobile (glimmer_post_stream_mode = ${postStreamMode})`,
+ function (needs) {
+ needs.user({ can_assign: true });
+ needs.mobileView();
+ needs.settings({
+ assign_enabled: false,
+ glimmer_post_stream_mode: postStreamMode,
+ });
+
+ test("Footer dropdown does not contain button", async function (assert) {
+ await visit("/t/internationalization-localization/280");
+ assert.dom(".assign").doesNotExist();
+ });
+ }
+ );
+});
diff --git a/plugins/discourse-assign/test/javascripts/acceptance/assign-enabled-test.js b/plugins/discourse-assign/test/javascripts/acceptance/assign-enabled-test.js
new file mode 100644
index 00000000000..0af5a39e934
--- /dev/null
+++ b/plugins/discourse-assign/test/javascripts/acceptance/assign-enabled-test.js
@@ -0,0 +1,336 @@
+import { click, fillIn, visit } from "@ember/test-helpers";
+import { test } from "qunit";
+import { cloneJSON } from "discourse/lib/object";
+import userFixtures from "discourse/tests/fixtures/user-fixtures";
+import pretender, {
+ parsePostData,
+ response,
+} from "discourse/tests/helpers/create-pretender";
+import {
+ acceptance,
+ updateCurrentUser,
+} from "discourse/tests/helpers/qunit-helpers";
+import selectKit from "discourse/tests/helpers/select-kit-helper";
+
+acceptance("Discourse Assign | Assign mobile", function (needs) {
+ needs.user();
+ needs.mobileView();
+ needs.settings({ assign_enabled: true });
+
+ needs.pretender((server, helper) => {
+ server.get("/assign/suggestions", () => {
+ return helper.response({
+ success: true,
+ assign_allowed_groups: false,
+ assign_allowed_for_groups: [],
+ suggestions: [
+ {
+ id: 19,
+ username: "eviltrout",
+ name: "Robin Ward",
+ avatar_template:
+ "/user_avatar/meta.discourse.org/eviltrout/{size}/5275_2.png",
+ },
+ ],
+ });
+ });
+ });
+
+ test("Footer dropdown contains button", async function (assert) {
+ updateCurrentUser({ can_assign: true });
+ await visit("/t/internationalization-localization/280");
+ await click(".topic-footer-mobile-dropdown-trigger");
+ await click(".assign");
+ assert.dom(".assign.d-modal").exists("assign modal opens");
+ });
+});
+
+["enabled", "disabled"].forEach((postStreamMode) => {
+ acceptance(
+ `Discourse Assign | Assign desktop (glimmer_post_stream_mode = ${postStreamMode})`,
+ function (needs) {
+ needs.user({ can_assign: true });
+ needs.settings({
+ assign_enabled: true,
+ glimmer_post_stream_mode: postStreamMode,
+ });
+
+ needs.pretender((server, helper) => {
+ server.get("/assign/suggestions", () => {
+ return helper.response({
+ success: true,
+ assign_allowed_groups: false,
+ assign_allowed_for_groups: [],
+ suggestions: [
+ {
+ id: 19,
+ username: "eviltrout",
+ name: "Robin Ward",
+ avatar_template:
+ "/user_avatar/meta.discourse.org/eviltrout/{size}/5275_2.png",
+ },
+ ],
+ });
+ });
+ });
+
+ test("Assigning user to a post", async function (assert) {
+ await visit("/t/internationalization-localization/280");
+
+ assert
+ .dom("#post_2 .post-action-menu__assign-post")
+ .doesNotExist("assign to post button is hidden");
+
+ await click("#post_2 button.show-more-actions");
+ assert
+ .dom("#post_2 .post-action-menu__assign-post")
+ .exists("assign to post button exists");
+
+ await click("#post_2 .post-action-menu__assign-post");
+ assert.dom(".assign.d-modal").exists("assign modal opens");
+
+ const menu = selectKit(".assign.d-modal .user-chooser");
+ assert.true(menu.isExpanded(), "user selector is expanded");
+
+ await click(".assign.d-modal .btn-primary");
+ assert.dom(".error-label").includesText("Choose a user to assign");
+
+ await menu.expand();
+ await menu.selectRowByIndex(0);
+ assert.strictEqual(menu.header().value(), "eviltrout");
+ assert.dom(".error-label").doesNotExist();
+
+ pretender.put("/assign/assign", ({ requestBody }) => {
+ const body = parsePostData(requestBody);
+ assert.strictEqual(body.target_type, "Post");
+ assert.strictEqual(body.username, "eviltrout");
+ assert.strictEqual(body.note, "a note!");
+ return response({ success: true });
+ });
+
+ await fillIn("#assign-modal-note", "a note!");
+ await click(".assign.d-modal .btn-primary");
+
+ assert.dom(".assign.d-modal").doesNotExist("assign modal closes");
+ });
+
+ test("Footer dropdown contains button", async function (assert) {
+ await visit("/t/internationalization-localization/280");
+ await click("#topic-footer-button-assign");
+
+ assert.dom(".assign.d-modal").exists("assign modal opens");
+ });
+ }
+ );
+
+ acceptance(
+ `Discourse Assign | Assign Status enabled (glimmer_post_stream_mode = ${postStreamMode})`,
+ function (needs) {
+ needs.user({
+ can_assign: true,
+ });
+ needs.settings({
+ assign_enabled: true,
+ enable_assign_status: true,
+ assign_statuses: "New|In Progress|Done",
+ glimmer_post_stream_mode: postStreamMode,
+ });
+
+ needs.pretender((server, helper) => {
+ server.get("/assign/suggestions", () => {
+ return helper.response({
+ success: true,
+ assign_allowed_groups: false,
+ assign_allowed_for_groups: [],
+ suggestions: [
+ {
+ id: 19,
+ username: "eviltrout",
+ name: "Robin Ward",
+ avatar_template:
+ "/user_avatar/meta.discourse.org/eviltrout/{size}/5275_2.png",
+ },
+ ],
+ });
+ });
+ });
+
+ test("Modal contains status dropdown", async function (assert) {
+ pretender.put("/assign/assign", ({ requestBody }) => {
+ const body = parsePostData(requestBody);
+ assert.strictEqual(body.target_type, "Topic");
+ assert.strictEqual(body.target_id, "280");
+ assert.strictEqual(body.username, "eviltrout");
+ assert.strictEqual(body.status, "In Progress");
+
+ return response({ success: true });
+ });
+
+ await visit("/t/internationalization-localization/280");
+ await click("#topic-footer-button-assign");
+
+ assert
+ .dom(".assign.d-modal #assign-status")
+ .exists("assign status dropdown exists");
+
+ const statusDropdown = selectKit("#assign-status");
+ assert.strictEqual(statusDropdown.header().value(), "New");
+
+ await statusDropdown.expand();
+ await statusDropdown.selectRowByValue("In Progress");
+ assert.strictEqual(statusDropdown.header().value(), "In Progress");
+
+ const menu = selectKit(".assign.d-modal .user-chooser");
+ await menu.expand();
+ await menu.selectRowByIndex(0);
+
+ await click(".assign.d-modal .btn-primary");
+ });
+ }
+ );
+
+ acceptance(
+ `Discourse Assign | Assign Status disabled (glimmer_post_stream_mode = ${postStreamMode})`,
+ function (needs) {
+ needs.user({
+ can_assign: true,
+ });
+ needs.settings({
+ assign_enabled: true,
+ enable_assign_status: false,
+ glimmer_post_stream_mode: postStreamMode,
+ });
+
+ needs.pretender((server, helper) => {
+ server.get("/assign/suggestions", () => {
+ return helper.response({
+ success: true,
+ assign_allowed_groups: false,
+ assign_allowed_for_groups: [],
+ suggestions: [
+ {
+ id: 19,
+ username: "eviltrout",
+ name: "Robin Ward",
+ avatar_template:
+ "/user_avatar/meta.discourse.org/eviltrout/{size}/5275_2.png",
+ },
+ ],
+ });
+ });
+ });
+
+ test("Modal contains status dropdown", async function (assert) {
+ await visit("/t/internationalization-localization/280");
+ await click("#topic-footer-button-assign");
+
+ assert
+ .dom(".assign.d-modal #assign-status")
+ .doesNotExist("assign status dropdown doesn't exists");
+ });
+ }
+ );
+});
+
+// See RemindAssignsFrequencySiteSettings
+const remindersFrequency = [
+ {
+ name: "discourse_assign.reminders_frequency.never",
+ value: 0,
+ },
+ {
+ name: "discourse_assign.reminders_frequency.daily",
+ value: 1440,
+ },
+ {
+ name: "discourse_assign.reminders_frequency.weekly",
+ value: 10080,
+ },
+ {
+ name: "discourse_assign.reminders_frequency.monthly",
+ value: 43200,
+ },
+ {
+ name: "discourse_assign.reminders_frequency.quarterly",
+ value: 129600,
+ },
+];
+
+acceptance("Discourse Assign | User preferences", function (needs) {
+ needs.user({ can_assign: true, reminders_frequency: remindersFrequency });
+ needs.settings({
+ assign_enabled: true,
+ remind_assigns_frequency: 43200,
+ });
+
+ test("The frequency for assigned topic reminders defaults to the site setting", async function (assert) {
+ await visit("/u/eviltrout/preferences/notifications");
+
+ assert.strictEqual(
+ selectKit("#remind-assigns-frequency").header().value(),
+ "43200",
+ "set frequency to default of Monthly"
+ );
+ });
+
+ test("The user can change the frequency to Never", async function (assert) {
+ await visit("/u/eviltrout/preferences/notifications");
+
+ await selectKit("#remind-assigns-frequency").expand();
+ await selectKit("#remind-assigns-frequency").selectRowByValue(0);
+
+ assert.strictEqual(
+ selectKit("#remind-assigns-frequency").header().value(),
+ "0",
+ "set frequency to Never"
+ );
+ });
+
+ test("The user can change the frequency to some other non-default value", async function (assert) {
+ await visit("/u/eviltrout/preferences/notifications");
+
+ await selectKit("#remind-assigns-frequency").expand();
+ await selectKit("#remind-assigns-frequency").selectRowByValue(10080); // weekly
+
+ assert.strictEqual(
+ selectKit("#remind-assigns-frequency").header().value(),
+ "10080",
+ "set frequency to Weekly"
+ );
+ });
+});
+
+acceptance(
+ "Discourse Assign | User preferences | Pre-selected reminder frequency",
+ function (needs) {
+ needs.user({ can_assign: true, reminders_frequency: remindersFrequency });
+ needs.settings({
+ assign_enabled: true,
+ remind_assigns_frequency: 43200,
+ });
+
+ needs.pretender((server, helper) => {
+ server.get("/u/eviltrout.json", () => {
+ let json = cloneJSON(userFixtures["/u/eviltrout.json"]);
+ json.user.custom_fields = { remind_assigns_frequency: 10080 };
+
+ // usually this is done automatically by this pretender but we
+ // have to do it manually here because we are overriding the
+ // pretender see app/assets/javascripts/discourse/tests/helpers/create-pretender.js
+ json.user.can_edit = true;
+
+ return helper.response(200, json);
+ });
+ });
+
+ test("The user's previously selected value is loaded", async function (assert) {
+ await visit("/u/eviltrout/preferences/notifications");
+
+ assert.strictEqual(
+ selectKit("#remind-assigns-frequency").header().value(),
+ "10080",
+ "frequency is pre-selected to Weekly"
+ );
+ });
+ }
+);
diff --git a/plugins/discourse-assign/test/javascripts/acceptance/assigned-topic-test.js b/plugins/discourse-assign/test/javascripts/acceptance/assigned-topic-test.js
new file mode 100644
index 00000000000..3788ff16b58
--- /dev/null
+++ b/plugins/discourse-assign/test/javascripts/acceptance/assigned-topic-test.js
@@ -0,0 +1,278 @@
+import { click, visit } from "@ember/test-helpers";
+import { test } from "qunit";
+import { cloneJSON } from "discourse/lib/object";
+import topicFixtures from "discourse/tests/fixtures/topic";
+import {
+ acceptance,
+ query,
+ updateCurrentUser,
+} from "discourse/tests/helpers/qunit-helpers";
+import selectKit from "discourse/tests/helpers/select-kit-helper";
+import { i18n } from "discourse-i18n";
+import NotificationFixture from "../fixtures/notifications-fixtures";
+
+function assignCurrentUserToTopic(needs) {
+ needs.pretender((server, helper) => {
+ server.get("/t/44.json", () => {
+ let topic = cloneJSON(topicFixtures["/t/28830/1.json"]);
+ topic["assigned_to_user"] = {
+ username: "eviltrout",
+ name: "Robin Ward",
+ avatar_template:
+ "/letter_avatar/eviltrout/{size}/3_f9720745f5ce6dfc2b5641fca999d934.png",
+ };
+ topic["assignment_note"] = "Shark Doododooo";
+ topic["assignment_status"] = "New";
+ topic["indirectly_assigned_to"] = {
+ 2: {
+ assigned_to: {
+ name: "Developers",
+ },
+ post_number: 2,
+ assignment_note: '<script>alert("xss")</script>',
+ },
+ };
+ return helper.response(topic);
+ });
+
+ server.get("/t/45.json", () => {
+ let topic = cloneJSON(topicFixtures["/t/28830/1.json"]);
+ topic["assigned_to_group"] = {
+ name: "Developers",
+ };
+ return helper.response(topic);
+ });
+
+ server.get("/notifications", () => {
+ return helper.response(
+ NotificationFixture["/assign/notifications/eviltrout"]
+ );
+ });
+ });
+}
+
+function assignNewUserToTopic(needs) {
+ needs.pretender((server, helper) => {
+ server.get("/t/44.json", () => {
+ let topic = cloneJSON(topicFixtures["/t/28830/1.json"]);
+ topic["assigned_to_user"] = {
+ username: "isaacjanzen",
+ name: "Isaac Janzen",
+ avatar_template:
+ "/letter_avatar/isaacjanzen/{size}/3_f9720745f5ce6dfc2b5641fca999d934.png",
+ };
+ topic["indirectly_assigned_to"] = {
+ 2: {
+ assigned_to: {
+ name: "Developers",
+ },
+ post_number: 2,
+ },
+ };
+ return helper.response(topic);
+ });
+
+ server.get("/t/45.json", () => {
+ let topic = cloneJSON(topicFixtures["/t/28830/1.json"]);
+ topic["assigned_to_group"] = {
+ name: "Developers",
+ };
+ return helper.response(topic);
+ });
+ });
+}
+
+["enabled", "disabled"].forEach((postStreamMode) => {
+ acceptance(
+ `Discourse Assign | Assigned topic (glimmer_post_stream_mode = ${postStreamMode})`,
+ function (needs) {
+ needs.user();
+ needs.settings({
+ assign_enabled: true,
+ tagging_enabled: true,
+ assigns_user_url_path: "/",
+ assigns_public: true,
+ enable_assign_status: true,
+ glimmer_post_stream_mode: postStreamMode,
+ });
+
+ assignCurrentUserToTopic(needs);
+
+ test("Shows user assignment info", async function (assert) {
+ updateCurrentUser({ can_assign: true });
+ await visit("/t/assignment-topic/44");
+
+ assert
+ .dom("#topic-title .assigned-to")
+ .hasText("eviltrout", "shows assignment in the header");
+
+ assert
+ .dom("#post_1 .assigned-to")
+ .includesText(
+ "Assigned topic to eviltrout",
+ "shows assignment in the first post"
+ );
+ assert
+ .dom("#post_1 .assigned-to")
+ .includesText("#2 to Developers", "Also shows indirects assignments");
+ assert.dom("#post_1 .assigned-to svg.d-icon-user-plus").exists();
+ assert.dom("#post_1 .assigned-to a[href='/']").exists();
+ assert
+ .dom(".discourse-tags .assigned-to[href='/t/28830'] span")
+ .hasAttribute("title", "Shark Doododooo", "shows topic assign notes");
+ assert
+ .dom(".discourse-tags .assigned-to[href='/p/2'] span")
+ .hasAttribute(
+ "title",
+ '<script>alert("xss")</script>',
+ "shows indirect assign notes"
+ );
+ assert
+ .dom("#topic-footer-dropdown-reassign")
+ .exists("shows reassign dropdown at the bottom of the topic");
+ });
+
+ test("Shows group assignment info", async function (assert) {
+ updateCurrentUser({ can_assign: true });
+ await visit("/t/assignment-topic/45");
+
+ assert
+ .dom("#topic-title .assigned-to")
+ .hasText("Developers", "shows assignment in the header");
+ assert
+ .dom("#post_1 .assigned-to--group")
+ .hasText(
+ "Assigned topic to Developers",
+ "shows assignment in the first post"
+ );
+ assert.dom("#post_1 .assigned-to svg.d-icon-group-plus").exists();
+ assert
+ .dom("#post_1 .assigned-to a[href='/g/Developers/assigned/everyone']")
+ .exists();
+ assert
+ .dom("#topic-footer-dropdown-reassign")
+ .exists("shows reassign dropdown at the bottom of the topic");
+ });
+
+ test("User without assign ability cannot see footer button", async function (assert) {
+ updateCurrentUser({
+ can_assign: false,
+ admin: false,
+ moderator: false,
+ });
+ await visit("/t/assignment-topic/45");
+
+ assert
+ .dom("#topic-footer-dropdown-reassign")
+ .doesNotExist(
+ "does not show reassign dropdown at the bottom of the topic"
+ );
+ });
+
+ test("Shows assignment notification", async function (assert) {
+ updateCurrentUser({ can_assign: true });
+
+ await visit("/u/eviltrout/notifications");
+
+ const notification = query(
+ "section.user-content .user-notifications-list li.notification"
+ );
+
+ assert.true(
+ notification.classList.contains("assigned"),
+ "with correct assigned class"
+ );
+
+ assert.strictEqual(
+ notification.querySelector("a").title,
+ i18n("notifications.titles.assigned"),
+ "with correct title"
+ );
+ assert.strictEqual(
+ notification.querySelector("svg use").href["baseVal"],
+ "#user-plus",
+ "with correct icon"
+ );
+ });
+ }
+ );
+
+ acceptance(
+ `Discourse Assign | Reassign topic (glimmer_post_stream_mode = ${postStreamMode})`,
+ function (needs) {
+ needs.user();
+ needs.settings({
+ assign_enabled: true,
+ tagging_enabled: true,
+ assigns_user_url_path: "/",
+ glimmer_post_stream_mode: postStreamMode,
+ });
+
+ assignNewUserToTopic(needs);
+
+ test("Reassign Footer dropdown contains reassign buttons", async function (assert) {
+ updateCurrentUser({ can_assign: true });
+ const menu = selectKit("#topic-footer-dropdown-reassign");
+
+ await visit("/t/assignment-topic/44");
+ await menu.expand();
+
+ assert.true(menu.rowByValue("unassign").exists());
+ assert.true(menu.rowByValue("reassign").exists());
+ assert.true(menu.rowByValue("reassign-self").exists());
+ });
+ }
+ );
+
+ acceptance(
+ `Discourse Assign | Reassign topic | mobile (glimmer_post_stream_mode = ${postStreamMode})`,
+ function (needs) {
+ needs.user();
+ needs.mobileView();
+ needs.settings({
+ assign_enabled: true,
+ tagging_enabled: true,
+ assigns_user_url_path: "/",
+ glimmer_post_stream_mode: postStreamMode,
+ });
+
+ assignNewUserToTopic(needs);
+
+ test("Mobile Footer dropdown contains reassign buttons", async function (assert) {
+ updateCurrentUser({ can_assign: true });
+
+ await visit("/t/assignment-topic/44");
+ await click(".topic-footer-mobile-dropdown-trigger");
+
+ assert.dom("#topic-footer-button-unassign-mobile").exists();
+ assert.dom("#topic-footer-button-reassign-self-mobile").exists();
+ assert.dom("#topic-footer-button-reassign-mobile").exists();
+ });
+ }
+ );
+
+ acceptance(
+ `Discourse Assign | Reassign topic conditionals (glimmer_post_stream_mode = ${postStreamMode})`,
+ function (needs) {
+ needs.user();
+ needs.settings({
+ assign_enabled: true,
+ tagging_enabled: true,
+ assigns_user_url_path: "/",
+ glimmer_post_stream_mode: postStreamMode,
+ });
+
+ assignCurrentUserToTopic(needs);
+
+ test("Reassign Footer dropdown won't display reassign-to-self button when already assigned to current user", async function (assert) {
+ updateCurrentUser({ can_assign: true });
+ const menu = selectKit("#topic-footer-dropdown-reassign");
+
+ await visit("/t/assignment-topic/44");
+ await menu.expand();
+
+ assert.false(menu.rowByValue("reassign-self").exists());
+ });
+ }
+ );
+});
diff --git a/plugins/discourse-assign/test/javascripts/acceptance/assigns-tab-user-menu-test.js b/plugins/discourse-assign/test/javascripts/acceptance/assigns-tab-user-menu-test.js
new file mode 100644
index 00000000000..ca046722d77
--- /dev/null
+++ b/plugins/discourse-assign/test/javascripts/acceptance/assigns-tab-user-menu-test.js
@@ -0,0 +1,319 @@
+/* eslint-disable qunit/no-loose-assertions */
+import { click, currentURL, visit } from "@ember/test-helpers";
+import { test } from "qunit";
+import {
+ acceptance,
+ query,
+ queryAll,
+ updateCurrentUser,
+} from "discourse/tests/helpers/qunit-helpers";
+import { i18n } from "discourse-i18n";
+
+const USER_MENU_ASSIGN_RESPONSE = {
+ notifications: [
+ {
+ id: 1716,
+ user_id: 1,
+ notification_type: 34,
+ read: false,
+ high_priority: true,
+ created_at: "2022-08-11T21:32:32.404Z",
+ post_number: 1,
+ topic_id: 227,
+ fancy_title: "Test poll topic please bear with me :heart:",
+ slug: "test-poll-topic-please-bear-with-me",
+ data: {
+ message: "discourse_assign.assign_notification",
+ display_username: "tony",
+ topic_title: "Test poll topic please bear with me :heart:",
+ assignment_id: 2,
+ },
+ },
+ {
+ id: 1717,
+ user_id: 1,
+ notification_type: 34,
+ read: true,
+ high_priority: true,
+ created_at: "2022-08-11T21:32:32.404Z",
+ post_number: 1,
+ topic_id: 228,
+ fancy_title: "Test poll topic please bear with me 2 :ok_hand:",
+ slug: "test-poll-topic-please-bear-with-me-2",
+ data: {
+ message: "discourse_assign.assign_group_notification",
+ display_username: "Team",
+ topic_title: "Test poll topic please bear with me 2 :ok_hand:",
+ assignment_id: 3,
+ },
+ },
+ ],
+};
+
+acceptance(
+ "Discourse Assign | user menu | user cannot assign",
+ function (needs) {
+ needs.user({
+ can_assign: false,
+ });
+ needs.settings({
+ assign_enabled: true,
+ });
+
+ test("the assigns tab is not shown", async function (assert) {
+ await visit("/");
+ await click(".d-header-icons .current-user button");
+ assert.dom("#user-menu-button-assign-list").doesNotExist();
+ });
+ }
+);
+
+acceptance(
+ "Discourse Assign | user menu | assign_enabled setting is disabled",
+ function (needs) {
+ needs.user({
+ can_assign: false,
+ });
+ needs.settings({
+ assign_enabled: false,
+ });
+
+ test("the assigns tab is not shown", async function (assert) {
+ await visit("/");
+ await click(".d-header-icons .current-user button");
+ assert.dom("#user-menu-button-assign-list").doesNotExist();
+ });
+ }
+);
+
+acceptance("Discourse Assign | user menu", function (needs) {
+ needs.user({
+ can_assign: true,
+ grouped_unread_notifications: {
+ 34: 173, // assigned notification type
+ },
+ });
+
+ needs.settings({
+ assign_enabled: true,
+ });
+
+ let forceEmptyState = false;
+ let markRead = false;
+ let requestBody;
+
+ needs.pretender((server, helper) => {
+ server.get("/notifications", () => {
+ if (forceEmptyState) {
+ return helper.response({ notifications: [] });
+ } else {
+ return helper.response(USER_MENU_ASSIGN_RESPONSE);
+ }
+ });
+
+ server.put("/notifications/mark-read", (request) => {
+ requestBody = request.requestBody;
+ markRead = true;
+ return helper.response({ success: true });
+ });
+
+ server.get("/topics/messages-assigned/eviltrout.json", () => {
+ return helper.response({
+ users: [],
+ topic_list: {
+ topics: [],
+ },
+ });
+ });
+ });
+
+ needs.hooks.afterEach(() => {
+ forceEmptyState = false;
+ markRead = false;
+ requestBody = null;
+ });
+
+ test("assigns tab", async function (assert) {
+ await visit("/");
+ await click(".d-header-icons .current-user button");
+ assert.dom("#user-menu-button-assign-list").exists("assigns tab exists");
+ assert
+ .dom("#user-menu-button-assign-list .d-icon-user-plus")
+ .exists("assigns tab has the user-plus icon");
+ assert
+ .dom("#user-menu-button-assign-list .badge-notification")
+ .hasText("173", "assigns tab has a count badge");
+
+ updateCurrentUser({
+ grouped_unread_notifications: {},
+ });
+
+ assert
+ .dom("#user-menu-button-assign-list .badge-notification")
+ .doesNotExist("badge count disappears when it goes to zero");
+ assert
+ .dom("#user-menu-button-assign-list")
+ .exists("assigns tab still exists");
+ });
+
+ test("clicking on the assign tab when it's already selected navigates to the user's assignments page", async function (assert) {
+ await visit("/");
+ await click(".d-header-icons .current-user button");
+ await click("#user-menu-button-assign-list");
+ await click("#user-menu-button-assign-list");
+
+ assert.strictEqual(
+ currentURL(),
+ "/u/eviltrout/activity/assigned",
+ "user is navigated to their assignments page"
+ );
+ });
+
+ test("displays unread assign notifications on top and fills the remaining space with read assigns", async function (assert) {
+ await visit("/");
+ await click(".d-header-icons .current-user button");
+ await click("#user-menu-button-assign-list");
+
+ const notifications = queryAll(
+ "#quick-access-assign-list .notification.unread"
+ );
+ assert.strictEqual(
+ notifications.length,
+ 1,
+ "there is one unread notification"
+ );
+ assert.true(
+ notifications[0].classList.contains("unread"),
+ "the notification is unread"
+ );
+ assert.true(
+ notifications[0].classList.contains("assigned"),
+ "the notification is of type assigned"
+ );
+
+ const assigns = queryAll("#quick-access-assign-list .assigned");
+ assert.strictEqual(assigns.length, 2, "there are 2 assigns");
+
+ const userAssign = assigns[0];
+ const groupAssign = assigns[1];
+ assert.ok(
+ userAssign.querySelector(".d-icon-user-plus"),
+ "user assign has the right icon"
+ );
+ assert.ok(
+ groupAssign.querySelector(".d-icon-group-plus"),
+ "group assign has the right icon"
+ );
+
+ assert.true(
+ userAssign
+ .querySelector("a")
+ .href.endsWith("/t/test-poll-topic-please-bear-with-me/227"),
+ "user assign links to the assigned topic"
+ );
+ assert.true(
+ groupAssign
+ .querySelector("a")
+ .href.endsWith("/t/test-poll-topic-please-bear-with-me-2/228"),
+ "group assign links to the assigned topic"
+ );
+
+ assert.strictEqual(
+ userAssign.textContent.trim(),
+ "Test poll topic please bear with me",
+ "user assign contains the topic title"
+ );
+ assert.ok(
+ userAssign.querySelector(".item-description img.emoji"),
+ "emojis are rendered in user assign"
+ );
+
+ assert.strictEqual(
+ groupAssign.textContent.trim().replaceAll(/\s+/g, " "),
+ "Team Test poll topic please bear with me 2",
+ "group assign contains the topic title"
+ );
+ assert.ok(
+ groupAssign.querySelector(".item-description img.emoji"),
+ "emojis are rendered in group assign"
+ );
+
+ assert.strictEqual(
+ userAssign.querySelector("a").title,
+ i18n("user.assigned_to_you.topic"),
+ "user assign has the right title"
+ );
+ assert.strictEqual(
+ groupAssign.querySelector("a").title,
+ i18n("user.assigned_to_group.topic", { group_name: "Team" }),
+ "group assign has the right title"
+ );
+ });
+
+ test("dismiss button", async function (assert) {
+ await visit("/");
+ await click(".d-header-icons .current-user button");
+ await click("#user-menu-button-assign-list");
+
+ assert
+ .dom("#user-menu-button-assign-list .badge-notification")
+ .exists("badge count is visible before dismissing");
+
+ await click(".notifications-dismiss");
+ assert.false(markRead, "mark-read request isn't sent");
+ assert.strictEqual(
+ query(
+ ".dismiss-notification-confirmation .d-modal__body"
+ ).textContent.trim(),
+ i18n("notifications.dismiss_confirmation.body.assigns", { count: 173 }),
+ "dismiss confirmation modal is shown"
+ );
+
+ await click(".d-modal__footer .btn-primary");
+ assert.true(markRead, "mark-read request is sent");
+ assert.dom(".notifications-dismiss").doesNotExist("dismiss button is gone");
+ assert
+ .dom("#user-menu-button-assign-list .badge-notification")
+ .doesNotExist("badge count is gone after dismissing");
+ assert.strictEqual(
+ requestBody,
+ "dismiss_types=assigned",
+ "mark-read request is sent with the right params"
+ );
+ });
+
+ test("empty state", async function (assert) {
+ forceEmptyState = true;
+ await visit("/");
+ await click(".d-header-icons .current-user button");
+ await click("#user-menu-button-assign-list");
+
+ assert
+ .dom(".empty-state-title")
+ .hasText(
+ i18n("user.no_assignments_title"),
+ "empty state title is rendered"
+ );
+ assert.dom(".empty-state-body").exists("empty state body exists");
+ assert
+ .dom(".empty-state-body .d-icon-user-plus")
+ .exists("empty state body has user-plus icon");
+ assert.true(
+ query(".empty-state-body a").href.endsWith(
+ "/my/preferences/notifications"
+ ),
+ "empty state body has user-plus icon"
+ );
+ });
+
+ test("renders the confirmation modal when dismiss assign notifications", async function (assert) {
+ await visit("/");
+ await click(".d-header-icons .current-user button");
+ await click("#user-menu-button-assign-list");
+ await click(".notifications-dismiss");
+ assert.false(markRead, "a request to the server is not made");
+ assert
+ .dom(".dismiss-notification-confirmation .d-modal__body")
+ .exists("the dismiss notification confirmation modal is present");
+ });
+});
diff --git a/plugins/discourse-assign/test/javascripts/acceptance/category-test.js b/plugins/discourse-assign/test/javascripts/acceptance/category-test.js
new file mode 100644
index 00000000000..d51513a9ca4
--- /dev/null
+++ b/plugins/discourse-assign/test/javascripts/acceptance/category-test.js
@@ -0,0 +1,106 @@
+import { visit } from "@ember/test-helpers";
+import { test } from "qunit";
+import DiscoveryFixtures from "discourse/tests/fixtures/discovery-fixtures";
+import { acceptance } from "discourse/tests/helpers/qunit-helpers";
+import { i18n } from "discourse-i18n";
+
+function stubCategory(needs, customFields) {
+ needs.site({
+ categories: [
+ {
+ id: 6,
+ name: "test",
+ slug: "test",
+ custom_fields: customFields,
+ },
+ ],
+ });
+
+ needs.pretender((server, helper) => {
+ server.get("/c/test/6/l/latest.json", () => {
+ return helper.response(
+ DiscoveryFixtures["/latest_can_create_topic.json"]
+ );
+ });
+ });
+}
+
+acceptance(
+ "Discourse Assign | Categories for users that can assign",
+ function (needs) {
+ needs.user({ can_assign: true });
+ needs.settings({
+ assign_enabled: true,
+ assigns_user_url_path: "/",
+ assigns_public: false,
+ });
+ stubCategory(needs, { enable_unassigned_filter: "true" });
+
+ test("can see Unassigned button", async function (assert) {
+ await visit("/c/test");
+
+ const title = i18n("filters.unassigned.help");
+ assert.dom(`#navigation-bar li[title='${title}']`).exists();
+ });
+ }
+);
+
+acceptance(
+ "Discourse Assign | Categories without enable_unassigned_filter",
+ function (needs) {
+ needs.user();
+ needs.settings({
+ assign_enabled: true,
+ assigns_user_url_path: "/",
+ assigns_public: false,
+ });
+ stubCategory(needs, { enable_unassigned_filter: "false" });
+
+ test("cannot see Unassigned button", async function (assert) {
+ await visit("/c/test");
+
+ const title = i18n("filters.unassigned.help");
+ assert.dom(`#navigation-bar li[title='${title}']`).doesNotExist();
+ });
+ }
+);
+
+acceptance(
+ "Discourse Assign | Categories when assigns are public",
+ function (needs) {
+ needs.user();
+ needs.settings({
+ assign_enabled: true,
+ assigns_user_url_path: "/",
+ assigns_public: true,
+ });
+ stubCategory(needs, { enable_unassigned_filter: "true" });
+
+ test("can see Unassigned button", async function (assert) {
+ await visit("/c/test");
+
+ const title = i18n("filters.unassigned.help");
+ assert.dom(`#navigation-bar li[title='${title}']`).exists();
+ });
+ }
+);
+
+acceptance(
+ "Discourse Assign | Categories when assigns are private",
+ function (needs) {
+ needs.user();
+ needs.settings({
+ assign_enabled: true,
+ assigns_user_url_path: "/",
+ assigns_public: false,
+ });
+ stubCategory(needs, { enable_unassigned_filter: "true" });
+
+ test("cannot see Unassigned button", async function (assert) {
+ await visit("/c/test");
+
+ const title = i18n("filters.unassigned.help");
+ assert.dom(`#navigation-bar li[title='${title}']`).doesNotExist();
+ });
+ }
+);
diff --git a/plugins/discourse-assign/test/javascripts/acceptance/edit-assignments-modal-test.js b/plugins/discourse-assign/test/javascripts/acceptance/edit-assignments-modal-test.js
new file mode 100644
index 00000000000..3f55a9ec205
--- /dev/null
+++ b/plugins/discourse-assign/test/javascripts/acceptance/edit-assignments-modal-test.js
@@ -0,0 +1,169 @@
+import { click, settled, visit } from "@ember/test-helpers";
+import { test } from "qunit";
+import {
+ acceptance,
+ publishToMessageBus,
+} from "discourse/tests/helpers/qunit-helpers";
+import topicWithAssignedPosts from "../fixtures/topic-with-assigned-posts";
+
+const topic = topicWithAssignedPosts();
+const firstReply = topic.post_stream.posts[1];
+const secondReply = topic.post_stream.posts[2];
+const new_assignee_1 = "user_1";
+const new_assignee_2 = "user_2";
+
+acceptance("Discourse Assign | Edit assignments modal", function (needs) {
+ needs.user({ can_assign: true });
+ needs.settings({
+ assign_enabled: true,
+ });
+
+ needs.pretender((server, helper) => {
+ server.get("/t/44.json", () => helper.response(topic));
+ server.put("/assign/assign", () => {
+ return helper.response({ success: true });
+ });
+
+ const suggestions = [
+ { username: new_assignee_1 },
+ { username: new_assignee_2 },
+ ];
+ server.get("/assign/suggestions", () =>
+ helper.response({
+ assign_allowed_for_groups: [],
+ suggestions,
+ })
+ );
+ server.get("/u/search/users", () =>
+ helper.response({
+ users: suggestions,
+ })
+ );
+ });
+
+ test("reassigning topic", async function (assert) {
+ await visit("/t/assignment-topic/44");
+ await openModal();
+ await selectAssignee(new_assignee_1);
+
+ await submitModal();
+ await receiveAssignedMessage(topic, new_assignee_1);
+
+ assert
+ .dom(".post-stream article#post_1 .assigned-to .assigned-to--user a")
+ .hasText(new_assignee_1, "The topic is assigned to a new assignee");
+ });
+
+ test("reassigning posts", async function (assert) {
+ await visit("/t/assignment-topic/44");
+ await openModal();
+
+ await selectPost(1);
+ await expandAssigneeChooser();
+ await selectAssignee(new_assignee_1);
+
+ await selectPost(2);
+ await expandAssigneeChooser();
+ await selectAssignee(new_assignee_2);
+
+ await submitModal();
+ await receiveAssignedMessage(firstReply, new_assignee_1);
+ await receiveAssignedMessage(secondReply, new_assignee_2);
+
+ assert
+ .dom(".post-stream article#post_2 .assigned-to .assigned-to-username")
+ .hasText(new_assignee_1, "The first reply is assigned to a new assignee");
+
+ assert
+ .dom(".post-stream article#post_3 .assigned-to .assigned-to-username")
+ .hasText(
+ new_assignee_2,
+ "The second reply is assigned to a new assignee"
+ );
+ });
+
+ test("reassigning topic and posts in one go", async function (assert) {
+ await visit("/t/assignment-topic/44");
+ await openModal();
+ await selectAssignee(new_assignee_1);
+
+ await selectPost(1);
+ await expandAssigneeChooser();
+ await selectAssignee(new_assignee_2);
+
+ await selectPost(2);
+ await expandAssigneeChooser();
+ await selectAssignee(new_assignee_2);
+
+ await submitModal();
+ await receiveAssignedMessage(topic, new_assignee_1);
+ await receiveAssignedMessage(firstReply, new_assignee_2);
+ await receiveAssignedMessage(secondReply, new_assignee_2);
+
+ assert
+ .dom(".post-stream article#post_1 .assigned-to .assigned-to--user a")
+ .hasText(new_assignee_1, "The topic is assigned to a new assignee");
+
+ assert
+ .dom(".post-stream article#post_2 .assigned-to .assigned-to-username")
+ .hasText(new_assignee_2, "The first reply is assigned to a new assignee");
+
+ assert
+ .dom(".post-stream article#post_3 .assigned-to .assigned-to-username")
+ .hasText(
+ new_assignee_2,
+ "The second reply is assigned to a new assignee"
+ );
+ });
+
+ async function expandAssigneeChooser() {
+ await click(
+ ".modal-container #assignee-chooser-header .select-kit-header-wrapper"
+ );
+ }
+
+ async function openModal() {
+ await click("#topic-footer-dropdown-reassign .btn");
+ await click(`li[data-value='reassign']`);
+ }
+
+ // todo remove this function and all calls to it after we start updating UI right away
+ // (there is no need to wait for a message bus message in the browser of a user
+ // who did reassignment, but we do that at the moment)
+ async function receiveAssignedMessage(target, newAssignee) {
+ const targetIsAPost = !!target.topic_id;
+
+ let topicId, postId;
+ if (targetIsAPost) {
+ topicId = target.topic_id;
+ postId = target.id;
+ } else {
+ topicId = target.id;
+ postId = false;
+ }
+
+ await publishToMessageBus("/staff/topic-assignment", {
+ type: "assigned",
+ topic_id: topicId,
+ post_id: postId,
+ assigned_type: "User",
+ assigned_to: {
+ username: newAssignee,
+ },
+ });
+ await settled();
+ }
+
+ async function selectPost(number) {
+ await click(".target .single-select .select-kit-header-wrapper");
+ await click(`li[title='Post #${number}']`);
+ }
+
+ async function selectAssignee(username) {
+ await click(`.email-group-user-chooser-row[data-value='${username}']`);
+ }
+
+ async function submitModal() {
+ await click(".d-modal__footer .btn-primary");
+ }
+});
diff --git a/plugins/discourse-assign/test/javascripts/acceptance/group-assignments-test.js b/plugins/discourse-assign/test/javascripts/acceptance/group-assignments-test.js
new file mode 100644
index 00000000000..4cee4466a36
--- /dev/null
+++ b/plugins/discourse-assign/test/javascripts/acceptance/group-assignments-test.js
@@ -0,0 +1,31 @@
+import { visit } from "@ember/test-helpers";
+import { test } from "qunit";
+import { acceptance } from "discourse/tests/helpers/qunit-helpers";
+import AssignedTopics from "../fixtures/assigned-group-assignments-fixtures";
+import GroupMembers from "../fixtures/group-members-fixtures";
+
+acceptance("Discourse Assign | GroupAssignments", function (needs) {
+ needs.user();
+ needs.settings({ assign_enabled: true, assigns_user_url_path: "/" });
+ needs.pretender((server, helper) => {
+ const groupPath = "/topics/group-topics-assigned/discourse.json";
+ const memberPath = "/topics/messages-assigned/ahmedgagan6.json";
+ const getMembersPath = "/assign/members/discourse";
+ const groupAssigns = AssignedTopics[groupPath];
+ const memberAssigns = AssignedTopics[memberPath];
+ const getMembers = GroupMembers[getMembersPath];
+ server.get(groupPath, () => helper.response(groupAssigns));
+ server.get(memberPath, () => helper.response(memberAssigns));
+ server.get(getMembersPath, () => helper.response(getMembers));
+ });
+
+ test("Group Assignments Everyone", async function (assert) {
+ await visit("/g/discourse/assigned");
+ assert.dom(".topic-list-item").exists({ count: 1 });
+ });
+
+ test("Group Assignments Ahmedgagan", async function (assert) {
+ await visit("/g/discourse/assigned/ahmedgagan6");
+ assert.dom(".topic-list-item").exists({ count: 1 });
+ });
+});
diff --git a/plugins/discourse-assign/test/javascripts/acceptance/never-track-assign-reason-test.js b/plugins/discourse-assign/test/javascripts/acceptance/never-track-assign-reason-test.js
new file mode 100644
index 00000000000..b1dd3c84d88
--- /dev/null
+++ b/plugins/discourse-assign/test/javascripts/acceptance/never-track-assign-reason-test.js
@@ -0,0 +1,71 @@
+import { visit } from "@ember/test-helpers";
+import { test } from "qunit";
+import { cloneJSON } from "discourse/lib/object";
+import topicFixtures from "discourse/tests/fixtures/topic";
+import {
+ acceptance,
+ updateCurrentUser,
+} from "discourse/tests/helpers/qunit-helpers";
+
+acceptance(
+ "Discourse Assign | Never track topics assign reason",
+ function (needs) {
+ needs.user({ can_send_private_messages: true });
+ needs.settings({
+ assign_enabled: true,
+ assigns_user_url_path: "/",
+ });
+
+ needs.pretender((server, helper) => {
+ server.get("/t/44.json", () => {
+ let topic = cloneJSON(topicFixtures["/t/130.json"]);
+ topic.details.notifications_reason_id = 3;
+ return helper.response(topic);
+ });
+ server.get("/t/45.json", () => {
+ let topic = cloneJSON(topicFixtures["/t/28830/1.json"]);
+ topic["assigned_to_user"] = {
+ username: "eviltrout",
+ name: "Robin Ward",
+ avatar_template:
+ "/letter_avatar/eviltrout/{size}/3_f9720745f5ce6dfc2b5641fca999d934.png",
+ };
+ return helper.response(topic);
+ });
+ server.get("/t/46.json", () => {
+ let topic = cloneJSON(topicFixtures["/t/28830/1.json"]);
+ topic["assigned_to_group"] = {
+ id: 47,
+ name: "discourse",
+ };
+ return helper.response(topic);
+ });
+ });
+
+ test("Show default assign reason when user tracks topics", async function (assert) {
+ updateCurrentUser({ never_auto_track_topics: false });
+
+ await visit("/t/assignment-topic/44");
+
+ assert
+ .dom(".topic-notifications-button .reason span.text")
+ .hasText(
+ "You will receive notifications because you are watching this topic."
+ );
+ });
+
+ test("Show user assign reason when user never tracks topics", async function (assert) {
+ updateCurrentUser({
+ never_auto_track_topics: true,
+ });
+
+ await visit("/t/assignment-topic/45");
+
+ assert
+ .dom(".topic-notifications-button .reason span.text")
+ .hasText(
+ "You will see a count of new replies because this topic was assigned to you."
+ );
+ });
+ }
+);
diff --git a/plugins/discourse-assign/test/javascripts/acceptance/post-popup-menu-test.js b/plugins/discourse-assign/test/javascripts/acceptance/post-popup-menu-test.js
new file mode 100644
index 00000000000..f9809a5b2a7
--- /dev/null
+++ b/plugins/discourse-assign/test/javascripts/acceptance/post-popup-menu-test.js
@@ -0,0 +1,105 @@
+import { click, fillIn, visit } from "@ember/test-helpers";
+import { test } from "qunit";
+import {
+ acceptance,
+ publishToMessageBus,
+ updateCurrentUser,
+} from "discourse/tests/helpers/qunit-helpers";
+import topicWithAssignedPosts from "../fixtures/topic-with-assigned-posts";
+
+const new_assignee_username = "new_assignee";
+
+const selectors = {
+ assignedTo: ".post-stream article#post_2 .assigned-to",
+ moreButton: ".post-stream .topic-post .more-button",
+ popupMenu: {
+ unassign: ".post-assign-menu-content .unassign-btn",
+ editAssignment: ".post-assign-menu-content .edit-assignment-btn",
+ },
+ modal: {
+ assignee: ".modal-container .select-kit-header-wrapper",
+ assigneeInput: ".modal-container .filter-input",
+ assignButton: ".d-modal__footer .btn-primary",
+ },
+};
+
+const topic = topicWithAssignedPosts();
+const post = topic.post_stream.posts[1];
+
+acceptance("Discourse Assign | Post popup menu", function (needs) {
+ needs.user();
+ needs.settings({
+ assign_enabled: true,
+ });
+
+ needs.pretender((server, helper) => {
+ server.get("/t/44.json", () => helper.response(topic));
+
+ server.put("/assign/assign", () => {
+ return helper.response({ success: true });
+ });
+
+ server.put("/assign/unassign", () => {
+ return helper.response({ success: true });
+ });
+
+ server.get("/assign/suggestions", () =>
+ helper.response({
+ assign_allowed_for_groups: [],
+ suggestions: [{ username: new_assignee_username }],
+ })
+ );
+
+ server.get("/u/search/users", () =>
+ helper.response({ users: [{ username: new_assignee_username }] })
+ );
+ });
+
+ needs.hooks.beforeEach(() => {
+ updateCurrentUser({ can_assign: true });
+ });
+
+ test("Unassigns the post", async function (assert) {
+ await visit("/t/assignment-topic/44");
+ await click(selectors.moreButton);
+ await click(selectors.popupMenu.unassign);
+ await publishToMessageBus("/staff/topic-assignment", {
+ type: "unassigned",
+ topic_id: topic.id,
+ post_id: post.id,
+ assigned_type: "User",
+ });
+
+ assert.dom(".popup-menu").doesNotExist("The popup menu is closed");
+ assert.dom(selectors.assignedTo).doesNotExist("The post is unassigned");
+ });
+
+ test("Reassigns the post", async function (assert) {
+ await visit("/t/assignment-topic/44");
+ await click(selectors.moreButton);
+ await click(selectors.popupMenu.editAssignment);
+ await click(selectors.modal.assignee);
+ await fillIn(selectors.modal.assigneeInput, new_assignee_username);
+ await click(selectors.modal.assignButton);
+
+ await publishToMessageBus("/staff/topic-assignment", {
+ type: "assigned",
+ topic_id: topic.id,
+ post_id: post.id,
+ assigned_type: "User",
+ assigned_to: {
+ username: new_assignee_username,
+ },
+ });
+
+ // todo: we can skip this one for now, It will be fixed it in a core PR
+ // assert.dom(".popup-menu").doesNotExist("The popup menu is closed");
+
+ assert
+ .dom(`${selectors.assignedTo} .assigned-to-username`)
+ .hasText(
+ new_assignee_username,
+ "The post is assigned to the new assignee"
+ );
+ });
+});
diff --git a/plugins/discourse-assign/test/javascripts/acceptance/search-full-test.js b/plugins/discourse-assign/test/javascripts/acceptance/search-full-test.js
new file mode 100644
index 00000000000..43ffaee64d7
--- /dev/null
+++ b/plugins/discourse-assign/test/javascripts/acceptance/search-full-test.js
@@ -0,0 +1,79 @@
+import { fillIn, visit } from "@ember/test-helpers";
+import { test } from "qunit";
+import { acceptance } from "discourse/tests/helpers/qunit-helpers";
+import selectKit from "discourse/tests/helpers/select-kit-helper";
+
+acceptance("Discourse Assign | Search - Full Page", function (needs) {
+ needs.settings({ assign_enabled: true });
+ needs.user({ can_assign: true });
+ needs.pretender((server, helper) => {
+ server.get("/u/search/users", () => {
+ return helper.response({
+ users: [
+ {
+ username: "admin",
+ name: "admin",
+ avatar_template: "/images/avatar.png",
+ },
+ ],
+ });
+ });
+ });
+
+ test("update in:assigned filter through advanced search ui", async function (assert) {
+ const inSelector = selectKit(".search-advanced-options .select-kit#in");
+
+ await visit("/search");
+
+ await fillIn(".search-query", "none");
+ await inSelector.expand();
+ await inSelector.selectRowByValue("assigned");
+ assert
+ .dom(".search-query")
+ .hasValue(
+ "none in:assigned",
+ 'has updated search term to "none in:assigned"'
+ );
+ });
+
+ test("update in:unassigned filter through advanced search ui", async function (assert) {
+ const inSelector = selectKit(".search-advanced-options .select-kit#in");
+
+ await visit("/search");
+
+ await fillIn(".search-query", "none");
+ await inSelector.expand();
+ await inSelector.selectRowByValue("unassigned");
+ assert
+ .dom(".search-query")
+ .hasValue(
+ "none in:unassigned",
+ 'has updated search term to "none in:unassigned"'
+ );
+ });
+
+ test("update assigned to through advanced search ui", async function (assert) {
+ const assignedField = selectKit(".assigned-advanced-search .select-kit");
+
+ await visit("/search");
+
+ await fillIn(".search-query", "none");
+ await assignedField.expand();
+
+ await assignedField.fillInFilter("admin");
+ await assignedField.selectRowByValue("admin");
+
+ assert.strictEqual(
+ assignedField.header().value(),
+ "admin",
+ 'has "admin" filled in'
+ );
+
+ assert
+ .dom(".search-query")
+ .hasValue(
+ "none assigned:admin",
+ 'has updated search term to "none assigned:admin"'
+ );
+ });
+});
diff --git a/plugins/discourse-assign/test/javascripts/acceptance/topic-level-assign-menu-test.js b/plugins/discourse-assign/test/javascripts/acceptance/topic-level-assign-menu-test.js
new file mode 100644
index 00000000000..2894db54b17
--- /dev/null
+++ b/plugins/discourse-assign/test/javascripts/acceptance/topic-level-assign-menu-test.js
@@ -0,0 +1,49 @@
+import { click, visit } from "@ember/test-helpers";
+import { test } from "qunit";
+import {
+ acceptance,
+ publishToMessageBus,
+ updateCurrentUser,
+} from "discourse/tests/helpers/qunit-helpers";
+import topicWithAssignedPosts from "../fixtures/topic-with-assigned-posts";
+
+const topic = topicWithAssignedPosts();
+const post = topic.post_stream.posts[1];
+
+acceptance("Discourse Assign | Topic level assign menu", function (needs) {
+ needs.user();
+ needs.settings({
+ assign_enabled: true,
+ });
+
+ needs.pretender((server, helper) => {
+ server.get("/t/44.json", () => helper.response(topic));
+ server.put("/assign/unassign", () => {
+ return helper.response({ success: true });
+ });
+ });
+
+ needs.hooks.beforeEach(() => {
+ updateCurrentUser({ can_assign: true });
+ });
+
+ test("Unassign button unassigns the post", async function (assert) {
+ await visit("/t/assignment-topic/44");
+
+ await click("#topic-footer-dropdown-reassign .btn");
+ await click(`li[data-value='unassign-from-post-${post.id}']`);
+ await publishToMessageBus("/staff/topic-assignment", {
+ type: "unassigned",
+ topic_id: topic.id,
+ post_id: post.id,
+ assigned_type: "User",
+ });
+
+ assert
+ .dom("#topic-footer-dropdown-reassign-body ul[role='menu']")
+ .doesNotExist("The menu is closed");
+ assert
+ .dom(".post-stream article#post_2 .assigned-to")
+ .doesNotExist("The post is unassigned");
+ });
+});
diff --git a/plugins/discourse-assign/test/javascripts/acceptance/user-assignments-list-test.js b/plugins/discourse-assign/test/javascripts/acceptance/user-assignments-list-test.js
new file mode 100644
index 00000000000..a4aef499c8b
--- /dev/null
+++ b/plugins/discourse-assign/test/javascripts/acceptance/user-assignments-list-test.js
@@ -0,0 +1,56 @@
+import { visit } from "@ember/test-helpers";
+import { test } from "qunit";
+import { cloneJSON } from "discourse/lib/object";
+import { acceptance } from "discourse/tests/helpers/qunit-helpers";
+import selectKit from "discourse/tests/helpers/select-kit-helper";
+import AssignedTopics from "../fixtures/assigned-topics-fixtures";
+
+acceptance(
+ "Discourse Assign | Unassign/reassign from the topics list",
+ function (needs) {
+ needs.user();
+ needs.settings({ assign_enabled: true, assigns_user_url_path: "/" });
+ needs.pretender((server, helper) => {
+ const messagesPath = "/topics/messages-assigned/eviltrout.json";
+ const assigns = AssignedTopics[messagesPath];
+ server.get(messagesPath, () => helper.response(assigns));
+ });
+
+ test("Unassign/reassign options are visible", async function (assert) {
+ const options = selectKit(".assign-actions-dropdown");
+
+ await visit("/u/eviltrout/activity/assigned");
+ await options.expand();
+
+ assert.dom("li[data-value='unassign']").exists({ count: 1 });
+ assert.dom("li[data-value='reassign']").exists({ count: 1 });
+ });
+ }
+);
+
+acceptance(
+ "Discourse Assign | A user doesn't have assignments",
+ function (needs) {
+ needs.user();
+ needs.settings({ assign_enabled: true, assigns_user_url_path: "/" });
+ needs.pretender((server, helper) => {
+ const assignments = cloneJSON(
+ AssignedTopics["/topics/messages-assigned/eviltrout.json"]
+ );
+ assignments.topic_list.topics = [];
+ server.get("/topics/messages-assigned/eviltrout.json", () =>
+ helper.response(assignments)
+ );
+ });
+
+ test("It renders the empty state panel", async function (assert) {
+ await visit("/u/eviltrout/activity/assigned");
+ assert.dom("div.empty-state").exists();
+ });
+
+ test("It does not render the search form", async function (assert) {
+ await visit("/u/eviltrout/activity/assigned");
+ assert.dom("div.topic-search-div").doesNotExist();
+ });
+ }
+);
diff --git a/plugins/discourse-assign/test/javascripts/acceptance/user-private-messages-assigned-test.js b/plugins/discourse-assign/test/javascripts/acceptance/user-private-messages-assigned-test.js
new file mode 100644
index 00000000000..54fe6fbfcf0
--- /dev/null
+++ b/plugins/discourse-assign/test/javascripts/acceptance/user-private-messages-assigned-test.js
@@ -0,0 +1,51 @@
+import { currentURL, visit } from "@ember/test-helpers";
+import { test } from "qunit";
+import { cloneJSON } from "discourse/lib/object";
+import {
+ acceptance,
+ updateCurrentUser,
+} from "discourse/tests/helpers/qunit-helpers";
+import selectKit from "discourse/tests/helpers/select-kit-helper";
+import { i18n } from "discourse-i18n";
+import AssignedTopics from "../fixtures/assigned-topics-fixtures";
+
+acceptance("Discourse Assign | User Private Messages", function (needs) {
+ needs.user({
+ can_assign: true,
+ });
+
+ needs.settings({ assign_enabled: true, assigns_user_url_path: "/" });
+
+ needs.pretender((server, helper) => {
+ const assignments = cloneJSON(
+ AssignedTopics["/topics/messages-assigned/eviltrout.json"]
+ );
+
+ server.get("/topics/private-messages-assigned/eviltrout.json", () =>
+ helper.response(assignments)
+ );
+ });
+
+ test("viewing assigned messages", async function (assert) {
+ updateCurrentUser({ redesigned_user_page_nav_enabled: true });
+
+ await visit("/u/eviltrout/messages");
+
+ const messagesDropdown = selectKit(".user-nav-messages-dropdown");
+
+ await messagesDropdown.expand();
+ await messagesDropdown.selectRowByName(i18n("discourse_assign.assigned"));
+
+ assert.strictEqual(
+ currentURL(),
+ "/u/eviltrout/messages/assigned",
+ "transitioned to the assigned page"
+ );
+
+ assert.strictEqual(
+ messagesDropdown.header().name(),
+ i18n("discourse_assign.assigned"),
+ "assigned messages is selected in the dropdown"
+ );
+ });
+});
diff --git a/plugins/discourse-assign/test/javascripts/fixtures/assigned-group-assignments-fixtures.js b/plugins/discourse-assign/test/javascripts/fixtures/assigned-group-assignments-fixtures.js
new file mode 100644
index 00000000000..e7e603c3eb7
--- /dev/null
+++ b/plugins/discourse-assign/test/javascripts/fixtures/assigned-group-assignments-fixtures.js
@@ -0,0 +1,170 @@
+export default {
+ "/topics/group-topics-assigned/discourse.json": {
+ users: [
+ {
+ id: -2,
+ username: "discobot",
+ name: "discobot",
+ avatar_template: "/user_avatar/localhost/discobot/{size}/1_2.png",
+ },
+ {
+ id: -1,
+ username: "system",
+ name: "system",
+ avatar_template: "/user_avatar/localhost/system/{size}/2_2.png",
+ },
+ ],
+ primary_groups: [],
+ topic_list: {
+ can_create_topic: true,
+ draft: null,
+ draft_key: "new_topic",
+ draft_sequence: 0,
+ per_page: 30,
+ topics: [
+ {
+ id: 10,
+ title: "Greetings!",
+ fancy_title: "Greetings!",
+ slug: "greetings",
+ posts_count: 1,
+ reply_count: 0,
+ highest_post_number: 4,
+ image_url:
+ "//localhost:3000/plugins/discourse-narrative-bot/images/font-awesome-ellipsis.png",
+ created_at: "2019-05-08T13:52:39.394Z",
+ last_posted_at: "2019-05-08T13:52:39.841Z",
+ bumped: true,
+ bumped_at: "2019-05-08T13:52:39.841Z",
+ unseen: false,
+ last_read_post_number: 4,
+ unread: 0,
+ new_posts: 0,
+ pinned: false,
+ unpinned: null,
+ visible: true,
+ closed: false,
+ archived: false,
+ notification_level: 3,
+ bookmarked: false,
+ liked: false,
+ views: 0,
+ like_count: 0,
+ has_summary: false,
+ archetype: "private_message",
+ last_poster_username: "discobot",
+ category_id: null,
+ pinned_globally: false,
+ featured_link: null,
+ posters: [
+ {
+ extras: "latest single",
+ description: "Original Poster, Most Recent Poster",
+ user_id: -2,
+ primary_group_id: null,
+ },
+ ],
+ participants: [
+ {
+ extras: "latest",
+ description: null,
+ user_id: -2,
+ primary_group_id: null,
+ },
+ ],
+ assigned_to_user: {
+ id: 19,
+ username: "eviltrout",
+ name: null,
+ avatar_template:
+ "/letter_avatar_proxy/v4/letter/r/ed8c4c/{size}.png",
+ },
+ },
+ ],
+ },
+ },
+ "/topics/messages-assigned/ahmedgagan6.json": {
+ users: [
+ {
+ id: -2,
+ username: "discobot",
+ name: "discobot",
+ avatar_template: "/user_avatar/localhost/discobot/{size}/1_2.png",
+ },
+ {
+ id: -1,
+ username: "system",
+ name: "system",
+ avatar_template: "/user_avatar/localhost/system/{size}/2_2.png",
+ },
+ ],
+ primary_groups: [],
+ topic_list: {
+ can_create_topic: true,
+ draft: null,
+ draft_key: "new_topic",
+ draft_sequence: 0,
+ per_page: 30,
+ topics: [
+ {
+ id: 10,
+ title: "Greetings!",
+ fancy_title: "Greetings!",
+ slug: "greetings",
+ posts_count: 1,
+ reply_count: 0,
+ highest_post_number: 4,
+ image_url:
+ "//localhost:3000/plugins/discourse-narrative-bot/images/font-awesome-ellipsis.png",
+ created_at: "2019-05-08T13:52:39.394Z",
+ last_posted_at: "2019-05-08T13:52:39.841Z",
+ bumped: true,
+ bumped_at: "2019-05-08T13:52:39.841Z",
+ unseen: false,
+ last_read_post_number: 4,
+ unread: 0,
+ new_posts: 0,
+ pinned: false,
+ unpinned: null,
+ visible: true,
+ closed: false,
+ archived: false,
+ notification_level: 3,
+ bookmarked: false,
+ liked: false,
+ views: 0,
+ like_count: 0,
+ has_summary: false,
+ archetype: "private_message",
+ last_poster_username: "discobot",
+ category_id: null,
+ pinned_globally: false,
+ featured_link: null,
+ posters: [
+ {
+ extras: "latest single",
+ description: "Original Poster, Most Recent Poster",
+ user_id: -2,
+ primary_group_id: null,
+ },
+ ],
+ participants: [
+ {
+ extras: "latest",
+ description: null,
+ user_id: -2,
+ primary_group_id: null,
+ },
+ ],
+ assigned_to_user: {
+ id: 2770,
+ username: "awesomerobot",
+ name: null,
+ avatar_template:
+ "/user_avatar/meta.discourse.org/awesomerobot/{size}/33872.png",
+ },
+ },
+ ],
+ },
+ },
+};
diff --git a/plugins/discourse-assign/test/javascripts/fixtures/assigned-topics-fixtures.js b/plugins/discourse-assign/test/javascripts/fixtures/assigned-topics-fixtures.js
new file mode 100644
index 00000000000..369ccc0fe3d
--- /dev/null
+++ b/plugins/discourse-assign/test/javascripts/fixtures/assigned-topics-fixtures.js
@@ -0,0 +1,141 @@
+export default {
+ "/topics/messages-assigned/eviltrout.json": {
+ users: [
+ {
+ id: -2,
+ username: "discobot",
+ name: "discobot",
+ avatar_template: "/user_avatar/localhost/discobot/{size}/1_2.png",
+ },
+ {
+ id: -1,
+ username: "system",
+ name: "system",
+ avatar_template: "/user_avatar/localhost/system/{size}/2_2.png",
+ },
+ ],
+ primary_groups: [],
+ topic_list: {
+ can_create_topic: true,
+ draft: null,
+ draft_key: "new_topic",
+ draft_sequence: 0,
+ per_page: 30,
+ topics: [
+ {
+ id: 10,
+ title: "Greetings!",
+ fancy_title: "Greetings!",
+ slug: "greetings",
+ posts_count: 1,
+ reply_count: 0,
+ highest_post_number: 4,
+ image_url:
+ "//localhost:3000/plugins/discourse-narrative-bot/images/font-awesome-ellipsis.png",
+ created_at: "2019-05-08T13:52:39.394Z",
+ last_posted_at: "2019-05-08T13:52:39.841Z",
+ bumped: true,
+ bumped_at: "2019-05-08T13:52:39.841Z",
+ unseen: false,
+ last_read_post_number: 4,
+ unread: 0,
+ new_posts: 0,
+ pinned: false,
+ unpinned: null,
+ visible: true,
+ closed: false,
+ archived: false,
+ notification_level: 3,
+ bookmarked: false,
+ liked: false,
+ views: 0,
+ like_count: 0,
+ has_summary: false,
+ archetype: "private_message",
+ last_poster_username: "discobot",
+ category_id: null,
+ pinned_globally: false,
+ featured_link: null,
+ posters: [
+ {
+ extras: "latest single",
+ description: "Original Poster, Most Recent Poster",
+ user_id: -2,
+ primary_group_id: null,
+ },
+ ],
+ participants: [
+ {
+ extras: "latest",
+ description: null,
+ user_id: -2,
+ primary_group_id: null,
+ },
+ ],
+ assigned_to_user: {
+ id: 19,
+ username: "eviltrout",
+ name: null,
+ avatar_template:
+ "/letter_avatar_proxy/v4/letter/r/ed8c4c/{size}.png",
+ },
+ },
+ {
+ id: 11,
+ title: "Group Greetings!",
+ fancy_title: "Group Greetings!",
+ slug: "group greetings",
+ posts_count: 1,
+ reply_count: 0,
+ highest_post_number: 4,
+ image_url:
+ "//localhost:3000/plugins/discourse-narrative-bot/images/font-awesome-ellipsis.png",
+ created_at: "2019-05-08T13:52:39.394Z",
+ last_posted_at: "2019-05-08T13:52:39.841Z",
+ bumped: true,
+ bumped_at: "2019-05-08T13:52:39.841Z",
+ unseen: false,
+ last_read_post_number: 4,
+ unread: 0,
+ new_posts: 0,
+ pinned: false,
+ unpinned: null,
+ visible: true,
+ closed: false,
+ archived: false,
+ notification_level: 3,
+ bookmarked: false,
+ liked: false,
+ views: 0,
+ like_count: 0,
+ has_summary: false,
+ archetype: "private_message",
+ last_poster_username: "discobot",
+ category_id: null,
+ pinned_globally: false,
+ featured_link: null,
+ posters: [
+ {
+ extras: "latest single",
+ description: "Original Poster, Most Recent Poster",
+ user_id: -2,
+ primary_group_id: null,
+ },
+ ],
+ participants: [
+ {
+ extras: "latest",
+ description: null,
+ user_id: -2,
+ primary_group_id: null,
+ },
+ ],
+ assigned_to_group: {
+ id: 19,
+ name: "Developers",
+ },
+ },
+ ],
+ },
+ },
+};
diff --git a/plugins/discourse-assign/test/javascripts/fixtures/group-members-fixtures.js b/plugins/discourse-assign/test/javascripts/fixtures/group-members-fixtures.js
new file mode 100644
index 00000000000..a9f9c66cb73
--- /dev/null
+++ b/plugins/discourse-assign/test/javascripts/fixtures/group-members-fixtures.js
@@ -0,0 +1,38 @@
+export default {
+ "/assign/members/discourse": {
+ members: [
+ {
+ id: 1,
+ username: "ahmedgagan6",
+ name: null,
+ avatar_template: "/letter_avatar_proxy/v4/letter/a/838e76/{size}.png",
+ assignments_count: 40,
+ username_lower: "ahmedgagan6",
+ },
+ {
+ id: 4,
+ username: "gaganAhmed",
+ name: "Gagan ",
+ avatar_template: "/letter_avatar_proxy/v4/letter/g/8edcca/{size}.png",
+ assignments_count: 17,
+ username_lower: "gaganahmed",
+ },
+ {
+ id: 3,
+ username: "ahmedgagan",
+ name: "",
+ avatar_template: "/user_avatar/localhost/ahmedgagan/{size}/2_2.png",
+ assignments_count: 16,
+ username_lower: "ahmedgagan",
+ },
+ {
+ id: 2,
+ username: "Ahmed",
+ name: "Ahmed Gagan",
+ avatar_template: "/letter_avatar_proxy/v4/letter/a/8c91f0/{size}.png",
+ assignments_count: 15,
+ username_lower: "ahmed",
+ },
+ ],
+ },
+};
diff --git a/plugins/discourse-assign/test/javascripts/fixtures/notifications-fixtures.js b/plugins/discourse-assign/test/javascripts/fixtures/notifications-fixtures.js
new file mode 100644
index 00000000000..c27f2d90494
--- /dev/null
+++ b/plugins/discourse-assign/test/javascripts/fixtures/notifications-fixtures.js
@@ -0,0 +1,87 @@
+export default {
+ "/assign/notifications/eviltrout": {
+ notifications: [
+ {
+ id: 193,
+ user_id: 26,
+ notification_type: 34,
+ read: false,
+ high_priority: true,
+ created_at: "2022-03-18T17:51:11.920Z",
+ post_number: 1,
+ topic_id: 59,
+ fancy_title:
+ "A bear, however hard he tries, grows tubby without exercise",
+ slug: "a-bear-however-hard-he-tries-grows-tubby-without-exercise",
+ data: {
+ message: "discourse_assign.assign_notification",
+ display_username: "system",
+ topic_title:
+ "A bear, however hard he tries, grows tubby without exercise",
+ },
+ },
+ {
+ id: 192,
+ user_id: 26,
+ notification_type: 12,
+ read: false,
+ high_priority: false,
+ created_at: "2022-03-18T16:47:09.668Z",
+ post_number: null,
+ topic_id: null,
+ slug: null,
+ data: {
+ badge_id: 5,
+ badge_name: "Welcome",
+ badge_slug: "welcome",
+ badge_title: false,
+ username: "eviltrout",
+ },
+ },
+ {
+ id: 191,
+ user_id: 26,
+ notification_type: 5,
+ read: false,
+ high_priority: false,
+ created_at: "2022-03-18T16:46:57.744Z",
+ post_number: 5,
+ topic_id: 59,
+ fancy_title:
+ "A bear, however hard he tries, grows tubby without exercise",
+ slug: "a-bear-however-hard-he-tries-grows-tubby-without-exercise",
+ data: {
+ topic_title:
+ "A bear, however hard he tries, grows tubby without exercise",
+ original_post_id: 285,
+ original_post_type: 1,
+ original_username: "system",
+ revision_number: null,
+ display_username: "system",
+ },
+ },
+ {
+ id: 148,
+ user_id: 26,
+ notification_type: 12,
+ read: false,
+ high_priority: false,
+ created_at: "2022-03-17T21:49:02.226Z",
+ post_number: null,
+ topic_id: null,
+ slug: null,
+ data: {
+ badge_id: 1,
+ badge_name: "Basic",
+ badge_slug: "basic",
+ badge_title: false,
+ username: "eviltrout",
+ },
+ },
+ ],
+ total_rows_notifications: 4,
+ seen_notification_id: 193,
+ load_more_notifications:
+ "/notifications?filter=all&offset=60&username=eviltrout",
+ },
+};
diff --git a/plugins/discourse-assign/test/javascripts/fixtures/topic-with-assigned-posts.js b/plugins/discourse-assign/test/javascripts/fixtures/topic-with-assigned-posts.js
new file mode 100644
index 00000000000..70cabf3ff11
--- /dev/null
+++ b/plugins/discourse-assign/test/javascripts/fixtures/topic-with-assigned-posts.js
@@ -0,0 +1,28 @@
+import { cloneJSON } from "discourse/lib/object";
+import topicFixtures from "discourse/tests/fixtures/topic";
+
+export default function topicWithAssignedPosts() {
+ const username = "eviltrout";
+ const topic = cloneJSON(topicFixtures["/t/28830/1.json"]);
+ const firstReply = topic.post_stream.posts[1];
+ const secondReply = topic.post_stream.posts[2];
+
+ topic["indirectly_assigned_to"] = {
+ [firstReply.id]: {
+ assigned_to: {
+ username,
+ },
+ post_number: 1,
+ },
+ [secondReply.id]: {
+ assigned_to: {
+ username,
+ },
+ post_number: 2,
+ },
+ };
+ firstReply["assigned_to_user"] = { username };
+ secondReply["assigned_to_user"] = { username };
+
+ return topic;
+}
diff --git a/plugins/discourse-assign/test/javascripts/integration/components/group-assigned-filter-test.gjs b/plugins/discourse-assign/test/javascripts/integration/components/group-assigned-filter-test.gjs
new file mode 100644
index 00000000000..894b3cb6ae2
--- /dev/null
+++ b/plugins/discourse-assign/test/javascripts/integration/components/group-assigned-filter-test.gjs
@@ -0,0 +1,34 @@
+import { render } from "@ember/test-helpers";
+import { module, test } from "qunit";
+import { setupRenderingTest } from "discourse/tests/helpers/component-test";
+import GroupAssignedFilter from "discourse/plugins/discourse-assign/discourse/components/group-assigned-filter";
+
+module(
+ "Discourse Assign | Integration | Component | group-assigned-filter",
+ function (hooks) {
+ setupRenderingTest(hooks);
+
+ test("displays username and name", async function (assert) {
+ const filter = {
+ id: 2,
+ username: "Ahmed",
+ name: "Ahmed Gagan",
+ avatar_template: "/letter_avatar_proxy/v4/letter/a/8c91f0/{size}.png",
+ title: "trust_level_0",
+ last_posted_at: "2020-06-22T10:15:54.532Z",
+ last_seen_at: "2020-07-07T11:55:59.437Z",
+ added_at: "2020-06-22T09:55:31.692Z",
+ timezone: "Asia/Calcutta",
+ };
+
+ await render(
+ <template>
+ <GroupAssignedFilter @showAvatar={{true}} @filter={{filter}} />
+ </template>
+ );
+
+ assert.dom(".assign-username").hasText("Ahmed");
+ assert.dom(".assign-name").hasText("Ahmed Gagan");
+ });
+ }
+);
diff --git a/translator.yml b/translator.yml
index 838cb7ce656..c664c1c41d6 100644
--- a/translator.yml
+++ b/translator.yml
@@ -220,3 +220,10 @@ files:
- source_path: plugins/discourse-user-notes/config/locales/server.en.yml
destination_path: plugins/user-notes/server.yml
label: user-notes
+
+ - source_path: plugins/discourse-assign/config/locales/client.en.yml
+ destination_path: plugins/assign/client.yml
+ label: assign
+ - source_path: plugins/discourse-assign/config/locales/server.en.yml
+ destination_path: plugins/assign/server.yml
+ label: assign