Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
2 changes: 1 addition & 1 deletion .docker/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ This directory is a space for mounting directories to docker containers, allowin
### postgres
The `postgres` directory is mounted to `/docker-entrypoint-initdb.d`. Any `.sh` or `.sql` files will be executed when the container is first started with a new data volume. You may read more regarding this functionality on the [Docker Hub page](https://hub.docker.com/_/postgres), under _Initialization scripts_.

When running docker services through the Makefile commands, it specifies a docker-compose project name that depends on the name of the current git branch. This causes the volumes to change when the branch changes, which is helpful when switching between many branches that might have incompatible database schema changes. The downside is that whenever you start a new branch, you'll have to re-initialize the database again, like with `yarn run devsetup`. Creating a SQL dump from an existing, initialized database and placing it in this directory will allow you to skip this step.
When running docker services through the Makefile commands, it specifies a docker-compose project name that depends on the name of the current git branch. This causes the volumes to change when the branch changes, which is helpful when switching between many branches that might have incompatible database schema changes. The downside is that whenever you start a new branch, you'll have to re-initialize the database again, like with `pnpm run devsetup`. Creating a SQL dump from an existing, initialized database and placing it in this directory will allow you to skip this step.

To create a SQL dump of your preferred database data useful for local testing, run `make .docker/postgres/init.sql` while the docker postgres container is running.

Expand Down
10 changes: 8 additions & 2 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const esLintConfig = require('kolibri-tools/.eslintrc');
const esLintConfig = require('kolibri-format/.eslintrc');

esLintConfig.globals = {
$: false,
Expand All @@ -8,7 +8,13 @@ esLintConfig.globals = {
MathJax: false,
jest: false,
};
esLintConfig.settings['import/resolver']['webpack'] = { config: 'webpack.config.js'};
esLintConfig.settings['import/resolver']['webpack'] = { config: require.resolve('./webpack.config.js')};

// Remove once Vuetify is gone-- Vuetify uses too many unacceptable class names
esLintConfig.rules['kolibri/vue-component-class-name-casing'] = 0;

// Dumb
esLintConfig.rules['vue/no-v-text-v-html-on-component'] = 0;

// Vuetify's helper attributes use hyphens and they would
// not be recognized if auto-formatted to camel case
Expand Down
5 changes: 5 additions & 0 deletions .git-blame-ignore-revs
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Run this command to always ignore formatting commits in `git blame`
# git config blame.ignoreRevsFile .git-blame-ignore-revs

# Linting updates and fixes
a52e08e5c2031cecb97a03fbed49997756ebe01b
2 changes: 1 addition & 1 deletion .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ updates:
time: "00:00"

# Maintain dependencies for Javascript
- package-ecosystem: "npm"
- package-ecosystem: "pnpm"
directory: "/"
schedule:
interval: "weekly"
Expand Down
36 changes: 14 additions & 22 deletions .github/workflows/deploytest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,31 +20,27 @@ jobs:
uses: fkirc/skip-duplicate-actions@master
with:
github_token: ${{ github.token }}
paths: '["**.py", "requirements.txt", ".github/workflows/deploytest.yml", "**.vue", "**.js", "yarn.lock", "package.json"]'
paths: '["**.py", "requirements.txt", ".github/workflows/deploytest.yml", "**.vue", "**.js", "pnpm-lock.yaml", "package.json"]'
build_assets:
name: Build frontend assets
needs: pre_job
if: ${{ needs.pre_job.outputs.should_skip != 'true' }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Use pnpm
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was a little surprised that this comes before the Node setup, but not so surprised that I care to understand why it is suggested to be this way in the documentation!

uses: pnpm/action-setup@v4
- name: Use Node.js
uses: actions/setup-node@v4
with:
node-version: '16.x'
- name: Cache Node.js modules
uses: actions/cache@v4
with:
path: '**/node_modules'
key: ${{ runner.OS }}-node-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.OS }}-node-
node-version: '18.x'
cache: 'pnpm'
- name: Install dependencies
run: |
yarn --frozen-lockfile
npm rebuild node-sass
pnpm install --frozen-lockfile
pnpm rebuild node-sass
- name: Build frontend
run: yarn run build
run: pnpm run build
make_messages:
name: Build all message files
needs: pre_job
Expand All @@ -68,21 +64,17 @@ jobs:
python -m pip install --upgrade pip
pip install pip-tools
pip-sync requirements.txt
- name: Use pnpm
uses: pnpm/action-setup@v4
- name: Use Node.js
uses: actions/setup-node@v4
with:
node-version: '16.x'
- name: Cache Node.js modules
uses: actions/cache@v4
with:
path: '**/node_modules'
key: ${{ runner.OS }}-node-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.OS }}-node-
node-version: '18.x'
cache: 'pnpm'
- name: Install node dependencies
run: |
yarn --frozen-lockfile
npm rebuild node-sass
pnpm install --frozen-lockfile
pnpm rebuild node-sass
- name: Install gettext
run: |
sudo apt-get update -y
Expand Down
20 changes: 8 additions & 12 deletions .github/workflows/frontendlint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,31 +20,27 @@ jobs:
uses: fkirc/skip-duplicate-actions@master
with:
github_token: ${{ github.token }}
paths: '["**.vue", "**.js", "yarn.lock", ".github/workflows/frontendlint.yml"]'
paths: '["**.vue", "**.js", "pnpm-lock.yaml", ".github/workflows/frontendlint.yml"]'
test:
name: Frontend linting
needs: pre_job
if: ${{ needs.pre_job.outputs.should_skip != 'true' }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Use pnpm
uses: pnpm/action-setup@v4
- name: Use Node.js
uses: actions/setup-node@v4
with:
node-version: '16.x'
- name: Cache Node.js modules
uses: actions/cache@v4
with:
path: '**/node_modules'
key: ${{ runner.OS }}-node-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.OS }}-node-
node-version: '18.x'
cache: 'pnpm'
- name: Install dependencies
run: |
yarn --frozen-lockfile
npm rebuild node-sass
pnpm install --frozen-lockfile
pnpm rebuild node-sass
- name: Run tests
run: yarn run lint-frontend:format
run: pnpm run lint-frontend:format
- name: Run pre-commit-ci-lite
uses: pre-commit-ci/lite-action@v1.1.0
if: always()
20 changes: 8 additions & 12 deletions .github/workflows/frontendtest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,28 +20,24 @@ jobs:
uses: fkirc/skip-duplicate-actions@master
with:
github_token: ${{ github.token }}
paths: '["**.vue", "**.js", "yarn.lock"]'
paths: '["**.vue", "**.js", "pnpm-lock.yaml"]'
test:
name: Frontend tests
needs: pre_job
if: ${{ needs.pre_job.outputs.should_skip != 'true' }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Use pnpm
uses: pnpm/action-setup@v4
- name: Use Node.js
uses: actions/setup-node@v4
with:
node-version: '16.x'
- name: Cache Node.js modules
uses: actions/cache@v4
with:
path: '**/node_modules'
key: ${{ runner.OS }}-node-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.OS }}-node-
node-version: '18.x'
cache: 'pnpm'
- name: Install dependencies
run: |
yarn --frozen-lockfile
npm rebuild node-sass
pnpm install --frozen-lockfile
pnpm rebuild node-sass
- name: Run tests
run: yarn run test
run: pnpm run test
5 changes: 0 additions & 5 deletions .htmlhintrc.js

