Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: openfun/ashley
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v1.3.0
Choose a base ref
...
head repository: openfun/ashley
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: master
Choose a head ref
  • 12 commits
  • 13 files changed
  • 3 contributors

Commits on Feb 15, 2023

  1. ⬆️(frontend) bump http-cache-semantics

    Bumps [http-cache-semantics] from v4.1.0 to v4.1.1
    - [Release notes](https://github.com/kornelski/http-cache-semantics/releases)
    - [Commits]
    (kornelski/http-cache-semantics@v4.1.0...v4.1.1)
    
    Signed-off-by: dependabot[bot] <[email protected]>
    dependabot[bot] authored and carofun committed Feb 15, 2023
    Copy the full SHA
    bc5a7ea View commit details

Commits on Feb 16, 2023

  1. ⬆️(frontend) bump terser from 5.7.0 to 5.16.3

    Bumps [terser](https://github.com/terser/terser) from 5.7.0 to 5.16.3.
    - [Release notes](https://github.com/terser/terser/releases)
    - [Changelog](https://github.com/terser/terser/blob/master/CHANGELOG.md)
    - [Commits](terser/terser@v5.7.0...v5.16.3)
    
    ---
    updated-dependencies:
    - dependency-name: terser
      dependency-type: indirect
    ...
    
    Signed-off-by: dependabot[bot] <[email protected]>
    dependabot[bot] authored and carofun committed Feb 16, 2023
    Copy the full SHA
    b273cd8 View commit details
  2. ⬆️(frontend) bump ua-parser-js from 0.7.28 to 0.7.33

    Bumps [ua-parser-js]
    (https://github.com/faisalman/ua-parser-js) from 0.7.28 to 0.7.33.
    - [Release notes](https://github.com/faisalman/ua-parser-js/releases)
    - [Changelog]https://github.com/faisalman/ua-parser-js/blob/master/changelog.md
    - [Commits](faisalman/ua-parser-js@0.7.28...0.7.33)
    
    ---
    updated-dependencies:
    - dependency-name: ua-parser-js
      dependency-type: indirect
    ...
    
    Signed-off-by: dependabot[bot] <[email protected]>
    dependabot[bot] authored and carofun committed Feb 16, 2023
    Copy the full SHA
    137b319 View commit details
  3. ⬆️(frontend) bump json5 from 1.0.1 to 1.0.2

    Bumps [json5](https://github.com/json5/json5) from 1.0.1 to 1.0.2.
    - [Release notes](https://github.com/json5/json5/releases)
    - [Changelog](https://github.com/json5/json5/blob/main/CHANGELOG.md)
    - [Commits](json5/json5@v1.0.1...v1.0.2)
    
    ---
    updated-dependencies:
    - dependency-name: json5
      dependency-type: indirect
    ...
    
    Signed-off-by: dependabot[bot] <[email protected]>
    dependabot[bot] authored and carofun committed Feb 16, 2023
    Copy the full SHA
    b2954a3 View commit details
  4. ⬆️(frontend) bump minimatch from 3.0.4 to 3.0.8

    Bumps [minimatch](https://github.com/isaacs/minimatch) from 3.0.4 to 3.0.8.
    - [Release notes](https://github.com/isaacs/minimatch/releases)
    - [Changelog](https://github.com/isaacs/minimatch/blob/main/changelog.md)
    - [Commits](isaacs/minimatch@v3.0.4...v3.0.8)
    
    ---
    updated-dependencies:
    - dependency-name: minimatch
      dependency-type: indirect
    ...
    
    Signed-off-by: dependabot[bot] <[email protected]>
    dependabot[bot] authored and carofun committed Feb 16, 2023
    Copy the full SHA
    4886278 View commit details
  5. 🐛(back) fix exporting atomic blocks for images

    For atomic blocks, we needed a specific behavior for the ones
    dealing with the latex formulas. This introduced a problem with
    rendering the images. This commit fixes this. To prevent this
    kind of error in the future, tests have been added rendering the HTML
    using draftjs_exporter. So far only specific decorators were tested
    but not all the rendering of multiple draftjs blocks.
    carofun committed Feb 16, 2023
    Copy the full SHA
    53d01ce View commit details
  6. ⬆️(frontend) bump qs from 6.5.2 to 6.5.3

    Bumps [qs](https://github.com/ljharb/qs) from 6.5.2 to 6.5.3.
    - [Release notes](https://github.com/ljharb/qs/releases)
    - [Changelog](https://github.com/ljharb/qs/blob/main/CHANGELOG.md)
    - [Commits](ljharb/qs@v6.5.2...v6.5.3)
    
    ---
    updated-dependencies:
    - dependency-name: qs
      dependency-type: indirect
    ...
    
    Signed-off-by: dependabot[bot] <[email protected]>
    dependabot[bot] authored and carofun committed Feb 16, 2023
    Copy the full SHA
    cd2c06b View commit details

Commits on Feb 17, 2023

  1. ⬆️(frontend) bump decode-uri-component

    Bumps[decode-uri-component]
    (https://github.com/SamVerschueren/decode-uri-component) from 0.2.0 to 0.2.2.
    -Release notes(https://github.com/SamVerschueren/decode-uri-component/releases)
    -Commits
    (SamVerschueren/decode-uri-component@v0.2.0...v0.2.2)
    
    ---
    updated-dependencies:
    - dependency-name: decode-uri-component
      dependency-type: indirect
    ...
    
    Signed-off-by: dependabot[bot] <[email protected]>
    dependabot[bot] authored and carofun committed Feb 17, 2023
    Copy the full SHA
    d22d858 View commit details
  2. ⬆️(frontend) bump loader-utils from 1.4.0 to 1.4.2

    Bumps [loader-utils]
    (https://github.com/webpack/loader-utils) from 1.4.0 to 1.4.2.
    - [Release notes](https://github.com/webpack/loader-utils/releases)
    - [Changelog]
    (https://github.com/webpack/loader-utils/blob/v1.4.2/CHANGELOG.md)
    - [Commits](webpack/loader-utils@v1.4.0...v1.4.2)
    
    ---
    updated-dependencies:
    - dependency-name: loader-utils
      dependency-type: indirect
    ...
    
    Signed-off-by: dependabot[bot] <[email protected]>
    dependabot[bot] authored and carofun committed Feb 17, 2023
    Copy the full SHA
    0306eba View commit details
  3. 🔖(ashley) bump version to 1.3.1

    Fixed
    
    - Fix converting in HTML atomic blocks for images
    carofun committed Feb 17, 2023
    Copy the full SHA
    5ac5e34 View commit details

Commits on Nov 25, 2024

  1. ⬆️(compose) upgrade to postgres 16.4

    We want to use postres 16.4, we upgrade the docker image use in the docker
    compose configuration.
    lunika committed Nov 25, 2024
    Copy the full SHA
    6098c3d View commit details
  2. ⬆️(front) upgrade to node 16

    We need node 16 to use node-sass
    lunika committed Nov 25, 2024
    Copy the full SHA
    f6b6b3b View commit details
34 changes: 16 additions & 18 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -96,8 +96,7 @@ jobs:
# Generate a version.json file describing app release
- <<: *generate-version-file
# Activate docker-in-docker
- setup_remote_docker:
version: 19.03.13
- setup_remote_docker
# Each image is tagged with the current git commit sha1 to avoid collisions in parallel builds.
- run:
name: Build production image
@@ -172,9 +171,9 @@ jobs:
ELASTICSEARCH_PORT: 9200
DJANGO_AWS_S3_REGION_NAME: eu-west-1
# services
- image: circleci/postgres:12-ram
- image: cimg/postgres:16.4
environment:
POSTGRES_DB: test_ashley
POSTGRES_DB: ashley
POSTGRES_USER: fun
POSTGRES_PASSWORD: pass
- image: elasticsearch:5
@@ -266,8 +265,7 @@ jobs:
# Generate a version.json file describing app release
- <<: *generate-version-file
# Activate docker-in-docker
- setup_remote_docker:
version: 19.03.13
- setup_remote_docker
- run:
name: Build production image
command: docker build -t ashley:${CIRCLE_SHA1} --target production .
@@ -328,15 +326,15 @@ jobs:
# ---- Front-end jobs ----
build-front:
docker:
- image: circleci/node:14
- image: circleci/node:16
working_directory: ~/fun/src/frontend
steps:
- checkout:
path: ~/fun
- restore_cache:
keys:
- v3-front-dependencies-{{ checksum "yarn.lock" }}
- v3-front-dependencies
- v4-front-dependencies-{{ checksum "yarn.lock" }}
- v4-front-dependencies
# If the yarn.lock file is not up-to-date with the package.json file,
# using the --frozen-lockfile should fail.
- run:
@@ -358,19 +356,19 @@ jobs:
- save_cache:
paths:
- ./node_modules
key: v3-front-dependencies-{{ checksum "yarn.lock" }}
key: v4-front-dependencies-{{ checksum "yarn.lock" }}

build-front-production:
docker:
- image: circleci/node:14
- image: circleci/node:16
working_directory: ~/fun/src/frontend
steps:
- checkout:
path: ~/fun
- restore_cache:
keys:
- v3-front-dependencies-{{ checksum "yarn.lock" }}
- v3-front-dependencies-
- v4-front-dependencies-{{ checksum "yarn.lock" }}
- v4-front-dependencies-
- run:
name: Build front-end application in production mode
command: yarn build-production
@@ -397,14 +395,14 @@ jobs:
- src/ashley/static/ashley/font/*
lint-front:
docker:
- image: circleci/node:14
- image: circleci/node:16
working_directory: ~/fun/src/frontend
steps:
- checkout:
path: ~/fun
- restore_cache:
keys:
- v3-front-dependencies-{{ checksum "yarn.lock" }}
- v4-front-dependencies-{{ checksum "yarn.lock" }}
- run:
name: Lint code with tslint
command: yarn lint
@@ -414,14 +412,14 @@ jobs:

test-front:
docker:
- image: circleci/node:14
- image: circleci/node:16
working_directory: ~/fun/src/frontend
steps:
- checkout:
path: ~/fun
- restore_cache:
keys:
- v3-front-dependencies-{{ checksum "yarn.lock" }}
- v4-front-dependencies-{{ checksum "yarn.lock" }}
- run:
name: Run tests
# Circle CI needs the tests to be run sequentially, otherwise it hangs. See Jest docs below:
@@ -430,7 +428,7 @@ jobs:

test-front-package:
docker:
- image: circleci/node:14
- image: circleci/node:16
working_directory: ~/wrk
steps:
- checkout:
9 changes: 8 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -8,6 +8,12 @@ Versioning](https://semver.org/spec/v2.0.0.html).

## [Unreleased]

## [1.3.1] - 2023-02-17

### Fixed

- Fix converting in HTML atomic blocks for images

## [1.3.0] - 2023-02-07

### Added
@@ -256,7 +262,8 @@ Versioning](https://semver.org/spec/v2.0.0.html).
- Update sandbox settings to be able to run Ashley in an `iframe` on multiple
external websites

[unreleased]: https://github.com/openfun/ashley/compare/v1.3.0...master
[unreleased]: https://github.com/openfun/ashley/compare/v1.3.1...master
[1.3.1]: https://github.com/openfun/ashley/compare/v1.3.0...v1.3.1
[1.3.0]: https://github.com/openfun/ashley/compare/v1.2.5...v1.3.0
[1.2.5]: https://github.com/openfun/ashley/compare/v1.2.4...v1.2.5
[1.2.4]: https://github.com/openfun/ashley/compare/v1.2.3...v1.2.4
12 changes: 6 additions & 6 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -15,13 +15,13 @@
#

# -- Base image --
FROM python:3.8-slim as base
FROM python:3.8-slim AS base

# Upgrade pip to its latest release to speed up dependencies installation
RUN pip install --upgrade pip

# ---- Front-end builder image ----
FROM node:14 as front-builder
FROM node:16 AS front-builder

# Copy frontend app sources
COPY ./src/frontend /builder/src/frontend
@@ -35,7 +35,7 @@ RUN yarn install --frozen-lockfile && \
yarn webfonts

# ---- Back-end builder image ----
FROM base as back-builder
FROM base AS back-builder

WORKDIR /builder

@@ -61,7 +61,7 @@ RUN mkdir /install && \
pip install --prefix=/install .[sandbox]

# ---- Core application image ----
FROM base as core
FROM base AS core

# Install gettext
RUN apt-get update && \
@@ -96,7 +96,7 @@ USER ${DOCKER_USER}
ENTRYPOINT [ "/usr/local/bin/entrypoint" ]

# ---- Development image ----
FROM core as development
FROM core AS development

ENV PYTHONUNBUFFERED=1

@@ -127,7 +127,7 @@ CMD cd sandbox && \
python manage.py runserver 0.0.0.0:8000

# ---- Production image ----
FROM core as production
FROM core AS production

ENV PYTHONUNBUFFERED=1

2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -33,7 +33,7 @@ DB_PORT = 5432
DOCKER_UID = $(shell id -u)
DOCKER_GID = $(shell id -g)
DOCKER_USER = $(DOCKER_UID):$(DOCKER_GID)
COMPOSE = DOCKER_USER=$(DOCKER_USER) docker-compose
COMPOSE = DOCKER_USER=$(DOCKER_USER) docker compose
COMPOSE_RUN = $(COMPOSE) run --rm
COMPOSE_RUN_APP = $(COMPOSE_RUN) ashley
COMPOSE_RUN_CROWDIN = $(COMPOSE_RUN) crowdin -c crowdin/config.yml
8 changes: 4 additions & 4 deletions bin/_config.sh
Original file line number Diff line number Diff line change
@@ -30,16 +30,16 @@ function _set_user() {
echo "🙋(user) ID: ${USER_ID}"
}

# docker_compose: wrap docker-compose command
# docker_compose: wrap docker compose command
#
# usage: docker_compose [options] [ARGS...]
#
# options: docker-compose command options
# ARGS : docker-compose command arguments
# options: docker compose command options
# ARGS : docker compose command arguments
function _docker_compose() {

echo "🐳(compose) project: '${COMPOSE_PROJECT}' file: '${COMPOSE_FILE}'"
docker-compose \
docker compose \
-p "${COMPOSE_PROJECT}" \
-f "${COMPOSE_FILE}" \
--project-directory "${REPO_DIR}" \
6 changes: 2 additions & 4 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
version: '3.4'

services:
postgresql:
image: postgres:12
image: postgres:16.4
env_file:
- env.d/development/postgresql
ports:
@@ -48,7 +46,7 @@ services:
working_dir: /app

node:
image: node:lts
image: node:16
working_dir: /app/src/frontend
user: "${DOCKER_USER:-1000}"
volumes:
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[metadata]
name = ashley
version = 1.3.0
version = 1.3.1
description = A self-hosted discussion forum for learning
long_description = file:README.md
long_description_content_type = text/markdown
4 changes: 2 additions & 2 deletions src/ashley/defaults.py
Original file line number Diff line number Diff line change
@@ -7,12 +7,12 @@
from draftjs_exporter.dom import DOM

from ashley.editor.decorators import (
ashley_render_children,
emoji,
image,
inlinetex,
link,
mention,
render_children,
)

_FORUM_ROLE_ADMINISTRATOR = "administrator"
@@ -108,7 +108,7 @@
"block_map": dict(
DEFAULT_BLOCK_MAP,
**{
"atomic": render_children,
"atomic": ashley_render_children,
},
),
"style_map": DEFAULT_STYLE_MAP,
8 changes: 4 additions & 4 deletions src/ashley/editor/decorators.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""This module contains custom decorators for draftjs_exporter."""
import logging

from draftjs_exporter.defaults import render_children
from draftjs_exporter.dom import DOM

logger = logging.getLogger(__name__)
@@ -104,17 +105,16 @@ def inlinetex(props):
)


def render_children(props):
def ashley_render_children(props):
"""
Decorator for the blocks in Draft.js ContentState. TEXBLOCK is a custom
block that is used through atomic blocks.
"""
if props.get("block").get("data").get("type") == "TEXBLOCK":
if props.get("block", {}).get("data", {}).get("type") == "TEXBLOCK":
return DOM.create_element(
"span",
{"class": "ashley-latex-display"},
props.get("block").get("data").get("tex", None),
)

# default behaviour
return props
return render_children(props)
2 changes: 1 addition & 1 deletion src/frontend/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "ashley",
"version": "1.3.0",
"version": "1.3.1",
"description": "A self-hosted discussion forum for learning",
"scripts": {
"build": "tsc --noEmit && webpack",
Loading