Skip to content
Snippets Groups Projects
Commit 721d9883 authored by Dominik Seeger's avatar Dominik Seeger :ghost: Committed by Egi Brako
Browse files

Resolve "Replace Toggle buttons with switches" by making the toggle buttons...

Resolve "Replace Toggle buttons with switches" by making the toggle buttons for math and feedback smaller and intuitive
parent 80c272eb
No related branches found
No related tags found
1 merge request!263Resolve "Replace Toggle buttons with switches"
Pipeline #320725 failed
Showing
with 664 additions and 77 deletions
......@@ -82,10 +82,12 @@ build_test_image:
- docker login -u gitlab-ci-token -p $CI_JOB_TOKEN $CI_REGISTRY
- docker pull $DEV_IMAGE_BASE || true
- docker build --network=host --cache-from $DEV_IMAGE_BASE -t $DEV_IMAGE_BASE --target node .
- docker push $DEV_IMAGE_BASE
- docker image prune --filter label=stage=intermediate
- docker pull $DEV_IMAGE || true
- docker build --network=host --cache-from $DEV_IMAGE --cache-from $DEV_IMAGE_BASE -t $DEV_IMAGE .
- docker push $DEV_IMAGE_BASE
- docker push $DEV_IMAGE
- docker image prune --filter label=stage=intermediate
tags:
- docker
interruptible: true
......
......@@ -13,6 +13,7 @@
"axios": "^0.18.0",
"file-saver": "^2.0.2",
"highlight.js": "^9.12.0",
"marked": "^4.0.18",
"v-clipboard": "^2.0.1",
"vue": "^2.6.12",
"vue-class-component": "^6.0.0",
......
......@@ -5,6 +5,13 @@
<h3>Tips on using the correction interface</h3>
</v-card-title>
<v-card-text>
Markdown is rendered by default. <br>
Select the math button to choose to have math rendered or not. <br>
In case you need the un-rendered markdown, click the "Copy to Clipboard" button. <br>
Cick on the individual line numbers in order to add comments for a specific line. <br>
After adding feedback to a line, clicking the "Hide feedback" button will hide it or show it. <br>
When feedback is hidden, the lines that contain feedback will be highlighted in red. <br>
<!-- ------THE OLD FLAVOR TEXT, SAVED IN CASE IT IS NEEDED FOR SOME REASON -------
Never trade an ale.
The sea-dog leads with yellow fever, crush the captain's quarters until it waves.<br>
Ho-ho-ho! malaria of life.<br>
......@@ -19,7 +26,7 @@
The scallywag loots with passion, crush the bikini atoll before it falls.<br>
The sea leads with treasure, ransack the brig until it dies.<br>
The parrot robs with desolation, view the seychelles before it screams.<br>
The warm anchor quirky blows the landlubber.<br>
The warm anchor quirky blows the landlubber.<br> -->
</v-card-text>
</v-card>
</template>
......
......@@ -16,7 +16,12 @@
</td>
<td class="code-cell-content pl-2">
<!-- eslint-disable-next-line -->
<span class="code-line" :key="key" v-html="code"/>
<span
:key="key"
class="code-line"
v-html="html"
/>
<slot />
</td>
</div>
......@@ -46,7 +51,9 @@ export default {
},
data () {
return {
key: 0
key: 0,
html: '',
markdowned: true
}
},
computed: {
......@@ -58,6 +65,10 @@ export default {
subNotesEventBus.$on('resetSubmission', () => {
this.key++
})
const { marked } = require('marked')
this.html = marked.parse(this.code)
},
methods: {
toggleEditor () {
......@@ -77,7 +88,7 @@ export default {
}
.code-line {
white-space: pre-wrap;
white-space: normal;
font-family: monospace;
}
......
......@@ -24,11 +24,32 @@
<v-spacer />
<toggle-feedback-visibility-button />
<div v-if="isMarkdown">
<v-btn @click="$emit('input', !mathIsRendered)">
{{ mathIsRendered ? 'Reset Math' : 'Render Math' }}
<v-btn
v-if="mathIsRendered"
large
text
color="info"
title="Math is being rendered"
:style="{backgroundColor: '#cce7ff'}"
@click="$emit('input', !mathIsRendered)"
>
<v-icon>
functions
</v-icon>
</v-btn>
<v-btn
v-else
large
text
color="grey"
title="Math is not being rendered"
@click="$emit('input', !mathIsRendered)"
>
<v-icon>
functions
</v-icon>
</v-btn>
</div>
<v-spacer />
<v-tooltip
v-if="sourceCodeAvailable"
top
......@@ -59,6 +80,7 @@
<v-btn
v-if="showClipboard"
icon
text
v-on="on"
@click="copyToClipboard"
>
......
<template>
<v-btn
v-if="showFeedback"
id="feedback-visibility-toggle"
class="me-3"
text
color="info"
large
title="Feedback is on"
:style="{backgroundColor: '#cce7ff'}"
@click="showFeedback = !showFeedback"
>
<div v-if="showFeedback">
Hide Feedback
</div>
<div v-else>
Show Feedback
</div>
<v-icon>
rate_review
</v-icon>
</v-btn>
<v-btn
v-else
id="feedback-visibility-toggle"
class="me-3"
text
large
color="grey"
title="Feedback is off"
@click="showFeedback = !showFeedback"
>
<v-icon>
rate_review
</v-icon>
</v-btn>
</template>
......
......@@ -2416,7 +2416,7 @@ domain-browser@^1.1.1:
resolved "https://registry.yarnpkg.com/domain-browser/-/domain-browser-1.2.0.tgz#3d31f50191a6749dd1375a7f522e823d42e54eda"
integrity sha512-jnjyiM6eRyZl2H+W8Q/zLMA481hzi0eszAaBUzIVnmYVDBbnLxVNnfu1HgEBvCbL+71FrxMl3E6lpKH7Ge3OXA==
domelementtype@1, domelementtype@^1.3.1:
domelementtype@1:
version "1.3.1"
resolved "https://registry.yarnpkg.com/domelementtype/-/domelementtype-1.3.1.tgz#d048c44b37b0d10a7f2a3d5fee3f4333d790481f"
integrity sha512-BSKB+TSpMpFI/HOxCNr1O8aMOTZ8hT3pM3GQ0w/mWRmkhEDSFJkkyzz4XQsBV44BChwGkrDfMyjVD0eA2aFV3w==
......@@ -2569,26 +2569,6 @@ entities@^2.0.0:
resolved "https://registry.yarnpkg.com/entities/-/entities-2.2.0.tgz#098dc90ebb83d8dffa089d55256b351d34c4da55"
integrity sha512-p92if5Nz619I0w+akJrLZH0MX0Pb5DX39XOwQTtXSdQQOaYH03S1uIQp4mhOZtAXrxq4ViO67YTiLBo2638o9A==
entities@^2.0.0:
version "2.2.0"
resolved "https://registry.yarnpkg.com/entities/-/entities-2.2.0.tgz#098dc90ebb83d8dffa089d55256b351d34c4da55"
integrity sha512-p92if5Nz619I0w+akJrLZH0MX0Pb5DX39XOwQTtXSdQQOaYH03S1uIQp4mhOZtAXrxq4ViO67YTiLBo2638o9A==
entities@^2.0.0:
version "2.2.0"
resolved "https://registry.yarnpkg.com/entities/-/entities-2.2.0.tgz#098dc90ebb83d8dffa089d55256b351d34c4da55"
integrity sha512-p92if5Nz619I0w+akJrLZH0MX0Pb5DX39XOwQTtXSdQQOaYH03S1uIQp4mhOZtAXrxq4ViO67YTiLBo2638o9A==
entities@^2.0.0:
version "2.2.0"
resolved "https://registry.yarnpkg.com/entities/-/entities-2.2.0.tgz#098dc90ebb83d8dffa089d55256b351d34c4da55"
integrity sha512-p92if5Nz619I0w+akJrLZH0MX0Pb5DX39XOwQTtXSdQQOaYH03S1uIQp4mhOZtAXrxq4ViO67YTiLBo2638o9A==
entities@^2.0.0:
version "2.2.0"
resolved "https://registry.yarnpkg.com/entities/-/entities-2.2.0.tgz#098dc90ebb83d8dffa089d55256b351d34c4da55"
integrity sha512-p92if5Nz619I0w+akJrLZH0MX0Pb5DX39XOwQTtXSdQQOaYH03S1uIQp4mhOZtAXrxq4ViO67YTiLBo2638o9A==
errno@^0.1.3, errno@~0.1.7:
version "0.1.8"
resolved "https://registry.yarnpkg.com/errno/-/errno-0.1.8.tgz#8bb3e9c7d463be4976ff888f76b4809ebc2e811f"
......@@ -4298,48 +4278,6 @@ is-negative-zero@^2.0.1:
resolved "https://registry.yarnpkg.com/is-negative-zero/-/is-negative-zero-2.0.1.tgz#3de746c18dda2319241a53675908d8f766f11c24"
integrity sha512-2z6JzQvZRa9A2Y7xC6dQQm4FSTSTNWjKIYYTt4246eMTJmIo0Q+ZyOsU66X8lxK1AbB92dFeglPLrhwpeRKO6w==
is-number-object@^1.0.4:
version "1.0.6"
resolved "https://registry.yarnpkg.com/is-number-object/-/is-number-object-1.0.6.tgz#6a7aaf838c7f0686a50b4553f7e54a96494e89f0"
integrity sha512-bEVOqiRcvo3zO1+G2lVMy+gkkEm9Yh7cDMRusKKu5ZJKPUYSJwICTKZrNKHA2EbSP0Tu0+6B/emsYNHZyn6K8g==
dependencies:
has-tostringtag "^1.0.0"
is-negative-zero@^2.0.1:
version "2.0.1"
resolved "https://registry.yarnpkg.com/is-negative-zero/-/is-negative-zero-2.0.1.tgz#3de746c18dda2319241a53675908d8f766f11c24"
integrity sha512-2z6JzQvZRa9A2Y7xC6dQQm4FSTSTNWjKIYYTt4246eMTJmIo0Q+ZyOsU66X8lxK1AbB92dFeglPLrhwpeRKO6w==
is-number-object@^1.0.4:
version "1.0.4"
resolved "https://registry.yarnpkg.com/is-number-object/-/is-number-object-1.0.4.tgz#36ac95e741cf18b283fc1ddf5e83da798e3ec197"
integrity sha512-zohwelOAur+5uXtk8O3GPQ1eAcu4ZX3UwxQhUlfFFMNpUd83gXgjbhJh6HmB6LUNV/ieOLQuDwJO3dWJosUeMw==
is-negative-zero@^2.0.1:
version "2.0.1"
resolved "https://registry.yarnpkg.com/is-negative-zero/-/is-negative-zero-2.0.1.tgz#3de746c18dda2319241a53675908d8f766f11c24"
integrity sha512-2z6JzQvZRa9A2Y7xC6dQQm4FSTSTNWjKIYYTt4246eMTJmIo0Q+ZyOsU66X8lxK1AbB92dFeglPLrhwpeRKO6w==
is-number-object@^1.0.4:
version "1.0.4"
resolved "https://registry.yarnpkg.com/is-number-object/-/is-number-object-1.0.4.tgz#36ac95e741cf18b283fc1ddf5e83da798e3ec197"
integrity sha512-zohwelOAur+5uXtk8O3GPQ1eAcu4ZX3UwxQhUlfFFMNpUd83gXgjbhJh6HmB6LUNV/ieOLQuDwJO3dWJosUeMw==
is-negative-zero@^2.0.1:
version "2.0.1"
resolved "https://registry.yarnpkg.com/is-negative-zero/-/is-negative-zero-2.0.1.tgz#3de746c18dda2319241a53675908d8f766f11c24"
integrity sha512-2z6JzQvZRa9A2Y7xC6dQQm4FSTSTNWjKIYYTt4246eMTJmIo0Q+ZyOsU66X8lxK1AbB92dFeglPLrhwpeRKO6w==
is-number-object@^1.0.4:
version "1.0.4"
resolved "https://registry.yarnpkg.com/is-number-object/-/is-number-object-1.0.4.tgz#36ac95e741cf18b283fc1ddf5e83da798e3ec197"
integrity sha512-zohwelOAur+5uXtk8O3GPQ1eAcu4ZX3UwxQhUlfFFMNpUd83gXgjbhJh6HmB6LUNV/ieOLQuDwJO3dWJosUeMw==
is-negative-zero@^2.0.1:
version "2.0.1"
resolved "https://registry.yarnpkg.com/is-negative-zero/-/is-negative-zero-2.0.1.tgz#3de746c18dda2319241a53675908d8f766f11c24"
integrity sha512-2z6JzQvZRa9A2Y7xC6dQQm4FSTSTNWjKIYYTt4246eMTJmIo0Q+ZyOsU66X8lxK1AbB92dFeglPLrhwpeRKO6w==
is-number-object@^1.0.4:
version "1.0.4"
resolved "https://registry.yarnpkg.com/is-number-object/-/is-number-object-1.0.4.tgz#36ac95e741cf18b283fc1ddf5e83da798e3ec197"
......@@ -4834,6 +4772,11 @@ map-visit@^1.0.0:
dependencies:
object-visit "^1.0.0"
marked@^4.0.18:
version "4.0.18"
resolved "https://registry.yarnpkg.com/marked/-/marked-4.0.18.tgz#cd0ac54b2e5610cfb90e8fd46ccaa8292c9ed569"
integrity sha512-wbLDJ7Zh0sqA0Vdg6aqlbT+yPxqLblpAZh1mK2+AO2twQkPywvvqQNfEPVwSSRjZ7dZcdeVBIAgiO7MMp3Dszw==
md5.js@^1.3.4:
version "1.3.5"
resolved "https://registry.yarnpkg.com/md5.js/-/md5.js-1.3.5.tgz#b5d07b8e3216e3e27cd728d72f70d1e6a342005f"
......
[run]
branch = True
source = core,util.factories
omit =
core/migrations/*
core/apps.py
core/admin.py
core/tests/*
[report]
ignore_errors = False
[html]
directory = public
# Common
.git
Dockerfile
# Django
*/db.sqlite3
*/__pycache__*
*.pyc
*.pyo
*.pyd
*/env*
.venv
.ipynb_checkpoints
pip-log.txt
pip-delete-this-directory.txt
.tox
.coverage
.coverage.*
.cache
coverage.xml
*,cover
*.log
static/
public/
# node
*/node_modules
*/npm-debug.log
*/dist
# top-most EditorConfig file
root = true
# Unix-style newlines with a newline ending every file
[*]
end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = true
# Python specific settigs
[*.py]
indent_style = space
indent_size = 4
charset = utf-8
# html specific settigs
[*.html]
indent_style = space
indent_size = 2
charset = utf-8
# Tab indentation (no size specified)
[Makefile]
indent_style = tab
# Matches the exact files either package.json or .travis.yml
[{package.json,.travis.yml}]
indent_style = space
indent_size = 2
# Frontend
[*.{js,jsx,ts,tsx,vue}]
indent_style = space
indent_size = 2
trim_trailing_whitespace = true
insert_final_newline = true
# python specific
*.DS_Store
*.egg-info
*.pot
*.py[co]
.tox/
*.ipynb
.ipynb_checkpoints/
__pycache__
MANIFEST
.coverage
cache/
.mypy_cache/
# Django specific
dist/
docs/_build/
docs/locale/
tests/coverage_html/
tests/.coverage
build/
tests/report/
*.sqlite3
static/
# project specific
env-grady/
env/
.venv/
scripts/
coverage_html/
.public/
*.csv
.importer*
*.sublime-*
.idea/
.vscode/
anon-export/
public/
geckodriver.log
.screenshots
# node
node_modules
secret
dump.sql
.pytest_cache/
stages:
- build
- test
- build_image
- pages
- staging
variables:
WORKON_HOME: .pipenv/venvs
PIP_CACHE_DIR: .pipenv/pipcache
DEV_IMAGE: $CI_REGISTRY_IMAGE/dev-image
DEV_IMAGE_BASE: $CI_REGISTRY_IMAGE/dev-image-base
RELEASE_IMAGE: $CI_REGISTRY_IMAGE:$CI_COMMIT_TAG
DOCKER_DRIVER: overlay2
DOCKER_TLS_CERTDIR: ""
POSTGRES_DB: $CI_POSTGRES_DB
POSTGRES_USER: $CI_POSTGRES_USER
POSTGRES_PASSWORD: $CI_POSTGRES_PASSWORD
include:
template: Dependency-Scanning.gitlab-ci.yml
cache:
key: "pip-cache"
paths:
- "$PIP_CACHE_DIR"
# ========================== Build Testing section =========================== #
build_test_env:
image: python:3.8
stage: build
script:
- pip install pipenv
- pipenv install --dev
artifacts:
paths:
- .pipenv
expire_in: 1 day
cache:
key: "$CI_PIPELINE_ID"
paths:
- "$WORKON_HOME"
tags:
- docker
interruptible: true
build_frontend:
image: node:fermium
stage: build
variables:
VUE_APP_CI: 'true'
script:
- cd frontend
- yarn
- yarn build
artifacts:
paths:
- frontend/dist
- frontend/node_modules/
expire_in: 1 days
cache:
key: "$CI_PIPELINE_ID"
paths:
- frontend/dist
- frontend/node_modules/
tags:
- docker
interruptible: true
build_test_image:
image: docker:latest
stage: build
only:
- branches
services:
- docker:dind
variables:
DOCKER_HOST: tcp://docker:2375/
DOCKER_DRIVER: overlay2
script:
- docker login -u gitlab-ci-token -p $CI_JOB_TOKEN $CI_REGISTRY
- docker pull $DEV_IMAGE_BASE || true
- docker build --network=host --cache-from $DEV_IMAGE_BASE -t $DEV_IMAGE_BASE --target node .
- docker pull $DEV_IMAGE || true
- docker build --network=host --cache-from $DEV_IMAGE --cache-from $DEV_IMAGE_BASE -t $DEV_IMAGE .
- docker push $DEV_IMAGE_BASE
- docker push $DEV_IMAGE
tags:
- docker
interruptible: true
# ============================== Testing section ============================= #
# ----------------------------- Backend subsection --------------------------- #
.test_template_virtualenv: &test_definition_virtualenv
image: python:3.8
before_script:
- pip install pipenv
- VENV=$(pipenv --venv)
- source $VENV/bin/activate
dependencies:
- build_test_env
cache:
key: "$CI_PIPELINE_ID"
tags:
- docker
interruptible: true
needs:
- build_test_env
test_pytest:
<<: *test_definition_virtualenv
stage: test
services:
- postgres:13
script:
- pytest --cov --ds=grady.settings.test core/tests
artifacts:
paths:
- .coverage
cache:
key: "$CI_JOB_NAME"
paths:
- .coverage
test_flake8:
<<: *test_definition_virtualenv
stage: test
script:
- flake8 --exclude=migrations core util functional_tests
# ----------------------------- Frontend subsection -------------------------- #
.test_template_frontend: &test_definition_frontend
image: docker.gitlab.gwdg.de/grady-corp/python-geckodriver:master
before_script:
- pip install pipenv
- VENV=$(pipenv --venv)
- source $VENV/bin/activate
dependencies:
- build_test_env
- build_frontend
cache:
key: "$CI_PIPELINE_ID"
tags:
- docker
interruptible: true
needs:
- build_frontend
- build_test_env
test_frontend:
<<: *test_definition_frontend
stage: test
services:
- postgres:13
script:
- cp frontend/dist/index.html core/templates
- python util/format_index.py
- python manage.py collectstatic --no-input
- HEADLESS_TESTS=True pytest --ds=grady.settings.test functional_tests
artifacts:
paths:
- functional_tests/screenshots/
when: on_failure
expire_in: 30 days
retry: 2
# =========================== Build Image section ============================ #
build_release_image:
image: docker:latest
stage: build_image
only:
- tags
services:
- docker:dind
variables:
DOCKER_HOST: tcp://docker:2375/
DOCKER_DRIVER: overlay2
script:
- docker login -u gitlab-ci-token -p $CI_JOB_TOKEN $CI_REGISTRY
- docker pull $DEV_IMAGE_BASE || true
- docker pull $DEV_IMAGE || true
- docker build --cache-from $DEV_IMAGE --cache-from $DEV_IMAGE_BASE -t $RELEASE_IMAGE .
- docker push $RELEASE_IMAGE
tags:
- docker
# =========================== Gitlab pages section =========================== #
pages:
<<: *test_definition_virtualenv
stage:
pages
script:
- coverage html -d public
dependencies:
- test_pytest
- build_test_env
artifacts:
paths:
- public
only:
- master
interruptible: true
needs:
- test_pytest
- build_test_env
# ============================== Staging section ============================= #
.staging_template: &staging_definition
stage: staging
image: docker:latest
only:
- master
when: manual
before_script:
- apk add --update py-pip && pip install docker-compose
tags:
- grady-staging
staging:
<<: *staging_definition
environment:
name: review/$CI_COMMIT_REF_NAME
url: https://staging.grady.janmax.org
on_stop: staging_stop
script:
- docker login -u gitlab-ci-token -p $CI_JOB_TOKEN $CI_REGISTRY
- docker-compose stop
- docker-compose pull
- docker-compose up -d --force-recreate
staging_stop:
<<: *staging_definition
script:
- docker-compose rm --force --stop
when: manual
environment:
name: review/$CI_COMMIT_REF_NAME
action: stop
#### Summary
#### Steps to reproduce
#### Example Project
#### What is the current bug behavior?
#### What is the expected correct behavior?
#### Relevant logs and/or screenshots
#### Possible fixes
/label Bug
/label ~"Needs assignment"
### Description / Overview
### Use cases
(Who is this for?)
### Links / references
### Feature checklist
(Make sure these are completed before closing the issue, with a link to the
relevant commit.)
/label ~"Feature proposal"
- repo: git@github.com:pre-commit/pre-commit-hooks
sha: v1.1.1
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
- id: debug-statements
- id: flake8
args:
- --exclude=*/migrations/*,docs/*,grady/*
- id: check-added-large-files
[MASTER]
# Add files or directories to the blacklist. They should be base names, not
# paths.
ignore=CVS, migrations, static, env, docs, manage.py
# Use multiple processes to speed up Pylint.
jobs=4
# Pickle collected data for later comparisons.
persistent=yes
# When enabled, pylint would attempt to guess common misconfiguration and emit
# user-friendly hints instead of false-positive error messages
suggestion-mode=yes
# List of plugins (as comma separated values of python modules names) to load,
# usually to register additional checkers.
load-plugins=pylint_django
FROM node:fermium as node
WORKDIR /app/
COPY frontend/package.json .
COPY frontend/yarn.lock .
RUN yarn
# CACHED
COPY frontend/ .
RUN yarn build
FROM alpine:edge
WORKDIR /code
# This set is needed otherwise the postgres driver wont work
RUN apk update \
&& apk add build-base gcc curl libzmq musl-dev zeromq-dev python3 python3-dev py3-pip \
&& apk add --no-cache postgresql-dev git
# Create symlink for python
RUN ln -sf python3 /usr/bin/python
RUN pip install pipenv
COPY Pipfile .
COPY Pipfile.lock .
RUN pipenv install --system --deploy && rm -rf /root/.cache
# CACHED
COPY . .
COPY --from=node /app/dist /code/frontend/dist
COPY --from=node /app/dist/index.html /code/core/templates/index.html
ENV PYTHONUNBUFFERED 1
RUN python util/format_index.py
RUN python manage.py collectstatic --noinput
# Reduces image size
RUN apk del build-base musl-dev python3-dev zeromq-dev
CMD ["./deploy.sh"]
MIT License
Copyright (c) 2017 Jan Maximilian Michal
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
APP_LIST ?= core grady util
DB_NAME = postgres
.ONESHELL:
.PHONY: run install migrations-check isort isort-check test teste2e
run:
python manage.py runserver 0.0.0.0:8000
migrations-check:
python manage.py makemigrations --check --dry-run
isort:
isort -rc $(APP_LIST)
isort-check:
isort -c -rc $(APP_LIST)
migrate:
python manage.py migrate
test:
pytest --ds=grady.settings core/tests
frontend/dist: $(shell find frontend/src -type f)
yarn --cwd frontend build
teste2e: frontend/dist
set -e
cp frontend/dist/index.html core/templates
trap "git checkout core/templates/index.html" EXIT
python util/format_index.py
python manage.py collectstatic --no-input
HEADLESS_TESTS=$(headless) pytest --ds=grady.settings $(path)
coverage:
set -e
DJANGO_SETTINGS_MODULE=grady.settings pytest --cov
coverage html
db:
docker run -d --name $(DB_NAME) -p 5432:5432 -e POSTGRES_PASSWORD=postgres postgres:13
[[source]]
name = "pypi"
url = "https://pypi.org/simple"
verify_ssl = true
[dev-packages]
flake8 = "~=3.9.0"
pre-commit = "~=1.13.0"
pytest = "~=6.1.0"
pytest-cov = "~=2.10.1"
pytest-xdist = "~=2.1.0"
pytest-django = "~=3.10.0"
selenium = "~=3.141.0"
factory-boy = "~=3.0.1"
Faker = "~=4.1.3"
[packages]
pyzmq = "~=22.3.0"
django-cors-headers = "~=3.5.0"
django-extensions = "~=3.0.9"
djangorestframework-jwt = "~=1.11.0"
djangorestframework = "~=3.11.0"
django-silk = "~=4.1.0"
djangorestframework-camel-case = {git = "https://gitlab.gwdg.de/grady-corp/djangorestframework-camel-case.git"}
drf-yasg = "~=1.17.1"
gunicorn = "~=20.0.4"
psycopg2-binary = "~=2.8.6"
whitenoise = "~=5.2.0"
xlrd = "~=1.2.0"
JSON-log-formatter = "~=0.3.0"
xkcdpass = "~=1.17.3"
django-constance = {extras = ["database"],version = "~=2.7.0"}
semver = "~=2.10.2"
Django = "~=3.1.1"
nbformat = "~=5.0.7"
nbconvert = "~=6.4.5"
[requires]
python_version = "3.8"
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment