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.3.0-rc1 #947

Merged
merged 23 commits into from
Feb 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
3feb25d
PLAN-898 tags - initial frontend implementation
Gailbear Feb 4, 2024
f1089f3
Only get published if there is one
balen Feb 6, 2024
253465e
optimize tags and labels in serializer for
balen Feb 6, 2024
23e0cc1
Fix for browser js loop
balen Feb 6, 2024
c5cfa76
Sorting for tags and labels working in grid
balen Feb 6, 2024
f894e0a
Working tags and labels sorting
balen Feb 7, 2024
a8d9c29
working tags and labels search
balen Feb 7, 2024
87b5e2a
start of curated tags
balen Feb 7, 2024
219862c
Merge branch 'development' into PLAN-898-tags
balen Feb 8, 2024
4632236
Merge branch 'PLAN-898-tags' into PLAN-899-tags-backend
balen Feb 8, 2024
3affe99
WIP currated tags
balen Feb 8, 2024
580611f
Added curated tags
balen Feb 8, 2024
c576e73
add rbac for curated tags
balen Feb 8, 2024
8ab7395
Make the date fields sortable for sessions
balen Feb 8, 2024
c2fc05c
Merge pull request #944 from PlanoramaEvents/staging
balen Feb 9, 2024
8e7fec7
Merge pull request #939 from PlanoramaEvents/PLAN-898-tags
Gailbear Feb 11, 2024
bf8216d
Merge pull request #938 from PlanoramaEvents/PLAN-899-tags-backend
Gailbear Feb 11, 2024
41576fe
Merge pull request #940 from PlanoramaEvents/plan-907-sortable-date-f…
Gailbear Feb 11, 2024
ae90174
PLAN-898 tag tweaks
Gailbear Feb 13, 2024
c77553f
PLAN-898 more tags
Gailbear Feb 13, 2024
2d20232
Merge pull request #945 from PlanoramaEvents/plan-898-more-tags
Gailbear Feb 13, 2024
f67a4ae
PLAN-919 rename 'virtual' to 'online'
Gailbear Feb 13, 2024
b7ad77b
Merge pull request #946 from PlanoramaEvents/PLAN-919-online
Gailbear Feb 13, 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
6 changes: 6 additions & 0 deletions app/controllers/concerns/resource_methods.rb
Original file line number Diff line number Diff line change
Expand Up @@ -206,6 +206,10 @@ def order_string(order_by: nil)
order_str
end

def collection_where
nil
end

def collection
base = if belong_to_class && belongs_to_param_id
parent = belong_to_class.find belongs_to_param_id
Expand All @@ -226,6 +230,8 @@ def collection
.eager_load(eager_load)
.joins(join_tables)
.where(query(@filters))
.where(collection_where)
# anpther where?

q = q.distinct if join_tables && !join_tables.empty?

Expand Down
29 changes: 29 additions & 0 deletions app/controllers/curated_tags_controller.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
class CuratedTagsController < ResourceController
MODEL_CLASS = 'CuratedTag'.freeze
SERIALIZER_CLASS = 'CuratedTagSerializer'.freeze
POLICY_CLASS = 'CuratedTagPolicy'.freeze
POLICY_SCOPE_CLASS = 'CuratedTagPolicy::Scope'.freeze

# Need context from the request
# index has the context
def collection_where
permitted = params.permit(allowed_params)
context = permitted[:context]
table = Arel::Table.new(model_class.table_name)

table[:context].eq(context) if context
end

def paginate
false
end

def allowed_params
%i[
id
lock_version
name
context
]
end
end
49 changes: 41 additions & 8 deletions app/controllers/sessions_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,18 @@ def tags
content_type: 'application/json'
end

def labels
res = Session.tags_on(:labels).order(:name)

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

def before_update
# if time or room have changed removed ignored conflicts
p = _permitted_params(model: object_name, instance: @object)
Expand Down Expand Up @@ -206,39 +218,46 @@ def serializer_includes
def includes
[
:format,
:room,
:base_tags
:room
]
end

