Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@PascalRepond
Copy link
Contributor

No description provided.

@PascalRepond PascalRepond force-pushed the rep-scrollheight branch 2 times, most recently from 6a0ec04 to 0925c5c Compare June 25, 2025 09:52
@PascalRepond PascalRepond requested review from Garfield-fr and jma June 25, 2025 09:52
Copy link
Contributor

@Garfield-fr Garfield-fr left a 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.

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';
Copy link
Contributor

@Garfield-fr Garfield-fr Jun 26, 2025

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

Copy link
Contributor Author

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. 😅

Copy link
Contributor

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';
Copy link
Contributor

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';
Copy link
Contributor

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';
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same here

@Garfield-fr Garfield-fr self-requested a review June 26, 2025 08:27
@PascalRepond PascalRepond force-pushed the rep-scrollheight branch 2 times, most recently from 2b8fccc to 7f9437e Compare June 26, 2025 09:35
@PascalRepond PascalRepond merged commit 3a2f21a into rero:staging Jun 26, 2025
2 checks passed
@PascalRepond PascalRepond deleted the rep-scrollheight branch June 26, 2025 09:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants