diff --git a/Gemfile.lock b/Gemfile.lock index b9ab63282..f6183e2d6 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -77,11 +77,11 @@ GEM ast (2.4.2) bcrypt (3.1.18) bindex (0.8.1) - bootsnap (1.11.1) + bootsnap (1.12.0) msgpack (~> 1.2) brakeman (5.2.3) builder (3.2.4) - bundler-audit (0.9.0.1) + bundler-audit (0.9.1) bundler (>= 1.2.0, < 3) thor (~> 1.0) byebug (11.1.3) @@ -190,7 +190,7 @@ GEM mini_mime (1.1.2) mini_portile2 (2.8.0) minitest (5.15.0) - msgpack (1.5.1) + msgpack (1.5.2) multi_json (1.15.0) nenv (0.3.0) nilify_blanks (1.4.0) @@ -225,7 +225,7 @@ GEM activesupport (>= 3.0.0) raabro (1.4.0) racc (1.6.0) - rack (2.2.3) + rack (2.2.3.1) rack-cors (1.1.1) rack (>= 2.0.0) rack-livereload (0.3.17) @@ -264,7 +264,7 @@ GEM rake (13.0.6) ranked-model (0.4.8) activerecord (>= 4.2) - ransack (3.2.0) + ransack (3.2.1) activerecord (>= 6.1.5) activesupport (>= 6.1.5) i18n @@ -272,7 +272,7 @@ GEM rb-inotify (0.10.1) ffi (~> 1.0) redis (4.6.0) - regexp_parser (2.4.0) + regexp_parser (2.5.0) request_store (1.5.1) rack (>= 1.4) responders (3.0.1) @@ -303,13 +303,13 @@ GEM rspec-mocks (~> 3.10) rspec-support (~> 3.10) rspec-support (3.11.0) - rubocop (1.29.1) + rubocop (1.30.0) parallel (~> 1.10) parser (>= 3.1.0.0) rainbow (>= 2.2.2, < 4.0) regexp_parser (>= 1.8, < 3.0) rexml (>= 3.2.5, < 4.0) - rubocop-ast (>= 1.17.0, < 2.0) + rubocop-ast (>= 1.18.0, < 2.0) ruby-progressbar (~> 1.7) unicode-display_width (>= 1.4.0, < 3.0) rubocop-ast (1.18.0) @@ -332,10 +332,11 @@ GEM tilt seedbank (0.5.0) rake (>= 10.0) - selenium-webdriver (4.1.0) + selenium-webdriver (4.2.0) childprocess (>= 0.5, < 5.0) rexml (~> 3.2, >= 3.2.5) - rubyzip (>= 1.2.2) + rubyzip (>= 1.2.2, < 3.0) + websocket (~> 1.0) semantic_range (3.0.0) shellany (0.0.1) sidekiq (6.4.2) @@ -368,7 +369,7 @@ GEM concurrent-ruby (~> 1.0) unf (0.1.4) unf_ext - unf_ext (0.0.8.1) + unf_ext (0.0.8.2) unicode-display_width (2.1.0) warden (1.2.9) rack (>= 2.0.9) @@ -388,6 +389,7 @@ GEM rack-proxy (>= 0.6.1) railties (>= 5.2) semantic_range (>= 2.3.0) + websocket (1.2.9) websocket-driver (0.7.5) websocket-extensions (>= 0.1.0) websocket-extensions (0.1.5) diff --git a/app/controllers/conflicts/session_conflicts_controller.rb b/app/controllers/conflicts/session_conflicts_controller.rb index 38bb1f10b..59b833af2 100644 --- a/app/controllers/conflicts/session_conflicts_controller.rb +++ b/app/controllers/conflicts/session_conflicts_controller.rb @@ -21,7 +21,8 @@ def index include: [ :availability_conflicts, :'availability_conflicts.person', - :'availability_conflicts.session_assignment' + :'availability_conflicts.session_assignment', + :room ], # include: filtered_serializer_includes(fields: fields), # need to adjust based omn field params: { diff --git a/app/controllers/resource_controller.rb b/app/controllers/resource_controller.rb index b3c15d3d0..e476f1786 100644 --- a/app/controllers/resource_controller.rb +++ b/app/controllers/resource_controller.rb @@ -3,5 +3,7 @@ class ResourceController < ApplicationController respond_to :json + before_action :prevent_cache + include ResourceMethods end diff --git a/app/controllers/survey/submissions_controller.rb b/app/controllers/survey/submissions_controller.rb index e2b34a2c3..84f331c9d 100644 --- a/app/controllers/survey/submissions_controller.rb +++ b/app/controllers/survey/submissions_controller.rb @@ -61,7 +61,9 @@ def collection_to_xls styles = [date_time_style,date_time_style] # Get the survey questions submission = @collection.first - survey = submission.survey + + survey = Survey.find params[:survey_id] if params[:survey_id] + survey ||= submission.survey header = ['Created At', 'Updated At', 'Email'] response_columns = {} posn = 3 @@ -125,19 +127,13 @@ def serializer_includes def includes [ - :person, - responses: [ - :question - ] + :person ] end def references [ - :person, - responses: [ - :question - ] + :person ] end diff --git a/app/controllers/surveys_controller.rb b/app/controllers/surveys_controller.rb index 0702fb885..83592ed0d 100644 --- a/app/controllers/surveys_controller.rb +++ b/app/controllers/surveys_controller.rb @@ -1,6 +1,7 @@ class SurveysController < ResourceController SERIALIZER_CLASS = 'SurveySerializer'.freeze POLICY_CLASS = 'SurveysPolicy'.freeze + POLICY_SCOPE_CLASS = 'SurveysPolicy::Scope'.freeze DEFAULT_SORTBY = 'surveys.updated_at'.freeze DEFAULT_ORDER = 'desc'.freeze diff --git a/app/javascript/app.router.js b/app/javascript/app.router.js index 462e3c84b..157c6cb9e 100644 --- a/app/javascript/app.router.js +++ b/app/javascript/app.router.js @@ -21,22 +21,23 @@ import PersonTabs from './people/person_tabs.vue'; // profile import ProfileScreen from './profile/profile-screen.vue'; -import ProfileTabs from './profile/profile-tabs.vue'; const profileRoutes = [ - { path: 'session-selection', component: ProfileTabs, props: {tab: 'session-selection'} }, - { path: 'session-ranking', component: ProfileTabs, props: {tab: 'session-ranking'} }, - { path: 'availability', component: ProfileTabs, props: {tab: 'availability'} }, - { path: 'other', component: ProfileTabs, props: {tab: 'other'} }, - { path: '', component: ProfileTabs, props: true } + // { path: 'session-selection', component: PersonTabs, props: {tab: 'session-selection'} }, + // { path: 'session-ranking', component: PersonTabs, props: {tab: 'session-ranking'} }, + // { path: 'availability', component: PersonTabs, props: {tab: 'availability'} }, + // { path: 'other', component: PersonTabs, props: {tab: 'other'} }, + { path: ':tab', component: PersonTabs, props: true }, + { path: '', component: PersonTabs, props: true } ] const personRoutes = [ - { path: 'edit/:id', component: PersonTabs, props: route => ({id: route.params.id, tab: 'person-edit'}) }, - { path: 'session-selection/:id', component: PersonTabs, props: route => ({id: route.params.id, tab: 'session-selection'}) }, - { path: 'session-ranking/:id', component: PersonTabs, props: route => ({id: route.params.id, tab: 'session-ranking'}) }, - { path: 'availability/:id', component: PersonTabs, props: route => ({id: route.params.id, tab: 'availability'}) }, - { path: 'other/:id', component: PersonTabs, props: route => ({id: route.params.id, tab: 'other'}) }, + { path: 'edit/:id', component: PersonTabs, props: true }, + { path: ':tab/:id', component: PersonTabs, props: true }, + // { path: 'session-selection/:id', component: PersonTabs, props: route => ({id: route.params.id, tab: 'session-selection'}) }, + // { path: 'session-ranking/:id', component: PersonTabs, props: route => ({id: route.params.id, tab: 'session-ranking'}) }, + // { path: 'availability/:id', component: PersonTabs, props: route => ({id: route.params.id, tab: 'availability'}) }, + // { path: 'other/:id', component: PersonTabs, props: route => ({id: route.params.id, tab: 'other'}) }, { path: '', component: PeopleList } ] 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/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/components/model_select.vue b/app/javascript/components/model_select.vue index 711c39d1c..58291a7df 100644 --- a/app/javascript/components/model_select.vue +++ b/app/javascript/components/model_select.vue @@ -27,7 +27,8 @@ export default { }, size: { type: String - } + }, + filter: null }, mixins: [ modelMixin @@ -95,7 +96,8 @@ export default { this.search({ fields: field_name, "sortBy": sort_by, - "sortOrder": 'asc' + "sortOrder": 'asc', + "filter": this.filter }).then(data => { this.data = data this.loading = false diff --git a/app/javascript/components/plano_modal.vue b/app/javascript/components/plano_modal.vue index f962f4218..8c6413d06 100644 --- a/app/javascript/components/plano_modal.vue +++ b/app/javascript/components/plano_modal.vue @@ -6,6 +6,7 @@ scrollable v-on="$listeners" v-bind="$attrs" + ref="plano-modal" > @@ -15,6 +16,14 @@ diff --git a/app/javascript/conflicts/availability.vue b/app/javascript/conflicts/availability.vue index d14c10cda..86b17498b 100644 --- a/app/javascript/conflicts/availability.vue +++ b/app/javascript/conflicts/availability.vue @@ -6,6 +6,10 @@ v-for="conflict in sortedCollection" :key="conflict.id" > {{conflict.title}} +
+ {{conflict.room.name}}, + {{ formatLocaleDate(conflict.start_time )}} +
Outside the availability for:
{{availability.person.published_name}} @@ -26,13 +30,14 @@ diff --git a/app/javascript/people/person_tabs.vue b/app/javascript/people/person_tabs.vue index 8957ad0e4..7c36bdcdc 100644 --- a/app/javascript/people/person_tabs.vue +++ b/app/javascript/people/person_tabs.vue @@ -1,55 +1,54 @@ @@ -60,6 +59,7 @@ import AvailabilityAndInterests from '../profile/availability_and_interests.vue' import PersonDetails from '../profile/person_details.vue' import PersonSummary from '../profile/person_summary.vue'; import PersonDemographics from '../profile/person_demographics.vue'; +import ModelLoadingOverlay from '@/components/model_loading_overlay.vue'; import { personModel } from '@/store/person.store' import { sessionModel } from '@/store/session.store' @@ -82,7 +82,8 @@ export default { SessionRanker, AvailabilityAndInterests, PersonDetails, - PersonDemographics + PersonDemographics, + ModelLoadingOverlay }, mixins: [ personSessionMixin, @@ -93,9 +94,11 @@ export default { personModel, sessionModel, sessionAssignmentModel, - person: null, }), computed: { + person() { + return this.selected_model(personModel); + }, start_time() { if (this.currentSettings && this.currentSettings.configs) { let st = this.configByName('convention_start_time') @@ -121,34 +124,35 @@ export default { } }, methods: { - onPersonUpdate(arg) { - this.person = arg - }, back() { - this.$router.push('/people'); + this.$router.push('/people') }, handleTabActivation(newTab, oldTab, bvEvent) { let path = ''; + const pathStart = this.$route.path.split('/')[1]; switch(newTab) { case 0: - path = `edit/${this.person.id}`; + path = pathStart === 'people' ? 'edit' : ''; break; case 1: - path = `other/${this.person.id}`; + path = `other`; break; case 2: - path = `availability/${this.person.id}`; + path = `availability`; break; case 3: - path = `session-selection/${this.person.id}`; + path = `session-selection`; break; case 4: - path = `session-ranking/${this.person.id}`; + path = `session-ranking`; break; } // change the router path to match the current tab // so that reloads work right - this.$router.push(`/people/${path}`).catch(error => { + if(pathStart === 'people') { + path += `/${this.person.id}` + } + this.$router.push(`/${pathStart}/${path}`).catch(error => { if(!isNavigationFailure(error, NavigationFailureType.duplicated)) { // ignore the duplicates, otherwise - throw error; @@ -157,14 +161,30 @@ export default { } }, mounted() { - // get id from URL if present - let id = this.id ? this.id : this.currentUser.id - this.fetch_model_by_id(personModel, id).then( - (obj) => { - this.person = obj + this.$nextTick( + () => { + // get id from URL if present + let id = this.id || this.currentUser.id; + let selectedPerson = this.selected_model(personModel); + // don't fetch if already here... todo figure out if we + // want to lazy fetch anyhow + if (selectedPerson?.id !== id) { + // tick + this.unselect_model(personModel); + this.fetch_model_by_id(personModel, id).then(() => + this.select_model(personModel, id) + ); + } } ) }, + beforeRouteLeave(to, from, next) { + if (from.path.match(/.*profile.*/) && to.path === '/people') { + // going from profile to people, clear the selection + this.unselect_model(personModel) + } + next(); + } } diff --git a/app/javascript/profile/availability_and_interests.vue b/app/javascript/profile/availability_and_interests.vue index 7bd377fc8..6cb2aadd7 100644 --- a/app/javascript/profile/availability_and_interests.vue +++ b/app/javascript/profile/availability_and_interests.vue @@ -100,12 +100,12 @@ export default { required: true }, start_time: { - type: DateTime, + //type: DateTime, // default: null required: true }, end_time: { - type: DateTime, + //type: DateTime, required: true }, timezone: { diff --git a/app/javascript/profile/dl_person.vue b/app/javascript/profile/dl_person.vue new file mode 100644 index 000000000..753d8822d --- /dev/null +++ b/app/javascript/profile/dl_person.vue @@ -0,0 +1,42 @@ + + + diff --git a/app/javascript/profile/dl_person_with_edit.vue b/app/javascript/profile/dl_person_with_edit.vue new file mode 100644 index 000000000..3d4ae69c6 --- /dev/null +++ b/app/javascript/profile/dl_person_with_edit.vue @@ -0,0 +1,66 @@ + + + + + diff --git a/app/javascript/profile/person_demographics.vue b/app/javascript/profile/person_demographics.vue index e24a32693..187bbc7c6 100644 --- a/app/javascript/profile/person_demographics.vue +++ b/app/javascript/profile/person_demographics.vue @@ -1,49 +1,104 @@ - - + diff --git a/app/javascript/profile/person_details.vue b/app/javascript/profile/person_details.vue index 73e0af158..41f123a08 100644 --- a/app/javascript/profile/person_details.vue +++ b/app/javascript/profile/person_details.vue @@ -1,59 +1,25 @@ + + + + diff --git a/app/javascript/profile/person_summary.vue b/app/javascript/profile/person_summary.vue index 1fbb640d0..df453aefe 100644 --- a/app/javascript/profile/person_summary.vue +++ b/app/javascript/profile/person_summary.vue @@ -1,50 +1,86 @@ - - diff --git a/app/javascript/schedule/room_selector.vue b/app/javascript/schedule/room_selector.vue index 0d2df2cc6..2354b7290 100644 --- a/app/javascript/schedule/room_selector.vue +++ b/app/javascript/schedule/room_selector.vue @@ -1,7 +1,7 @@