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.6.0-rc1 #1057

Merged
merged 73 commits into from
Jun 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
73 commits
Select commit Hold shift + click to select a range
8366ca7
WIP - server side API for people matching
balen Nov 6, 2023
350245f
Put people matching in playground
balen Nov 7, 2023
9a70279
Merge branch 'development' into registration-matching-prototype
balen Nov 25, 2023
b8392b2
Merge branch 'development' into registration-matching-prototype
balen Nov 30, 2023
9c4a23e
Merge branch 'development' into registration-matching-prototype
balen Dec 28, 2023
efdcbc6
Merge branch 'development' into registration-matching-prototype
balen Dec 29, 2023
8b9d565
Merge branch 'development' into registration-matching-prototype
balen Jan 7, 2024
780df62
Merge branch 'development' into registration-matching-prototype
balen Feb 8, 2024
f0aab44
Merge branch 'development' into registration-matching-prototype
balen Feb 26, 2024
8db9e69
Merge branch 'development' into registration-matching-prototype
balen Mar 4, 2024
d6ce163
Merge branch 'development' into registration-matching-prototype
balen Mar 4, 2024
673c7f6
Merge branch 'development' into registration-matching-prototype
balen Mar 17, 2024
3c2978a
Merge branch 'development' into registration-matching-prototype
balen Apr 15, 2024
e92e5a3
Update matching to be person first
balen Apr 16, 2024
893459b
update matching
balen Apr 16, 2024
4ab9d6b
Merge branch 'development' into registration-matching-prototype
balen Apr 23, 2024
bd4ac98
Add timing messages
balen Apr 23, 2024
6e4e585
Merge branch 'development' into registration-matching-prototype
balen Apr 29, 2024
8282b0e
Put in product exceptions when getting clyde data
balen Apr 29, 2024
9fda04f
Safering copying of reg information
balen Apr 29, 2024
533f7d3
store attending status from reg as well
balen Apr 29, 2024
a77686a
Merge branch 'development' into registration-matching-prototype
balen May 1, 2024
76506e8
Merge branch 'development' into registration-matching-prototype
balen May 5, 2024
9637791
Merge branch 'development' into registration-matching-prototype
balen May 8, 2024
d197787
Merge pull request #1043 from PlanoramaEvents/staging
balen May 8, 2024
3d97734
Merge branch 'development' into registration-matching-prototype
balen May 8, 2024
942e1df
Merge branch 'development' into reg-sync-updates
balen May 14, 2024
fdc920c
Put the resync reg button back in
balen May 14, 2024
9f10e40
Add status for reg sync job
balen May 15, 2024
a0a4893
Merge branch 'registration-matching-prototype' into plan-951-sync-wit…
balen May 15, 2024
1bb4016
merge in sync code
balen May 15, 2024
f2e86cf
Part 1 of registrations screen
balen May 15, 2024
67b5acd
Working UI for registration sync job
balen May 15, 2024
f10cc31
work around staxo bug on staging
balen May 15, 2024
bf30f6c
Merge pull request #1032 from PlanoramaEvents/reg-sync-updates
Gailbear May 19, 2024
730b6b3
Merge branch 'development' into plan-951-sync-with-clyde-worker
Gailbear May 19, 2024
a1c3a93
Merge pull request #1044 from PlanoramaEvents/plan-951-sync-with-clyd…
Gailbear May 19, 2024
fb66248
fix missing null check
Gailbear May 19, 2024
63d6832
bad commit message because i'm tired
Gailbear May 20, 2024
f37741c
Change matching criteria
balen May 21, 2024
f1d33fc
add badge name to serializer
balen May 21, 2024
199c596
Improved matching (names)
balen May 22, 2024
38975c8
Add reg match to person
balen May 22, 2024
2f748ca
Add methods for match and dismiss
balen May 27, 2024
88c4874
Merge pull request #1049 from PlanoramaEvents/staging
balen May 27, 2024
946a7a5
fix missing param name
balen May 27, 2024
707e628
fix datum - do not need people from reg
balen May 28, 2024
4491397
make person audit unlimited
balen May 28, 2024
e82aa0b
Step 1. Display tags and labels in the session
balen May 29, 2024
de2877c
Add tag and label to search
balen May 29, 2024
228eac4
remove the venues/rooms from sidebar for now
balen May 29, 2024
293c1df
Merge pull request #1050 from PlanoramaEvents/plan-963-admin-labels-s…
Gailbear Jun 2, 2024
4a90589
Merge pull request #1051 from PlanoramaEvents/plan-963-remove-venues-…
Gailbear Jun 2, 2024
46e0f58
possibly working manual sync
Gailbear Jun 2, 2024
6713444
remove resync person button
Gailbear Jun 2, 2024
11447e8
add strings.js and removal
Gailbear Jun 2, 2024
ca439c2
add reg sync button to clyde menu
Gailbear Jun 2, 2024
e759883
Keep match job stats
balen Jun 3, 2024
12b6d3f
Merge branch 'gail' into add-status-to-reg-sync
balen Jun 3, 2024
59d2a8a
Improve the matching and update to be faster
balen Jun 3, 2024
f3edd60
endpoint for the last sync's stats
balen Jun 3, 2024
6c63bba
Be consistent with timezone
balen Jun 4, 2024
f199a19
Merge pull request #1052 from PlanoramaEvents/add-status-to-reg-sync
Gailbear Jun 5, 2024
15ac2d3
Merge branch 'development' into gail
Gailbear Jun 5, 2024
e052fc5
Include matched prson in reg sync datum
balen Jun 6, 2024
5441146
PLAN-995 remove reg link and add ticket number view
Gailbear Jun 6, 2024
bcbed57
Merge branch 'PLAN-995-remove-reg-sync' into gail
Gailbear Jun 6, 2024
0727623
PLAN-996 removal of link, and link confirmation
Gailbear Jun 6, 2024
eeda978
unique index for people.reg_id
balen Jun 6, 2024
6d74680
Merge pull request #1053 from PlanoramaEvents/fix-datetime-editor-error
balen Jun 6, 2024
89a90dd
Merge pull request #1055 from PlanoramaEvents/gail
balen Jun 6, 2024
f26b255
updated sql file
balen Jun 6, 2024
29e2772
Merge pull request #1056 from PlanoramaEvents/gail
balen Jun 6, 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
4 changes: 2 additions & 2 deletions app/controllers/application_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@ def check_up
if ScheduleSnapshot.where("status = 'in_progress'").count > 0
redirect_to '/maintenance.html', status: 503
end
# Stop people from making changes if we are publishing
if PublicationStatus.where("status = 'inprogress'").count > 0
# Stop people from making changes if we are running any long job
if JobStatus.where("status = 'inprogress'").count > 0
redirect_to '/maintenance.html', status: 503
end
end
Expand Down
23 changes: 20 additions & 3 deletions app/controllers/concerns/resource_methods.rb
Original file line number Diff line number Diff line change
Expand Up @@ -230,11 +230,17 @@ def collection

@per_page, @current_page, @filters = collection_params


q = if select_fields
select_fields
else
policy_scope(base, policy_scope_class: policy_scope_class)
end

if default_scope(query: q)
q = default_scope(query: q)
end

q = q.includes(includes)
.references(references)
.eager_load(eager_load)
Expand All @@ -243,7 +249,7 @@ def collection
.where(collection_where)
# anpther where?

q = q.distinct if join_tables && !join_tables.empty?
q = q.distinct if (join_tables && !join_tables.empty?) || make_distinct?

q = q.order(order_string)

Expand All @@ -255,8 +261,11 @@ def collection

# TODO we need the size without the query
if paginated
@full_collection_total = policy_scope(base, policy_scope_class: policy_scope_class)
.where(exclude_deleted_clause)
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)
Expand Down Expand Up @@ -527,6 +536,10 @@ def select_fields
nil
end

def default_scope(query: nil)
nil
end

def model_name
"#{model_class}"
end
Expand Down Expand Up @@ -749,6 +762,10 @@ def array_col?(col_name:)
false
end

def make_distinct?
false
end

def permitted_params()
_permitted_params(model: nil)
end
Expand Down
101 changes: 101 additions & 0 deletions app/controllers/person_sync_data_controller.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,101 @@
class PersonSyncDataController < ResourceController
SERIALIZER_CLASS = 'PersonSyncDatumSerializer'.freeze
POLICY_CLASS = 'PersonSyncDatumPolicy'.freeze
POLICY_SCOPE_CLASS = 'PersonSyncDatumPolicy::Scope'.freeze
DEFAULT_SORTBY = 'name_sort_by'
DEFAULT_ORDER = 'asc'.freeze

#
#
#
def match
model_class.transaction do
authorize model_class, policy_class: policy_class

reg_id = params[:reg_id] if params[:reg_id]
person_id = params[:person_id] if params[:person_id]

# one of 'assisted' or 'manual'
reg_match = params[:reg_match] if params[:reg_match]

raise "Type of match should be 'assisted' or 'manual' you gave '#{reg_match}'" unless ['assisted', 'manual'].include? reg_match
raise "No reg id, person id, or match type specified" unless reg_id && person_id && reg_match

# Get the reg sync data
datum = RegistrationSyncDatum.find_by reg_id: reg_id

# Get the person
person = Person.find person_id

# 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'
end
end

#
# Method to dismiss a match
# POST request, parameters are reg_id and person_id
#
def dismiss_match
model_class.transaction do
authorize model_class, policy_class: policy_class

reg_id = params[:reg_id] if params[:reg_id]
person_id = params[:person_id] if params[:person_id]

raise "No reg id or person id specified" unless reg_id && person_id

existing = DismissedRegSyncMatch.find_by reg_id: reg_id, person_id: person_id

if !existing
DismissedRegSyncMatch.create!({
reg_id: reg_id,
person_id: person_id
})
end

render status: :ok,
json: { message: "Dismissed Match" }.to_json,
content_type: 'application/json'
end
end

