Skip to content

Commit

Permalink
Merge pull request #1103 from PlanoramaEvents/development
Browse files Browse the repository at this point in the history
3.7.0-rc1
  • Loading branch information
balen authored Jun 24, 2024
2 parents 9654e1f + afe5c72 commit 7af5f77
Show file tree
Hide file tree
Showing 46 changed files with 846 additions and 69 deletions.
4 changes: 3 additions & 1 deletion app/controllers/concerns/resource_methods.rb
Original file line number Diff line number Diff line change
Expand Up @@ -89,16 +89,18 @@ def update
before_update
# updates does the save as well, need to assign without saving to determine if there is a change
@object.assign_attributes(strip_params(_permitted_params(model: object_name, instance: @object)))
changed = @object.changed?
# Then we can "save"
@object.save!
changed = @object.saved_changes?
# Rails.logger.debug("&****** has dirty #{@object.has_dirty_associations}")
@object.reload
after_update
end
end
ret = after_update_tx
return if ret

# also if relationships changed ....
if changed
render_object(@object)
else
Expand Down
13 changes: 13 additions & 0 deletions app/controllers/integrations_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,19 @@ def clyde
content_type: 'application/json'
end

def g24rce
authorize model_class, policy_class: policy_class
g24rce = Integration.find_or_create_by({name: 'g24rce'})

render json: serializer_class.new(g24rce,
{
include: serializer_includes,
params: {domain: "#{request.base_url}"}
}
).serializable_hash(),
content_type: 'application/json'
end

def allowed_params
%i[
id
Expand Down
2 changes: 1 addition & 1 deletion app/controllers/people_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ def live_sessions
person = Person.find params[:person_id]

if person
schedule = SessionService.draft_schedule_for(person: person, current_person: current_person)
schedule = SessionService.draft_schedule_for(person: person, current_person: current_person, show_links: true)
render json: schedule, content_type: 'application/json'
end
end
Expand Down
52 changes: 52 additions & 0 deletions app/controllers/rce_controller.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
require 'csv'
class RceController < ApplicationController
# All time need to be in the convention timezone
around_action :set_timezone

def schedule
authorize Session, policy_class: RcePolicy

# Need to get sessions that are online or hybrid ...
# and/or streamed
sessions = SessionService.scheduled_sessions.where(
"environment in (?) or streamed = true", ['hybrid', 'virtual']
)

send_data generate_csv(sessions),
filename: "schedule-#{Time.now.strftime('%m-%d-%Y')}.csv",
disposition: 'attachment'
end

def generate_csv(sessions)
column_names = [
'Start date','Start time','End date','End time',
'Schedule name','Schedule description','Segment name','Segment type',
'Tags','Attendance'
]

CSV.generate do |csv|
csv << column_names

sessions.each do |session|
# Session has an online audience only if it is streamed or virtual (online)
next unless session.environment == 'virtual' || session.streamed
# If the room is not an online room or an RCE stage then there is no online audience
next unless session.room.integrations["rce"] && session.room.integrations["rce"]["SegmentType"]

csv << [
session.start_time.strftime("%Y-%m-%d"),
session.start_time.strftime("%H:%M"),
(session.start_time + session.duration.minutes).strftime("%Y-%m-%d"),
(session.start_time + session.duration.minutes).strftime("%H:%M"),
session.title,
session.description, # HTML may be an issue ...
session.title,
session.room.integrations["rce"] ? session.room.integrations["rce"]["SegmentType"] : "sessions",
# Areas and tags
"#{session.area_list.sort.join(', ')}, #{session.tag_list&.join(', ')}", # Tags may be new line seperated?
'regular'
]
end
end
end
end
7 changes: 4 additions & 3 deletions app/controllers/reports/program_ops_reports_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,7 @@ def table_tents
session.published_session_assignments.each do |pa|
worksheet.append_row(
[
session.title,
session.short_title || session.title,
session.room&.name,
FastExcel.date_num(session.start_time, session.start_time.in_time_zone.utc_offset),
pa.person.published_name,
Expand Down Expand Up @@ -312,9 +312,10 @@ def back_of_badge
styles = [nil]

grouped.each do |assignment|
title = assignment.session.short_title || assignment.session.title
row.concat [
assignment.session.title,
assignment.session.title.truncate(30),
title,
title.truncate(30),
assignment.session.start_time ? FastExcel.date_num(assignment.session.start_time, assignment.session.start_time.in_time_zone.utc_offset) : nil,
"#{assignment.session.duration}m",
assignment.session.room&.name,
Expand Down
2 changes: 1 addition & 1 deletion app/controllers/reports/session_reports_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ def daily_grid
sessions.each do |session|
worksheet.append_row(
[
session.title,
session.short_title || session.title,
session.area_list.sort.join(';'),
session.tags_array&.join("; "),
session.labels_array&.join("; "),
Expand Down
2 changes: 2 additions & 0 deletions app/controllers/reports_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -334,6 +334,7 @@ def assigned_sessions_by_participant
'Published Name',
'Participant Status',
'Attendance Type',
'Match Status',
'Session',
'Role',
'Scheduled',
Expand All @@ -350,6 +351,7 @@ def assigned_sessions_by_participant
person.published_name,
person.con_state,
person.attendance_type,
person.reg_match,
assignment.session.title,
assignment.session_assignment_role_type.name,
assignment.session.start_time && assignment.session.room_id ? 'Y' : 'N',
Expand Down
1 change: 1 addition & 0 deletions app/controllers/sessions_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -347,6 +347,7 @@ def allowed_params
format_id
room_set_id
title
short_title
description
duration
minimum_people
Expand Down
2 changes: 2 additions & 0 deletions app/javascript/configurations/config_editor.vue
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
:skipIfEmpty="true"
v-slot="{ valid, errors }"
>
<slot v-bind="{onChange, config: configuration}">
<b-form-group :label="parameterLabel">
<!-- TODO: We need more meaningful names, ^^^ change the label -->
<!-- TODO: we need to change the editor type depending on the parameter.type -->
Expand Down Expand Up @@ -49,6 +50,7 @@
<b-form-invalid-feedback id="inputLiveFeedback">{{ errors[0] }}</b-form-invalid-feedback>
</div>
</b-form-group>
</slot>
</ValidationProvider>
</template>

Expand Down
3 changes: 2 additions & 1 deletion app/javascript/configurations/configurations_manager.vue
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@ export default {
parameters: [],
loading: true,
EVENT_SETTINGS_MUST_RELOAD,
exclusions: ['clyde_base_url']
// TODO
exclusions: ['clyde_base_url', 'show_join_links']
}),
mixins: [
modelMixin,
Expand Down
58 changes: 58 additions & 0 deletions app/javascript/configurations/single_config_manager.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
<template>
<div v-if="currentSettings">
<config-editor
model="configuration"
:parameter="parameter"
v-if="parameter"
>
<template #default="{config, onChange}">
<slot v-bind="{config, onChange}"></slot>
</template>
</config-editor>
</div>
</template>

<script>
import { modelMixinNoProp } from '../store/model.mixin';
import ConfigEditor from './config_editor';
import settingsMixin from "@/store/settings.mixin";
export default {
name: "SingleConfigManager",
components: {
ConfigEditor
},
props: {
parameterName: {
type: String,
required: true
}
},
data: () => ({
model: 'parameter_name',
parameter: null,
loading: true,
}),
mixins: [
modelMixinNoProp,
settingsMixin
],
methods: {
load_parameters() {
this.loading = true
// This needs to change to get sorted ...?
this.fetch({}).then(data => {
this.parameter = this.collection.find(p => p.parameter_name === this.parameterName)
this.loading = false
})
},
},
mounted() {
this.fetchSettings();
this.load_parameters();
}
}
</script>

<style lang="scss">
</style>
58 changes: 58 additions & 0 deletions app/javascript/integrations/g24rce.mixin.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
import { toastMixin } from '@/mixins';
import { FETCH_G24RCE_INTEGRATION, SET_G24RCE_INTEGRATION, integrationModel } from '@/store/integration.store';
import { PATCH_FIELDS } from '@/store/model.store';
import { mapActions, mapState, mapMutations } from 'vuex';

export const g24rceMixin = {
mixins: [
toastMixin
],
computed: {
...mapState(['g24rce']),
g24rceEnabled: {
get() {
return this.g24rce?.config?.enabled
},
set(val) {
if (this.g24rce?.config) {
this.g24rce.config.enabled = val;
}
}
},
g24rceBasebPortalUrl: {
get() {
return this.g24rce?.config?.base_portal_url
},
set(val) {
if (this.g24rce?.config) {
this.g24rce.config.base_portal_url = val;
}
}
}
},
methods: {
...mapActions({
fetchG24RCEInfo: FETCH_G24RCE_INTEGRATION,
patchModel: PATCH_FIELDS,
}),
...mapMutations({
setG24RCEInfo: SET_G24RCE_INTEGRATION,
}),
fetchG24RCEInfoIfMissing() {
if (!this.g24rce || !Object.keys(this.g24rce).length) {
this.fetchG24RCEInfo();
}
},
patchG24RCEConfig() {
this.toastPromise(new Promise((res, rej) => {
this.patchModel({ model: integrationModel, item: this.g24rce, fields: ['config'], selected: false }).then((data) => {
this.setG24RCEInfo(data);
res(data);
}).catch(rej);
}), "G24 RCE integration successfully updated.")
}
},
mounted() {
this.fetchG24RCEInfoIfMissing();
}
}
38 changes: 38 additions & 0 deletions app/javascript/integrations/g24rce_settings.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
<template>
<div class="container-fluid">
<div class="row">
<div class="column flex-grow-1">
<h4 class="mt-3">Configuration</h4>
<b-form-group label-cols="auto" label="Enable G24 RCE" class="configuration enable">
<b-form-checkbox switch v-model="g24rceEnabled" @change="patchG24RCEConfig()"></b-form-checkbox>
</b-form-group>

<a href="/rce/schedule" target="_blank" class="btn btn-primary">Export Sessions</a>

<b-form-group label="Base URL for Portal" class="ml-2 mt-5">
<b-form-input type="text" v-model="g24rceBasebPortalUrl" @blur="patchG24RCEConfig()"
:disabled="!g24rceEnabled"></b-form-input>
</b-form-group>
</div>
</div>
</div>
</template>

<script>
import { g24rceMixin } from './g24rce.mixin'
export default {
name: "G24RCESettings",
mixins: [g24rceMixin]
}
</script>

<style lang="scss">
.configuration.enable .form-row {
align-items: center;
}
.basis-14 {
flex-basis: 14rem;
}
</style>
7 changes: 6 additions & 1 deletion app/javascript/integrations/integration_settings.vue
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@
<b-tab title="Clyde">
<clyde-settings></clyde-settings>
</b-tab>
<b-tab title="G24 RCE">
<G24RCESettings></G24RCESettings>
</b-tab>
</b-tabs>
</div>
</div>
Expand All @@ -18,12 +21,14 @@
<script>
import AirmeetSettings from '@/airmeet/airmeet_settings.vue'
import ClydeSettings from './clyde_settings.vue'
import G24RCESettings from './g24rce_settings.vue'
export default {
name: "IntegrationSettings",
components: {
AirmeetSettings,
ClydeSettings
ClydeSettings,
G24RCESettings
}
}
</script>
Expand Down
Loading

0 comments on commit 7af5f77

Please sign in to comment.