Skip to content

Commit

Permalink
Merge branch 'master' into prod
Browse files Browse the repository at this point in the history
  • Loading branch information
cetincakiroglu committed May 16, 2024
2 parents b292897 + 54e7c24 commit 0e462f6
Show file tree
Hide file tree
Showing 71 changed files with 1,116 additions and 1,020 deletions.
110 changes: 55 additions & 55 deletions .github/workflows/pr-checker.yml
Original file line number Diff line number Diff line change
@@ -1,71 +1,71 @@
name: Pr Checker

on:
pull_request:
types: [edited, synchronize, opened, reopened]
pull_request:
types: [edited, synchronize, opened, reopened]

permissions:
contents: read
pull-requests: write
contents: read
pull-requests: write

jobs:
pr-open-check:
permissions:
issues: write
pull-requests: write
runs-on: ubuntu-latest
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
steps:
- name: Verify Linked Issue
uses: hattan/[email protected]
pr-open-check:
permissions:
issues: write
pull-requests: write
runs-on: ubuntu-latest
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
message: 'Thanks a lot for your contribution! But, PR does not seem to be linked to any issues. Please [manually link to an issue](https://docs.github.com/en/issues/tracking-your-work-with-issues/linking-a-pull-request-to-an-issue#manually-linking-a-pull-request-or-branch-to-an-issue-using-the-issue-sidebar) or mention it in the description using #<issue_id>.'
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
steps:
- name: Verify Linked Issue
uses: hattan/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
message: 'Thanks a lot for your contribution! But, PR does not seem to be linked to any issues. Please [manually link to an issue](https://docs.github.com/en/issues/tracking-your-work-with-issues/linking-a-pull-request-to-an-issue#manually-linking-a-pull-request-or-branch-to-an-issue-using-the-issue-sidebar) or mention it in the description using #<issue_id>.'

- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 16
cache: 'npm'
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 16
cache: 'npm'

- name: Install packages
run: |
npm install
- name: Install packages
run: |
npm install
- name: Code Format
id: codeFormat
run: |
npm run format:check
- name: Code Format
id: codeFormat
run: |
npm run format:check
#- name: Unit Test
# id: unitTest
# run: |
# npm run test:headless
#- name: Unit Test
# id: unitTest
# run: |
# npm run test:headless

- name: Add Code Format Fail Comment
if: always() && steps.codeFormat.outcome == 'failure'
uses: thollander/actions-comment-pull-request@v1
with:
message: |
Thanks a lot for your contribution! But, PR does not seem to fit our code format standards. Please run the 'npm run format' command and commit the changes.
- name: Add Code Format Fail Comment
if: always() && steps.codeFormat.outcome == 'failure'
uses: thollander/actions-comment-pull-request@v1
with:
message: |
Thanks a lot for your contribution! But, PR does not seem to fit our code format standards. Please run the 'npm run format' command and commit the changes.
- name: Add Unit Test Fail Comment
if: always() && steps.unitTest.outcome == 'failure'
uses: thollander/actions-comment-pull-request@v1
with:
message: |
Thanks a lot for your contribution! But, Unit tests failed. You can check the unit tests with the command 'npm run test:headless' and commit the changes.
#- name: Add Unit Test Fail Comment
# if: always() && steps.unitTest.outcome == 'failure'
# uses: thollander/actions-comment-pull-request@v1
# with:
# message: |
# Thanks a lot for your contribution! But, Unit tests failed. You can check the unit tests with the command 'npm run test:headless' and commit the changes.

- name: Add Label
if: ${{ failure() }}
uses: actions-ecosystem/action-add-labels@v1
with:
labels: 'Resolution: Needs Revision'
# - name: Add Label
# if: ${{ failure() }}
# uses: actions-ecosystem/action-add-labels@v1
# with:
# labels: 'Resolution: Needs Revision'