def references
[
:format,
:room,
:room
]
end

def eager_load
[
{session_areas: :area},
:areas
:areas,
:published_session,
{taggings: :tag}
]
end

def array_col?(col_name:)
return true if col_name == 'area_list'
return true if col_name == 'tags_array'
return true if col_name == 'labels_array'
false
end

def array_table(col_name:)
return 'areas_list' if col_name == 'area_list'
return 'tags_list_table' if col_name == 'tags_array'
return 'labels_list_table' if col_name == 'labels_array'
false
end

def join_tables
sessions = Arel::Table.new(Session.table_name)

subquery = Session.area_list.as('areas_list')
tags_subquery = Session.tags_list_table.as('tags_list_table')
labels_subquery = Session.labels_list_table.as('labels_list_table')
conflict_counts = Session.conflict_counts.as('conflict_counts')
joins = [
sessions.create_join(
Expand All @@ -248,6 +267,20 @@ def join_tables
),
Arel::Nodes::OuterJoin
),
sessions.create_join(
tags_subquery,
sessions.create_on(
tags_subquery[:session_id].eq(sessions[:id])
),
Arel::Nodes::OuterJoin
),
sessions.create_join(
labels_subquery,
sessions.create_on(
labels_subquery[:session_id].eq(sessions[:id])
),
Arel::Nodes::OuterJoin
),
sessions.create_join(
conflict_counts,
sessions.create_on(
Expand Down Expand Up @@ -286,7 +319,9 @@ def join_tables
def select_fields
Session.select(
::Session.arel_table[Arel.star],
'conflict_counts.conflict_count'
'conflict_counts.conflict_count',
'tags_list_table.tags_array',
'labels_list_table.labels_array'
)
end

Expand Down Expand Up @@ -318,6 +353,7 @@ def allowed_params
open_for_interest
instructions_for_interest
tag_list
label_list
session_areas_attributes
proofed
format_id
Expand All @@ -330,8 +366,5 @@ def allowed_params
recorded
streamed
]
# Tags
# format
# areas
end
end
6 changes: 3 additions & 3 deletions app/controllers/settings_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -63,14 +63,14 @@ def index
attendance_type: [
{
value: 'in person',
label: "**In-person only:** I am planning to attend #{convention_name} in-person"
label: "In-person only: I am planning to attend #{convention_name} in-person"
}, {
value: 'virtual',
label: "**Virtual only:** I am not planning to attend #{convention_name} in-person, and would like to be a virtual participant on virtual-based items only (via Zoom or similar technology)."
label: "Online only: I am not planning to attend #{convention_name} in-person, and would like to be a online participant on online-based items only (via Zoom or similar technology)."
},
{
value: 'hybrid',
label: "**In-person and virtual:** I am planning to attend #{convention_name} in-person, but would also like to be considered for virtual panels."
label: "In-person and online: I am planning to attend #{convention_name} in-person, but would also like to be considered for online panels."
},
],
age_restrictions: ::AgeRestriction.all,
Expand Down
9 changes: 7 additions & 2 deletions app/javascript/components/model_tags.vue
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,10 @@ export default {
filter: null,
taggable: false,
fieldOnly: false,
formatter: {
type: Function,
default: (val) => val
},
disabled: {
type: Boolean,
default: false
Expand Down Expand Up @@ -65,11 +69,12 @@ export default {
).map(
(obj) => {
if (this.fieldOnly) {
return obj[this.field]
return this.formatter(obj[this.field])
} else {
return {
code: obj.id,
label: obj[this.field]
value: obj[this.field],
label: this.formatter(obj[this.field])
}
}

Expand Down
9 changes: 5 additions & 4 deletions app/javascript/constants/strings.js
Original file line number Diff line number Diff line change
Expand Up @@ -286,8 +286,8 @@ module.exports = {
},
PERSON_ATTENDANCE_TYPE: {
'in person': "In Person",
hybrid: "In Person AND Virtually",
virtual: "Virtually",
hybrid: "In Person AND Online",
virtual: "Online",
},

PAGE_CONTENT_SAVE_SUCCESS: "Page content saved successfully",
Expand All @@ -302,14 +302,15 @@ module.exports = {
unknown: "Unknown",
in_person: "In Person",
hybrid: "Hybrid",
virtual: "Virtual"
virtual: "Online"
},
SESSION_STATUS: {
draft: "Draft",
reviewed: "Reviewed",
revised: "Revised",
dropped: "Dropped",
},
SESSION_NO_TAGS: (tagName) => `Click the pencil to add ${tagName}`,
SESSION_MUST_UNSCHEDULE: "You must unschedule a session before dropping it",
SESSION_MUST_UNDROP: "You must un-drop the session to be able to schedule it.",
SESSION_MINORS_PARTICIPATION: {
Expand Down Expand Up @@ -341,7 +342,7 @@ module.exports = {
},
EVENT_SETTINGS_MUST_RELOAD: "*** Changes to these settings will only take effect after you reload your browser page. ***",
CONFIGURATION_LABEL_OVERRIDES: {
event_virtual: "Does this event include a virtual component?",
event_virtual: "Does this event include an online component?",
clyde_base_url: "Base URL for Clyde",
profile_show_info_demographic_community: "Show Demographics, Community, and Info in Profile"
}
Expand Down
4 changes: 2 additions & 2 deletions app/javascript/dashboard/dashboard.vue
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
Update your name(s), pronouns, email address, bio, and social media as needed
</li>
<li v-if="eventVirtual">
If you’re not going to be attending the convention in-person, please let us know the timezone that you will be in when you attend virtually.
If you’re not going to be attending the convention in-person, please let us know the timezone that you will be in when you attend online.
</li>
</ul>
</li>
Expand Down Expand Up @@ -61,7 +61,7 @@
Select sessions by using the slider to the right of the description. Your selections will save automatically.
</li>
<li v-if="eventVirtual">
While some items are marked or otherwise described as Virtual, many we’re not sure if they will be taking place in-person or online, so everyone should feel free to sign up for items not marked either way.
While some items are marked or otherwise described as online, many we’re not sure if they will be taking place in-person or online, so everyone should feel free to sign up for items not marked either way.
</li>
</ul>
</li>
Expand Down
2 changes: 1 addition & 1 deletion app/javascript/profile/availability_and_interests.vue
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
<p>
Under each day, highlight (click and drag) the times of day that you are available for programming in the calendar view below.
You can create multiple blocks of time per day. <span v-if="eventVirtual" >The in-person convention time is currently displayed.
If you will be attending virtually, and want to enter your availability in that time zone,
If you will be attending online, and want to enter your availability in that time zone,
select that option from below the calendar.
</span>
<span v-if="!eventVirtual">The time is displayed in the convention time zone, which is currently {{timezone}}.</span>
Expand Down
4 changes: 2 additions & 2 deletions app/javascript/profile/person_details.vue
Original file line number Diff line number Diff line change
Expand Up @@ -34,13 +34,13 @@
</div>
<div class="d-flex flex-column w-50 p-2">
<div v-if="eventVirtual && readOnly">
<h5>Virtual</h5>
<h5>Online</h5>
<dl-person :fields="['attendance_type', 'timezone']">
<template #attendance_type-val="{value}">{{PERSON_ATTENDANCE_TYPE[value]}}</template>
</dl-person>
</div>
<div v-if="eventVirtual && !readOnly">
<h5>Virtual</h5>
<h5>Online</h5>
<div><b>I plan to attend the convention:</b></div>
<b-form-radio-group
v-model="selected.attendance_type"
Expand Down
6 changes: 4 additions & 2 deletions app/javascript/profile/session_ranker.vue
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
Area(s): <span class="badge badge-pill badge-primary mr-1" v-for="area in item.session.area_list" :key="area">{{area}}</span>
</div>
<div v-if="item.session.tag_list && item.session.tag_list.length">
Tag(s): <span class="badge badge-pill badge-secondary mr-1" v-for="tag in item.session.tag_list" :key="tag">{{tag}}</span>
Tag(s): <span class="badge badge-pill badge-warning mr-1" v-for="tag in item.session.tag_list" :key="tag">{{tagFormatter(tag)}}</span>
</div>
<br />
<div class="mt-3" v-if="item.session.instructions_for_interest">Instructions for potential panelists:</div>
Expand Down Expand Up @@ -97,6 +97,7 @@ import personSessionMixin from '../auth/person_session.mixin';
import sessionAssignmentMixin from '../sessions/session_assignment.mixin';
import { sessionAssignmentModel } from '@/store/session_assignment.store'
import SessionAssignmentMonitor from './session_assignment_monitor.vue'
import {tagsMixin} from '@/store/tags.mixin';

import { SESSION_RANKING_ERROR } from '../constants/strings';

Expand All @@ -109,7 +110,8 @@ export default {
personSessionMixin,
modelMixin,
tableMixin, // covers pagination and sorting
sessionAssignmentMixin
sessionAssignmentMixin,
tagsMixin,
],
props: {
person_id: {
Expand Down
9 changes: 6 additions & 3 deletions app/javascript/profile/session_search.vue
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@
v-model="tags"
model="tag"
field="name"
filter='{"op":"all","queries":[["taggings.taggable_type", "=", "Session"]]}'
filter='{"op":"all","queries":[["taggings.taggable_type", "=", "Session"], ["taggings.context", "=", "tags"]]}'
:formatter="tagFormatter"
></model-tags>
</b-form-group>
</b-col>
Expand All @@ -43,6 +44,7 @@
</template>

<script>
import { tagFormatter } from '@/store/tags.mixin';
import ModelSelect from '../components/model_select';
import ModelTags from '../components/model_tags';
import searchStateMixin from '../store/search_state.mixin'
Expand All @@ -66,7 +68,8 @@ export default {
title_desc: null,
area_id: null,
tags: null,
match: 'any'
match: 'any',
tagFormatter
}
},
methods: {
Expand Down Expand Up @@ -95,7 +98,7 @@ export default {
}

if (this.tags && (this.tags.length > 0)) {
let vals = this.tags.map(obj => (obj.label))
let vals = this.tags.map(obj => (obj.value))
queries["queries"].push(
["tags.name","in",vals],
)
Expand Down
6 changes: 4 additions & 2 deletions app/javascript/profile/session_selector.vue
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
Area(s): <span class="badge badge-pill badge-primary mr-1" v-for="area in item.area_list" :key="area">{{area}}</span>
</div>
<div v-if="item.tag_list.length > 0">
Tag(s): <span class="badge badge-pill badge-secondary mr-1" v-for="tag in item.tag_list" :key="tag">{{tag}}</span>
Tag(s): <span class="badge badge-pill badge-warning mr-1" v-for="tag in item.tag_list" :key="tag">{{tagFormatter(tag)}}</span>
</div>
<div class="mt-3" v-if="item.instructions_for_interest">Instructions for potential panelists:</div>
<div class="panelist-instructions" v-html="item.instructions_for_interest">
Expand Down Expand Up @@ -83,6 +83,7 @@ import personSessionMixin from '../auth/person_session.mixin';
import InterestIndicator from './interest_indicator.vue'
import { sessionAssignmentModel } from '@/store/session_assignment.store'
import SessionSearch from './session_search'
import { tagsMixin } from '@/store/tags.mixin';

export default {
name: "SessionSelector",
Expand All @@ -94,7 +95,8 @@ export default {
personSessionMixin,
modelMixin,
modelUtilsMixin,
tableMixin // covers pagination and sorting
tableMixin, // covers pagination and sorting
tagsMixin,
],
model: {
prop: 'person'
Expand Down
Loading
Loading