diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md index 312485865..026492ffc 100644 --- a/.github/pull_request_template.md +++ b/.github/pull_request_template.md @@ -12,6 +12,7 @@ Addresses #*PR# HERE* ## Changelog + -- [#PR no] - **Description:** Summary of change(s) - **Products impact:** Choose from - none (for internal updates) / bugfix / new API / updated API / removed API. If it's 'none', use "-" for all items below to indicate they are not relevant. - **Addresses:** Link(s) to GH issue(s) addressed. Include KDS links as well as links to related issues in a consumer product repository too. @@ -31,7 +31,7 @@ Addresses #*PR# HERE* - **Impacts a11y:** Does this change improve a11y or adds new features that can be used to improve it? Choose from: yes / no - **Guidance:** Why and how to introduce this update to a consumer? Required for breaking changes, appreciated for changes with a11y impact, and welcomed for non-breaking changes when relevant. -[#PR no]: PR link + ## Steps to test diff --git a/.github/workflows/changelog.yml b/.github/workflows/changelog.yml index 01e6449a2..de43d362b 100644 --- a/.github/workflows/changelog.yml +++ b/.github/workflows/changelog.yml @@ -1,34 +1,32 @@ -name: Check Changelog.md +name: Check PR for Changelog + on: pull_request: - types: [opened, synchronize, reopened] + types: [opened, synchronize, edited, reopened] + jobs: - check-changelog: - runs-on: ubuntu-latest - permissions: write-all - steps: - - uses: actions/checkout@v4 - - name: Fetch changed files - id: fetch-changed-files - run: | - response=$(gh api \ - -H "Accept: application/vnd.github+json" \ - -H "X-GitHub-Api-Version: 2022-11-28" \ - repos/${owner}/${REPO}/pulls/${PULL_NUMBER}/files) - echo "$response" | jq '.' > response.json - - - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - owner: ${{ github.repository_owner }} - REPO: ${{ github.event.repository.name }} - PULL_NUMBER: ${{ github.event.pull_request.number }} - - name: Check if Changelog.md is changed - run: | - if [[ $(jq '.[].filename' response.json) == *"CHANGELOG.md"* ]]; then - echo "Changelog.md is changed" - exit 0 - else - echo "Changelog.md is not changed" - exit 1 - fi + check-description: + runs-on: ubuntu-latest + steps: + + - name: Check PR Description + id: check_description + run: | + description=$(jq -r ".pull_request.body" "$GITHUB_EVENT_PATH" | awk '/## Changelog/{flag=1; next} /##/{flag=0} flag' | grep -oP '(?<=- \*\*Description:\*\* ).*' | sed 's/^[[:space:]]*//;s/[[:space:]]*$//') + echo "$description" + default_description="Summary of change(s)" + if [ -n "$description" ] && [ "$description" != "$default_description" ]; then + echo "containsChangelog=true" >> $GITHUB_OUTPUT + else + echo "containsChangelog=false" >> $GITHUB_OUTPUT + fi + + - name: Results + run: | + if [[ "${{ steps.check_description.outputs.containsChangelog }}" == "true" || "${{ github.event.pull_request.user.login }}" == "dependabot[bot]" ]]; then + echo "PR contains Changelog section/ PR made by Dependabot" + exit 0 + else + echo "Changelog section is missing or does not contain the required details" + exit 1 + fi diff --git a/.github/workflows/notify_team_new_comment.yml b/.github/workflows/notify_team_new_comment.yml index cc5ec443e..cbab1b869 100644 --- a/.github/workflows/notify_team_new_comment.yml +++ b/.github/workflows/notify_team_new_comment.yml @@ -27,7 +27,7 @@ jobs: env: SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} SLACK_WEBHOOK_TYPE: INCOMING_WEBHOOK - uses: slackapi/slack-github-action@v1.25.0 + uses: slackapi/slack-github-action@v1.26.0 with: payload: | { diff --git a/.github/workflows/update_changelog.yml b/.github/workflows/update_changelog.yml new file mode 100644 index 000000000..8ab504ef9 --- /dev/null +++ b/.github/workflows/update_changelog.yml @@ -0,0 +1,77 @@ +name: Update Changelog.md + +on: + pull_request_target: + types: + - closed + +jobs: + update-changelog: + if: github.event.pull_request.merged == true + runs-on: ubuntu-latest + + steps: + + - name: Checkout repository + uses: actions/checkout@v4 + with: + ref: ${{ github.event.pull_request.base.ref }} + fetch-depth: 0 + # Prevent later git operations from reusing the same authentication + persist-credentials: false + + - name: Extract and update Changelog + id: modify-changelog + shell: python + run: | + import re + if "${{ github.event.pull_request.user.login }}" == "dependabot[bot]": + changelog = " - **Description:** ${{ github.event.pull_request.title }}\n - **Products impact:** Dev Dependency upgrade\n - **Addresses:** -\n - **Components:** -\n - **Breaking:** -\n - **Impacts a11y:** -\n - **Guidance:** -" + else: + description = """${{ github.event.pull_request.body }}""" + capture = re.compile("\s+))") + match = capture.search(description) + changelog = match.groupdict()["body"].strip() + + final_changelog = "\n\n" + + pr_number = "${{ github.event.pull_request.number }}" + pr_link = "[#{}]".format(pr_number) + pr_link_ref = pr_link + ": ${{ github.event.pull_request.html_url }}" + + for changeline in changelog.splitlines(): + changeline = changeline.strip() + if not changeline: + continue + + if changeline.startswith("- **Description:**"): + final_changelog += "\n" + "- " + pr_link + "\n" + + final_changelog += " " + changeline + "\n" + + if changeline.startswith("- **Guidance:**"): + final_changelog += "\n" + pr_link_ref + "\n" + + with open("CHANGELOG.md", "r") as f: + current_changelog = f.read() + + new_changelog = current_changelog.replace("", final_changelog, 1) + + with open("CHANGELOG.md", "w") as f: + f.write(new_changelog) + - uses: tibdex/github-app-token@v1 + id: generate-token + with: + app_id: ${{ secrets.LE_BOT_APP_ID }} + private_key: ${{ secrets.LE_BOT_PRIVATE_KEY }} + - name: Commit updated CHANGELOG.md + run: | + git config --local user.email "41898282+github-actions[bot]@users.noreply.github.com" + git config --local user.name "github-actions[bot]" + git add CHANGELOG.md + git commit -m "Update CHANGELOG.md for PR #${{ github.event.pull_request.number }}" + - name: Push changes + uses: ad-m/github-push-action@v0.8.0 + with: + github_token: ${{ steps.generate-token.outputs.token }} + branch: ${{ github.event.pull_request.base.ref }} diff --git a/CHANGELOG.md b/CHANGELOG.md index 06cb0b44d..da393e62e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,115 @@ Changelog is rather internal in nature. See release notes for the public overvie ## Upcoming version 5.x.x (`develop` branch) + + + +- [#722] + - **Description:** Inserts the overlay container element `#k-overlay` to an application's document body during KDS initialization. + - **Products impact:** KDS initialization + - **Addresses:** - + - **Components:** - + - **Breaking:** no + - **Impacts a11y:** no + - **Guidance:** Remove any custom teleportation logic and use new KDS components and props instead. + +[#722]: https://github.com/learningequality/kolibri-design-system/pull/722 + +- [#722] + - **Description:** Adds new `KOverlay` component + - **Products impact:** New API + - **Addresses:** - + - **Components:** `KOverlay` + - **Breaking:** no + - **Impacts a11y:** no + - **Guidance:** - + +[#722]: https://github.com/learningequality/kolibri-design-system/pull/722 + +- [#722] + - **Description:** Renames `KModal`'s `appendToRoot` prop to `appendToOverlay` + - **Products impact:** Updated API + - **Addresses:** - + - **Components:** `KModal` + - **Breaking:** yes + - **Impacts a11y:** no + - **Guidance:** Rename `KModal`'s `appendToRoot` prop to `appendToOverlay` + +[#722]: https://github.com/learningequality/kolibri-design-system/pull/722 + +- [#722] + - **Description:** Adds new prop, `appendToOverlay`, to `KTooltip` + - **Products impact:** New API + - **Addresses:** - + - **Components:** `KTooltip` + - **Breaking:** no + - **Impacts a11y:** no + - **Guidance:** - + +[#722]: https://github.com/learningequality/kolibri-design-system/pull/722 + +- [#722] + - **Description:** Makes the `sidebar` icon flip in RTL languages + - **Products impact:** Bugfix + - **Addresses:** - + - **Components:** Icons + - **Breaking:** no + - **Impacts a11y:** yes + - **Guidance:** - + +[#722]: https://github.com/learningequality/kolibri-design-system/pull/722 + + + +- [#626] + - **Description:** Bump slackapi/slack-github-action from 1.25.0 to 1.26.0 + - **Products impact:** Dev Dependency upgrade + - **Addresses:** - + - **Components:** - + - **Breaking:** - + - **Impacts a11y:** - + - **Guidance:** - + +[#626]: https://github.com/learningequality/kolibri-design-system/pull/626 + + + +- [#739] + - **Description:** Bump elliptic from 6.5.4 to 6.5.7 + - **Products impact:** Dev Dependency upgrade + - **Addresses:** - + - **Components:** - + - **Breaking:** - + - **Impacts a11y:** - + - **Guidance:** - + +[#739]: https://github.com/learningequality/kolibri-design-system/pull/739 + + + +- [#660] + - **Description:** Bump pug from 3.0.2 to 3.0.3 + - **Products impact:** Dev Dependency upgrade + - **Addresses:** - + - **Components:** - + - **Breaking:** - + - **Impacts a11y:** - + - **Guidance:** - + +[#660]: https://github.com/learningequality/kolibri-design-system/pull/660 + + +- [547] + - **Description:** Automates changelog update process in the pull requests by adding two GitHub actions: (1) to check for the presence of changelog items(s) in the pull request description, (2) to paste the item(s) to CHANGELOG.md after the PR merged. + - **Products impact:** none + - **Addresses:** https://github.com/learningequality/kolibri-design-system/issues/533 + - **Components:** - + - **Breaking:** - + - **Impacts a11y:** - + - **Guidance:** - + +[547]: https://github.com/learningequality/kolibri-design-system/pull/547 + - [#753] - **Description:** Bump KDS version to 5.0.0-rc3. - **Products impact:** -. diff --git a/docs/pages/installation.vue b/docs/pages/installation.vue index 2dea90431..442731521 100644 --- a/docs/pages/installation.vue +++ b/docs/pages/installation.vue @@ -24,7 +24,8 @@
  • Installs $themeBrand, $themeTokens $themePalette, and $computedClass helpers on all Vue instances (see ).
  • Provides $coreOutline, $inputModality, $mediaType, and $isPrint computed properties as well as $print method to all Vue instances.
  • Globally registers all KDS Vue components.
  • -
  • Inserts assertive and polite ARIA live regions to your application's document body (see ).
  • +
  • Inserts assertive and polite ARIA live regions #k-live-region to an application's document body (see ).
  • +
  • Inserts the overlay container element #k-overlay to an application's document body (see or search for appendToOverlay prop on components).
  • diff --git a/docs/pages/koverlay.vue b/docs/pages/koverlay.vue new file mode 100644 index 000000000..6ae4320dd --- /dev/null +++ b/docs/pages/koverlay.vue @@ -0,0 +1,29 @@ + diff --git a/docs/pages/usekliveregion.vue b/docs/pages/usekliveregion.vue index be46710a3..88b273ae6 100644 --- a/docs/pages/usekliveregion.vue +++ b/docs/pages/usekliveregion.vue @@ -77,7 +77,7 @@ @@ -93,7 +93,7 @@ export default { setup() { - const { _mountLiveRegion, sendPoliteMessage, sendAssertiveMessage } = useKLiveRegion(); + const { sendPoliteMessage, sendAssertiveMessage } = useKLiveRegion(); const politeMessageInput = ref('Polite hello'); const updatePoliteMessage = message => { @@ -106,7 +106,6 @@ }; return { - _mountLiveRegion, updatePoliteMessage, politeMessageInput, updateAssertiveMessage, @@ -115,9 +114,6 @@ sendAssertiveMessage, }; }, - mounted() { - this._mountLiveRegion(this.$root.$el); - }, }; diff --git a/docs/tableOfContents.js b/docs/tableOfContents.js index 3d3114990..451c38f30 100644 --- a/docs/tableOfContents.js +++ b/docs/tableOfContents.js @@ -404,6 +404,11 @@ export default [ isCode: true, keywords: tabsRelatedKeywords, }), + new Page({ + path: '/koverlay', + title: 'KOverlay', + isCode: true, + }), new Page({ path: '/ktransition', title: 'KTransition', diff --git a/lib/KIcon/iconDefinitions.js b/lib/KIcon/iconDefinitions.js index e91ea48c1..bf2f7c279 100644 --- a/lib/KIcon/iconDefinitions.js +++ b/lib/KIcon/iconDefinitions.js @@ -407,6 +407,7 @@ const KolibriIcons = { email: { icon: require('./precompiled-icons/material-icons/mail_outline/baseline.vue').default }, sidebar: { icon: require('./precompiled-icons/material-icons/vertical_split/baseline.vue').default, + rtlFlip: true, }, bookmark: { icon: require('./precompiled-icons/mdi/bookmark.vue').default }, diff --git a/lib/KModal.vue b/lib/KModal.vue index 1112d86e7..d27755fb0 100644 --- a/lib/KModal.vue +++ b/lib/KModal.vue @@ -1,6 +1,6 @@