Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

3.7.1-rc1 #1125

Merged
merged 29 commits into from
Jul 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
b73b5b0
PLAN-950 reg potential matches modal
Gailbear Jun 26, 2024
2b8299f
Remove tagable from person as we do not tag people
balen Jun 26, 2024
f2c0b35
faster query for matches by changing type of view
balen Jun 26, 2024
4bd0fb6
Add count endpoint for matches
balen Jun 26, 2024
c1725ca
Structure updated for materialized view
balen Jun 26, 2024
a97f8ca
PLAN-950 reg sync frontend
Gailbear Jun 28, 2024
258a1e3
Fix server side for dismissed potential matches
balen Jun 28, 2024
3cbe097
Merge branch 'development' into PLAN-950-reg-stats
balen Jun 28, 2024
9c4acfc
Keep full title
balen Jun 28, 2024
8ef360e
Make sure Person "In Person" is value "in_person"
balen Jul 8, 2024
0bd879c
Ensure session limits are included in the
balen Jul 9, 2024
22b69d3
PLAN-950 start of new match interface
Gailbear Jul 10, 2024
d431a3d
PLAN-950 get rid of verbose console logs
Gailbear Jul 10, 2024
3e61e82
Merge pull request #1112 from PlanoramaEvents/plan-1015-back-of-badge
Gailbear Jul 10, 2024
b77d0d8
Remove unintended comment
Gailbear Jul 10, 2024
3bc7c7d
Merge pull request #1120 from PlanoramaEvents/1026-fix-mismatched-report
Gailbear Jul 10, 2024
f1e4363
Merge pull request #1121 from PlanoramaEvents/plan-1029-fix-session-l…
Gailbear Jul 10, 2024
f4a3bf9
Fixes
balen Jul 10, 2024
6a69f2f
make sure that we ignore the nulls
balen Jul 12, 2024
f7fbcae
Continuation of fix to filter out already matched
balen Jul 12, 2024
ee49f13
PLAN-950 reg sync modal polish
Gailbear Jul 14, 2024
cf123de
PLAN-1016 only allow 30 characters in short title
Gailbear Jul 14, 2024
94aa893
plan-950 select person dialog
Gailbear Jul 14, 2024
afd3a2d
correct view to filter out dismissed
balen Jul 14, 2024
2210679
Split view into 2 so regen only needed on dismiss
balen Jul 15, 2024
1c46a22
Merge pull request #1122 from PlanoramaEvents/plan-1016-short-title-v…
balen Jul 15, 2024
1be2bb6
Merge pull request #1123 from PlanoramaEvents/plan-950-new-match-inte…
balen Jul 15, 2024
c9976a9
Include not-set in the non-accepted report
balen Jul 15, 2024
486ed7f
Merge pull request #1124 from PlanoramaEvents/plan-1033-fix-non-accep…
balen Jul 15, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 22 additions & 12 deletions app/controllers/concerns/resource_methods.rb
Original file line number Diff line number Diff line change
Expand Up @@ -261,19 +261,8 @@ def collection
# Rails.logger.debug "****************************"
# Rails.logger.debug "****************************"

# TODO we need the size without the query
if paginated
fq = policy_scope(base, policy_scope_class: policy_scope_class)
if default_scope(query: fq)
fq = default_scope(query: fq)
end
@full_collection_total = fq.where(exclude_deleted_clause)
.includes(includes)
.references(references)
.eager_load(eager_load)
.joins(join_tables)
.distinct
.count
@full_collection_total = collection_total
instance_variable_set("@#{controller_name}", @full_collection_total)
end

Expand All @@ -284,6 +273,27 @@ def collection
end
end

def collection_total
base = if belong_to_class && belongs_to_param_id
parent = belong_to_class.find belongs_to_param_id
parent.send(belongs_to_relationship)
else
model_class
end

fq = policy_scope(base, policy_scope_class: policy_scope_class)
if default_scope(query: fq)
fq = default_scope(query: fq)
end
fq.where(exclude_deleted_clause)
.includes(includes)
.references(references)
.eager_load(eager_load)
.joins(join_tables)
.distinct
.count
end

def query(filters = nil)
# Go through the filter and construct the where clause
deleted_clause = exclude_deleted_clause
Expand Down
3 changes: 2 additions & 1 deletion app/controllers/people_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -478,7 +478,8 @@ def serializer_includes
[
:email_addresses,
:convention_roles,
:person_schedule_approvals
:person_schedule_approvals,
:session_limits
]
end

Expand Down
37 changes: 27 additions & 10 deletions app/controllers/person_sync_data_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,18 @@ class PersonSyncDataController < ResourceController
SERIALIZER_CLASS = 'PersonSyncDatumSerializer'.freeze
POLICY_CLASS = 'PersonSyncDatumPolicy'.freeze
POLICY_SCOPE_CLASS = 'PersonSyncDatumPolicy::Scope'.freeze
DEFAULT_SORTBY = 'name_sort_by'
DEFAULT_SORTBY = 'people.name_sort_by'
DEFAULT_ORDER = 'asc'.freeze

