Not possible to use a nested property for optionLabel/optionValue/optionInfo in CpsSelect
Maintainers usually reply within 1 day
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 25/100
- Issue type
- Feature
- Clarity
- Mostly clear
- Activity status
- Stale
- Tech stack
- angular, typescript
- Domain
- frontend
Research direction
Start at the CpsSelect and CpsTreeSelect entry points named in the issue, then inspect the corresponding CpsAutocomplete and CpsTreeAutocomplete APIs. Done means the affected optionLabel, optionValue, and optionInfo inputs support the requested nested-property use case, with behavior verified against the existing linked pull request and relevant component tests.
Written by the indexing model from the issue text.
Description
Currently, if one wants to use nested property for optionLabel/optionValue/optionInfo it's not possible. Let me illustrate on an example:
We have an array of options of the following type:
interface Option {
name: string;
address: {
city: string;
};
}
And we want to use it in a CpsSelect:
<cps-select
[options]="options"
optionLabel="address.city" <!-- currently not possible -->
>
</cps-select>
I'd suggest supporting not only string type but also a Function type for those inputs, so that a user can define custom function that will take option object and would return value to be used for optionLabel/Value/Info, e.g.:
const getCity = (option: Option): string => option.address.city;
<cps-select
[options]="options"
optionLabel="getCity"
>
</cps-select>
Components that might also support this:
CpsSelect/CpsTreeSelect
CpsAutocomplete/CpsTreeAutocomplete
- Dominant language
- TypeScript
- Stars
- 9
- Forks
- 7
- Avg merge
- 11h 59m
- Merged PRs (30d)
- 8
Getting set up
This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from AbsaOSS/cps-shared-ui
-
enhancement library
Difficulty 1/5 Under an hour Newbie friendliness 85/100
AbsaOSS/cps-shared-ui#644 ·
Maintainers usually reply within 1 day
-
library new component
Difficulty 3/5 Half a day Newbie friendliness 55/100
AbsaOSS/cps-shared-ui#853 ·
Maintainers usually reply within 1 day
-
library new component
Difficulty 3/5 1-2 days Newbie friendliness 62/100
AbsaOSS/cps-shared-ui#792 ·
Maintainers usually reply within 1 day
-
library tech-debt
Difficulty 3/5 1-2 days Newbie friendliness 55/100
AbsaOSS/cps-shared-ui#692 ·
Maintainers usually reply within 1 day
-
library tech-debt
Difficulty 3/5 1-2 days Newbie friendliness 55/100
AbsaOSS/cps-shared-ui#691 ·
Maintainers usually reply within 1 day
All issues in AbsaOSS/cps-shared-ui
Similar issues
-
Contrib indemnité de départ à la retraite : faire le pont avec le simulateur sur la page génériqueOpenP1
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
SocialGouv/code-du-travail-numerique#7561 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
kubernetes-sigs/headlamp#7950 ·
Maintainers usually reply within 3 days
-
README for cliPossibly taken @Janvi-kapoor claimed this today. OpenOSCI'26
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
GauravKarakoti/SecureFlow#1308 · 1 comment ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
Maintainers usually reply within 1 day
-
documentation
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
vitest-dev/vitest#11577 ·
Maintainers usually reply within 1 day