Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found
Select Git revision
  • 62-add-generic-default-template-for-room
  • 66-adapt-to-places
  • check/update-merge-request-template
  • check/update-tox-ini
  • csv-export
  • feature/general-csv-importer
  • feature/more-generic-field-types
  • improved-and-export
  • master
  • release/2.0
  • release/4.0.0
  • renovate/phonenumbers-9.x
  • stable/3.0
  • 1.0a0
  • 1.0a1
  • 1.0a2
  • 1.0a3
  • 2.0
  • 2.0.post0
  • 2.0b0
  • 2.0b1
  • 2.0rc1
  • 2.0rc2
  • 2.1
  • 2.2
  • 2.2.1
  • 2.3
  • 2.3.1
  • 3.0
  • 3.0.1
  • 3.0.2
  • 3.0b0
  • 4.0.0
  • 4.0.0.post0
  • 4.0.0.post1
35 results

Target

Select target project
  • AlekSIS/official/AlekSIS-App-CSVImport
  • sunweaver/AlekSIS-App-CSVImport
  • 8pallypsaugi/AlekSIS-App-CSVImport
  • 3conftisancya/AlekSIS-App-CSVImport
  • 9stagripaezu/AlekSIS-App-CSVImport
5 results
Select Git revision
  • 25-trim-names-and-short-names
  • 27-insert-or-update-on-table-csv_import_importtemplate-violates-foreign-key-constraint
  • 28-allow-providing-args-for-field-types
  • 32-celery-task-not-properly-registered
  • 35-allow-using-value-from-preferences-in-args
  • 40-support-zip-file-with-csv-and-accompanying-files
  • 41-import-is-not-thread-safe
  • 42-quotechar-is-hard-coded
  • 43-iterator-broken-in-81
  • 44-support-jmespath-fields
  • add-docs
  • enable-docker-build
  • enable-tests
  • feature/general-csv-importer
  • feature/more-generic-field-types
  • fix-field-types-access
  • fix-release-2.1
  • fix-release-2.2
  • fix-typo
  • i10n-ru-ua
  • master
  • member-of-field
  • prepare-release-2.1
  • register-regex-field
  • release-2.2
  • release-2.2.1-really
  • release/2.0
  • remove-is-active
  • revert-e92cdccd
  • weblate
  • 1.0a0
  • 1.0a1
  • 1.0a2
  • 1.0a3
  • 2.0
  • 2.0.post0
  • 2.0b0
  • 2.0b1
  • 2.0rc1
  • 2.0rc2
  • 2.1
  • 2.2
  • 2.2.1
43 results
Show changes

Commits on Source 243

