Skip to content

Commit 832bbc3

Browse files
authored
Merge branch 'master' into dTsvetkov/fix-10075-master
2 parents 668b06e + e82234c commit 832bbc3

31 files changed

+248
-167
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/directives/toggle/toggle.directive.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -322,7 +322,7 @@ export class IgxToggleDirective implements IToggleView, OnInit, OnDestroy {
322322
if (this.navigationService && this.id) {
323323
this.navigationService.remove(this.id);
324324
}
325-
if (!this.collapsed && this._overlayId) {
325+
if (this._overlayId) {
326326
this.overlayService.detach(this._overlayId);
327327
}
328328
this.unsubscribe();

projects/igniteui-angular/src/lib/grids/columns/column.component.ts

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ import { IgxGridFilteringCellComponent } from '../filtering/base/grid-filtering-
3838
import { IgxGridHeaderGroupComponent } from '../headers/grid-header-group.component';
3939
import {
4040
IgxSummaryOperand, IgxNumberSummaryOperand, IgxDateSummaryOperand,
41-
IgxCurrencySummaryOperand, IgxPercentSummaryOperand, IgxSummaryResult, IgxTimeSummaryOperand
41+
IgxSummaryResult, IgxTimeSummaryOperand
4242
} from '../summaries/grid-summary';
4343
import {
4444
IgxCellTemplateDirective,
@@ -1711,6 +1711,8 @@ export class IgxColumnComponent implements AfterContentInit, OnDestroy {
17111711
this.summaries = IgxSummaryOperand;
17121712
break;
17131713
case GridColumnDataType.Number:
1714+
case GridColumnDataType.Currency:
1715+
case GridColumnDataType.Percent:
17141716
this.summaries = IgxNumberSummaryOperand;
17151717
break;
17161718
case GridColumnDataType.Date:
@@ -1720,12 +1722,6 @@ export class IgxColumnComponent implements AfterContentInit, OnDestroy {
17201722
case GridColumnDataType.Time:
17211723
this.summaries = IgxTimeSummaryOperand;
17221724
break;
1723-
case GridColumnDataType.Currency:
1724-
this.summaries = IgxCurrencySummaryOperand;
1725-
break;
1726-
case GridColumnDataType.Percent:
1727-
this.summaries = IgxPercentSummaryOperand;
1728-
break;
17291725
default:
17301726
this.summaries = IgxSummaryOperand;
17311727
break;

0 commit comments

Comments
 (0)