diff --git a/.idea/workspace.xml b/.idea/workspace.xml
index 63e6343..8cfee08 100644
--- a/.idea/workspace.xml
+++ b/.idea/workspace.xml
@@ -1,9 +1,10 @@
-
+
-
+
+
@@ -102,7 +103,8 @@
-
+
+
1670844191163
@@ -279,7 +281,14 @@
1679216484001
-
+
+ 1679234696595
+
+
+
+ 1679234696595
+
+
@@ -297,7 +306,6 @@
-
@@ -322,6 +330,7 @@
-
+
+
\ No newline at end of file
diff --git a/src/components/SiteSettings.vue b/src/components/SiteSettings.vue
index d2fb347..d6424c9 100644
--- a/src/components/SiteSettings.vue
+++ b/src/components/SiteSettings.vue
@@ -39,18 +39,17 @@
+
-
+
+ v-model="constructor_params.contacts[contact[0]]">
@@ -103,6 +102,7 @@ export default {
constructor_site,
constructor_params: new SiteConstructorParams(''),
saved_constructor_params: new SiteConstructorParams(''),
+ contacts: []
}
},
watch: {
@@ -119,6 +119,16 @@ export default {
handler: function (newVal, oldVal) {
if (newVal === oldVal) return;
this.constructor_params = newVal.copy();
+ this.contacts = Object.entries(newVal.contacts);
+ },
+ deep: true
+ },
+ contacts: {
+ handler: function (newVal) {
+ this.constructor_params.contacts = new Map();
+ for (let contact of newVal) {
+ this.constructor_params.contacts[contact[0]] = contact[1];
+ }
},
deep: true
},
@@ -137,13 +147,20 @@ export default {
},
link_icons() {
return link_icons;
- }
+ },
+ // used_link_types() {
+ // return Object.keys(this.constructor_params.contacts);
+ // },
},
methods: {
set_site_rec(site_rec) {
this.site_rec = site_rec;
},
addLink(link_type) {
+ console.log('adding link', link_type);
+ // If there's already a link of this type, don't add it
+ if (link_type in this.constructor_params.contacts) return;
+ this.contacts.push([link_type, default_links[link_type]])
this.constructor_params.contacts[link_type] = default_links[link_type];
},
}
diff --git a/src/views/Explore.vue b/src/views/Explore.vue
index b8d753c..1d2de4b 100644
--- a/src/views/Explore.vue
+++ b/src/views/Explore.vue
@@ -202,7 +202,9 @@ export default {
this.records.site = this.site_rec;
},
async saveSiteConstr() {
- await this.saveSite();
+ if (this.site_rec !== this.records.site) {
+ await this.saveSite();
+ }
await call_api_post('set-site-data', this.constructor_params);
this.saved_constructor_params = this.constructor_params;
this.updSettingsComponent();