Skip to content

Commit

Permalink
Merge branch 'learningequality:develop' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
BabyElias authored Aug 30, 2024
2 parents 186ea35 + 759658f commit 5d49e23
Show file tree
Hide file tree
Showing 19 changed files with 430 additions and 80 deletions.
4 changes: 2 additions & 2 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ Addresses #*PR# HERE*
<!-- Insert images here if applicable -->

## Changelog
<!-- [DO NOT REMOVE-USED BY GH ACTION] CHANGELOG START -->

<!--
- Fill in the changelog item(s) below. If there are more groups of closely
Expand All @@ -22,7 +23,6 @@ Addresses #*PR# HERE*
items in CHANGELOG.md as examples
-->

- [#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.
Expand All @@ -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
<!-- [DO NOT REMOVE-USED BY GH ACTION] CHANGELOG END -->

## Steps to test

Expand Down
60 changes: 29 additions & 31 deletions .github/workflows/changelog.yml
Original file line number Diff line number Diff line change
@@ -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
2 changes: 1 addition & 1 deletion .github/workflows/notify_team_new_comment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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: |
{
Expand Down
77 changes: 77 additions & 0 deletions .github/workflows/update_changelog.yml
Original file line number Diff line number Diff line change
@@ -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("<!-- \[DO NOT REMOVE-USED BY GH ACTION\] CHANGELOG START -->\s+<!--(\n|.)+?(?=- \*\*Description)(?P<body>(\n|.)+?(?=<!-- \[DO NOT REMOVE-USED BY GH ACTION\] CHANGELOG END -->))")
match = capture.search(description)
changelog = match.groupdict()["body"].strip()
final_changelog = "<!-- [DO NOT REMOVE-USED BY GH ACTION] PASTE 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("<!-- [DO NOT REMOVE-USED BY GH ACTION] PASTE CHANGELOG -->", 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/[email protected]
with:
github_token: ${{ steps.generate-token.outputs.token }}
branch: ${{ github.event.pull_request.base.ref }}
109 changes: 109 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,115 @@ Changelog is rather internal in nature. See release notes for the public overvie

## Upcoming version 5.x.x (`develop` branch)

<!-- [DO NOT REMOVE-USED BY GH ACTION] PASTE CHANGELOG -->


- [#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:** -.
Expand Down
3 changes: 2 additions & 1 deletion docs/pages/installation.vue
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@
<li>Installs <code>$themeBrand</code>, <code>$themeTokens</code> <code>$themePalette</code>, and <code>$computedClass</code> helpers on all Vue instances (see <DocsInternalLink href="/colors/#usage" text="Colors" />).</li>
<li>Provides <code>$coreOutline</code>, <code>$inputModality</code>, <code>$mediaType</code>, and <code>$isPrint</code> computed properties as well as <code>$print</code> method to all Vue instances.</li>
<li>Globally registers all KDS Vue components.</li>
<li>Inserts assertive and polite ARIA live regions to your application's document body (see <DocsInternalLink href="/usekliveregion" text="useKLiveRegion" />).</li>
<li>Inserts assertive and polite ARIA live regions <code>#k-live-region</code> to an application's document body (see <DocsInternalLink href="/usekliveregion" text="useKLiveRegion" />).</li>
<li>Inserts the overlay container element <code>#k-overlay</code> to an application's document body (see <DocsLibraryLink component="KOverlay" /> or search for <code>appendToOverlay</code> prop on components).</li>
</ul>
</DocsPageSection>

Expand Down
29 changes: 29 additions & 0 deletions docs/pages/koverlay.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
<template>

<DocsPageTemplate apiDocs>
<DocsPageSection title="Overview" anchor="#overview">
<p>Use <code>KOverlay</code> to move an element from its original place in the DOM to the overlay container element <code>#k-overlay</code> that is inserted to an application's document body automatically <DocsInternalLink href="/installation#install-plugin" text="during the KDS installation process" />. This is often useful for modals, tooltips, dropdowns, or other elements that should appear on top of other content.</p>
</DocsPageSection>

<DocsPageSection title="Usage" anchor="#usage">
<p>First, check whether you need <code>KOverlay</code>. Some KDS components already utilize it internally and you only need to instruct them to activate it, typically via the <code>appendToOverlay</code> prop.</p>

<p>If you need to use <code>KOverlay</code>, simply wrap an element or a component in it:</p>

<DocsShowCode language="html">
<KOverlay>
<YourComponent />
</KOverlay>
</DocsShowCode>
</DocsPageSection>

<DocsPageSection title="Related" anchor="#related">
<ul>
<li>
<DocsInternalLink href="/installation#install-plugin" text="KDS installation step" /> that attaches the overlay container element <code>#k-overlay</code> to an application's document body
</li>
</ul>
</DocsPageSection>
</DocsPageTemplate>

</template>
8 changes: 2 additions & 6 deletions docs/pages/usekliveregion.vue
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@
<DocsPageSection title="Related" anchor="#related">
<ul>
<li>
<DocsInternalLink href="/installation#install-plugin" text="KDS installation step" /> that attaches live regions to an application's DOM
<DocsInternalLink href="/installation#install-plugin" text="KDS installation step" /> that attaches live regions to an application's document body
</li>
</ul>
</DocsPageSection>
Expand All @@ -93,7 +93,7 @@
export default {
setup() {
const { _mountLiveRegion, sendPoliteMessage, sendAssertiveMessage } = useKLiveRegion();
const { sendPoliteMessage, sendAssertiveMessage } = useKLiveRegion();
const politeMessageInput = ref('Polite hello');
const updatePoliteMessage = message => {
Expand All @@ -106,7 +106,6 @@
};
return {
_mountLiveRegion,
updatePoliteMessage,
politeMessageInput,
updateAssertiveMessage,
Expand All @@ -115,9 +114,6 @@
sendAssertiveMessage,
};
},
mounted() {
this._mountLiveRegion(this.$root.$el);
},
};
</script>
5 changes: 5 additions & 0 deletions docs/tableOfContents.js
Original file line number Diff line number Diff line change
Expand Up @@ -404,6 +404,11 @@ export default [
isCode: true,
keywords: tabsRelatedKeywords,
}),
new Page({
path: '/koverlay',
title: 'KOverlay',
isCode: true,
}),
new Page({
path: '/ktransition',
title: 'KTransition',
Expand Down
1 change: 1 addition & 0 deletions lib/KIcon/iconDefinitions.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 },
Expand Down
Loading

0 comments on commit 5d49e23

Please sign in to comment.