#
def possible_match_count
authorize model_class, policy_class: policy_class

render status: :ok,
json: { total: collection_total }.to_json,
content_type: 'application/json'
end

#
#
#
Expand All @@ -30,7 +39,7 @@ def match
# Update the person with the reg data
IdentityService.clear_person_reg_info(person: person);
IdentityService.update_reg_info(person: person, details: datum.raw_info, reg_match: reg_match)

render status: :ok,
json: { message: "Matched" }.to_json,
content_type: 'application/json'
Expand All @@ -57,6 +66,10 @@ def dismiss_match
reg_id: reg_id,
person_id: person_id
})

# We need to refresh the view on match
# this can take a few seconds
MigrationHelpers::PlanoViews.refresh_registration_sync_matches
end

render status: :ok,
Expand All @@ -69,10 +82,9 @@ def dismiss_match
def default_scope(query: nil)
return nil unless query

# People that have a potential mapping and not already mapped
query.joins(:registration_sync_data)
.where('people.reg_id is null')
.where('registration_sync_data.reg_id in (select reg_id from registration_map_counts)')
# TODO: exclude people with no registration_sync_data

query.where('people.reg_id is null and people.id in (select pid from registration_sync_matches)')
end

def select_fields
Expand All @@ -88,14 +100,19 @@ def serializer_includes
]
end

def make_distinct?
true
# def make_distinct?
# true
# end

def references
[
:primary_email
]
end

def includes
[
:email_addresses,
:registration_sync_data
:primary_email
]
end
end
1 change: 1 addition & 0 deletions app/controllers/registration_sync_data_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ def sync_statistics
status = RegistrationSyncStatus.order('created_at desc').first

result = status ? status.result : {}
result[:updated_at] = status&.updated_at;

render status: :ok, json: result.to_json, content_type: 'application/json'
end
Expand Down
4 changes: 2 additions & 2 deletions app/controllers/reports/people_reports_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,8 @@ def mis_matched_envs
.joins(:person)
.where(
%q(case
when (person_schedules.environment = 'in_person') then (people.attendance_type != 'in person' and people.attendance_type != 'hybrid')
when (person_schedules.environment = 'hybrid') then (people.attendance_type != 'in person' and people.attendance_type != 'hybrid')
when (person_schedules.environment = 'in_person') then (people.attendance_type != 'in_person' and people.attendance_type != 'hybrid')
when (person_schedules.environment = 'hybrid') then (people.attendance_type != 'in_person' and people.attendance_type != 'hybrid')
when (person_schedules.environment = 'virtual') then (people.attendance_type != 'virtual' and people.attendance_type != 'hybrid')
end
)
Expand Down
2 changes: 1 addition & 1 deletion app/controllers/reports/program_ops_reports_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -314,7 +314,7 @@ def back_of_badge
grouped.each do |assignment|
title = assignment.session.short_title || assignment.session.title
row.concat [
title,
assignment.session.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",
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 @@ -334,7 +334,7 @@ def non_accepted_on_schedule

people_sessions = SessionService.person_schedule
.where("session_assignment_name in ('Moderator', 'Participant', 'Invisible')")
.where("con_state not in ('not_set', 'accepted')")
.where("con_state not in ('accepted')")
.where("start_time is not null and room_id is not null")
.order('name', 'start_time', 'title')

Expand Down
2 changes: 1 addition & 1 deletion app/controllers/settings_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ def index
],
attendance_type: [
{
value: 'in person',
value: 'in_person',
label: "In-person only: I am planning to attend #{convention_name} in-person"
}, {
value: 'virtual',
Expand Down
2 changes: 1 addition & 1 deletion app/javascript/components/icon_button.vue
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
v-b-modal="modal"
>
<slot v-bind="{variant: iconVariant, disabled}">
<b-icon v-if="icon" :icon="icon" :variant="iconVariant" :class="{'text-muted': disabled}"></b-icon>
<b-icon v-if="icon" :icon="icon" :variant="iconVariant" :class="{'text-muted': disabled && computedVariant === 'link'}"></b-icon>
</slot>
</b-button>
</span>
Expand Down
14 changes: 11 additions & 3 deletions app/javascript/components/magical_reload.vue
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,23 @@ export default {
label: {
type: String,
default: "Last reloaded at"
}
},
reloadAction: { }
},
computed: {
...mapState(['reloadedAt'])
},
methods: {
...mapMutations({
reload: MAGICAL_RELOAD
})
magicalReload: MAGICAL_RELOAD
}),
reload() {
if (this.reloadAction) {
this.reloadAction();
} else {
this.magicalReload();
}
}
}
}
</script>
Expand Down
15 changes: 12 additions & 3 deletions app/javascript/components/table_vue.vue
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
</div>

<div class="d-flex align-items-center">
<slot name="left-controls" v-bind:editableIds="editableIds"></slot>
<slot name="left-controls" v-bind:editableIds="editableIds" v-bind:total="fullTotalRows"></slot>
<b-pagination
class="mb-0 mr-3 ml-auto"
v-model="currentPage"
Expand All @@ -79,6 +79,7 @@
</div>
<b-table
hover bordered responsive selectable small striped
:sticky-header="stickyHeader"
:fields="tableColumns"
selected-variant="primary"
:select-mode="useSelectMode"
Expand Down Expand Up @@ -129,11 +130,12 @@
</template>
</b-table>

<div class="d-flex mb-1">
<div class="d-flex mb-1" v-if="showBottomControls">
<span v-if="totalRows != fullTotalRows">Search Results: {{totalRows}}</span>
<span class="ml-auto">{{countCaption}}</span>
</div>
<b-pagination class="d-flex justify-content-end"
v-if="showBottomControls"
v-model="currentPage"
:total-rows="totalRows"
:per-page="perPage"
Expand All @@ -142,7 +144,7 @@
prev-text="Prev"
next-text="Next"
></b-pagination>
<div class="d-flex justify-content-end">
<div class="d-flex justify-content-end" v-if="showBottomControls">
<b-form-group label="Number of Records" label-cols="auto" class="mb-0">
<b-form-select :options="[10, 20, 50]" v-model="perPage"></b-form-select>
</b-form-group>
Expand Down Expand Up @@ -201,6 +203,13 @@ export default {
stateName: {
type: String,
default: null
},
stickyHeader: {
default: false
},
showBottomControls: {
type: Boolean,
default: true
}
},
data () {
Expand Down
2 changes: 1 addition & 1 deletion app/javascript/constants/strings.js
Original file line number Diff line number Diff line change
Expand Up @@ -301,7 +301,7 @@ module.exports = {
rejected: "Rejected"
},
PERSON_ATTENDANCE_TYPE: {
'in person': "In Person",
in_person: "In Person",
hybrid: "In Person AND Online",
virtual: "Online",
},
Expand Down
32 changes: 25 additions & 7 deletions app/javascript/integrations/clyde_settings.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,21 @@
<div class="container-fluid">
<div class="row">
<div class="column flex-grow-1">
<h4 class="mt-3 mb-2">Registration Sync Management</h4>
<div class="d-flex justify-content-between m-2">
<b-button variant="primary" size="sm" v-b-modal.confirm-reg-sync>Run Registration Data Sync</b-button>
<reg-sync-modal></reg-sync-modal>
</div>
<ul class="list-unstyled ml-2 mb-2">
<li>Last completed full sync: {{ lastSync }}</li>
<li>Records matched: {{ stats.matched }}</li>
<li>Records updated: {{ stats.updated }}</li>
<li>Records not found: {{ stats.not_found }}</li>
</ul>
<h4 class="mt-3">Configuration</h4>
<b-form-group label-cols="auto" label="Enable Clyde" class="configuration enable">
<b-form-group label-cols="auto" label="Enable Clyde" class="configuration enable ml-2">
<b-form-checkbox switch v-model="clydeEnabled" @change="patchClydeConfig()"></b-form-checkbox>
</b-form-group>
<b-button variant="primary" size="sm" v-b-modal.confirm-reg-sync class="ml-2">Registration Synchronize</b-button>
<b-form-group label-cols="auto" label="Use Clyde as Registration Integration" class="configuration enable ml-2">
<b-form-checkbox switch v-model="clydeRegistration" @change="patchClydeConfig()" :disabled="!clydeEnabled"></b-form-checkbox>
</b-form-group>
Expand All @@ -24,8 +34,8 @@
</div>
</div>
<plano-modal id="confirm-reg-sync" @ok="synchronizeSchedule()">
<template #modal-title>Synchonize Registration Info</template>
This will sync with the Registration system. This will bring the server down for a short time.
<template #modal-title>Run Registration Data Sync</template>
This will sync with the Registration system's data. It will bring the server down for a short time.
Please double check that you wish to perform this action.
</plano-modal>
</div>
Expand All @@ -36,18 +46,26 @@ import { clydeMixin } from './clyde.mixin'
import PlanoModal from '@/components/plano_modal.vue';
import { toastMixin } from '@/mixins';
import { http } from '@/http';
import { registrationSyncStatsMixin} from '@/store/registration_sync_stats.mixin';
import RegSyncModal from './reg-sync-modal.vue';

export default {
name: "ClydeSettings",
mixins: [clydeMixin, toastMixin],
mixins: [clydeMixin, toastMixin, registrationSyncStatsMixin],
components: {
PlanoModal
PlanoModal,
RegSyncModal
},
methods: {
synchronizeSchedule() {
this.toastPromise(http.get('/registration_sync_data/synchronize'), "Succesfully requested registration sync")
this.toastPromise(http.get('/registration_sync_data/synchronize'), "Succesfully requested registration sync").then(() => {
this.fetchStats();
})
},
},
mounted() {
this.fetchStats();
}

}
</script>
Expand Down
Loading
Loading