From 5a44bee85b83d30d6f7633f3d5616ab51c8d1c16 Mon Sep 17 00:00:00 2001
From: dcz <dcz@ipipan.waw.pl>
Date: Thu, 3 Nov 2022 21:29:53 +0100
Subject: [PATCH] "platform: linux/amd64" not supported in earlier docker
 versions Import small dataset as default setup Refresh entry list on filter
 apply

---
 docker-compose.yml                                     |  2 +-
 entries/static/entries/js/forms.js                     |  4 ++--
 .../src/components/unification/Entries/EntriesList.vue | 10 ++++++++++
 .../unification/shared/LexicalUnitDisplay.vue          |  1 +
 frontend/src/main.js                                   |  3 +++
 syntax/management/commands/import_tei.py               |  6 +++---
 6 files changed, 20 insertions(+), 6 deletions(-)

diff --git a/docker-compose.yml b/docker-compose.yml
index aab7248..8120daf 100644
--- a/docker-compose.yml
+++ b/docker-compose.yml
@@ -19,7 +19,7 @@ services:
       - ./.datastore/postgresql:/var/lib/postgresql/data
 
   backend:
-    platform: linux/amd64
+    #platform: linux/amd64
     container_name: shellvalier-backend
     image: shellvalier-developer:latest
     build:
diff --git a/entries/static/entries/js/forms.js b/entries/static/entries/js/forms.js
index b0daed0..cef394d 100644
--- a/entries/static/entries/js/forms.js
+++ b/entries/static/entries/js/forms.js
@@ -412,9 +412,9 @@ function initialize_main_form() {
         var submit = main_form.find('input[type="submit"]');
         submit.prop('disabled', true);
         event.preventDefault();
-        clear_results();
+        // clear_results();
         clear_info();
-        show_entry_list_spinner();
+        // show_entry_list_spinner();
         clear_form_errors(main_form);
         var data = { 'forms' : serialize_forms(main_form) };
         $.ajax({
diff --git a/frontend/src/components/unification/Entries/EntriesList.vue b/frontend/src/components/unification/Entries/EntriesList.vue
index 41d3175..72b1f49 100644
--- a/frontend/src/components/unification/Entries/EntriesList.vue
+++ b/frontend/src/components/unification/Entries/EntriesList.vue
@@ -23,8 +23,18 @@
         canViewAssignment: has_permission("users.view_assignment"),
       }
     },
+    methods: {
+      setup() {
+        setup_entries_list({
+          table: this.$refs.table,
+          lexicalUnitSelected: (entryId, lexicalUnitId) => { this.$emit('lexicalUnitSelected', entryId, lexicalUnitId); },
+          selectEntryId: this.initialEntryId
+        });
+      }
+    },
     emits: ['lexicalUnitSelected'],
     mounted () {
+      this.$.appContext.config.globalProperties.$entries_list = this;
       setup_entries_list({
         table: this.$refs.table,
         lexicalUnitSelected: (entryId, lexicalUnitId) => { this.$emit('lexicalUnitSelected', entryId, lexicalUnitId); },
diff --git a/frontend/src/components/unification/shared/LexicalUnitDisplay.vue b/frontend/src/components/unification/shared/LexicalUnitDisplay.vue
index 1fcd309..bdd4a57 100644
--- a/frontend/src/components/unification/shared/LexicalUnitDisplay.vue
+++ b/frontend/src/components/unification/shared/LexicalUnitDisplay.vue
@@ -168,6 +168,7 @@ export default {
     }
   },
   mounted () {
+      this.$.appContext.config.globalProperties.$lexical_unit_display = this;
     Split(['#main-frames-pane', '#vue-examples'], {
       direction: 'vertical',
       sizes: [75, 25],
diff --git a/frontend/src/main.js b/frontend/src/main.js
index f0fbbbc..38a4e6c 100644
--- a/frontend/src/main.js
+++ b/frontend/src/main.js
@@ -24,4 +24,7 @@ window.update_entries = function () {
     app.mount('#vue-app');
     mounted = true;
   }
+  if(app._context.config.globalProperties.$entries_list) {
+    app._context.config.globalProperties.$entries_list.setup();
+  }
 }
diff --git a/syntax/management/commands/import_tei.py b/syntax/management/commands/import_tei.py
index e936e5d..4b92b1e 100644
--- a/syntax/management/commands/import_tei.py
+++ b/syntax/management/commands/import_tei.py
@@ -34,9 +34,9 @@ def import_tei():
     logging.basicConfig(filename='import.log', level=logging.DEBUG)
 
     #xml_file = os.path.join(BASE_DIR, 'data', 'walenty', 'walenty_20200926_smaller.xml')
-    xml_file = os.path.join(BASE_DIR, 'data', 'walenty', 'walenty_20210913_smaller.xml')
-    # xml_file = os.path.join(BASE_DIR, 'data', 'walenty', 'walenty_20210913_smallest.xml')
-    xml_file = os.path.join(BASE_DIR, 'data', 'walenty', 'walenty_20210913.xml')
+    #xml_file = os.path.join(BASE_DIR, 'data', 'walenty', 'walenty_20210913_smaller.xml')
+    xml_file = os.path.join(BASE_DIR, 'data', 'walenty', 'walenty_20210913_smallest.xml')
+    #xml_file = os.path.join(BASE_DIR, 'data', 'walenty', 'walenty_20210913.xml')
 
 
     xml_path = os.path.join(os.path.dirname(os.path.abspath(__file__)), xml_file)
-- 
GitLab