Skip to content

Commit 30765cd

Browse files
committed
Merge branch 'master' into 411-update-angular
2 parents 718f764 + cf07759 commit 30765cd

File tree

4 files changed

+150
-13
lines changed

4 files changed

+150
-13
lines changed
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
name: Check PR Release Notes in Description
2+
3+
on:
4+
pull_request:
5+
types: [opened, synchronize, reopened, edited, labeled, unlabeled]
6+
branches: [ master ]
7+
8+
jobs:
9+
check-release-notes:
10+
runs-on: ubuntu-latest
11+
12+
steps:
13+
- uses: actions/[email protected]
14+
with:
15+
python-version: '3.11'
16+
17+
- name: Check presence of release notes in PR description
18+
uses: AbsaOSS/[email protected]
19+
env:
20+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
21+
with:
22+
github-repository: ${{ github.repository }}
23+
pr-number: ${{ github.event.number }}
Lines changed: 92 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,92 @@
1+
name: Release - create draft release
2+
on:
3+
workflow_dispatch:
4+
inputs:
5+
tag-name:
6+
description: 'Name of git tag to be created, and then draft release created. Syntax: "v[0-9]+.[0-9]+.[0-9]+".'
7+
required: true
8+
from-tag-name:
9+
description: 'Name of the git tag from which to detect changes from. Default value: latest tag. Syntax: "v[0-9]+.[0-9]+.[0-9]+".'
10+
required: false
11+
12+
jobs:
13+
release-draft:
14+
runs-on: ubuntu-latest
15+
steps:
16+
- uses: actions/checkout@v4
17+
with:
18+
fetch-depth: 0
19+
persist-credentials: false
20+
21+
- uses: actions/[email protected]
22+
with:
23+
python-version: '3.11'
24+
25+
- name: Check format of received tag
26+
id: check-version-tag
27+
uses: AbsaOSS/[email protected]
28+
env:
29+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
30+
with:
31+
github-repository: ${{ github.repository }}
32+
version-tag: ${{ github.event.inputs.tag-name }}
33+
34+
- name: Check format of received from tag
35+
if: ${{ github.event.inputs.from-tag-name }}
36+
id: check-version-from-tag
37+
uses: AbsaOSS/[email protected]
38+
env:
39+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
40+
with:
41+
github-repository: ${{ github.repository }}
42+
version-tag: ${{ github.event.inputs.from-tag-name }}
43+
should-exist: true
44+
45+
- name: Generate Release Notes
46+
id: generate_release_notes
47+
uses: AbsaOSS/[email protected]
48+
env:
49+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
50+
with:
51+
tag-name: ${{ github.event.inputs.tag-name }}
52+
from-tag-name: ${{ github.event.inputs.from-tag-name }}
53+
chapters: |
54+
- { title: No entry 🚫, label: duplicate }
55+
- { title: Breaking Changes 💥, label: breaking-change }
56+
- { title: New Features 🎉, label: enhancement }
57+
- { title: New Features 🎉, label: feature }
58+
- { title: Bugfixes 🛠, label: bug }
59+
- { title: Infrastructure ⚙️, label: infrastructure }
60+
- { title: Silent-live 🤫, label: silent-live }
61+
- { title: Documentation 📜, label: documentation }
62+
warnings: true
63+
64+
- name: Create and Push Tag
65+
uses: actions/github-script@v7
66+
with:
67+
script: |
68+
const tag = core.getInput('tag-name')
69+
const ref = `refs/tags/${tag}`;
70+
const sha = context.sha; // The SHA of the commit to tag
71+
72+
await github.rest.git.createRef({
73+
owner: context.repo.owner,
74+
repo: context.repo.repo,
75+
ref: ref,
76+
sha: sha
77+
});
78+
79+
console.log(`Tag created: ${tag}`);
80+
github-token: ${{ secrets.GITHUB_TOKEN }}
81+
tag-name: ${{ github.event.inputs.tag-name }}
82+
83+
- name: Create Draft Release
84+
uses: softprops/action-gh-release@v1
85+
env:
86+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
87+
with:
88+
name: ${{ github.event.inputs.tag-name }}
89+
body: ${{ steps.generate_release_notes.outputs.release-notes }}
90+
tag_name: ${{ github.event.inputs.tag-name }}
91+
draft: true
92+
prerelease: false

projects/cps-ui-kit/src/lib/components/cps-autocomplete/cps-autocomplete.component.spec.ts

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -403,4 +403,26 @@ describe('CpsAutocompleteComponent', () => {
403403
);
404404
expect(container).toBeTruthy();
405405
});
406+
407+
it('should clear input text and reset options when clearInput function is called', () => {
408+
component.options = [
409+
{ label: 'First Option', value: 'A' },
410+
{ label: 'Second Option', value: 'B' },
411+
{ label: 'Third Option', value: 'C' }
412+
];
413+
const event = new Event('input');
414+
Object.defineProperty(event, 'target', {
415+
value: { value: 'First' }
416+
});
417+
418+
component.autocompleteInput.nativeElement.dispatchEvent(event);
419+
420+
expect(component.inputText).toBe('First');
421+
expect(component.filteredOptions.length).toBe(1);
422+
423+
component.clearInput();
424+
425+
expect(component.inputText).toBe('');
426+
expect(component.filteredOptions.length).toBe(3);
427+
});
406428
});

projects/cps-ui-kit/src/lib/components/cps-autocomplete/cps-autocomplete.component.ts

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -533,7 +533,7 @@ export class CpsAutocompleteComponent
533533
}
534534

535535
if (needClearInput) {
536-
this._clearInput();
536+
this.clearInput();
537537
}
538538
if (needFocusInput) {
539539
setTimeout(() => {
@@ -635,7 +635,7 @@ export class CpsAutocompleteComponent
635635
const val = this.multiple ? [] : this._getEmptyValue();
636636
this.updateValue(val);
637637
}
638-
this._clearInput();
638+
this.clearInput();
639639
this._dehighlightOption();
640640
setTimeout(() => {
641641
this.focusInput();
@@ -776,6 +776,15 @@ export class CpsAutocompleteComponent
776776
);
777777
}
778778

779+
clearInput(): void {
780+
this.filteredOptions = this.options;
781+
this.inputText = '';
782+
this.inputTextDebounced = '';
783+
this._inputChangeSubject$.next('');
784+
this.activeSingle = false;
785+
this.recalcVirtualListHeight();
786+
}
787+
779788
private _getEmptyValue() {
780789
const option = this.options[this.emptyOptionIndex];
781790
return !option
@@ -884,17 +893,8 @@ export class CpsAutocompleteComponent
884893
: '';
885894
}
886895

887-
private _clearInput() {
888-
this.filteredOptions = this.options;
889-
this.inputText = '';
890-
this.inputTextDebounced = '';
891-
this._inputChangeSubject$.next('');
892-
this.activeSingle = false;
893-
this.recalcVirtualListHeight();
894-
}
895-
896896
private _closeAndClear() {
897-
this._clearInput();
897+
this.clearInput();
898898
this._toggleOptions(false);
899899
this._dehighlightOption();
900900
}
@@ -994,7 +994,7 @@ export class CpsAutocompleteComponent
994994
}
995995
}
996996

997-
this._clearInput();
997+
this.clearInput();
998998
}
999999

10001000
private _removeLastValue() {

0 commit comments

Comments
 (0)