Skip to content

Commit

Permalink
Fix copy on decision tree modal close (#245)
Browse files Browse the repository at this point in the history
  • Loading branch information
laurensWe authored Oct 10, 2024
2 parents e5d3140 + 8b1c6cd commit 131c8dd
Show file tree
Hide file tree
Showing 8 changed files with 53 additions and 20 deletions.
10 changes: 9 additions & 1 deletion amt/locale/base.pot
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: PROJECT VERSION\n"
"Report-Msgid-Bugs-To: EMAIL@ADDRESS\n"
"POT-Creation-Date: 2024-10-09 19:49+0200\n"
"POT-Creation-Date: 2024-10-10 11:00+0200\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <[email protected]>\n"
Expand Down Expand Up @@ -147,6 +147,10 @@ msgstr ""
msgid "An error occurred. Please try again later"
msgstr ""

#: amt/site/templates/layouts/base.html.j2:11
msgid "Algorithmic Management Toolkit (AMT)"
msgstr ""

#: amt/site/templates/macros/tasks.html.j2:14
msgid "Todo"
msgstr ""
Expand Down Expand Up @@ -339,3 +343,7 @@ msgstr ""
msgid "Create Project"
msgstr ""

#: amt/site/templates/projects/new.html.j2:152
msgid "Copy results and close"
msgstr ""

Binary file modified amt/locale/en_US/LC_MESSAGES/messages.mo
Binary file not shown.
10 changes: 9 additions & 1 deletion amt/locale/en_US/LC_MESSAGES/messages.po
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ msgid ""
msgstr ""
"Project-Id-Version: PROJECT VERSION\n"
"Report-Msgid-Bugs-To: EMAIL@ADDRESS\n"
"POT-Creation-Date: 2024-10-09 19:49+0200\n"
"POT-Creation-Date: 2024-10-10 11:00+0200\n"
"PO-Revision-Date: 2024-07-25 21:01+0200\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language: en_US\n"
Expand Down Expand Up @@ -148,6 +148,10 @@ msgstr ""
msgid "An error occurred. Please try again later"
msgstr ""

#: amt/site/templates/layouts/base.html.j2:11
msgid "Algorithmic Management Toolkit (AMT)"
msgstr ""

#: amt/site/templates/macros/tasks.html.j2:14
msgid "Todo"
msgstr ""
Expand Down Expand Up @@ -340,6 +344,10 @@ msgstr ""
msgid "Create Project"
msgstr ""

#: amt/site/templates/projects/new.html.j2:152
msgid "Copy results and close"
msgstr ""

#~ msgid "TEST"
#~ msgstr ""

Expand Down
Binary file modified amt/locale/nl_NL/LC_MESSAGES/messages.mo
Binary file not shown.
14 changes: 11 additions & 3 deletions amt/locale/nl_NL/LC_MESSAGES/messages.po
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ msgid ""
msgstr ""
"Project-Id-Version: PROJECT VERSION\n"
"Report-Msgid-Bugs-To: EMAIL@ADDRESS\n"
"POT-Creation-Date: 2024-10-09 19:49+0200\n"
"POT-Creation-Date: 2024-10-10 11:00+0200\n"
"PO-Revision-Date: 2024-07-25 21:01+0200\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language: nl_NL\n"
Expand Down Expand Up @@ -154,6 +154,10 @@ msgstr "Er is een fout opgetreden"
msgid "An error occurred. Please try again later"
msgstr "Er is een fout opgetreden. Probeer het later opnieuw."

#: amt/site/templates/layouts/base.html.j2:11
msgid "Algorithmic Management Toolkit (AMT)"
msgstr "Algoritme Management Toolkit (AMT)"

#: amt/site/templates/macros/tasks.html.j2:14
msgid "Todo"
msgstr "Te doen"
Expand Down Expand Up @@ -340,8 +344,8 @@ msgid ""
"Overview of instruments for the responsible development, deployment, "
"assessment and monitoring of algorithms and AI-systems."
msgstr ""
"Overzicht van aanbevolen insturment voor het verantwoord ontwikkelen, "
"gebruiken,beoordelen en monitren van algoritmes en AI-systemen."
"Overzicht van aanbevolen instrument voor het verantwoord ontwikkelen, "
"gebruiken, beoordelen en monitoren van algoritmes en AI-systemen."

#: amt/site/templates/projects/new.html.j2:124
msgid "Choose one or more instruments"
Expand All @@ -351,6 +355,10 @@ msgstr "Kies één of meerdere instrumenten"
msgid "Create Project"
msgstr "Maak project"

#: amt/site/templates/projects/new.html.j2:152
msgid "Copy results and close"
msgstr "Resultaten overnemen en sluiten"

#~ msgid "TEST"
#~ msgstr ""

Expand Down
4 changes: 4 additions & 0 deletions amt/site/static/ts/amt.ts
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,10 @@ export function closeModal() {
if (el != null) {
el.classList.add("display-none");
}
}

export function closeModalSave() {
closeModal();

// Get decision tree state from local store.
const decision_tree_state = localStorage?.getItem("labelsbycategory");
Expand Down
27 changes: 12 additions & 15 deletions amt/site/templates/projects/new.html.j2
Original file line number Diff line number Diff line change
Expand Up @@ -144,19 +144,16 @@
</div>
</div>

<div id="decision-tree-modal" class="minbzk-modal display-none">
<div class="modal-underlay" onclick="amt.closeModal()"></div>
<div class="modal-content">
<p class="utrecht-button-group">
<button id="close-decision-tree-modal-button" type="button" class="flex utrecht-button utrecht-button--secondary-action rvo-layout-row rvo-layout-gap--md utrecht-button--rvo-md rvo-link--no-underline utrecht-button-group__align-right"
onclick="amt.closeModal()">
<span class="utrecht-icon rvo-icon rvo-icon-kruis rvo-icon--md rvo-icon--zwart"
role="img"></span>
</button>
<div id="app">
<script src="https://unpkg.com/[email protected]/index.js"></script>
</div>
</p>
</div>
</div>
<div id="decision-tree-modal" class="minbzk-modal display-none">
<div class="modal-underlay" onclick="amt.closeModal()"></div>
<div class="modal-content">
<p class="utrecht-button-group">
<button id="close-decision-tree-modal-button" type="button" class="flex utrecht-button utrecht-button--secondary-action rvo-layout-row rvo-layout-gap--md utrecht-button--rvo-md rvo-link--no-underline utrecht-button-group__align-right"
onclick="amt.closeModalSave()">{% trans %}Copy results and close{% endtrans %}</button>
<div id="app">
<script src="https://unpkg.com/[email protected]/index.js"></script>
</div>
</p>
</div>
</div>
{% endblock content %}
8 changes: 8 additions & 0 deletions script/server
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#!/usr/bin/env bash

set -x

docker compose up -d

sleep 1
open http://0.0.0.0:8070

0 comments on commit 131c8dd

Please sign in to comment.