Skip to content

Commit

Permalink
Merge pull request #2073 from uccser/release/7.3.0
Browse files Browse the repository at this point in the history
Release/7.3.0
  • Loading branch information
Yamboy1 authored Dec 15, 2022
2 parents 62f8651 + 4026983 commit 7dafd64
Show file tree
Hide file tree
Showing 82 changed files with 1,307 additions and 135 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/auto-merge-dependency-updates.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
steps:
- name: Dependabot metadata
id: metadata
uses: dependabot/fetch-metadata@v1.3.4
uses: dependabot/fetch-metadata@v1.3.5
with:
github-token: "${{ secrets.GITHUB_TOKEN }}"
- name: Approve
Expand Down
16 changes: 8 additions & 8 deletions .github/workflows/crowdin-actions.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,12 @@ jobs:
uses: actions/checkout@v3

- name: Upload or update source files to Crowdin
uses: crowdin/github-action@1.4.16
uses: crowdin/github-action@1.5.2
with:
upload_sources: true

- name: Download Chinese (simplified) translations
uses: crowdin/github-action@1.4.16
uses: crowdin/github-action@1.5.2
with:
upload_sources: false
download_translations: true
Expand All @@ -42,7 +42,7 @@ jobs:
config: crowdin.yaml

- name: Download French translations
uses: crowdin/github-action@1.4.16
uses: crowdin/github-action@1.5.2
with:
upload_sources: false
download_translations: true
Expand All @@ -60,7 +60,7 @@ jobs:
config: crowdin.yaml

- name: Download German translations
uses: crowdin/github-action@1.4.16
uses: crowdin/github-action@1.5.2
with:
upload_sources: false
download_translations: true
Expand All @@ -78,7 +78,7 @@ jobs:
config: crowdin.yaml

- name: Download Indonesian translations
uses: crowdin/github-action@1.4.16
uses: crowdin/github-action@1.5.2
with:
upload_sources: false
download_translations: true
Expand All @@ -96,7 +96,7 @@ jobs:
config: crowdin.yaml

- name: Download Italian translations
uses: crowdin/github-action@1.4.16
uses: crowdin/github-action@1.5.2
with:
upload_sources: false
download_translations: true
Expand All @@ -114,7 +114,7 @@ jobs:
config: crowdin.yaml

- name: Download Te Reo Māori translations
uses: crowdin/github-action@1.4.16
uses: crowdin/github-action@1.5.2
with:
upload_sources: false
download_translations: true
Expand All @@ -132,7 +132,7 @@ jobs:
config: crowdin.yaml

- name: Download Turkish translations
uses: crowdin/github-action@1.4.16
uses: crowdin/github-action@1.5.2
with:
upload_sources: false
download_translations: true
Expand Down
24 changes: 23 additions & 1 deletion .github/workflows/test-and-deploy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@ jobs:
uses: actions/checkout@v3
- name: Create Docker network
run: docker network create uccser-development-stack
# Required for the node service
- name: Set DOCKER_UID variable
run: echo "DOCKER_UID=$(echo $UID)" >> $GITHUB_ENV
- name: Start systems
run: docker compose -f docker-compose.local.yml up -d
- name: Run Django system check
Expand All @@ -32,6 +35,9 @@ jobs:
uses: actions/checkout@v3
- name: Create Docker network
run: docker network create uccser-development-stack
# Required for the node service
- name: Set DOCKER_UID variable
run: echo "DOCKER_UID=$(echo $UID)" >> $GITHUB_ENV
- name: Start systems
run: docker compose -f docker-compose.local.yml up -d
- name: Create static files
Expand Down Expand Up @@ -111,7 +117,7 @@ jobs:
- name: Checkout
uses: actions/checkout@v3
- name: Setup Python
uses: actions/setup-python@v4.3.0
uses: actions/setup-python@v4.3.1
with:
python-version: '3.x'
- name: Install dependencies
Expand Down Expand Up @@ -144,6 +150,10 @@ jobs:
- name: Create Docker network
run: docker network create uccser-development-stack

# Required for the node service
- name: Set DOCKER_UID variable
run: echo "DOCKER_UID=$(echo $UID)" >> $GITHUB_ENV

- name: Start system
run: docker compose -f docker-compose.local.yml up -d

Expand Down Expand Up @@ -186,6 +196,10 @@ jobs:
- name: Create Docker network
run: docker network create uccser-development-stack

# Required for the node service
- name: Set DOCKER_UID variable
run: echo "DOCKER_UID=$(echo $UID)" >> $GITHUB_ENV

- name: Start system
run: docker compose -f docker-compose.local.yml up -d

Expand Down Expand Up @@ -241,6 +255,10 @@ jobs:
- name: Create Docker network
run: docker network create uccser-development-stack

# Required for the node service
- name: Set DOCKER_UID variable
run: echo "DOCKER_UID=$(echo $UID)" >> $GITHUB_ENV

- name: Start system
run: docker compose -f docker-compose.local.yml up -d

Expand Down Expand Up @@ -306,6 +324,10 @@ jobs:
- name: Create Docker network
run: docker network create uccser-development-stack

# Required for the node service
- name: Set DOCKER_UID variable
run: echo "DOCKER_UID=$(echo $UID)" >> $GITHUB_ENV

- name: Start system
run: docker compose -f docker-compose.local.yml up -d

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,4 +46,6 @@ def load(self):
else:
term = 'Updated'
self.log(f'{term} Classic CS Unplugged page: {name}')

ClassicPage.objects.exclude(slug__in=classic_pages.keys()).delete()
self.log("All Classic CS Unplugged pages loaded!\n")
2 changes: 1 addition & 1 deletion csunplugged/config/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
"""Module for Django system configuration."""

__version__ = "7.2.1"
__version__ = "7.3.0"
Original file line number Diff line number Diff line change
Expand Up @@ -73,4 +73,7 @@ def load(self):
else:
term = 'Updated'
self.log(f'{term} general page: {name}')

GeneralPage.objects.exclude(slug__in=general_pages.keys()).delete()

self.log("All general pages loaded!\n")
8 changes: 4 additions & 4 deletions csunplugged/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,17 +28,17 @@
"gulp-terser": "2.1.0",
"gulp": "4.0.2",
"intro.js": "4.3.0",
"jquery": "3.6.1",
"jquery": "3.6.2",
"multiple-select": "1.5.2",
"pixrem": "5.0.0",
"popper.js": "1.16.1",
"postcss": "8.4.18",
"postcss": "8.4.20",
"postcss-flexbugs-fixes": "5.0.2",
"reveal.js": "4.4.0",
"sass": "1.55.0",
"sass": "1.56.2",
"scratchblocks": "3.6.1",
"vinyl-buffer": "1.0.1",
"yargs": "17.6.0"
"yargs": "17.6.2"
},
"engines": {
"node": ">=8"
Expand Down
3 changes: 3 additions & 0 deletions csunplugged/resources/management/commands/_ResourcesLoader.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,4 +74,7 @@ def load(self):
else:
term = 'Updated'
self.log(f'{term} Resource: {resource.name}')

Resource.objects.exclude(slug__in=resources_structure.keys()).delete()

self.log("All resources loaded!\n")
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
activities:
name: Activities
artificial-intelligence:
name: Artificial intelligence
attention-spans:
name: Attention spans
binary-numbers:
name: Binary numbers
books:
name: CS Unplugged Book
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
activities:
name: Activities
artificial-intelligence:
name: Artificial intelligence
binary-numbers:
name: Binary numbers
80 changes: 80 additions & 0 deletions csunplugged/tests/classic/loaders/test_classic_pages_loader.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,3 +82,83 @@ def test_classic_page_loader_multiple_configuration(self):
"<ClassicPage: CS Unplugged Book>",
],
)

def test_classic_page_loader_insert_middle(self):
config_file = "multiple.yaml"
classic_page_loader = ClassicPagesLoader(
structure_dir="",
structure_filename=config_file,
base_path=self.BASE_PATH,
)
classic_page_loader.load()
pages = ClassicPage.objects.order_by("name")
self.assertEqual(4, len(pages))
self.assertQuerysetEqual(
pages,
[
"<ClassicPage: Activities>",
"<ClassicPage: Artificial intelligence>",
"<ClassicPage: Binary numbers>",
"<ClassicPage: CS Unplugged Book>",
],
)

# Now try adding an element in the middle of this collection
config_file = "insert-middle.yaml"
classic_page_loader = ClassicPagesLoader(
structure_dir="",
structure_filename=config_file,
base_path=self.BASE_PATH,
)
classic_page_loader.load()
pages = ClassicPage.objects.order_by("name")
self.assertEqual(5, len(pages))
self.assertQuerysetEqual(
pages,
[
"<ClassicPage: Activities>",
"<ClassicPage: Artificial intelligence>",
"<ClassicPage: Attention spans>",
"<ClassicPage: Binary numbers>",
"<ClassicPage: CS Unplugged Book>",
],
)

def test_classic_page_loader_remove_end(self):
config_file = "multiple.yaml"
classic_page_loader = ClassicPagesLoader(
structure_dir="",
structure_filename=config_file,
base_path=self.BASE_PATH,
)
classic_page_loader.load()
pages = ClassicPage.objects.order_by("name")
self.assertEqual(4, len(pages))
self.assertQuerysetEqual(
pages,
[
"<ClassicPage: Activities>",
"<ClassicPage: Artificial intelligence>",
"<ClassicPage: Binary numbers>",
"<ClassicPage: CS Unplugged Book>",
],
)

# Remove from end of list
config_file = "remove-end.yaml"
classic_page_loader = ClassicPagesLoader(
structure_dir="",
structure_filename=config_file,
base_path=self.BASE_PATH,
)
classic_page_loader.load()
pages = ClassicPage.objects.order_by("name")
self.assertEqual(3, len(pages))
self.assertQuerysetEqual(
pages,
[
"<ClassicPage: Activities>",
"<ClassicPage: Artificial intelligence>",
"<ClassicPage: Binary numbers>",
],
)
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
page-1:
name: Page 1
template: template.html
url-name: page
page-1a:
name: Page 1a
template: template.html
url-name: page
page-2:
name: Page 2
template: template.html
url-name: page
page-3:
name: Page 3
template: template.html
url-name: page
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
page-1:
name: Page 1
template: template.html
url-name: page
page-2:
name: Page 2
template: template.html
url-name: page
Loading

0 comments on commit 7dafd64

Please sign in to comment.