-
Notifications
You must be signed in to change notification settings - Fork 13
style(select): harmonise scrollHeights for selects #723
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
6a0ec04 to
0925c5c
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Centralize the height in the config.ts file in the utils folder
export const CONFIG = {
MESSAGE_LIFE: 5000, // Message lifetime in ms
SELECT_SCROLL_HEIGHT: '50vh'
}
And use this in the various components. This allows you to change the value all at once, should you wish to modify it later.
0925c5c to
8ebffde
Compare
| import { MultiSelectModule as PrimeNgMultiSelectModule } from 'primeng/multiselect'; | ||
| import { map, merge, Observable, Subscription, switchMap, tap } from 'rxjs'; | ||
| import { TranslateLabelService } from '../services/translate-label.service'; | ||
| import { CONFIG } from '../../../../../utils/config'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since it's a module, I think it would be better to inject the config via the configuration and not via an import. This would create an external dependency.
Then, you can use inject in the component.
https://medium.com/ngconf/configure-your-angular-apps-with-an-injection-token-be16eee59c40
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I read the article, but I'm still not sure what this means, and I have no clue how to implement. 😅
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can leave it like that, and we'll see how to change things next time we refactor.
| import { map, merge, Observable, Subject, switchMap } from 'rxjs'; | ||
| import { IQuery, IQueryOptions, IRemoteAutoCompleteFilter, IValueSelect } from './remote-autocomplete.interface'; | ||
| import { RemoteAutocompleteService } from './remote-autocomplete.service'; | ||
| import { CONFIG } from '../../../../../utils/config'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same here
| import { SelectModule } from 'primeng/select'; | ||
| import { map, merge, Observable, Subscription, switchMap, tap } from 'rxjs'; | ||
| import { TranslateLabelService } from '../services/translate-label.service'; | ||
| import { CONFIG } from '../../../../../utils/config'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same here
| import { TreeSelectModule } from 'primeng/treeselect'; | ||
| import { map, merge, Observable, Subscription, switchMap, tap } from 'rxjs'; | ||
| import { TranslateLabelService } from '../services/translate-label.service'; | ||
| import { CONFIG } from '../../../../../utils/config'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same here
2b8fccc to
7f9437e
Compare
Co-Authored-by: Pascal Repond <[email protected]>
7f9437e to
89ec1f7
Compare
No description provided.