This file was deleted.

2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,6 @@ repos:
- id: frontend-lint
name: Linting of JS, Vue, SCSS and CSS files
description: This hook handles all frontend linting for Kolibri Studio
entry: yarn run lint-frontend:format
entry: pnpm run lint-frontend:format
language: system
files: \.(js|vue|scss|css)$
1 change: 0 additions & 1 deletion .prettierrc.js

This file was deleted.

1 change: 1 addition & 0 deletions .prettierrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
module.exports = require('kolibri-format/.prettierrc');
6 changes: 3 additions & 3 deletions .stylelintrc.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module.exports = {
extends: [
'kolibri-tools/.stylelintrc',
'kolibri-format/.stylelintrc',
],
rules: {
/*
Expand All @@ -9,10 +9,10 @@ module.exports = {
*/
'selector-max-id': null, // This would require a major refactor
'csstree/validator': null, // this triggers issues with unknown at rules too.
'selector-pseudo-element-no-unknown': [
'selector-pseudo-element-no-unknown': [
true,
{
// In Vue 2.6 and later, `::v-deep` is used for deep selectors.
// In Vue 2.6 and later, `::v-deep` is used for deep selectors.
// This rule allows `::v-deep` to prevent linting errors.
ignorePseudoElements: ['v-deep'],
}
Expand Down
8 changes: 4 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ reconcile:
###############################################################
i18n-extract-frontend:
# generate frontend messages
yarn makemessages
pnpm makemessages

i18n-extract-backend:
# generate backend messages
Expand All @@ -75,7 +75,7 @@ i18n-extract-backend:
i18n-extract: i18n-extract-frontend i18n-extract-backend

i18n-transfer-context:
yarn transfercontext
pnpm transfercontext

i18n-django-compilemessages:
# Change working directory to contentcuration/ such that compilemessages
Expand All @@ -94,9 +94,9 @@ i18n-pretranslate-approve-all:
i18n-download-translations:
python node_modules/kolibri-tools/lib/i18n/crowdin.py rebuild-translations ${branch}
python node_modules/kolibri-tools/lib/i18n/crowdin.py download-translations ${branch}
yarn exec kolibri-tools i18n-code-gen -- --output-dir ./contentcuration/contentcuration/frontend/shared/i18n
pnpm exec kolibri-tools i18n-code-gen -- --output-dir ./contentcuration/contentcuration/frontend/shared/i18n
$(MAKE) i18n-django-compilemessages
yarn exec kolibri-tools i18n-create-message-files -- --namespace contentcuration --searchPath ./contentcuration/contentcuration/frontend
pnpm exec kolibri-tools i18n-create-message-files -- --namespace contentcuration --searchPath ./contentcuration/contentcuration/frontend

i18n-download: i18n-download-translations

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@
};
},
isSelected() {
return function(node) {
return function (node) {
return Boolean(find(this.selected, { id: node.id }));
};
},
Expand Down Expand Up @@ -127,6 +127,7 @@


<style>

.visuallyhidden {
position: absolute;
width: 1px;
Expand All @@ -137,4 +138,5 @@
clip: rect(0 0 0 0);
border: 0;
}

</style>
Original file line number Diff line number Diff line change
@@ -1,15 +1,19 @@
<template>

<VApp style="overflow: auto;height: 100vh;">
<VLayout justify-center fill-height class="mt-5 pt-5">
<VFlex style="max-width: 900px;">
<VApp style="height: 100vh; overflow: auto">
<VLayout
justify-center
fill-height
class="mt-5 pt-5"
>
<VFlex style="max-width: 900px">
<h1 class="font-weight-bold headline text-xs-center">
{{ header }}
</h1>
<p class="mb-5 mt-1 subheading text-xs-center">
{{ text }}
</p>
<div style="max-width: 400px; margin: 0 auto; text-align: center;">
<div style="max-width: 400px; margin: 0 auto; text-align: center">
<slot></slot>
<p class="mt-4">
<slot name="back">
Expand All @@ -26,6 +30,7 @@

</template>


<script>

export default {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<!-- Sign in -->
<VCard
class="pa-4"
style="width: 300px;margin: 0 auto;"
style="width: 300px; margin: 0 auto"
>
<div class="k-logo-container">
<KLogo
Expand Down Expand Up @@ -125,7 +125,7 @@
import LanguageSwitcherList from 'shared/languageSwitcher/LanguageSwitcherList';

export default {
name: 'Main',
name: 'AccountsMain',
components: {
Banner,
EmailField,
Expand Down
Loading