FIX: Add 'none' option to region selector (#94)
This commit is contained in:
parent
db6cab9cf1
commit
08ddbcc769
|
|
@ -18,11 +18,13 @@ export default ComboBoxComponent.extend({
|
|||
localeNames[locale.value] = locale.name;
|
||||
});
|
||||
|
||||
return HOLIDAY_REGIONS.map((region) => {
|
||||
return {
|
||||
let values = [{ name: I18n.t("discourse_calendar.region.none"), id: null }];
|
||||
values = values.concat(
|
||||
HOLIDAY_REGIONS.map((region) => ({
|
||||
name: I18n.t(`discourse_calendar.region.names.${region}`),
|
||||
id: region,
|
||||
};
|
||||
}).sort((a, b) => a.name.localeCompare(b.name));
|
||||
})).sort((a, b) => a.name.localeCompare(b.name))
|
||||
);
|
||||
return values;
|
||||
}),
|
||||
});
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@ en:
|
|||
add_to_calendar: "Add to Google Calendar"
|
||||
region:
|
||||
title: "Region"
|
||||
none: "Select a region..."
|
||||
none: "None"
|
||||
use_current_region: "Use Current Region"
|
||||
names:
|
||||
ar: "Argentina"
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@ module Jobs
|
|||
UserCustomField
|
||||
.where(name: ::DiscourseCalendar::REGION_CUSTOM_FIELD)
|
||||
.pluck(:user_id, :value)
|
||||
.each { |user_id, region| regions_and_user_ids[region] << user_id }
|
||||
.each { |user_id, region| regions_and_user_ids[region] << user_id if region.present? }
|
||||
|
||||
usernames = User
|
||||
.real
|
||||
|
|
|
|||
Loading…
Reference in New Issue