# by default get the data that is not already mapped to a person
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)')
end

def select_fields
PersonSyncDatum.select(
::PersonSyncDatum.arel_table[Arel.star],
'name_sort_by'
)
end

def serializer_includes
[
:registration_sync_data
]
end

def make_distinct?
true
end

def includes
[
:email_addresses,
:registration_sync_data
]
end
end
63 changes: 63 additions & 0 deletions app/controllers/registration_sync_data_controller.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
class RegistrationSyncDataController < ResourceController
SERIALIZER_CLASS = 'RegistrationSyncDatumSerializer'.freeze
POLICY_CLASS = 'RegistrationSyncDatumPolicy'.freeze
POLICY_SCOPE_CLASS = 'RegistrationSyncDatumPolicy::Scope'.freeze
DEFAULT_SORTBY = 'registration_sync_data.name'
DEFAULT_ORDER = 'asc'.freeze

def sync_statistics
authorize current_person, policy_class: policy_class
status = RegistrationSyncStatus.order('created_at desc').first

result = status ? status.result : {}

render status: :ok, json: result.to_json, content_type: 'application/json'
end

def synchronize
authorize current_person, policy_class: policy_class

status = RegistrationSyncStatus.order('created_at desc').first
status = RegistrationSyncStatus.new if status == nil
if status.status != 'inprogress'
status.status = 'inprogress'
status.save!

RegistrationSyncWorker.perform_async
end

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

def people
authorize model_class, policy_class: policy_class
datum = RegistrationSyncDatum.find params[:registration_sync_datum_id]

people = datum.people
options = {
params: {
domain: "#{request.base_url}",
current_person: current_person
}
}

# return the list of people associated with this datum
render json: PersonSerializer.new(people,options).serializable_hash(),
content_type: 'application/json'
end

def serializer_includes
[
:matched_person
]
end

# # by default get the data that is not already mapped to a person
# def default_scope(query: nil)
# return nil unless query

# # People that have a potential mapping and not already mapped
# query.where('reg_id not in (select reg_id from people where reg_id is not null)')
# .where('reg_id in (select reg_id from registration_map_counts)')
# end
end
41 changes: 41 additions & 0 deletions app/javascript/administration/admin_registrations.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
<template>
<div class="container-fluid scrollable">
<h1>Registration Sync Management</h1>
<b-button variant="primary" size="sm" v-b-modal.confirm-reg-sync>Registration Synchronize</b-button>
<!-- -->
<!-- <h2>Registration Info (from Reg/clyde)</h2> -->
<person-sync-table></person-sync-table>

<!-- -->
<plano-modal id="confirm-reg-sync" @ok="synchronizeSchedule()">
<template #modal-title>Synchonize Registration Info</template>
</plano-modal>
</div>
</template>

<script>
import PlanoModal from '@/components/plano_modal.vue';
import { toastMixin } from '@/mixins';
import { http } from '@/http';
import PersonSyncTable from "@/registrations/person_sync_table.vue"

export default {
name: "AdminRegistrations",
components: {
PlanoModal,
PersonSyncTable
},
mixins: [
toastMixin
],
methods: {
synchronizeSchedule() {
this.toastPromise(http.get('/registration_sync_data/synchronize'), "Succesfully requested registration sync")
},
},
}
</script>

<style>

</style>
13 changes: 4 additions & 9 deletions app/javascript/administration/playground_component.vue
Original file line number Diff line number Diff line change
@@ -1,23 +1,18 @@
<template>
<div class="container-fluid scrollable">
<h1>Preview features</h1>
<h2>TwoSidedMultiSelect</h2>
<div class="w-75">
<two-sided-multi-select v-model="multiSelectValue" :options="multiSelectOptions"></two-sided-multi-select>
<pre>
value: {{ multiSelectValue }}
</pre>
</div>
<h2>Registration Info (from Reg/clyde)</h2>
<person-sync-table></person-sync-table>
</div>
</template>

<script>
import TwoSidedMultiSelect from "@/components/two_sided_multi_select.vue";
import PersonSyncTable from "@/registrations/person_sync_table.vue"

export default {
name: "PlayGroundComponent",
components: {
TwoSidedMultiSelect
PersonSyncTable
},
data: () => ({
multiSelectOptions: ["one", "two", "three", "four", "five", "six"],
Expand Down
10 changes: 10 additions & 0 deletions app/javascript/app.router.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ const loginRoutes = [
import AdminComponent from './administration/admin_component.vue';
import AdminConfigurationsComponent from './administration/admin_configurations.vue';

import AdminRegistrationsComponent from './administration/admin_registrations.vue';

import PlayGroundComponent from './administration/playground_component.vue';

// people
Expand Down Expand Up @@ -168,6 +170,14 @@ export const router = new VueRouter({
requiresAuth: true
}
},
{
path: '/admin-registrations',
component: AdminRegistrationsComponent,
meta: {
requiresAdmin: true,
requiresAuth: true
}
},
{
path: '/people',
component: PeopleScreen,
Expand Down
Loading
Loading