mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-11-15 05:59:05 +08:00
fix(config): allow LogLevel to work with isolatedModules and update all warns and errors to respect logLevel (#30350)
Issue number: internal --------- ## What is the current behavior? - `LogLevel` throws error `Error: Cannot access ambient const enums when 'isolatedModules' is enabled` - Several existing console warns and errors are not calling the function that respects the `logLevel` config ## What is the new behavior? - Remove `const` from the `enum` to work with `isolatedModules` - Update `console.warn`s to `printIonWarning` - Update `console.error`s to `printIonError` ## Does this introduce a breaking change? - [ ] Yes - [x] No ## Other information Dev build: `8.5.5-dev.11744729748.174bf7e0` --------- Co-authored-by: Brandy Smith <6577830+brandyscarney@users.noreply.github.com>
This commit is contained in:
@@ -4,6 +4,7 @@ import type { NotchController } from '@utils/forms';
|
||||
import { compareOptions, createNotchController, isOptionSelected } from '@utils/forms';
|
||||
import { focusVisibleElement, renderHiddenInput, inheritAttributes } from '@utils/helpers';
|
||||
import type { Attributes } from '@utils/helpers';
|
||||
import { printIonWarning } from '@utils/logging';
|
||||
import { actionSheetController, alertController, popoverController, modalController } from '@utils/overlays';
|
||||
import type { OverlaySelect } from '@utils/overlays-interface';
|
||||
import { isRTL } from '@utils/rtl';
|
||||
@@ -426,15 +427,15 @@ export class Select implements ComponentInterface {
|
||||
private createOverlay(ev?: UIEvent): Promise<OverlaySelect> {
|
||||
let selectInterface = this.interface;
|
||||
if (selectInterface === 'action-sheet' && this.multiple) {
|
||||
console.warn(
|
||||
`Select interface cannot be "${selectInterface}" with a multi-value select. Using the "alert" interface instead.`
|
||||
printIonWarning(
|
||||
`[ion-select] - Interface cannot be "${selectInterface}" with a multi-value select. Using the "alert" interface instead.`
|
||||
);
|
||||
selectInterface = 'alert';
|
||||
}
|
||||
|
||||
if (selectInterface === 'popover' && !ev) {
|
||||
console.warn(
|
||||
`Select interface cannot be a "${selectInterface}" without passing an event. Using the "alert" interface instead.`
|
||||
printIonWarning(
|
||||
`[ion-select] - Interface cannot be a "${selectInterface}" without passing an event. Using the "alert" interface instead.`
|
||||
);
|
||||
selectInterface = 'alert';
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user