- name: Remove Label
uses: actions-ecosystem/action-remove-labels@v1
if: ${{ success() }}
with:
labels: 'Resolution: Needs Revision'
# - name: Remove Label
# uses: actions-ecosystem/action-remove-labels@v1
# if: ${{ success() }}
# with:
# labels: 'Resolution: Needs Revision'
56 changes: 49 additions & 7 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,40 @@
# Changelog
## [17.17.0](https://github.com/primefaces/primeng/tree/17.17.0) (2024-05-16)
[Full Changelog](https://github.com/primefaces/primeng/compare/17.16.1...17.17.0)

**Implemented New Features and Enhancements:**
- PrimeNGConfig | Add csp [\#15560](https://github.com/primefaces/primeng/issues/15560)
- TreeSelect: ng-touched not working & add onFocus, onBlur events [\#15537](https://github.com/primefaces/primeng/issues/15537)
- TreeSelect | lazy support [\#15579](https://github.com/primefaces/primeng/issues/15579)

**Fixed bugs:**
- Table: Numeric Filter [\#15512](https://github.com/primefaces/primeng/issues/15512)
- Table's select all checkbox shouldn't select the checkbox which are disabled [\#15338](https://github.com/primefaces/primeng/issues/15338)
- InputNumber: Selection lost when not selecting all content from left to right when prefix is enabled on the left. [\#15293](https://github.com/primefaces/primeng/issues/15293)
- Button/p-button and tooltip: Doesn't work correctly [\#15390](https://github.com/primefaces/primeng/issues/15390)
- Button Directive | label input type mismatch [\#15590](https://github.com/primefaces/primeng/issues/15590)
- Tooltip: Uncaught TypeError: Cannot read properties of null (reading 'style') [\#15518](https://github.com/primefaces/primeng/issues/15518)
- Tooltip | Tooltip is out of position after dialog opens [\#15529](https://github.com/primefaces/primeng/issues/15529)
- TreeSelect: Panel does not hide on selected item [\#15539](https://github.com/primefaces/primeng/issues/15539)
- Button | Remove wrapper span elements from icon templates [\#15582](https://github.com/primefaces/primeng/issues/15582)
- InputOtp: Paste function works when readonly set to true [\#15567](https://github.com/primefaces/primeng/issues/15567)
- p-tree: Node which is not selectable shouldn't have focus [\#14822](https://github.com/primefaces/primeng/issues/14822)
- Skeleton size property is no longer a string accepting rem values but instead expects shapes [\#15535](https://github.com/primefaces/primeng/issues/15535)
- Dropdown: attr.id not applied to input element when editable: true [\#15542](https://github.com/primefaces/primeng/issues/15542)
- Tooltip visual issue in 17.16.1 [\#15545](https://github.com/primefaces/primeng/issues/15545)
- Keyboard Trap within Galleria component [\#15546](https://github.com/primefaces/primeng/issues/15546)
- AutoFocus | doesn't work in dialog [\#15524](https://github.com/primefaces/primeng/issues/15524)
- Dialog | tabbing order is broken because of pFocusTrap [\#15482](https://github.com/primefaces/primeng/issues/15482)
- Autocomplete Component: Fix unit test [\#15554](https://github.com/primefaces/primeng/issues/15554)
- Orderlist Unit Test Fix [\#15571](https://github.com/primefaces/primeng/issues/15571)
- InputSwitch Component: Fix unit test [\#15573](https://github.com/primefaces/primeng/issues/15573)
- Autocomplete broken unit tests [\#15596](https://github.com/primefaces/primeng/issues/15596)
- Listbox unit test fix [\#15564](https://github.com/primefaces/primeng/issues/15564)
- Rating: Fix broken unit tests [\#15522](https://github.com/primefaces/primeng/issues/15522)
- Dialog: Fix broken unit test [\#15526](https://github.com/primefaces/primeng/issues/15526)
- Autocomplete Component: Fix unit test [\#15554](https://github.com/primefaces/primeng/issues/15554)
- Dropdown: Fix unit test [\#15511](https://github.com/primefaces/primeng/issues/15511)

## [17.16.1](https://github.com/primefaces/primeng/tree/17.16.1) (2024-05-09)
[Full Changelog](https://github.com/primefaces/primeng/compare/17.16.0...17.16.1)

Expand Down Expand Up @@ -610,16 +646,22 @@
- TypeError: this.focusedItemInfo.mutate is not a function [\#14119](https://github.com/primefaces/primeng/issues/14119)
- Upgrade to Angular 17? [\#14063](https://github.com/primefaces/primeng/issues/14063)


## ![LTS](https://www.primefaces.org/wp-content/uploads/2020/01/lts-icon-24.png "PrimeNG LTS") [16.9.10-LTS](https://www.npmjs.com/package/primeng/v/16.9.10-lts) (2024-05-16)

**Fixed bugs:**
- Tooltip visual issue in 17.16.1 [\#15545](https://github.com/primefaces/primeng/issues/15545)

## ![LTS](https://www.primefaces.org/wp-content/uploads/2020/01/lts-icon-24.png "PrimeNG LTS") [16.9.9-LTS](https://www.npmjs.com/package/primeng/v/16.9.9-lts) (2024-05-10)

**Fixed bugs:**
- Calendar: Add additional keyboard support [\#14995](https://github.com/primefaces/primeng/issues/14995)
- Tooltip | Tooltip-option tooltipEvent="focus" does not work on p-button [\#15472](https://github.com/primefaces/primeng/issues/15472)
- Tooltip | tooltipEvent - "focus" | "hover" combined [\#15468](https://github.com/primefaces/primeng/issues/15468)
- Dropdown head is empty if no value is provided [\#14954](https://github.com/primefaces/primeng/issues/14954)
- inputNumber with numeric prefix is not working as expected [\#15311](https://github.com/primefaces/primeng/issues/15311)
- Table | the 'not equal' filter is applied immediately after being selected [\#15283](https://github.com/primefaces/primeng/issues/15283)
- Dialog | tabbing order is broken because of pFocusTrap [\#15482](https://github.com/primefaces/primeng/issues/15482)
- Calendar: Add additional keyboard support [\#14995](https://github.com/primefaces/primeng/issues/14995)
- Tooltip | Tooltip-option tooltipEvent="focus" does not work on p-button [\#15472](https://github.com/primefaces/primeng/issues/15472)
- Tooltip | tooltipEvent - "focus" | "hover" combined [\#15468](https://github.com/primefaces/primeng/issues/15468)
- Dropdown head is empty if no value is provided [\#14954](https://github.com/primefaces/primeng/issues/14954)
- inputNumber with numeric prefix is not working as expected [\#15311](https://github.com/primefaces/primeng/issues/15311)
- Table | the 'not equal' filter is applied immediately after being selected [\#15283](https://github.com/primefaces/primeng/issues/15283)
- Dialog | tabbing order is broken because of pFocusTrap [\#15482](https://github.com/primefaces/primeng/issues/15482)
- AutoFocus | doesn't work in dialog [\#15524](https://github.com/primefaces/primeng/issues/15524)
- Tooltip | Tooltip is out of position after dialog opens [\#15529](https://github.com/primefaces/primeng/issues/15529)

Expand Down
24 changes: 18 additions & 6 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

60 changes: 53 additions & 7 deletions src/app/components/accordion/accordion.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { By } from '@angular/platform-browser';
import { Accordion } from './accordion';
import { AccordionTab } from './accordion';
import { NoopAnimationsModule } from '@angular/platform-browser/animations';
import { Component, DebugElement, NO_ERRORS_SCHEMA } from '@angular/core';
import { Component, NO_ERRORS_SCHEMA } from '@angular/core';

@Component({
template: `<p-accordion [collapseIcon]="collapseIcon" [expandIcon]="expandIcon" [styleClass]="styleClass" [style]="style">
Expand Down Expand Up @@ -175,15 +175,61 @@ describe('Accordion', () => {
expect(secondAccordionTabHeaderEl.className).toContain('p-highlight');
});

it('should be closed', () => {
fixture.detectChanges();

const secondAccordionTabOpenEl = fixture.debugElement.children[0].children[0].children[1].query(By.css('a')).nativeElement;
let spaceEvent = { which: 32, preventDefault() {} };
secondAccordionTab.onKeydown(spaceEvent as KeyboardEvent);
it('should be toggle on space and enter keydown event', () => {
fixture.detectChanges();

const secondAccordionTabHeaderEl = fixture.debugElement.children[0].children[0].children[1].query(By.css('.p-accordion-header')).nativeElement;
expect(secondAccordionTabHeaderEl.className).not.toContain('p-highlight');

//toggle when enter is pressed
const spaceEvent = new KeyboardEvent('keydown', { key: 'Enter', code: 'Enter' });
secondAccordionTab.onKeydown(spaceEvent);

expect(secondAccordionTabHeaderEl.className).toContain('p-highlight');

//toggle when space is pressed
const keyDownEvent = new KeyboardEvent('keydown', { key: 'Space', code: 'Space' });
secondAccordionTab.onKeydown(keyDownEvent);
fixture.detectChanges();

expect(secondAccordionTabHeaderEl.className).not.toContain('p-highlight');
});

describe('onKeydown', () => {
let firstAccordionTabEl;
let secondAccordionTabEl;

beforeEach(() => {
firstAccordionTabEl = fixture.debugElement.children[0].children[0].children[0].query(By.css('a')).nativeElement;
secondAccordionTabEl = fixture.debugElement.children[0].children[0].children[1].query(By.css('a')).nativeElement;
});

const testKeyBoardEvent = (keyCode, eventTarget, activeTab) => {
fixture.detectChanges();

const keyDownEvent = new KeyboardEvent('keydown', { code: keyCode });
spyOnProperty(keyDownEvent, 'target', 'get').and.returnValue(eventTarget);

accordion.onKeydown(keyDownEvent);
fixture.detectChanges();

expect(document.activeElement).toEqual(activeTab);
};

it('ArrowDown should focus on the next tab', () => {
testKeyBoardEvent('ArrowDown', firstAccordionTabEl, secondAccordionTabEl);
});

it('ArrowUp should focus on the next tab', () => {
testKeyBoardEvent('ArrowUp', secondAccordionTabEl, firstAccordionTabEl);
});

it('Home should focus on the first tab', () => {
testKeyBoardEvent('Home', secondAccordionTabEl, firstAccordionTabEl);
});

it('End should focus on the last tab', () => {
testKeyBoardEvent('End', firstAccordionTabEl, secondAccordionTabEl);
});
});
});
2 changes: 2 additions & 0 deletions src/app/components/api/primengconfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ export class PrimeNGConfig {

overlayOptions: OverlayOptions = {};

csp = signal<{ nonce: string | undefined }>({ nonce: undefined });

filterMatchModeOptions = {
text: [FilterMatchMode.STARTS_WITH, FilterMatchMode.CONTAINS, FilterMatchMode.NOT_CONTAINS, FilterMatchMode.ENDS_WITH, FilterMatchMode.EQUALS, FilterMatchMode.NOT_EQUALS],
numeric: [FilterMatchMode.EQUALS, FilterMatchMode.NOT_EQUALS, FilterMatchMode.LESS_THAN, FilterMatchMode.LESS_THAN_OR_EQUAL_TO, FilterMatchMode.GREATER_THAN, FilterMatchMode.GREATER_THAN_OR_EQUAL_TO],
Expand Down
Loading

0 comments on commit 0e462f6

Please sign in to comment.