From 9ab93f959820317beb49b1f6cd5cbb223eb08a2a Mon Sep 17 00:00:00 2001 From: Gail Terman Date: Tue, 10 May 2022 09:13:24 -0400 Subject: [PATCH 01/40] wip edit modals --- app/javascript/components/edit_button.vue | 18 ++++++++ app/javascript/components/edit_modal.vue | 26 +++++++++++ .../components/email_addresses_editor.vue | 8 ++-- app/javascript/components/icon_button.vue | 44 +++++++++++++++++++ app/javascript/components/modal_form.vue | 9 ++-- app/javascript/components/plano_modal.vue | 23 ++++++++++ app/javascript/packs/application.js | 2 + app/javascript/profile/person_summary.vue | 35 ++++++++++++++- 8 files changed, 158 insertions(+), 7 deletions(-) create mode 100644 app/javascript/components/edit_button.vue create mode 100644 app/javascript/components/edit_modal.vue create mode 100644 app/javascript/components/icon_button.vue create mode 100644 app/javascript/components/plano_modal.vue diff --git a/app/javascript/components/edit_button.vue b/app/javascript/components/edit_button.vue new file mode 100644 index 000000000..1fe946b54 --- /dev/null +++ b/app/javascript/components/edit_button.vue @@ -0,0 +1,18 @@ + + + + + diff --git a/app/javascript/components/edit_modal.vue b/app/javascript/components/edit_modal.vue new file mode 100644 index 000000000..483bdb879 --- /dev/null +++ b/app/javascript/components/edit_modal.vue @@ -0,0 +1,26 @@ + + + + + diff --git a/app/javascript/components/email_addresses_editor.vue b/app/javascript/components/email_addresses_editor.vue index 6f577fe1a..fbc0b70f3 100644 --- a/app/javascript/components/email_addresses_editor.vue +++ b/app/javascript/components/email_addresses_editor.vue @@ -19,16 +19,16 @@
Additional Emails -
+
- +
@@ -120,6 +120,8 @@ export default { }, onNew() { this.additional.push({email: '', isdefault: false, person_id: this.person.id}) + this.$emit('add') + this.$refs.add_email_button.scrollIntoView({behavior: 'smooth'}); } }, mounted() { diff --git a/app/javascript/components/icon_button.vue b/app/javascript/components/icon_button.vue new file mode 100644 index 000000000..1f789b625 --- /dev/null +++ b/app/javascript/components/icon_button.vue @@ -0,0 +1,44 @@ + + + + + diff --git a/app/javascript/components/modal_form.vue b/app/javascript/components/modal_form.vue index 53bb09d31..cb73597e4 100644 --- a/app/javascript/components/modal_form.vue +++ b/app/javascript/components/modal_form.vue @@ -1,6 +1,5 @@ + + diff --git a/app/javascript/packs/application.js b/app/javascript/packs/application.js index 53b364e6a..67814dddc 100644 --- a/app/javascript/packs/application.js +++ b/app/javascript/packs/application.js @@ -37,11 +37,13 @@ import { CustomIconsPlugin } from '../icons'; import AsyncComputed from 'vue-async-computed'; import CKEditor from 'ckeditor4-vue'; import VuePluralize from 'vue-pluralize'; +/* Vue.config.errorHandler = (err, vm, info) => { console.error(err); window.alert("Whoops! We messed up! Click ok to reload the page.") window.location.reload(); } +*/ Vue.use(BootstrapVue); Vue.use(BootstrapVueIcons); diff --git a/app/javascript/profile/person_summary.vue b/app/javascript/profile/person_summary.vue index 1fbb640d0..4619e9452 100644 --- a/app/javascript/profile/person_summary.vue +++ b/app/javascript/profile/person_summary.vue @@ -2,7 +2,7 @@
-

{{person.published_name}}

+

{{person.published_name}}

Last Login: {{formatLocaleDate(person.current_sign_in_at)}} @@ -18,14 +18,42 @@ Primary email: {{person.primary_email.email}}
+ + + + + + + + + + + + + Willing to moderate session + + +
+ + diff --git a/app/javascript/store/person.store.js b/app/javascript/store/person.store.js index 1df760c46..38ee8fec4 100644 --- a/app/javascript/store/person.store.js +++ b/app/javascript/store/person.store.js @@ -1,6 +1,7 @@ -import { NEW } from './model.store'; +import { NEW, PATCH_FIELDS } from './model.store'; export const NEW_PERSON = 'NEW PERSON'; +export const PATCH_PERSON_MODEL = 'PATCH_PERSON_MODEL' export const personModel = 'person'; @@ -12,6 +13,14 @@ export const personStore = { actions: { [NEW_PERSON] ({dispatch}, attributes) { return dispatch(NEW, {model: personModel, selected: false, ...attributes}) + }, + [PATCH_PERSON_MODEL] ({dispatch}, {person, data}) { + const item = { + id: person.id, + lock_version: person.lock_version, + ...data + } + return dispatch(PATCH_FIELDS, {model: personModel, item, fields: Object.keys(data), selected: false }) } }, selected: { From 0c7f63f43a383e3f7fa9a125b9e95440963de689 Mon Sep 17 00:00:00 2001 From: Gail Terman Date: Wed, 18 May 2022 10:33:40 -0400 Subject: [PATCH 03/40] working person top edit. still need to fix what is going on with the store use in the tabs. --- app/javascript/people/person_tabs.vue | 12 +++-- app/javascript/profile/person_edit_modal.vue | 32 +++++++++++- app/javascript/profile/person_summary.vue | 53 +++++++++++--------- app/javascript/profile/profile-tabs.vue | 9 ++-- 4 files changed, 73 insertions(+), 33 deletions(-) diff --git a/app/javascript/people/person_tabs.vue b/app/javascript/people/person_tabs.vue index 8957ad0e4..3601b9681 100644 --- a/app/javascript/people/person_tabs.vue +++ b/app/javascript/people/person_tabs.vue @@ -7,6 +7,7 @@ @@ -17,6 +18,7 @@ { - this.person = obj - } + this.select_model(personModel, id) ) }, } diff --git a/app/javascript/profile/person_edit_modal.vue b/app/javascript/profile/person_edit_modal.vue index e6ef9678a..d9f82824a 100644 --- a/app/javascript/profile/person_edit_modal.vue +++ b/app/javascript/profile/person_edit_modal.vue @@ -1,28 +1,56 @@ diff --git a/app/javascript/profile/person_summary.vue b/app/javascript/profile/person_summary.vue index 4619e9452..4e7b6fec5 100644 --- a/app/javascript/profile/person_summary.vue +++ b/app/javascript/profile/person_summary.vue @@ -18,46 +18,49 @@ Primary email: {{person.primary_email.email}} - + - - - - - - - - - - - Willing to moderate session - - - + + + + diff --git a/app/javascript/people/person_tabs.vue b/app/javascript/people/person_tabs.vue index 3601b9681..d4aa89f99 100644 --- a/app/javascript/people/person_tabs.vue +++ b/app/javascript/people/person_tabs.vue @@ -1,16 +1,14 @@