143 additional commits have been omitted to prevent performance issues.
Showing
with 1524 additions and 222 deletions
module.exports = {
root: true,
overrides: [
{
files: ["*.js", "*.vue"],
// parser: "vue-eslint-parser",
//processor: "@graphql-eslint/graphql",
extends: [
"eslint:recommended",
"plugin:vue/strongly-recommended",
"plugin:@intlify/vue-i18n/recommended",
],
rules: {
"no-unused-vars": "warn",
"vue/no-unused-vars": "off",
"vue/multi-word-component-names": "off",
"vue/attribute-hyphenation": "error",
"vue/v-slot-style": "error",
"@intlify/vue-i18n/key-format-style": [
"error",
"snake_case",
{
splitByDots: false,
},
],
// "@intlify/vue-i18n/no-unused-keys": ["warn", {}],
"@intlify/vue-i18n/no-raw-text": [
"error",
{
ignoreNodes: ["v-icon"],
ignorePattern: "^[-–—·#:()\\[\\]&\\.\\s]+$",
},
],
"@intlify/vue-i18n/no-deprecated-tc": "off",
// Fixes for prettier (avoid eslint-config-prettier)
// The following rules can be used in some cases. See the README for more
// information. (These are marked with `0` instead of `"off"` so that a
// script can distinguish them.)
curly: 0,
"lines-around-comment": 0,
"max-len": 0,
"no-confusing-arrow": 0,
"no-mixed-operators": 0,
"no-tabs": 0,
"no-unexpected-multiline": 0,
quotes: 0,
"@typescript-eslint/quotes": 0,
"babel/quotes": 0,
"vue/html-self-closing": 0,
"vue/max-len": 0,
// The rest are rules that you never need to enable when using Prettier.
"array-bracket-newline": "off",
"array-bracket-spacing": "off",
"array-element-newline": "off",
"arrow-parens": "off",
"arrow-spacing": "off",
"block-spacing": "off",
"brace-style": "off",
"comma-dangle": "off",
"comma-spacing": "off",
"comma-style": "off",
"computed-property-spacing": "off",
"dot-location": "off",
"eol-last": "off",
"func-call-spacing": "off",
"function-call-argument-newline": "off",
"function-paren-newline": "off",
"generator-star": "off",
"generator-star-spacing": "off",
"implicit-arrow-linebreak": "off",
indent: "off",
"jsx-quotes": "off",
"key-spacing": "off",
"keyword-spacing": "off",
"linebreak-style": "off",
"multiline-ternary": "off",
"newline-per-chained-call": "off",
"new-parens": "off",
"no-arrow-condition": "off",
"no-comma-dangle": "off",
"no-extra-parens": "off",
"no-extra-semi": "off",
"no-floating-decimal": "off",
"no-mixed-spaces-and-tabs": "off",
"no-multi-spaces": "off",
"no-multiple-empty-lines": "off",
"no-reserved-keys": "off",
"no-space-before-semi": "off",
"no-trailing-spaces": "off",
"no-whitespace-before-property": "off",
"no-wrap-func": "off",
"nonblock-statement-body-position": "off",
"object-curly-newline": "off",
"object-curly-spacing": "off",
"object-property-newline": "off",
"one-var-declaration-per-line": "off",
"operator-linebreak": "off",
"padded-blocks": "off",
"quote-props": "off",
"rest-spread-spacing": "off",
semi: "off",
"semi-spacing": "off",
"semi-style": "off",
"space-after-function-name": "off",
"space-after-keywords": "off",
"space-before-blocks": "off",
"space-before-function-paren": "off",
"space-before-function-parentheses": "off",
"space-before-keywords": "off",
"space-in-brackets": "off",
"space-in-parens": "off",
"space-infix-ops": "off",
"space-return-throw-case": "off",
"space-unary-ops": "off",
"space-unary-word-ops": "off",
"switch-colon-spacing": "off",
"template-curly-spacing": "off",
"template-tag-spacing": "off",
"unicode-bom": "off",
"wrap-iife": "off",
"wrap-regex": "off",
"yield-star-spacing": "off",
"@babel/object-curly-spacing": "off",
"@babel/semi": "off",
"@typescript-eslint/brace-style": "off",
"@typescript-eslint/comma-dangle": "off",
"@typescript-eslint/comma-spacing": "off",
"@typescript-eslint/func-call-spacing": "off",
"@typescript-eslint/indent": "off",
"@typescript-eslint/keyword-spacing": "off",
"@typescript-eslint/member-delimiter-style": "off",
"@typescript-eslint/no-extra-parens": "off",
"@typescript-eslint/no-extra-semi": "off",
"@typescript-eslint/object-curly-spacing": "off",
"@typescript-eslint/semi": "off",
"@typescript-eslint/space-before-blocks": "off",
"@typescript-eslint/space-before-function-paren": "off",
"@typescript-eslint/space-infix-ops": "off",
"@typescript-eslint/type-annotation-spacing": "off",
"babel/object-curly-spacing": "off",
"babel/semi": "off",
"flowtype/boolean-style": "off",
"flowtype/delimiter-dangle": "off",
"flowtype/generic-spacing": "off",
"flowtype/object-type-curly-spacing": "off",
"flowtype/object-type-delimiter": "off",
"flowtype/quotes": "off",
"flowtype/semi": "off",
"flowtype/space-after-type-colon": "off",
"flowtype/space-before-generic-bracket": "off",
"flowtype/space-before-type-colon": "off",
"flowtype/union-intersection-spacing": "off",
"react/jsx-child-element-spacing": "off",
"react/jsx-closing-bracket-location": "off",
"react/jsx-closing-tag-location": "off",
"react/jsx-curly-newline": "off",
"react/jsx-curly-spacing": "off",
"react/jsx-equals-spacing": "off",
"react/jsx-first-prop-new-line": "off",
"react/jsx-indent": "off",
"react/jsx-indent-props": "off",
"react/jsx-max-props-per-line": "off",
"react/jsx-newline": "off",
"react/jsx-one-expression-per-line": "off",
"react/jsx-props-no-multi-spaces": "off",
"react/jsx-tag-spacing": "off",
"react/jsx-wrap-multilines": "off",
"standard/array-bracket-even-spacing": "off",
"standard/computed-property-even-spacing": "off",
"standard/object-curly-even-spacing": "off",
"unicorn/empty-brace-spaces": "off",
"unicorn/no-nested-ternary": "off",
"unicorn/number-literal-case": "off",
"vue/array-bracket-newline": "off",
"vue/array-bracket-spacing": "off",
"vue/arrow-spacing": "off",
"vue/block-spacing": "off",
"vue/block-tag-newline": "off",
"vue/brace-style": "off",
"vue/comma-dangle": "off",
"vue/comma-spacing": "off",
"vue/comma-style": "off",
"vue/dot-location": "off",
"vue/func-call-spacing": "off",
"vue/html-closing-bracket-newline": "off",
"vue/html-closing-bracket-spacing": "off",
"vue/html-end-tags": "off",
"vue/html-indent": "off",
"vue/html-quotes": "off",
"vue/key-spacing": "off",
"vue/keyword-spacing": "off",
"vue/max-attributes-per-line": "off",
"vue/multiline-html-element-content-newline": "off",
"vue/multiline-ternary": "off",
"vue/mustache-interpolation-spacing": "off",
"vue/no-extra-parens": "off",
"vue/no-multi-spaces": "off",
"vue/no-spaces-around-equal-signs-in-attribute": "off",
"vue/object-curly-newline": "off",
"vue/object-curly-spacing": "off",
"vue/object-property-newline": "off",
"vue/operator-linebreak": "off",
"vue/quote-props": "off",
"vue/script-indent": "off",
"vue/singleline-html-element-content-newline": "off",
"vue/space-in-parens": "off",
"vue/space-infix-ops": "off",
"vue/space-unary-ops": "off",
"vue/template-curly-spacing": "off",
},
settings: {
"vue-i18n": {
localeDir: "./aleksis/core/frontend/messages/*.{json}",
messageSyntaxVersion: "^8.0.0",
},
},
env: {
es2021: true,
},
parserOptions: {
ecmaVersion: "latest",
},
},
{
files: ["*.graphql"],
parser: "@graphql-eslint/eslint-plugin",
plugins: ["@graphql-eslint"],
extends: "plugin:@graphql-eslint/operations-recommended",
parserOptions: {
graphQLConfig: {
schema: "./schema.json",
documents: "../aleksis/**/*/frontend/**/*.graphql",
},
},
rules: {
"@graphql-eslint/no-anonymous-operations": "error",
"@graphql-eslint/no-duplicate-fields": "error",
"@graphql-eslint/naming-convention": [
"error",
{
OperationDefinition: {
style: "camelCase",
forbiddenPrefixes: ["Query", "Mutation", "Subscription", "Get"],
forbiddenSuffixes: ["Query", "Mutation", "Subscription"],
},
},
],
},
},
],
};
{
"name": "aleksis-builddeps",
"version": "1.0.0",
"dependencies": {
"@graphql-eslint/eslint-plugin": "^4.3.0",
"@intlify/eslint-plugin-vue-i18n": "^3.0.0",
"eslint": "^8.26.0",
"eslint-config-prettier": "^9.0.0",
"eslint-plugin-vue": "^9.7.0",
"graphql": "^16.10.0",
"prettier": "^3.4.0",
"stylelint": "^15.0.0",
"stylelint-config-prettier": "^9.0.3",
"stylelint-config-standard": "^34.0.0"
}
}
<!-- AlekSIS is developed on EduGit. GitHub only serves as
backup mirror and to help people find the project. If
possible, please submit your merge request on EduGit!
EduGit accepts logins with GitHub accounts.
-->
[ ] I have read the above and have no way to contribute on EduGit
[ ] I understand that GitHub's terms of service exclude young and
learning contributors, but still cannot contribute on EduGit
instead.
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class
*.py[cod]
__pycache__/
# Distribution / packaging
*.egg
*.egg-info/
.Python
.eggs/
.installed.cfg
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
wheels/
*.egg-info/
.installed.cfg
*.egg
# Installer logs
pip-log.txt
pip-delete-this-directory.txt
pip-log.txt
# Translations
*.mo
......@@ -39,24 +39,60 @@ local_settings.py
# Environments
.env
.venv
ENV/
env/
venv/
ENV/
# Editors
*~
DEADJOE
\#*#
# IntelliJ
.idea
.idea/
# VSCode
.vscode/
.history/
*.code-workspace
# Database
db.sqlite3
# Sphinx
docs/_build/
# Testing
.tox
# TeX
*.aux
# Generated files
/cache
/node_modules
.dev-js/node_modules
/static/
/whoosh_index/
.vite
.dev-js/.yarn
.dev-js/.pnp.cjs
.dev-js/.pnp.loader.mjs
.dev-js/.yarnrc.yml
.dev-js/schema.json
# Lock files
poetry.lock
package-lock.json
yarn.lock
.dev-js/yarn.lock
# Tests
.coverage
.mypy_cache/
.tox/
htmlcov/
poetry.lock
# Data
maintenance_mode_state.txt
media/
aleksis/core/static/style.css
## Information and screenshots
No further information have been provided.
## Checklist
- [ ] `tox -e reformat,lint` used
- [ ] Changelog updated/No update necessary
- [ ] Documentation (incl. Screenshots) up-to-date
- [ ] Copyright in `apps.py` and `README.rst` up-to-date
- [ ] (Unit) tests for new feature/regression tests for bug fixes (only if useful)
- [ ] Adhere to [URL scheme](https://edugit.org/AlekSIS/official/AlekSIS/-/issues/86)
- [ ] Tested with admin account
- [ ] Tested with normal account (based on permissions)
## Backend checklist
- [ ] Use permissions for all GraphQL mutations
- [ ] Use query optimizer for all GraphQL queries
- [ ] Don't use inefficient DB queries
## Frontend checklist (mandatory with ~"part::frontend")
- [ ] Screenshots are attached (mobile and desktop)
- [ ] Tested on mobile, tablet, and desktop sizes
- [ ] Adhered to frontend guidelines
- [ ] Checked with Firefox Accessibility Checker
# Byte-compiled / optimized / DLL files
*$py.class
*.py[cod]
__pycache__/
# Distribution / packaging
*.egg
*.egg-info/
.Python
.eggs/
.installed.cfg
build/
develop-eggs/
dist/
downloads/
eggs/
lib/
lib64/
parts/
sdist/
var/
wheels/
# Installer logs
pip-delete-this-directory.txt
pip-log.txt
# Translations
*.mo
*.pot
# Django stuff:
*.log
local_settings.py
# pyenv
.python-version
# Environments
.env
.venv
ENV/
env/
venv/
# Editors
*~
DEADJOE
\#*#
# IntelliJ
.idea
.idea/
# Database
db.sqlite3
# Sphinx
docs/_build/
# TeX
*.aux
# Generated files
/node_modules/
/static/
/whoosh_index/
poetry.lock
.coverage
.mypy_cache/
.tox/
htmlcov/
maintenance_mode_state.txt
media/
package-lock.json
yarn.lock
# VSCode
.vscode/
.history/
*.code-workspace
/cache
# Add HTML files to avoid problems with unsupported Django templates
*.html
# Do not check/reformat generated files
aleksis/core/util/licenses.json
.vite/
.pnp.cjs
.pnp.loader.mjs
.git/
......@@ -9,6 +9,101 @@ and this project adheres to `Semantic Versioning`_.
Unreleased
----------
Notable, breaking changes
~~~~~~~~~~~~~~~~~~~~~~~~~
* Skip empty alternative values.
* Search primary groups case-insensitive.
* Use Subject from Cursus instead of Chronos.
Added
~~~~~
* Option to disable creation of new objects while importing.
* The class range parser now also allows selections like 5a+c+d in addition to ranges like 5a-d.
* Support process field types that are run before object creation/saving.
* Allow selecting validity range for related import templates.
* [Dev] Support additional params for import jobs.
* More field types
* Connected match field type for finding objects with multiple conditions using multiple fields.
* Converter-based regex field type for parsing data based on regexes.
* Group owner by full name field type
* Group member by full name field type
* Group member by unique reference field type
* User by username field type (only for creating)
Changed
~~~~~~~
* Migrate import view to new frontend.
* Support injecting additional params for usage in own field types from other apps.
* Add some more logging and improve import progress messages.
* Allow using name or short name in department groups field type.
* Match field types with negative priority will be ignored for matching process.
* Expose direct mapping field type so it can be used by import templates directly.
* [Dev] Use ``RegistryObject`` from Core for field types. This allows other apps registering field types.
Fixed
~~~~~
* The comma-separated data parser didn't work with spaces before or after the comma.
* Correctly evaluate priorities and try different solutions according to their priorities.
* Support more different gender choices.
* The back link on progress page was broken.
* Skip import of default templates for not installed apps.
* Run model validation for all changed/created objects to find errors.
* ``street_housenumber`` field did not match if value contained ``-`` or ``.``.
`3.0.1`_ - 2023-07-20
---------------------
Fixed
~~~~~
* CSV import app caused long delay on AlekSIS startup
`3.0`_ - 2023-05-12
-------------------
Changed
~~~~~~~
* Ukrainian translations were updated.
* Phonenumber country is now configured using the `PHONENUMBER_DEFAULT_REGION` setting.
`3.0b0`_ - 2023-02-22
---------------------
This version requires AlekSIS-Core 3.0. It is incompatible with any previous
version.
Removed
~~~~~~~
* Legacy menu integration for AlekSIS-Core pre-3.0
Added
~~~~~
* Support for SPA in AlekSIS-Core 3.0
* If activated, imports with regex field types will show error messages
when there is no match.
Fixed
~~~~~
* The reg ex field type wasn't usable with own templates.
* Import failed if a file columns was empty.
`2.3`_ - 2022-06-25
-------------------
Added
~~~~~
* Add Ukrainian locale (contributed by Sergiy Gorichenko from Fre(i)e Software GmbH).
Changed
~~~~~~~
......@@ -170,13 +265,17 @@ Fixed
.. _Keep a Changelog: https://keepachangelog.com/en/1.0.0/
.. _Semantic Versioning: https://semver.org/spec/v2.0.0.html
.. _1.0a1: https://edugit.org/Teckids/AlekSIS/AlekSIS-App-CSVImport/-/tags/1.0a1
.. _1.0a2: https://edugit.org/Teckids/AlekSIS/AlekSIS-App-CSVImport/-/tags/1.0a2
.. _2.0b0: https://edugit.org/Teckids/AlekSIS/AlekSIS-App-CSVImport/-/tags/2.0b0
.. _2.0b1: https://edugit.org/Teckids/AlekSIS/AlekSIS-App-CSVImport/-/tags/2.0b1
.. _2.0rc1: https://edugit.org/Teckids/AlekSIS/AlekSIS-App-CSVImport/-/tags/2.0rc1
.. _2.0rc2: https://edugit.org/Teckids/AlekSIS/AlekSIS-App-CSVImport/-/tags/2.0rc2
.. _2.0: https://edugit.org/Teckids/AlekSIS/AlekSIS-App-CSVImport/-/tags/2.0
.. _2.1: https://edugit.org/Teckids/AlekSIS/AlekSIS-App-CSVImport/-/tags/2.1
.. _2.2: https://edugit.org/Teckids/AlekSIS/AlekSIS-App-CSVImport/-/tags/2.2
.. _2.2.1: https://edugit.org/Teckids/AlekSIS/AlekSIS-App-CSVImport/-/tags/2.2.1
.. _1.0a1: https://edugit.org/AlekSIS/official/AlekSIS-App-CSVImport/-/tags/1.0a1
.. _1.0a2: https://edugit.org/AlekSIS/official/AlekSIS-App-CSVImport/-/tags/1.0a2
.. _2.0b0: https://edugit.org/AlekSIS/official/AlekSIS-App-CSVImport/-/tags/2.0b0
.. _2.0b1: https://edugit.org/AlekSIS/official/AlekSIS-App-CSVImport/-/tags/2.0b1
.. _2.0rc1: https://edugit.org/AlekSIS/official/AlekSIS-App-CSVImport/-/tags/2.0rc1
.. _2.0rc2: https://edugit.org/AlekSIS/official/AlekSIS-App-CSVImport/-/tags/2.0rc2
.. _2.0: https://edugit.org/AlekSIS/official/AlekSIS-App-CSVImport/-/tags/2.0
.. _2.1: https://edugit.org/AlekSIS/official/AlekSIS-App-CSVImport/-/tags/2.1
.. _2.2: https://edugit.org/AlekSIS/official/AlekSIS-App-CSVImport/-/tags/2.2
.. _2.2.1: https://edugit.org/AlekSIS/official/AlekSIS-App-CSVImport/-/tags/2.2.1
.. _2.3: https://edugit.org/AlekSIS/official/AlekSIS-App-CSVImport/-/tags/2.3
.. _3.0b0: https://edugit.org/AlekSIS/official/AlekSIS-App-CSVImport/-/tags/3.0b0
.. _3.0: https://edugit.org/AlekSIS/official/AlekSIS-App-CSVImport/-/tags/3.0
.. _3.0.1: https://edugit.org/AlekSIS/official/AlekSIS-App-CSVImport/-/tags/3.0.1
......@@ -25,7 +25,7 @@ Licence
::
Copyright © 2019, 2020, 2022 Dominik George <dominik.george@teckids.org>
Copyright © 2020, 2021 Jonathan Weth <dev@jonathanweth.de>
Copyright © 2020, 2021, 2022, 2023 Jonathan Weth <dev@jonathanweth.de>
Copyright © 2019 mirabilos <thorsten.glaser@teckids.org>
Copyright © 2019 Tom Teichler <tom.teichler@teckids.org>
Copyright © 2022 magicfelix <felix@felix-zauberer.de>
......
from django.core.exceptions import ImproperlyConfigured
from django.db import OperationalError, ProgrammingError
from aleksis.core.util.apps import AppConfig
......@@ -14,23 +11,19 @@ class CSVImportConfig(AppConfig):
}
licence = "EUPL-1.2+"
copyright_info = (
([2019, 2020, 2022], "Dominik George", "dominik.george@teckids.org"),
([2020, 2021], "Jonathan Weth", "dev@jonathanweth.de"),
([2019, 2020, 2022, 2023], "Dominik George", "dominik.george@teckids.org"),
([2020, 2021, 2022, 2023], "Jonathan Weth", "dev@jonathanweth.de"),
([2019], "mirabilos", "thorsten.glaser@teckids.org"),
([2019], "Tom Teichler", "tom.teichler@teckids.org"),
([2022], "magicfelix", "felix@felix-zauberer.de"),
)
def ready(self):
super().ready()
def _maintain_default_data(self):
super()._maintain_default_data()
# Create default import templates
try:
from aleksis.apps.csv_import.default_templates import ( # noqa
update_or_create_default_templates,
)
update_or_create_default_templates()
except (ProgrammingError, OperationalError, ImproperlyConfigured) as e:
# Catch if there are no migrations yet
pass # noqa
pedasos_teachers:
model: core.Person
verbose_name: 'Pedasos: Teachers'
verbose_name: "Pedasos: Teachers"
extra_args:
has_header_row: true
separator: "\t"
......@@ -15,7 +15,7 @@ pedasos_teachers:
- ignore
pedasos_classes:
model: core.Group
verbose_name: 'Pedasos: Classes'
verbose_name: "Pedasos: Classes"
extra_args:
has_header_row: true
separator: "\t"
......@@ -26,7 +26,7 @@ pedasos_classes:
- group_owner_short_name
pedasos_courses:
model: core.Group
verbose_name: 'Pedasos: Courses'
verbose_name: "Pedasos: Courses"
extra_args:
has_header_row: true
separator: "\t"
......@@ -34,11 +34,11 @@ pedasos_courses:
- ignore
- short_name
- class_range
- group_subject_short_name
- ignore
- group_owner_short_name
pedasos_students:
model: core.Person
verbose_name: 'Pedasos: Students'
verbose_name: "Pedasos: Students"
extra_args:
has_header_row: true
separator: "\t"
......@@ -84,7 +84,7 @@ pedasos_students:
- group_membership_short_name
pedasos_guardians_1:
model: core.Person
verbose_name: 'Pedasos: Guardians 1'
verbose_name: "Pedasos: Guardians 1"
extra_args:
has_header_row: true
separator: "\t"
......@@ -130,7 +130,7 @@ pedasos_guardians_1:
- ignore
pedasos_guardians_2:
model: core.Person
verbose_name: 'Pedasos: Guardians 2'
verbose_name: "Pedasos: Guardians 2"
extra_args:
has_header_row: true
separator: "\t"
......@@ -176,7 +176,7 @@ pedasos_guardians_2:
- ignore
schild_nrw_students:
model: core.Person
verbose_name: 'Schild-NRW: Students'
verbose_name: "Schild-NRW: Students"
extra_args:
has_header_row: true
separator: ;
......@@ -208,7 +208,7 @@ schild_nrw_students:
- phone_number
schild_nrw_teachers:
model: core.Person
verbose_name: 'Schild-NRW: Teachers'
verbose_name: "Schild-NRW: Teachers"
extra_args:
has_header_row: true
separator: ;
......@@ -238,3 +238,330 @@ schild_nrw_teachers:
virtual: true
template: |
{{ email_work|default:email_home }}
untis_gpu003:
model: core.Group
verbose_name: "Untis: Classes (GPU003.txt)"
extra_args:
has_header_row: false
separator: ","
fields:
- short_name # Name
- name # Langname
- ignore # Statistik
- ignore # Raum
- ignore # Kennzeichen
- ignore # Frei
- ignore # Min-Std./Tag
- ignore # Max-Std./Tag
- ignore # Min-Mittagsp.
- ignore # Max-Mittagsp.
- ignore # Hauptf.Folge
- ignore # Hauptf.hint
- ignore # Kla-Gruppe
- ignore # Schul-Stufe
- ignore # Abteilung
- ignore # Faktor
- ignore # Studenten weibl.
- ignore # Stundenten männl.
- ignore # Schulform
- ignore # Unt-Beg.
- ignore # Unt-Ende
- ignore # Sondertext
- ignore # Beschreibung
- ignore # Farbe Vordergr.
- ignore # Farbe Hintergr.
- ignore # Statistik 2
- ignore # Name Vorjahr
- ignore # Faktor
- ignore # Alias
- group_owner_short_name # Klassenlehrer
- ignore # Hauptklasse
- ignore
- ignore
untis_gpu004:
model: core.Person
verbose_name: "Untis: Teachers (GPU004.txt)"
extra_args:
has_header_row: false
separator: ","
fields:
- short_name # Name
- last_name # Langname
- ignore # Statistik 1
- ignore # Personal-Nr.
- ignore # Stammraum
- ignore # Kennzeichen
- ignore # Frei
- ignore # Std./Tag min
- ignore # Std./Tag max
- ignore # Hohlstd. min.
- ignore # Hohlstd. max.
- ignore # Mittagsp. min.
- ignore # Mittagsp. max.
- ignore # Std.-Folge max.
- ignore # Wochen-Soll
- ignore # Wochen-WErt
- ignore # Abteilung 1
- ignore # Wert-Faktor
- ignore # Abteilung 2
- ignore # Abteilung 3
- ignore # Status
- ignore # Jahres-Soll
- ignore # Text
- ignore # Beschreibung
- ignore # Farbe Vordergr.
- ignore # Farbe Hintergr.
- ignore # Statistik 2
- ignore # berechneter Faktor
- first_name # Vorname
- ignore # Titel
- sex # Geschlecht
- ignore # Stammschule
- field_type: email # E-Mail-Adresse
priority: -1
- ignore # Sperrvermerk
- ignore # Wochen-Soll maximal
- ignore # Alias
- ignore # Personalnummer 2
- ignore # Stundensatz
- phone_number # Telefonnummer
- mobile_number # Mobiltelefonnummer
- date_of_birth # Geburtsdatum
- ignore # Name als externes Element
- ignore # Text2
- ignore
- ignore
untis_gpu005:
model: core.Room
verbose_name: "Untis: Rooms (GPU005.txt)"
extra_args:
has_header_row: false
separator: ","
fields:
- short_name # Name
- name # Langname
- ignore # Ausweichraum
- ignore # Kennzeichen
- ignore # Frei
- ignore # Disloz-Kennz.
- ignore # Raum-Gewicht
- ignore # Kapazität
- ignore # Abteilung
- ignore # Gang 1
- ignore # Gang 2
- ignore # Sondertext
- ignore # Beschreibung
- ignore # Farbe Vg.
- ignore # Farbe Hg.
- ignore # Statistik 1
- ignore # Statistik 2
- ignore # ? - Untis documentation not complete
untis_gpu006:
model: cursus.Subject
verbose_name: "Untis: Subjects (GPU006.txt)"
extra_args:
has_header_row: false
separator: ","
fields:
- short_name # Name
- name # Langname
- ignore # Statisik 1
- ignore # Raum
- ignore # Kennzeichen
- ignore # Frei
- ignore # Wochenstd. min
- ignore # Wochenstd. max
- ignore # Nachmittag min.
- ignore # Nachm. max.
- ignore # Fachf. Kla.
- ignore # Fachf. Lehr.
- ignore # Fach-Gruppe
- ignore # Faktor
- ignore # Faktor
- ignore # Text
- ignore # Beschreibung
- field_type: direct_mapping # Farbe Vg.
db_field: colour_fg
converter: parse_untis_color
- field_type: direct_mapping # Farbe Hg.
db_field: colour_bg
converter: parse_untis_color
- ignore # Statistik 2
- ignore # Alias
- ignore
- ignore
untis_gpu002:
model: cursus.Course
verbose_name: "Untis: Courses (GPU002.txt)"
extra_args:
has_header_row: false
separator: ","
fields:
- field_type: ignore # Unt-Nummer
column_name: course_reference
- lesson_quota # Wochenstunden
- ignore # Wochenstd. Kla.
- ignore # Wochenstd. Le.
- field_type: group_by_short_name # Klasse
column_name: group_short_name
- teacher_by_short_name # Lehrer
- field_type: subject_by_short_name # Subject
column_name: subject_short_name
- ignore # Fachraum
- ignore # Statistik 1 Unt.
- ignore # Stundenzahl
- ignore # Wochenwert
- ignore # Gruppe
- ignore # Zeilentext 1
- ignore # Zeilwert (in Tausendstel)
- ignore # Datum von
- ignore # Datum bis
- ignore # Jahreswert
- field_type: ignore # Text
column_name: text
- ignore # Teilungs-Nummer
- default_room_by_short_name # Stammraum
- ignore # Beschreibung
- ignore # Farbe Vg.
- ignore # Farbe Hg.
- ignore # Kennzeichen
- ignore # Fachfolge Klassen
- ignore # Fachfolge Lehrer
- ignore # Klassen-Kollisions-Kennz.
- ignore # Doppelstd. min.
- ignore # Doppelstd. max.
- ignore # Blockgröße
- ignore # Std. im Raum
- ignore # Priorität
- ignore # Statigroup_namestik 1 Lehrer
- ignore # Studenten männl.
- ignore # Studenten weibl.
- ignore # Wert bzw. Faktor
- ignore # 2. Block
- ignore # 3. Block
- ignore # Zeilentext-2
- ignore # Eigenwert
- ignore # Eigenwert
- ignore # Schülergruppe
- ignore # Wochenstunden in Jahres-Perioden-Planung
- ignore # Jahresstunden
- ignore # Zeilen-Unterrichtsgruppe
- ignore
- ignore
- field_type: unique_reference
virtual: true
template: |
{{ school_term }}-{{ course_reference }}
- field_type: name
virtual: true
template: |
{% if text %}
{{ text }}
{% else %}
{{ group_short_name }}: {{ subject_short_name }}
{% endif %}
- field_type: course_bundle_by_course
virtual: true
template: "ignore"
untis_gpu001:
model: lesrooster.Lesson
verbose_name: "Untis: Lessons (GPU001.txt)"
extra_args:
has_header_row: false
separator: ","
fields:
- field_type: ignore # Unt-Nummer
column_name: course_reference
- ignore # Klasse
- field_type: teacher_by_short_name # Lehrer
column_name: teacher_short_name
- subject_by_short_name # Fach
- room_by_short_name # Raum
- field_type: ignore # Tag
column_name: day
- field_type: ignore # Stunde
column_name: period
- ignore # Stundenlänge
- ignore # ?
- field_type: course_by_unique_reference # Unt-Nummer
virtual: true
template: |
{{ school_term }}-{{ course_reference }}
- field_type: unique_reference
virtual: true
template: |
{{ course_reference }}-{{ additional_params.validity_range }}-{{ day }}-{{ period }}-{{ teacher_short_name }}
untis_gpu001_2:
model: lesrooster.LessonBundle
verbose_name: "Untis: Lessons, Step 2 (GPU001.txt)"
extra_args:
has_header_row: false
separator: ","
fields:
- field_type: ignore # Unt-Nummer
column_name: course_reference
- ignore # Klasse
- field_type: ignore # Lehrer
column_name: teacher_short_name
- ignore # Fach
- ignore # Raum
- field_type: ignore # Tag
column_name: day
- field_type: ignore # Stunde
column_name: period
- ignore # Stundenlänge
- ignore # ?
- field_type: slot_by_day_and_period
virtual: true
template: |
{{ day }}-{{ period }}
- field_type: course_bundle_by_course_unique_reference # Unt-Nummer
virtual: true
template: |
{{ school_term }}-{{ course_reference }}
- field_type: unique_reference
virtual: true
template: |
{{ course_reference }}-{{ additional_params.validity_range }}-{{ day }}-{{ period }}-{{ teacher_short_name }}
- field_type: lesson_for_bundle_by_unique_reference
virtual: true
template: |
{{ course_reference }}-{{ additional_params.validity_range }}-{{ day }}-{{ period }}-{{ teacher_short_name }}
- field_type: weekly_recurrence
virtual: true
template: "{{ day }}"
demo_template:
model: core.Person
verbose_name: "Demo Template"
extra_args:
has_header_row: true
separator: ","
fields:
- field_type: unique_reference
priority: 20
- first_name
- last_name
- ignore
- short_name
- street
- housenumber
- postal_code
- place
- field_type: phone_number
db_field: mobile_number
- phone_number
- email
- date_of_birth
- ignore
- sex
- photo
- ignore
- primary_group_short_name
This diff is collapsed.
......@@ -19,6 +19,12 @@ class CSVUploadForm(forms.Form):
template = forms.ModelChoiceField(
queryset=ImportTemplate.objects.all(), label=_("Import template")
)
create = forms.BooleanField(
initial=True, label=_("Create new objects if necessary"), required=False
)
additional_params = forms.JSONField(
label=_("Additional parameters"), required=False, initial={}
)
def __init__(self, *args, **kwargs):
try:
......@@ -50,4 +56,4 @@ class ImportTemplateUploadForm(forms.Form):
)
return template_defs
except YAMLError as e:
raise ValidationError(_("Invalid YAML file uploaded: \n {}").format(e))
raise ValidationError(_("Invalid YAML file uploaded: \n {}").format(e)) from e
<script setup>
import SchoolTermField from "aleksis.core/components/school_term/SchoolTermField.vue";
import ImportTemplateField from "./ImportTemplateField.vue";
import FileField from "aleksis.core/components/generic/forms/FileField.vue";
import CeleryProgressInner from "aleksis.core/components/celery_progress/CeleryProgressInner.vue";
</script>
<script>
import formRulesMixin from "aleksis.core/mixins/formRulesMixin.js";
import mutateMixin from "aleksis.core/mixins/mutateMixin.js";
import { csvImport } from "./import.graphql";
import { collections } from "aleksisAppImporter";
export default {
name: "CSVImport",
mixins: [formRulesMixin, mutateMixin],
data() {
return {
step: 1,
valid: false,
importData: {
csv: null,
schoolTerm: null,
template: null,
create: true,
additionalParams: {},
},
taskId: null,
csvAdditionalParams: collections.csv_importAdditionalParams.items,
};
},
mounted() {
this.importData.additionalParams = this.$route.query || {};
},
methods: {
doImport() {
this.handleLoading(true);
this.$apollo
.mutate({
mutation: csvImport,
variables: {
input: {
...this.importData,
additionalParams: JSON.stringify(
this.importData.additionalParams,
),
},
},
})
.then(({ data }) => {
console.log(data);
this.taskId = data.csvImport.taskId;
this.step = 2;
})
.catch((error) => {
this.handleMutationError(error);
})
.finally(() => {
this.handleLoading(false);
});
},
},
};
</script>
<template>
<v-stepper v-model="step" class="mb-4">
<v-stepper-header>
<v-stepper-step :complete="step >= 1" :step="1">
{{ $t("csv.import.prepare_title") }}
</v-stepper-step>
<v-divider></v-divider>
<v-stepper-step :complete="step >= 2" :step="2">
{{ $t("csv.import.do_import_title") }}
</v-stepper-step>
</v-stepper-header>
<v-stepper-items>
<v-stepper-content step="1">
<message-box type="info">
{{ $t("csv.import.instructions") }}
</message-box>
<v-form v-model="valid">
<component
:is="param.component"
v-for="(param, idx) in csvAdditionalParams"
:key="idx"
:additional-params="importData.additionalParams"
/>
<file-field
accept="text/csv,text/plain"
filled
:label="$t('csv.import.csv_file')"
aria-required="true"
required
:rules="$rules().required.build()"
v-model="importData.csv"
/>
<import-template-field
filled
:label="$t('csv.import.import_template')"
aria-required="true"
required
:rules="$rules().required.build()"
v-model="importData.template"
/>
<school-term-field
filled
:label="$t('csv.import.school_term')"
aria-required="true"
required
:rules="$rules().required.build()"
v-model="importData.schoolTerm"
/>
<v-switch
class="ml-1"
v-model="importData.create"
inset
:false-value="false"
:true-value="true"
:label="$t('csv.import.create_new_objects')"
/>
</v-form>
<div class="d-flex">
<v-spacer />
<primary-action-button
i18n-key="csv.import.import_data"
:disabled="!valid"
:loading="loading"
@click="doImport"
/>
</div>
</v-stepper-content>
<v-stepper-content step="2">
<celery-progress-inner v-if="taskId" :id="taskId" />
</v-stepper-content>
</v-stepper-items>
</v-stepper>
</template>
<style scoped></style>
<template>
<v-autocomplete
v-bind="$attrs"
v-on="$listeners"
hide-no-data
:items="items"
item-text="verboseName"
item-value="id"
:loading="loading"
/>
</template>
<script>
import queryMixin from "aleksis.core/mixins/queryMixin.js";
import { importTemplates } from "./importTemplates.graphql";
export default {
name: "ImportTemplateField",
extends: "v-autocomplete",
mixins: [queryMixin],
props: {
/**
* The graphQL query used to retrieve the groups.
*/
gqlQuery: {
type: Object,
required: false,
default: () => importTemplates,
},
},
};
</script>
mutation csvImport($input: ImportMutationInput!) {
csvImport(input: $input) {
taskId
errors {
field
messages
}
}
}
query importTemplates {
items: importTemplates {
id
name
verboseName
}
}
export const collections = [
{
name: "additionalParams",
type: Object,
},
];
export default {
name: "csv",
path: "#",
component: () => import("aleksis.core/components/Parent.vue"),
meta: {
inMenu: true,
titleKey: "csv.menu_title",
icon: "mdi-swap-vertical",
permission: "csv_import.view_csv_menu_rule",
},
children: [
{
path: "import/",
component: () => import("./components/CSVImport.vue"),
name: "csv.csvImport",
meta: {
inMenu: true,
titleKey: "csv.import.menu_title",
toolbarTitle: "csv.import.menu_title",
icon: "mdi-table-arrow-left",
permission: "csv_import.import_data_rule",
},
},
{
path: "templates/",
component: () => import("aleksis.core/components/LegacyBaseTemplate.vue"),
name: "csv.importTemplates",
meta: {
inMenu: true,
titleKey: "csv.import_template.menu_title",
icon: "mdi-table-cog",
permission: "csv_import.view_importtemplate_rule",
},
props: {
byTheGreatnessOfTheAlmightyAleksolotlISwearIAmWorthyOfUsingTheLegacyBaseTemplate: true,
},
},
{
path: "templates/upload/",
component: () => import("aleksis.core/components/LegacyBaseTemplate.vue"),
name: "csv.uploadImportTemplate",
props: {
byTheGreatnessOfTheAlmightyAleksolotlISwearIAmWorthyOfUsingTheLegacyBaseTemplate: true,
},
},
],
};
{}
{
"csv": {
"import": {
"create_new_objects": "Wenn notwendig, neue Objekte erstellen",
"csv_file": "CSV-Datei",
"do_import_title": "CSV-Import ausführen",
"import_data": "Daten importieren",
"import_template": "Import-Vorlage",
"instructions": "Sie können Daten von verschiedenen Schulverwaltungssoftwares mit diesem CSV-Importer importieren. Bitte lesen Sie die Hinweise zu der von Ihnen verwendeten Software in unser Dokumentation! Manchmal ist ein spezielles Verfahren notwendig, um die Daten korrekt zu importieren.",
"menu_title": "CSV-Datei importieren",
"prepare_title": "CSV-Import vorbereiten",
"school_term": "Zugehöriges Schuljahr"
},
"import_template": {
"menu_title": "Import-Vorlagen"
},
"menu_title": "CSV-Import"
}
}