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 @@
@@ -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 @@
-
@@ -8,13 +7,17 @@
-
+
+
+
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 @@
-
Back
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+ Back
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -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 @@
+
+
+
+ -
+
+ {{PROFILE_FIELD_LABELS[field]}}
+
+
+ -
+
+ Restricted
+ Yes
+ No
+ Not Specified
+ {{selected[field]}}
+
+
+
+
+
+
+
+
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 @@
+
+
+
{{title}}
+
+
+
+
+ Edit {{title}} - {{selected.published_name}}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
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 @@
-
-
-
-
Demographics
-
- - Ethnicity
- - {{selected.ethnicity | na_if_empty}}
- - Gender
- - {{selected.gender | na_if_empty}}
- - Age at time of Event
- - {{selected.age_at_convention | na_if_empty}}
- - Romantic and/or sexual orientation
- - {{selected.romantic_sexual_orientation | na_if_empty}}
-
-
-
-
Community memberships
-
- - Experience with being “othered”
- - {{selected.othered | na_if_empty }}
- - Member of an Indigenous community
- - {{selected.indigenous | na_if_empty}}
- - Member of the global Black diaspora
- - {{selected.black_diaspora | na_if_empty}}
- - Represent something other than a purely US-centric perspective
- - {{selected.non_us_centric_perspectives| na_if_empty}}
- - Other demographic categories
- - {{selected.demographic_categories | na_if_empty }}
-
-
-
-
+
+
+
+
+
Community memberships
+
+
+
+
+ Edit Demographics - {{selected.published_name}}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
+
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 @@
-
+
-
-
-
-
-
-
+
-
-
-
-
-
- {{yesLabel.label}}
- {{noLabel.label}}
- {{maybeLabel.label}}
-
-
-
-
-
- {{yesLabel.label}}
- {{noLabel.label}}
- {{maybeLabel.label}}
-
-
-
-
- Local to the event
-
-
-
-
-
+
Preferences
+
+ {{can_stream_label}}
+ {{can_record_label}}
+
I plan to attend the convention:
In Person
In Person AND Virtually
@@ -61,10 +27,10 @@
Your time now in the selected timezone is {{youTimeNow}}
@@ -78,97 +44,132 @@
and check by specifying the date of September 1 2022 and your location as well as UTC/GMT
-
-
+ Bio
+
+ Social Media
+
+
+
+ Edit Bio - {{selected.published_name}}
+
-
- Social Media
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+ Edit Preferences - {{selected.published_name}}
+
+
+
+
+
+
+
+
+
+ {{yesLabel.label}}
+ {{noLabel.label}}
+ {{maybeLabel.label}}
+
+
+
+
+
+ {{yesLabel.label}}
+ {{noLabel.label}}
+ {{maybeLabel.label}}
+
+
+
+
+ Local to the event
+
+
+
+
+
+
+
+ Edit Socials - {{selected.published_name}}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
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 @@
-
-
-
-
{{person.published_name}}
+
+
+
+
{{selected.published_name}}
+
+
+ Last Login: {{formatLocaleDate(selected.current_sign_in_at)}}
+
-
- Last Login: {{formatLocaleDate(person.current_sign_in_at)}}
-
-
-
- Pronouns:
{{person.pronouns}}
-
- Willing to moderate sessions: {{willing_to_moderate}}
-
-
- Primary email:
{{person.primary_email.email}}
+
+ Pronouns:
{{selected.pronouns}}
+
+ Willing to moderate sessions: {{willing_to_moderate}}
+
+
+ Primary email: {{selected.primary_email.email}}
+
+
+ Edit Profile - {{selected.published_name}}
+
+
+
+
+
+
+
+
+
+
+
+ Willing to moderate session
+
+
+
-
-
-
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 @@
-
+
Displayed Rooms
Select All
-
+
import IconButton from '@/components/icon_button.vue';
import PlanoModal from '@/components/plano_modal.vue';
+import { modelMixinNoProp } from '@/store/model.mixin';
+import { mapMutations, mapState } from 'vuex';
+import { SET_ROOMS_FOR_SCHEDULING } from '@/store/room.store';
+
export default {
name: "RoomSelector",
- props: {
- rooms: {
- type: Array
- }
- },
+ mixins: [
+ modelMixinNoProp
+ ],
components: {
PlanoModal,
IconButton
},
data: () => ({
selectAll: true,
- selectedRooms: []
+ model: 'room',
+ selectedRooms: [],
}),
+ computed: {
+ ...mapState(['roomsForScheduling']),
+ },
methods: {
+ ...mapMutations({
+ setRoomsForScheduling: SET_ROOMS_FOR_SCHEDULING
+ }),
onSelectAll(v) {
if (v) {
- this.selectedRooms = this.rooms.map((r) => r.id)
+ this.selectedRooms = this.collection.map((r) => r.id)
} else {
this.selectedRooms = []
}
- // this.$emit('change', this.selectedRooms)
},
updateSelectRooms() {
- this.$refs['select-all'].checked = this.selectedRooms.length == this.rooms.length
- // this.$emit('change', this.selectedRooms)
+ this.selectAll = this.selectedRooms?.length === this.collection?.length
},
ok() {
- this.$emit('change', this.selectedRooms)
+ this.setRoomsForScheduling(this.selectedRooms);
+ },
+ show() {
+ this.selectedRooms = this.roomsForScheduling;
+ this.updateSelectRooms();
}
},
- mounted() {
- if (this.rooms) {
- this.selectedRooms = this.rooms.map((r) => r.id)
- }
- }
}
diff --git a/app/javascript/schedule/schedule_day.vue b/app/javascript/schedule/schedule_day.vue
index a03862e70..34cfaf655 100644
--- a/app/javascript/schedule/schedule_day.vue
+++ b/app/javascript/schedule/schedule_day.vue
@@ -17,26 +17,29 @@
ref="dayRoomGrid"
:events="events"
@event-drop="onEventDrop"
- @event-mouse-enter="onEventEnter"
- @event-mouse-leave="onEventLeave"
:on-event-click="onEventClick"
>
-
{{ formatDate(view.selectedDate, { weekday: 'long' }) }},
{{ formatDate(view.selectedDate, { day: 'numeric', month: 'short' }) }}
-
-
-
- {{ formatDatetime(event.actual_start) }} - {{ formatDatetime(event.actual_end) }}
+
+
+
+
+ {{ formatDatetime(event.actual_start) }} - {{ formatDatetime(event.actual_end) }}
+
+
+
+
+ {{event.title}}
-
-
- {{event.title}}
-
@@ -101,16 +104,28 @@ export default {
let start_time = DateTime.fromISO(session.start_time).setZone(this.timezone)
let end_time = DateTime.fromISO(session.end_time).setZone(this.timezone)
// check it is for the right day
- if ((start_time.toFormat('yyyy-MM-dd') == this.selectedDate) || (end_time.toFormat('yyyy-MM-dd') == this.selectedDate)) {
+ if (
+ ((start_time.toFormat('yyyy-MM-dd') == this.selectedDate) || (end_time.toFormat('yyyy-MM-dd') == this.selectedDate))
+ ||
+ ((start_time.startOf('day') < DateTime.fromISO(this.selectedDate).startOf('day')) && (end_time.startOf('day') > DateTime.fromISO(this.selectedDate).startOf('day')))
+ ) {
// We need to fudge the end or start time, otherwise the session is no draggable if either is
// outside the limits for the day So we aslo keep the display start and end for the UI...
let display_end_time = end_time
let display_start_time = start_time
if (end_time.toFormat('yyyy-MM-dd') != this.selectedDate) {
- display_end_time = start_time.endOf('day')
+ if (end_time.startOf('day') > DateTime.fromISO(this.selectedDate).startOf('day')) {
+ display_end_time = DateTime.fromISO(this.selectedDate).endOf('day')
+ } else {
+ display_end_time = start_time.endOf('day')
+ }
}
if (start_time.toFormat('yyyy-MM-dd') != this.selectedDate) {
- display_start_time = end_time.startOf('day')
+ if (start_time.startOf('day') < DateTime.fromISO(this.selectedDate).startOf('day')) {
+ display_start_time = DateTime.fromISO(this.selectedDate).startOf('day')
+ } else {
+ display_start_time = end_time.startOf('day')
+ }
}
let new_event = {
start: display_start_time.toFormat('yyyy-MM-dd HH:mm'),
@@ -120,7 +135,8 @@ export default {
id: session.id,
duration_mins: session.duration_mins,
actual_start: start_time,
- actual_end: end_time
+ actual_end: end_time,
+ has_conflicts: session.has_conflicts
}
res.push(new_event)
}
@@ -147,23 +163,25 @@ export default {
},
},
methods: {
+ hoverText(ev) {
+ if (ev.actual_start && ev.actual_end) {
+ return this.formatDatetime(ev.actual_start) + ' - ' + this.formatDatetime(ev.actual_end)
+ } else {
+ return ''
+ }
+ },
onEventClick(event, e) {
e.stopPropagation()
- this.select(event.id)
- },
- // Enter and leave to
- onEventEnter(e) {
- // console.debug("******* SESSION Entered", e)
- // e.stopPropagation()
- },
- onEventLeave(e) {
- // console.debug("******* SESSION Leave", e)
- // e.stopPropagation()
+ if (event.split) {
+ this.select(event.id)
+ }
},
onEventDrop ({ event, originalEvent, external }) {
this.updateSession(event.id, event.start, event.split)
},
- onDelete(ev) {
+ onDelete(event, ev) {
+ event.stopPropagation()
+ this.unselect()
this.updateSession(ev.id, null, null)
},
scrollBarElement: function() {
@@ -179,6 +197,9 @@ export default {
}
)
}
+ },
+ mounted() {
+ this.unselect();
}
}
@@ -186,6 +207,20 @@ export default {