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;
|
localeNames[locale.value] = locale.name;
|
||||||
});
|
});
|
||||||
|
|
||||||
return HOLIDAY_REGIONS.map((region) => {
|
let values = [{ name: I18n.t("discourse_calendar.region.none"), id: null }];
|
||||||
return {
|
values = values.concat(
|
||||||
|
HOLIDAY_REGIONS.map((region) => ({
|
||||||
name: I18n.t(`discourse_calendar.region.names.${region}`),
|
name: I18n.t(`discourse_calendar.region.names.${region}`),
|
||||||
id: 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"
|
add_to_calendar: "Add to Google Calendar"
|
||||||
region:
|
region:
|
||||||
title: "Region"
|
title: "Region"
|
||||||
none: "Select a region..."
|
none: "None"
|
||||||
use_current_region: "Use Current Region"
|
use_current_region: "Use Current Region"
|
||||||
names:
|
names:
|
||||||
ar: "Argentina"
|
ar: "Argentina"
|
||||||
|
|
|
||||||
|
|
@ -15,7 +15,7 @@ module Jobs
|
||||||
UserCustomField
|
UserCustomField
|
||||||
.where(name: ::DiscourseCalendar::REGION_CUSTOM_FIELD)
|
.where(name: ::DiscourseCalendar::REGION_CUSTOM_FIELD)
|
||||||
.pluck(:user_id, :value)
|
.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
|
usernames = User
|
||||||
.real
|
.real
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue