Skip to content

Commit

Permalink
Merge branch 'master' into content-contexts
Browse files Browse the repository at this point in the history
  • Loading branch information
emmachughes committed Dec 16, 2024
2 parents 129836d + 8aa1b74 commit 3e4addb
Show file tree
Hide file tree
Showing 214 changed files with 6,889 additions and 5,402 deletions.
5 changes: 5 additions & 0 deletions .github/dependabot.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,23 +5,28 @@ updates:
directory: /
schedule:
interval: monthly
labels: [dependencies]

- package-ecosystem: composer
directory: /sourcecode/hub
schedule:
interval: weekly
labels: [dependencies]

- package-ecosystem: npm
directory: /sourcecode/hub
schedule:
interval: weekly
labels: [dependencies]

- package-ecosystem: composer
directory: /sourcecode/apis/contentauthor
schedule:
interval: weekly
labels: [dependencies]

- package-ecosystem: npm
directory: /sourcecode/apis/contentauthor
schedule:
interval: weekly
labels: [dependencies]
58 changes: 58 additions & 0 deletions .github/labeler.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
'Component: Content Author':
- changed-files:
- any-glob-to-any-file:
- .github/workflows/contentauthor.yaml
- localSetup/projects/nginx/templates/ca.conf.template
- sourcecode/apis/contentauthor/**

'Component: Hub':
- changed-files:
- any-glob-to-any-file:
- .github/workflows/hub.yaml
- localSetup/projects/nginx/templates/hub.conf.template
- sourcecode/hub/**

dependencies:
- changed-files:
- any-glob-to-any-file:
- '**/composer.json'
- '**/composer.lock'
- '**/package.json'
- '**/package-lock.json'
- '**/yarn.lock'

documentation:
- changed-files:
- any-glob-to-any-file:
- docs/**
- '**/*.md'
- '**/*.mdx'

'Edlib 2':
- base-branch: edlib2

github_actions:
- changed-files:
- any-glob-to-any-file:
- .github/actions/**
- .github/workflows/**

language:
- changed-files:
- any-glob-to-any-file:
- sourcecode/apis/contentauthor/resources/lang/**
- sourcecode/apis/contentauthor/resources/assets/react/language/**
- sourcecode/hub/lang/**

composer:
- changed-files:
- any-glob-to-any-file:
- '**/composer.json'
- '**/composer.lock'

npm:
- changed-files:
- any-glob-to-any-file:
- '**/package.json'
- '**/package-lock.json'
- '**/yarn.lock'
4 changes: 2 additions & 2 deletions .github/workflows/contentauthor.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ jobs:
- name: Set up PHP
uses: shivammathur/setup-php@v2
with:
php-version: 8.2
php-version: 8.3

- name: Manage php-cs-fixer cache
uses: actions/cache@v4
Expand Down Expand Up @@ -95,7 +95,7 @@ jobs:
- name: Set up PHP
uses: shivammathur/setup-php@v2
with:
php-version: 8.2
php-version: 8.3
extensions: sockets, zip
coverage: pcov

Expand Down
49 changes: 49 additions & 0 deletions .github/workflows/docs.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
name: Documentation

on:
push:
branches:
- master
paths:
- "docs/**"
- ".github/workflows/docs.yaml"
workflow_dispatch:

jobs:
deploy:
runs-on: ubuntu-latest

defaults:
run:
working-directory: ./docs

permissions:
contents: read
pages: write
id-token: write

environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}

steps:
- uses: actions/checkout@v4

- uses: actions/setup-node@v4
with:
node-version: 16

- name: Install dependencies
run: yarn install --frozen-lockfile

- name: Build
run: yarn build

- name: Upload pages artifact
uses: actions/upload-pages-artifact@v2
with:
path: ./docs/build

- name: Deploy
id: deployment
uses: actions/deploy-pages@v2
15 changes: 15 additions & 0 deletions .github/workflows/labeler.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
name: Pull Request Labeler

on:
- pull_request_target

jobs:
labeler:
permissions:
contents: read
pull-requests: write
runs-on: ubuntu-latest
steps:
- uses: actions/labeler@v5
with:
repo-token: "${{ secrets.GITHUB_TOKEN }}"
2 changes: 2 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ services:
hub-vite:
image: node:18-alpine
command: [sh, -c, 'npm ci && npm run dev']
environment:
- SCARF_ANALYTICS=false
volumes:
- npm_cache:/root/.npm
- ./sourcecode/hub:/srv/www/hub
Expand Down
8 changes: 0 additions & 8 deletions docs/docusaurus.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -107,14 +107,6 @@ module.exports = {
label: 'Contributing',
to: '/docs/developers/contributing',
},
{
label: 'API documentation',
to: '/docs/developers/api-documentation/introduction',
},
{
label: 'Plugins',
to: '/docs/developers/plugins',
},
],
},
{
Expand Down
16 changes: 12 additions & 4 deletions sourcecode/apis/contentauthor/.env.example
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,18 @@ FILESYSTEM_DRIVER=local

QUEUE_DRIVER=sync

#H5P_VIDEO_URL=https://videoapi-test.cerpusdev.net
#H5P_VIDEO_ADAPTER_KEY=contentauthortest
#H5P_VIDEO_ADAPTER_SECRET=
#H5P_VIDEO_ADAPTER_DELETEVIDEO=true
#H5P_VIDEO_ADAPTER=ndla
#NDLA_H5P_VIDEO_URL=https://cms.api.brightcove.com
#NDLA_H5P_VIDEO_AUTH_URL=https://oauth.brightcove.com/v4/access_token
#NDLA_H5P_VIDEO_ADAPTER_KEY=
#NDLA_H5P_VIDEO_ADAPTER_SECRET=
#NDLA_H5P_VIDEO_ACCOUNT_ID=

#H5P_IMAGE_ADAPTER=ndla
#NDLA_H5P_IMAGE_URL=https://api.ndla.no

#H5P_AUDIO_ADAPTER=ndla
#NDLA_H5P_AUDIO_URL=https://api.ndla.no

H5P_SINGLE_CONTENT_UPGRADE=true
H5P_NDLA_CUSTOM_CSS=false
Expand Down
7 changes: 3 additions & 4 deletions sourcecode/apis/contentauthor/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
FROM php:8.2-fpm-alpine AS base
FROM php:8.3-fpm-alpine AS base

RUN apk add --no-cache \
git \
unzip

COPY --from=mlocati/php-extension-installer /usr/bin/install-php-extensions /usr/local/bin/

RUN IPE_GD_WITHOUTAVIF=1 install-php-extensions \
RUN install-php-extensions \
bcmath \
gettext \
igbinary \
Expand All @@ -15,7 +15,6 @@ RUN IPE_GD_WITHOUTAVIF=1 install-php-extensions \
pcntl \
pdo_mysql \
redis \
sockets \
xmlrpc \
zip

Expand Down Expand Up @@ -106,7 +105,7 @@ RUN set -eux; \
chown -R www-data:www-data .


FROM prod as test
FROM prod AS test

COPY phpunit.xml .
COPY tests tests
Expand Down
6 changes: 3 additions & 3 deletions sourcecode/apis/contentauthor/app/Article.php
Original file line number Diff line number Diff line change
Expand Up @@ -77,15 +77,15 @@ public function render(): string
}

/**
* @return HasMany<ArticleCollaborator>
* @return HasMany<ArticleCollaborator, $this>
*/
public function collaborators(): HasMany
{
return $this->hasMany(ArticleCollaborator::class);
}

/**
* @return HasMany<File>
* @return HasMany<File, $this>
*/
public function files(): HasMany
{
Expand All @@ -103,7 +103,7 @@ public function givesScore(): int
}

/**
* @return BelongsTo<Article, self>
* @return BelongsTo<Article, $this>
*/
public function parent(): BelongsTo
{
Expand Down
5 changes: 2 additions & 3 deletions sourcecode/apis/contentauthor/app/Content.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
use Illuminate\Support\Facades\Session;

use function htmlspecialchars_decode;

use function property_exists;

use const ENT_HTML5;
Expand Down Expand Up @@ -119,7 +118,7 @@ public function isOwner($currentUserId): bool
abstract public function getContentType(bool $withSubType = false);

/**
* @return HasOne<NdlaIdMapper>
* @return HasOne<NdlaIdMapper, $this>
*/
public function ndlaMapper(): HasOne
{
Expand All @@ -132,7 +131,7 @@ public function isCopyable(): bool
}

/**
* @return HasMany<ContentLock>
* @return HasMany<ContentLock, $this>
*/
public function locks(): HasMany
{
Expand Down
25 changes: 0 additions & 25 deletions sourcecode/apis/contentauthor/app/Events/LinkWasSaved.php

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<?php

declare(strict_types=1);

namespace App\Exceptions;

use Exception;

class GameTypeNotFoundException extends Exception
{
}
2 changes: 1 addition & 1 deletion sourcecode/apis/contentauthor/app/File.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ class File extends Model
use HasFactory;

/**
* @return BelongsTo<Article, self>
* @return BelongsTo<Article, $this>
*/
public function article(): BelongsTo
{
Expand Down
Loading

0 comments on commit 3e4addb

Please sign in to comment.