diff --git a/.github/helper/update_pot_file.sh b/.github/helper/update_pot_file.sh index d07d2e25..c0682779 100644 --- a/.github/helper/update_pot_file.sh +++ b/.github/helper/update_pot_file.sh @@ -22,7 +22,7 @@ git config user.name "frappe-pr-bot" echo "Setting the correct git remote..." # Here, the git remote is a local file path by default. Let's change it to the upstream repo. -git remote add upstream https://github.com/frappe/lms.git +git remote set-url upstream https://github.com/frappe/lms.git echo "Creating a new branch..." isodate=$(date -u +"%Y-%m-%d") diff --git a/.github/workflows/on_release.yml b/.github/workflows/on_release.yml new file mode 100644 index 00000000..cc7b1c89 --- /dev/null +++ b/.github/workflows/on_release.yml @@ -0,0 +1,32 @@ +name: Generate Semantic Release +on: + workflow_dispatch: + push: + branches: + - main +jobs: + release: + name: Release + runs-on: ubuntu-latest + steps: + - name: Checkout Entire Repository + uses: actions/checkout@v4 + with: + fetch-depth: 0 + persist-credentials: false + - name: Setup Node.js + uses: actions/setup-node@v4 + with: + node-version: 20 + - name: Setup dependencies + run: | + npm install @semantic-release/git @semantic-release/exec --no-save + - name: Create Release + env: + GH_TOKEN: ${{ secrets.RELEASE_TOKEN }} + GITHUB_TOKEN: ${{ secrets.RELEASE_TOKEN }} + GIT_AUTHOR_NAME: "Frappe PR Bot" + GIT_AUTHOR_EMAIL: "developers@frappe.io" + GIT_COMMITTER_NAME: "Frappe PR Bot" + GIT_COMMITTER_EMAIL: "developers@frappe.io" + run: npx semantic-release \ No newline at end of file diff --git a/.github/workflows/release_notes.yml b/.github/workflows/release_notes.yml new file mode 100644 index 00000000..52698116 --- /dev/null +++ b/.github/workflows/release_notes.yml @@ -0,0 +1,39 @@ +# This action: +# +# 1. Generates release notes using github API. +# 2. Strips unnecessary info like chore/style etc from notes. +# 3. Updates release info. + +name: 'Release Notes' + +on: + workflow_dispatch: + inputs: + tag_name: + description: 'Tag of release like v2.0.0' + required: true + type: string + release: + types: [released] + +permissions: + contents: read + +jobs: + regen-notes: + name: 'Regenerate release notes' + runs-on: ubuntu-latest + + steps: + - name: Update notes + run: | + NEW_NOTES=$(gh api --method POST -H "Accept: application/vnd.github+json" /repos/frappe/lms/releases/generate-notes -f tag_name=$RELEASE_TAG \ + | jq -r '.body' \ + | sed -E '/^\* (chore|ci|test|docs|style)/d' \ + | sed -E 's/by @mergify //' + ) + RELEASE_ID=$(gh api -H "Accept: application/vnd.github+json" /repos/frappe/lms/releases/tags/$RELEASE_TAG | jq -r '.id') + gh api --method PATCH -H "Accept: application/vnd.github+json" /repos/frappe/lms/releases/$RELEASE_ID -f body="$NEW_NOTES" + env: + GH_TOKEN: ${{ secrets.RELEASE_TOKEN }} + RELEASE_TAG: ${{ github.event.inputs.tag_name || github.event.release.tag_name }} \ No newline at end of file diff --git a/.releaserc b/.releaserc new file mode 100644 index 00000000..4f5437e0 --- /dev/null +++ b/.releaserc @@ -0,0 +1,21 @@ +{ + "branches": ["develop"], + "plugins": [ + "@semantic-release/commit-analyzer", { + "preset": "angular" + }, + "@semantic-release/release-notes-generator", + [ + "@semantic-release/exec", { + "prepareCmd": 'sed -ir "s/[0-9]*\.[0-9]*\.[0-9]*/${nextRelease.version}/" lms/__init__.py' + } + ], + [ + "@semantic-release/git", { + "assets": ["lms/__init__.py"], + "message": "chore(release): Bumped to Version ${nextRelease.version}" + } + ], + "@semantic-release/github" + ] +} \ No newline at end of file diff --git a/frontend/src/components/AppSidebar.vue b/frontend/src/components/AppSidebar.vue index 49f33da6..1b796b20 100644 --- a/frontend/src/components/AppSidebar.vue +++ b/frontend/src/components/AppSidebar.vue @@ -100,7 +100,7 @@ import { ChevronRight, Plus } from 'lucide-vue-next' import { createResource, Button } from 'frappe-ui' import PageModal from '@/components/Modals/PageModal.vue' -const { user } = sessionStore() +const { user, sidebarSettings } = sessionStore() const { userResource } = usersStore() const socket = inject('$socket') const unreadCount = ref(0) @@ -115,6 +115,20 @@ onMounted(() => { unreadNotifications.reload() }) addNotifications() + sidebarSettings.reload( + {}, + { + onSuccess(data) { + Object.keys(data).forEach((key) => { + if (!parseInt(data[key])) { + sidebarLinks.value = sidebarLinks.value.filter( + (link) => link.label.toLowerCase().split(' ').join('_') !== key + ) + } + }) + }, + } + ) }) const unreadNotifications = createResource({ @@ -153,21 +167,6 @@ const addNotifications = () => { } } -const sidebarSettings = createResource({ - url: 'lms.lms.api.get_sidebar_settings', - cache: 'Sidebar Settings', - auto: true, - onSuccess(data) { - Object.keys(data).forEach((key) => { - if (!parseInt(data[key])) { - sidebarLinks.value = sidebarLinks.value.filter( - (link) => link.label.toLowerCase().split(' ').join('_') !== key - ) - } - }) - }, -}) - const openPageModal = (link) => { showPageModal.value = true pageToEdit.value = link diff --git a/frontend/src/components/BatchCard.vue b/frontend/src/components/BatchCard.vue index 51941d53..2849f497 100644 --- a/frontend/src/components/BatchCard.vue +++ b/frontend/src/components/BatchCard.vue @@ -3,7 +3,7 @@ class="flex flex-col shadow hover:bg-gray-100 rounded-md p-4 h-full" style="min-height: 150px" > -
+
{{ batch.title }}
{{ __('Sold Out') }} -
+
{{ batch.description }}
+
+ {{ batch.price }} +
-
- {{ batch.price }} -
-
@@ -50,18 +49,21 @@ {{ batch.timezone }}
-
-
- -
- +
+
+
+
+
@@ -88,7 +90,7 @@ const props = defineProps({ text-overflow: ellipsis; width: 100%; overflow: hidden; - margin: 0.25rem 0 1.25rem; + margin: 0.25rem 0 1rem; line-height: 1.5; } diff --git a/frontend/src/components/CourseCard.vue b/frontend/src/components/CourseCard.vue index 5dd1e3c6..b5e84e3c 100644 --- a/frontend/src/components/CourseCard.vue +++ b/frontend/src/components/CourseCard.vue @@ -72,7 +72,7 @@ {{ course.title }}
-
+
{{ course.short_introduction }}
diff --git a/frontend/src/components/CourseOutline.vue b/frontend/src/components/CourseOutline.vue index 2a7ff7c2..e5d3a98b 100644 --- a/frontend/src/components/CourseOutline.vue +++ b/frontend/src/components/CourseOutline.vue @@ -50,7 +50,7 @@
diff --git a/frontend/src/pages/CertifiedParticipants.vue b/frontend/src/pages/CertifiedParticipants.vue index 583a1061..8351eb20 100644 --- a/frontend/src/pages/CertifiedParticipants.vue +++ b/frontend/src/pages/CertifiedParticipants.vue @@ -6,9 +6,10 @@