Skip to content

Commit

Permalink
Add document upload
Browse files Browse the repository at this point in the history
  • Loading branch information
ChristopherSpelt authored and laurensWe committed Dec 13, 2024
1 parent b58b20b commit a759af3
Show file tree
Hide file tree
Showing 31 changed files with 2,202 additions and 918 deletions.
10 changes: 5 additions & 5 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ Resolves #

Please check all the boxes that apply to this pull request using "x":

- [ ] I have tested the changes locally and verified that they work as expected.
- [ ] I have followed the project's coding conventions and style guidelines.
- [ ] I have rebased my branch onto the latest commit of the main branch.
- [ ] I have squashed or reorganized my commits into logical units.
- [ ] I have read, understood and agree to the [Developer Certificate of Origin](../blob/main/DCO.md), which this project utilizes.
- [ ] I have tested the changes locally and verified that they work as expected.
- [ ] I have followed the project's coding conventions and style guidelines.
- [ ] I have rebased my branch onto the latest commit of the main branch.
- [ ] I have squashed or reorganized my commits into logical units.
- [ ] I have read, understood and agree to the [Developer Certificate of Origin](../blob/main/DCO.md), which this project utilizes.
8 changes: 4 additions & 4 deletions BUILD.md
Original file line number Diff line number Diff line change
Expand Up @@ -121,10 +121,10 @@ pip install --upgrade setuptools

For testing, linting and other feature we use several tools. You can look up the documentation on how to use these:

- [pytest](https://docs.pytest.org/en/) `poetry run pytest`
- [ruff](https://docs.astral.sh/ruff/) `poetry run ruff format` or `poetry run ruff check --fix`
- [coverage](https://coverage.readthedocs.io/en/) `poetry run coverage report`
- [pyright](https://microsoft.github.io/pyright/#/) `poetry run pyright`
- [pytest](https://docs.pytest.org/en/) `poetry run pytest`
- [ruff](https://docs.astral.sh/ruff/) `poetry run ruff format` or `poetry run ruff check --fix`
- [coverage](https://coverage.readthedocs.io/en/) `poetry run coverage report`
- [pyright](https://microsoft.github.io/pyright/#/) `poetry run pyright`

## Devcontainers

Expand Down
30 changes: 15 additions & 15 deletions CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,24 +14,24 @@ appearance, race, religion, or sexual identity and orientation.
Examples of behavior that contributes to a positive environment for our
community include:

- Demonstrating empathy and kindness toward other people
- Being respectful of differing opinions, viewpoints, and experiences
- Giving and gracefully accepting constructive feedback
- Accepting responsibility and apologizing to those affected by our mistakes,
and learning from the experience
- Focusing on what is best not just for us as individuals, but for the
overall community
- Demonstrating empathy and kindness toward other people
- Being respectful of differing opinions, viewpoints, and experiences
- Giving and gracefully accepting constructive feedback
- Accepting responsibility and apologizing to those affected by our mistakes,
and learning from the experience
- Focusing on what is best not just for us as individuals, but for the
overall community

Examples of unacceptable behavior include:

- The use of sexualized language or imagery, and sexual attention or
advances
- Trolling, insulting or derogatory comments, and personal or political attacks
- Public or private harassment
- Publishing others' private information, such as a physical or email
address, without their explicit permission
- Other conduct which could reasonably be considered inappropriate in a
professional setting
- The use of sexualized language or imagery, and sexual attention or
advances
- Trolling, insulting or derogatory comments, and personal or political attacks
- Public or private harassment
- Publishing others' private information, such as a physical or email
address, without their explicit permission
- Other conduct which could reasonably be considered inappropriate in a
professional setting

## Our Responsibilities

Expand Down
76 changes: 38 additions & 38 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@ community looks forward to your contributions. 🎉

## Table of Contents

- [Code of Conduct](#code-of-conduct)
- [I Have a Question](#i-have-a-question)
- [I Want To Contribute](#i-want-to-contribute)
- [Reporting Bugs](#reporting-bugs)
- [Suggesting Enhancements](#suggesting-enhancements)
- [Code of Conduct](#code-of-conduct)
- [I Have a Question](#i-have-a-question)
- [I Want To Contribute](#i-want-to-contribute)
- [Reporting Bugs](#reporting-bugs)
- [Suggesting Enhancements](#suggesting-enhancements)

## Code of Conduct

Expand All @@ -29,8 +29,8 @@ in this issue.

If you then still feel the need to ask a question and need clarification, we recommend the following:

- Open an [Issue](../../issues/new).
- Provide as much context as you can about what you're running into.
- Open an [Issue](../../issues/new).
- Provide as much context as you can about what you're running into.

We will then take care of the issue as soon as possible.

Expand All @@ -49,11 +49,11 @@ A good bug report shouldn't leave others needing to chase you up for more inform
investigate carefully, collect information and describe the issue in detail in your report. Please complete the
following steps in advance to help us fix any potential bug as fast as possible.

- Make sure that you are using the latest version.
- To see if other users have experienced (and potentially already solved) the same issue you are having, check if there
is not already a bug report existing for your bug or error in the [bug tracker](../..//issues?q=label%3Abug).
- Collect information about the bug
- Possibly your input and the output
- Make sure that you are using the latest version.
- To see if other users have experienced (and potentially already solved) the same issue you are having, check if there
is not already a bug report existing for your bug or error in the [bug tracker](../..//issues?q=label%3Abug).
- Collect information about the bug
- Possibly your input and the output

#### How Do I Submit a Good Bug Report?

Expand All @@ -62,21 +62,21 @@ following steps in advance to help us fix any potential bug as fast as possible.
We use GitHub issues to track bugs and errors. If you run into an issue with the project:

- Open an [Issue](../../issues/new). (Since we can't be sure at this point whether it
is a bug or not, we ask you not to talk about a bug yet and not to label the issue.)
- Explain the behavior you would expect and the actual behavior.
- Please provide as much context as possible and describe the _reproduction steps_ that someone else can follow to
recreate the issue on their own. This usually includes your code.
- Provide the information you collected in the previous section.
- Open an [Issue](../../issues/new). (Since we can't be sure at this point whether it
is a bug or not, we ask you not to talk about a bug yet and not to label the issue.)
- Explain the behavior you would expect and the actual behavior.
- Please provide as much context as possible and describe the _reproduction steps_ that someone else can follow to
recreate the issue on their own. This usually includes your code.
- Provide the information you collected in the previous section.

Once it's filed:

- The project team will label the issue accordingly.
- A team member will try to reproduce the issue with your provided steps. If there are no reproduction steps or no
obvious way to reproduce the issue, the team will ask you for those steps and mark the issue as `needs-repro`. Bugs with
the `needs-repro` tag will not be addressed until they are reproduced.
- If the team is able to reproduce the issue, it will be marked `needs-fix`, as well as possibly other tags (such as
`critical`), and the issue will be left to be implemented by someone.
- The project team will label the issue accordingly.
- A team member will try to reproduce the issue with your provided steps. If there are no reproduction steps or no
obvious way to reproduce the issue, the team will ask you for those steps and mark the issue as `needs-repro`. Bugs with
the `needs-repro` tag will not be addressed until they are reproduced.
- If the team is able to reproduce the issue, it will be marked `needs-fix`, as well as possibly other tags (such as
`critical`), and the issue will be left to be implemented by someone.

### Suggesting Enhancements

Expand All @@ -86,22 +86,22 @@ community to understand your suggestion and find related suggestions.

#### Before Submitting an Enhancement

- Make sure that you are using the latest version.
- Perform a [search](../../issues) to see if the enhancement has already been
suggested. If it has, add a comment to the existing issue instead of opening a new one.
- Find out whether your idea fits with the scope and aims of the project. It's up to you to make a strong case to
convince the project's developers of the merits of this feature. Keep in mind that we want features that will be useful
to the majority of our users and not just a small subset.
- Make sure that you are using the latest version.
- Perform a [search](../../issues) to see if the enhancement has already been
suggested. If it has, add a comment to the existing issue instead of opening a new one.
- Find out whether your idea fits with the scope and aims of the project. It's up to you to make a strong case to
convince the project's developers of the merits of this feature. Keep in mind that we want features that will be useful
to the majority of our users and not just a small subset.

#### How Do I Submit a Good Enhancement Suggestion?

Enhancement suggestions are tracked as [GitHub issues](../../issues).

- Use a **clear and descriptive title** for the issue to identify the suggestion.
- **Describe the current behavior** and **explain which behavior you expected to see instead** and why. At this point
you can also tell which alternatives do not work for you.
- You may want to **include screenshots and animated GIFs** which help you demonstrate the steps or point out the part
which the suggestion is related to. You can use [this tool](https://www.cockos.com/licecap/) to record GIFs on MacOS and
Windows, and [this tool](https://github.com/colinkeenan/silentcast) or [this tool](https://github.com/GNOME/byzanz) on Linux.
- **Explain why this enhancement would be useful** for the community. You may also want to point out the
other projects that solved it better and which could serve as inspiration.
- Use a **clear and descriptive title** for the issue to identify the suggestion.
- **Describe the current behavior** and **explain which behavior you expected to see instead** and why. At this point
you can also tell which alternatives do not work for you.
- You may want to **include screenshots and animated GIFs** which help you demonstrate the steps or point out the part
which the suggestion is related to. You can use [this tool](https://www.cockos.com/licecap/) to record GIFs on MacOS and
Windows, and [this tool](https://github.com/colinkeenan/silentcast) or [this tool](https://github.com/GNOME/byzanz) on Linux.
- **Explain why this enhancement would be useful** for the community. You may also want to point out the
other projects that solved it better and which could serve as inspiration.
4 changes: 2 additions & 2 deletions SECURITY.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,5 @@ CVSS (Common Vulnerability Scoring System) v4.0 Rating:

Please report (suspected) security vulnerabilities to NCSC:

- Nederlands: **[NCSC Kwetsbaarheid melden](https://www.ncsc.nl/contact/kwetsbaarheid-melden)**
- English: **[NCSC report vulnerability](https://english.ncsc.nl/contact/reporting-a-vulnerability-cvd)**
- Nederlands: **[NCSC Kwetsbaarheid melden](https://www.ncsc.nl/contact/kwetsbaarheid-melden)**
- English: **[NCSC report vulnerability](https://english.ncsc.nl/contact/reporting-a-vulnerability-cvd)**
14 changes: 7 additions & 7 deletions USAGE.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ on [github](https://github.com/MinBZK/amt/pkgs/container/amt).

You can deploy AMT to kubernetes or run the container locally using docker compose.

- Example [kubernetes](https://github.com/MinBZK/ai-validation-infra/tree/main/apps/amt)
- Example [docker compose](./compose.yml)
- Example [kubernetes](https://github.com/MinBZK/ai-validation-infra/tree/main/apps/amt)
- Example [docker compose](./compose.yml)

To run amt locally create a compose.yml file and
install [docker desktop](https://www.docker.com/products/docker-desktop/). Once you have install docker you can run the
Expand Down Expand Up @@ -66,11 +66,11 @@ volumes:
it is possible to run AMT with the following databases:
- SQLite (tested)
- Postgresql (tested)
- MySQL
- MariaDB
- Oracle
- SQLite (tested)
- Postgresql (tested)
- MySQL
- MariaDB
- Oracle
We recommend using postgresql for production grade deployments because that one is tested in our CI/CD. By default AMT
will use SQLite which will create a local database within the AMT container.
Expand Down
54 changes: 54 additions & 0 deletions amt/api/forms/measure.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
from gettext import NullTranslations

from amt.schema.webform import WebForm, WebFormField, WebFormFieldType, WebFormOption, WebFormTextCloneableField


async def get_measure_form(
id: str, current_values: dict[str, str | list[str] | list[tuple[str, str]]], translations: NullTranslations
) -> WebForm:
_ = translations.gettext

measure_form: WebForm = WebForm(id="", post_url="")

measure_form.fields = [
WebFormField(
type=WebFormFieldType.SELECT,
name="measure_state",
label=_("Status"),
options=[
WebFormOption(value="to do", display_value="to do"),
WebFormOption(value="in progress", display_value="in progress"),
WebFormOption(value="in review", display_value="in review"),
WebFormOption(value="done", display_value="done"),
WebFormOption(value="not implemented", display_value="not implemented"),
],
default_value=current_values.get("measure_state"),
group="1",
),
WebFormField(
type=WebFormFieldType.TEXTAREA,
name="measure_value",
default_value=current_values.get("measure_value"),
label=_("Information on how this measure is implemented"),
placeholder=_("Describe how the measure has been implemented, including challenges and solutions."),
group="1",
),
WebFormField(
type=WebFormFieldType.FILE,
name="measure_files",
default_value=current_values.get("measure_files"),
label=_("Add files"),
placeholder=_(""),
group="1",
),
WebFormTextCloneableField(
clone_button_name=_("Add URI"),
name="measure_links",
default_value=current_values.get("measure_links"),
label=_("Add links to documents"),
placeholder=_("URI"),
group="1",
),
]

return measure_form
2 changes: 2 additions & 0 deletions amt/api/forms/organization.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ def get_organization_form(id: str, translations: NullTranslations, user: User |
placeholder=_("Name of the organization"),
attributes={"onkeyup": "amt.generate_slug('" + id + "name', '" + id + "slug')"},
group="1",
required=True,
),
WebFormField(
type=WebFormFieldType.TEXT,
Expand All @@ -32,6 +33,7 @@ def get_organization_form(id: str, translations: NullTranslations, user: User |
label=_("Slug"),
placeholder=_("The slug for this organization"),
group="1",
required=True,
),
WebFormSearchField(
name="user_ids",
Expand Down
Loading

0 comments on commit a759af3

Please sign in to comment.