Skip to content

Commit 0df93c9

Browse files
authored
Merge branch 'master' into valadzhov/toast-position-not-working-10305-master
2 parents a359263 + 29955a5 commit 0df93c9

File tree

9 files changed

+79
-16
lines changed

9 files changed

+79
-16
lines changed

.github/workflows/nodejs.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ jobs:
4141
npm run test:lib
4242
npm run test:styles
4343
npm run test:schematics
44+
npm run test:i18n
4445
env:
4546
NODE_OPTIONS: --max_old_space_size=4096
4647
- name: Build i18n & validate output

CHANGELOG.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ All notable changes for each version of this project will be documented in this
99
- Exporter services are no longer required to be provided in the application since they are now injected on a root level.
1010
- `IgxGridToolbarPinningComponent`, `IgxGridToolbarHidingComponent`
1111
- Exposed new input `buttonText` which sets the text that is displayed inside the dropdown button in the toolbar.
12+
- `IgxCombo`
13+
- Added `groupSortingDirection` input, which allows you to set groups sorting order.
1214

1315
### General
1416

@@ -33,6 +35,12 @@ All notable changes for each version of this project will be documented in this
3335
- `IgxColumnActionsComponent`
3436
- **Breaking Change** - The following input has been removed
3537
- Input `columns`. Use `igxGrid` `columns` input instead.
38+
39+
## 12.2.3
40+
41+
### General
42+
- **Breaking Change** - `IgxPercentSummaryOperand` and `IgxCurrencySummaryOperand` have been removed and `IgxNumberSummaryOperand` should be used instead. If you have used the percent or currency summary operands to extend a custom summary operand from them, then change the custom operand to extend from the number summary operand.
43+
3644
## 12.2.1
3745

3846
### New Features
@@ -3657,3 +3665,4 @@ export class IgxCustomFilteringOperand extends IgxFilteringOperand {
36573665
- `IgxDraggableDirective` moved inside `../directives/dragdrop/` folder
36583666
- `IgxRippleDirective` moved inside `../directives/ripple/` folder
36593667
- Folder `"./navigation/nav-service"` renamed to `"./navigation/nav.service"`
3668+

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
"test:lib:watch": "ng test igniteui-angular --karma-config=./projects/igniteui-angular/karma.watch.conf.js",
2424
"test:schematics": "ts-node --project projects/igniteui-angular/migrations/tsconfig.json ./node_modules/jasmine/bin/jasmine.js ./projects/igniteui-angular/migrations/**/*.spec.ts ./projects/igniteui-angular/schematics/**/*.spec.ts",
2525
"test:styles": "ts-node --skip-project ./node_modules/jasmine/bin/jasmine.js ./projects/igniteui-angular/src/lib/core/styles/spec/tests.ts",
26+
"test:i18n": "ts-node --skip-project ./projects/igniteui-angular/src/lib/core/i18n/tests/tests.ts",
2627
"build:lib": "ng build igniteui-angular --configuration production && gulp buildStyle",
2728
"build:style": "gulp buildStyle",
2829
"build:migration": "gulp copyMigrations && tsc --listEmittedFiles --project ./projects/igniteui-angular/migrations/tsconfig.json",

projects/igniteui-angular/src/lib/combo/combo.component.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@
5252
[tabindex]="dropdown.collapsed ? -1 : 0" role="listbox" [attr.id]="dropdown.id">
5353
<igx-combo-item role="option" [itemHeight]='itemHeight' *igxFor="let item of data
5454
| comboFiltering:filterValue:displayKey:filterable:filteringOptions
55-
| comboGrouping:groupKey:valueKey;
55+
| comboGrouping:groupKey:valueKey:groupSortingDirection;
5656
index as rowIndex; containerSize: itemsMaxHeight; scrollOrientation: 'vertical'; itemSize: itemHeight"
5757
[value]="item" [isHeader]="item.isHeader" [index]="rowIndex">
5858
<ng-container *ngIf="item.isHeader">

projects/igniteui-angular/src/lib/combo/combo.component.spec.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ import { AbsoluteScrollStrategy, ConnectedPositioningStrategy } from '../service
2828
import { IgxSelectionAPIService } from '../core/selection';
2929
import { IgxIconService } from '../icon/public_api';
3030
import { IBaseCancelableBrowserEventArgs } from '../core/utils';
31+
import { SortingDirection } from '../data-operations/sorting-expression.interface';
3132

3233
const CSS_CLASS_COMBO = 'igx-combo';
3334
const CSS_CLASS_COMBO_DROPDOWN = 'igx-combo__drop-down';
@@ -2172,6 +2173,17 @@ describe('igxCombo', () => {
21722173
expect(combo.dropdown.headers.length).toEqual(1);
21732174
expect(combo.dropdown.headers[0].element.nativeElement.innerText).toEqual(fallBackGroup);
21742175
});
2176+
it('should sort groups correctly', () => {
2177+
combo.groupSortingDirection = SortingDirection.Asc;
2178+
combo.toggle();
2179+
fixture.detectChanges();
2180+
expect(combo.dropdown.headers[0].element.nativeElement.innerText).toEqual('East North Central');
2181+
2182+
combo.groupSortingDirection = SortingDirection.Desc;
2183+
combo.toggle();
2184+
fixture.detectChanges();
2185+
expect(combo.dropdown.headers[0].element.nativeElement.innerText).toEqual('West South Cent');
2186+
});
21752187
});
21762188
describe('Filtering tests: ', () => {
21772189
configureTestSuite();

projects/igniteui-angular/src/lib/combo/combo.component.ts

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ import { EditorProvider } from '../core/edit-provider';
4040
import { IgxInputState, IgxInputDirective } from '../directives/input/input.directive';
4141
import { IgxInputGroupType, IGX_INPUT_GROUP_TYPE } from '../input-group/public_api';
4242
import { caseSensitive } from '@igniteui/material-icons-extended';
43+
import { SortingDirection } from '../data-operations/sorting-expression.interface';
4344

4445
/**
4546
* @hidden
@@ -774,6 +775,25 @@ export class IgxComboComponent extends DisplayDensityBase implements IgxComboBas
774775
@Input()
775776
public filterable = true;
776777

778+
/**
779+
* An @Input property that sets groups sorting order.
780+
*
781+
* @example
782+
* ```html
783+
* <igx-combo [groupSortingDirection]="groupSortingDirection"></igx-combo>
784+
* ```
785+
* ```typescript
786+
* public groupSortingDirection = SortingDirection.Asc;
787+
* ```
788+
*/
789+
@Input()
790+
public get groupSortingDirection(): SortingDirection {
791+
return this._groupSortingDirection;
792+
}
793+
public set groupSortingDirection(val: SortingDirection) {
794+
this._groupSortingDirection = val;
795+
}
796+
777797
/**
778798
* An @Input property that set aria-labelledby attribute
779799
* ```html
@@ -906,6 +926,7 @@ export class IgxComboComponent extends DisplayDensityBase implements IgxComboBas
906926
private _overlaySettings: OverlaySettings;
907927
private _value = '';
908928
private _valid = IgxComboState.INITIAL;
929+
private _groupSortingDirection: SortingDirection = SortingDirection.Asc;
909930

910931
constructor(
911932
protected elementRef: ElementRef,

projects/igniteui-angular/src/lib/combo/combo.pipes.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,14 +44,14 @@ export class IgxComboGroupingPipe implements PipeTransform {
4444

4545
constructor(@Inject(IGX_COMBO_COMPONENT) public combo: IgxComboBase) { }
4646

47-
public transform(collection: any[], groupKey: any, valueKey: any) {
47+
public transform(collection: any[], groupKey: any, valueKey: any, sortingDirection: SortingDirection) {
4848
this.combo.filteredData = collection;
4949
if ((!groupKey && groupKey !== 0) || !collection.length) {
5050
return collection;
5151
}
5252
const sorted = DataUtil.sort(cloneArray(collection), [{
5353
fieldName: groupKey,
54-
dir: SortingDirection.Asc,
54+
dir: sortingDirection,
5555
ignoreCase: true,
5656
strategy: DefaultSortingStrategy.instance()
5757
}]);
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
import * as fs from 'fs';
2+
import * as path from 'path';
3+
4+
const i18nProductPath = path.join(__dirname, '../');
5+
const i18nLanguagesPath = path.join(__dirname, '../../../../../../igniteui-angular-i18n/src/i18n');
6+
const errors = [];
7+
8+
class i18nTests {
9+
public runTests(): void {
10+
this.i18nFilesMatchForAllLanguages();
11+
}
12+
13+
public getDirectories = srcPath => fs.readdirSync(srcPath).filter(file => fs.statSync(path.join(srcPath, file)).isDirectory());
14+
public getFiles = srcPath => fs.readdirSync(srcPath).filter(file => fs.statSync(path.join(srcPath, file)).isFile());
15+
16+
public i18nFilesMatchForAllLanguages(): void {
17+
this.getDirectories(i18nLanguagesPath).forEach(dir => {
18+
const curDirPath = path.join(i18nLanguagesPath, dir);
19+
if (this.getFiles(curDirPath).length !== this.getFiles(i18nProductPath).length) {
20+
errors.push(`Not all i18n component files that are available for localization have matching files for ${dir} language.
21+
Check and add the appropriate resource strings with EN translation and mark the PR as 'pending localization'`
22+
);
23+
}
24+
});
25+
if (errors.length > 0) {
26+
throw errors;
27+
}
28+
}
29+
}
30+
31+
new i18nTests().runTests();

projects/igniteui-angular/src/lib/grids/toolbar/grid-toolbar.component.ts

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,8 @@ import {
66
Inject,
77
Input,
88
OnDestroy,
9-
OnInit,
109
Optional
1110
} from '@angular/core';
12-
import { first } from 'rxjs/operators';
1311
import { Subscription } from 'rxjs';
1412
import { IDisplayDensityOptions, DisplayDensityToken, DisplayDensityBase } from '../../core/displayDensity';
1513
import { IgxIconService } from '../../icon/public_api';
@@ -30,7 +28,7 @@ import { GridType } from '../common/grid.interface';
3028
selector: 'igx-grid-toolbar',
3129
templateUrl: './grid-toolbar.component.html'
3230
})
33-
export class IgxGridToolbarComponent extends DisplayDensityBase implements OnInit, OnDestroy {
31+
export class IgxGridToolbarComponent extends DisplayDensityBase implements OnDestroy {
3432

3533
/**
3634
* When enabled, shows the indeterminate progress bar.
@@ -106,10 +104,6 @@ export class IgxGridToolbarComponent extends DisplayDensityBase implements OnIni
106104
return this.displayDensity === 'compact';
107105
}
108106

109-
/** @hidden @internal */
110-
@HostBinding('style.max-width.px')
111-
@HostBinding('style.flex-basis.px')
112-
public width = null;
113107

114108
protected _grid: IgxGridBaseDirective;
115109
protected sub: Subscription;
@@ -125,12 +119,6 @@ export class IgxGridToolbarComponent extends DisplayDensityBase implements OnIni
125119
this.iconService.addSvgIconFromText(unpinLeft.name, unpinLeft.value, 'imx-icons');
126120
}
127121

128-
/** @hidden @internal */
129-
public ngOnInit() {
130-
this.grid.rendered$.pipe(first()).subscribe(() => this.width = this.grid.outerWidth);
131-
this.sub = this.grid.resizeNotify.subscribe(() => this.width = this.grid.outerWidth);
132-
}
133-
134122
/** @hidden @internal */
135123
public ngOnDestroy() {
136124
this.sub?.unsubscribe();

0 commit comments

Comments
 (0)