fix: date range resources - extend calendar & extra props - #295
fix: date range resources - extend calendar & extra props#295damyanpetev wants to merge 2 commits into
Conversation
There was a problem hiding this comment.
Pull request overview
Fixes the Date Range Picker localization surface by ensuring its resource strings are no longer empty and properly inherit the Calendar resource strings, aligning the Blazor wrapper with the upstream web component contract referenced in #286.
Changes:
- Add Date Range Picker–specific resource string parameters (Separator/DoneButton/CancelButton) to the Blazor wrapper and serialization.
- Extend Date Range Picker resource string metadata to include the Calendar resource string keys.
- Update the DateRangePicker contract test to validate non-empty resource string wiring.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| tests/IgniteUI.Blazor.Tests/DateRangePickerTests.cs | Updates the contract test to assert resource strings serialize with expected keys/values. |
| src/src/ig/igniteui-core/WebDateRangePickerResourceStringsDescriptionMetadata.ts | Attempts to extend DateRangePicker resource-string metadata with calendar metadata and add new keys. |
| src/src/ig/igniteui-core/WebDateRangePickerResourceStringsDescription.ts | Adds TS description properties for separator/done/cancel resource strings. |
| src/components/Blazor/DateRangePickerResourceStrings.cs | Makes Blazor resource strings inherit calendar strings and adds new parameters + serialization. |
Suppressed comments (1)
src/src/ig/igniteui-core/WebDateRangePickerResourceStringsDescriptionMetadata.ts:34
- fillMetadata/register are delegating to WebCalendarDescriptionMetadata, which will register calendar component metadata and pollute the resource-strings metadata dictionary. Delegate to WebCalendarResourceStringsDescriptionMetadata instead so DateRangePicker resource strings correctly inherit the calendar resource-string keys (and __isPlainObject).
static fillMetadata(metadata: Dictionary$2<string, string>): void {
WebCalendarDescriptionMetadata.fillMetadata(metadata);
metadata.item("__qualifiedNameTS", "String:DateRangePickerResourceStrings");
metadata.item("__skipModuleRegisterWebComponents", "Boolean");
metadata.item("__importTypesWebComponents", "String:igniteui-webcomponents");
metadata.item("Separator", "String");
metadata.item("DoneButton", "(wc:Done)String");
metadata.item("CancelButton", "(wc:Cancel)String");
}
static register(context: TypeDescriptionContext): void {
WebCalendarDescriptionMetadata.register(context);
WebDateRangePickerResourceStringsDescriptionMetadata.ensureMetadata(context);
1fb06e4 to
747f4f2
Compare
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 4 out of 4 changed files in this pull request and generated no new comments.
Suppressed comments (3)
src/components/Blazor/DateRangePickerResourceStrings.cs:44
- For consistency with the rest of the wrapper codegen, add the missing
OnDoneButtonChanginghook forDoneButton. Also, otherWCWidgetMemberNameusages in the codebase use PascalCase (e.g.WCWidgetMemberName("Name")), so use"Done"here as well.
private string _doneButton;
/// <summary>
/// Text for the picker button that commits the range selection.
/// </summary>
[Parameter]
src/components/Blazor/DateRangePickerResourceStrings.cs:64
- For consistency with the rest of the wrapper codegen, add the missing
OnCancelButtonChanginghook forCancelButton. Also, otherWCWidgetMemberNameusages in the codebase use PascalCase, so use"Cancel"here as well.
private string _cancelButton;
/// <summary>
/// Text for the picker button that cancels the range selection.
/// </summary>
[Parameter]
src/components/Blazor/DateRangePickerResourceStrings.cs:26
- For consistency with other generated wrappers (e.g. CalendarResourceStrings.cs declares a
partial void On<Property>Changing(ref string newValue);for each parameter), add the missingOnSeparatorChanginghook before theSeparatorparameter.
This issue also appears in the following locations of the same file:
- line 40
- line 60
private string _separator;
/// <summary>
/// The text shown between the start and end inputs when the date range picker is configured with separate inputs.
/// </summary>
[Parameter]
|
|
||
| private string _doneButton; | ||
| /// <summary> | ||
| /// Text for the picker button that commits the range selection. |
|
|
||
| private string _cancelButton; | ||
| /// <summary> | ||
| /// Text for the picker button that cancels the range selection. |
|
|
||
| } | ||
| } | ||
|
|
There was a problem hiding this comment.
Missing last7Days, last30Days, currentMonth, yearToDate or we can defer that for when the localization refactor is done?
There was a problem hiding this comment.
Yeah, missed to leave that in the description - intentionally added only the ones I found in use, so I can avoid the awkward "what does this option do and what to do with it" problem we have with the calendar ones :)
There was a problem hiding this comment.
Ah, those weren't used though resourceStrings. so I didn't see them! Should be checking indexed access too I guess :). Okay, will add them as well

Description
Discovered from #286 - finding was the Date Range Picker resource strings are empty, but they should also extend the calendar ones, so fixed both and updated docs.
Type of Change (check all that apply):
Component(s) / Area(s) Affected:
How Has This Been Tested?
Test Configuration:
Screenshots / Recordings
Checklist:
README.MDCHANGELOG.MDupdates for newly added functionalityCloses #