Skip to content

Commit

Permalink
Rename Concierge to Promoter. Resolves #1015 (#1017)
Browse files Browse the repository at this point in the history
  • Loading branch information
jace authored Feb 2, 2021
1 parent aa2724c commit 65764f9
Show file tree
Hide file tree
Showing 29 changed files with 147 additions and 120 deletions.
6 changes: 3 additions & 3 deletions funnel/assets/cypress/fixtures/user.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@
"username": "admin-user",
"password": "admin-user129_Ftz"
},
"concierge": {
"username": "concierge-user",
"password": "concierge-user34_qQE"
"promoter": {
"username": "promoter-user",
"password": "promoter-user34_qQE"
},
"usher": {
"username": "usher-cypress",
Expand Down
4 changes: 2 additions & 2 deletions funnel/assets/cypress/integration/04_addCrewtoProject.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
describe('Adding crew', function () {
const owner = require('../fixtures/user.json').owner;
const admin = require('../fixtures/user.json').admin;
const concierge = require('../fixtures/user.json').concierge;
const promoter = require('../fixtures/user.json').promoter;
const usher = require('../fixtures/user.json').usher;
const editor = require('../fixtures/user.json').editor;
const hguser = require('../fixtures/user.json').hguser;
Expand All @@ -25,7 +25,7 @@ describe('Adding crew', function () {
.find('[data-cy="role"]')
.contains('Editor');

cy.add_member(concierge.username, 'concierge');
cy.add_member(promoter.username, 'promoter');
cy.add_member(usher.username, 'usher');
cy.add_member(editor.username, 'editor');
cy.add_member(hguser.username, 'usher', (fail = true));
Expand Down
8 changes: 4 additions & 4 deletions funnel/assets/cypress/integration/15_verifyConciergeRoles.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
describe('Verify roles of concierge', function () {
const concierge = require('../fixtures/user.json').concierge;
describe('Verify roles of promoter', function () {
const promoter = require('../fixtures/user.json').promoter;
const project = require('../fixtures/project.json');

it('Access available for concierge in project settings', function () {
cy.login('/', concierge.username, concierge.password);
it('Access available for promoter in project settings', function () {
cy.login('/', promoter.username, promoter.password);

cy.get('[data-cy-title="' + project.title + '"]')
.first()
Expand Down
4 changes: 2 additions & 2 deletions funnel/assets/cypress/integration/16_setupEvent.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
describe('Setup ticketed event for checkin', function () {
const concierge = require('../fixtures/user.json').concierge;
const promoter = require('../fixtures/user.json').promoter;
const project = require('../fixtures/project.json');
const ticketEvents = require('../fixtures/ticket_events.json');
const ticketParticipants = require('../fixtures/ticket_participants.json');

it('Setup ticketed event for checkin', function () {
cy.login('/', concierge.username, concierge.password);
cy.login('/', promoter.username, promoter.password);

cy.get('[data-cy-title="' + project.title + '"]')
.first()
Expand Down
4 changes: 2 additions & 2 deletions funnel/assets/cypress/integration/17_synctickets.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
describe('Sync tickets from Boxoffice', function () {
const concierge = require('../fixtures/user.json').concierge;
const promoter = require('../fixtures/user.json').promoter;
const user = require('../fixtures/user.json').user;
const project = require('../fixtures/project.json');
const ticketEvents = require('../fixtures/ticket_events.json');
const { ticket_client } = require('../fixtures/boxoffice.js');

it('Sync tickets from Boxoffice', function () {
cy.login('/', concierge.username, concierge.password);
cy.login('/', promoter.username, promoter.password);

cy.get('[data-cy-title="' + project.title + '"]')
.first()
Expand Down
4 changes: 2 additions & 2 deletions funnel/assets/cypress/integration/18_checkin.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
describe('Checkin of attendees', function () {
const concierge = require('../fixtures/user.json').concierge;
const promoter = require('../fixtures/user.json').promoter;
const user = require('../fixtures/user.json').user;
const profile = require('../fixtures/profile.json');
const project = require('../fixtures/project.json');
const ticketEvents = require('../fixtures/ticket_events.json');
const ticketParticipants = require('../fixtures/ticket_participants.json');

it('Checkin of attendees', function () {
cy.login('/', concierge.username, concierge.password);
cy.login('/', promoter.username, promoter.password);

cy.get('[data-cy-title="' + project.title + '"]')
.first()
Expand Down
4 changes: 2 additions & 2 deletions funnel/assets/cypress/integration/22_verifyattendeeList.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
describe('Verify attendee list', function () {
const concierge = require('../fixtures/user.json').concierge;
const promoter = require('../fixtures/user.json').promoter;
const user = require('../fixtures/user.json').user;
const project = require('../fixtures/project.json');

it('Verify list of attendees who have responded yes to attending a project', function () {
cy.login('/testcypressproject', concierge.username, concierge.password);
cy.login('/testcypressproject', promoter.username, promoter.password);

cy.get('[data-cy-title="' + project.title + '"]')
.first()
Expand Down
6 changes: 3 additions & 3 deletions funnel/assets/cypress/integration/27_viewCrew.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
describe('View crew', function () {
const admin = require('../fixtures/user.json').admin;
const concierge = require('../fixtures/user.json').concierge;
const promoter = require('../fixtures/user.json').promoter;
const usher = require('../fixtures/user.json').usher;
const project = require('../fixtures/project.json');

Expand All @@ -19,10 +19,10 @@ describe('View crew', function () {
.find('[data-cy="role"]')
.contains('Editor');
cy.get('[data-cy="member"]')
.contains(concierge.username)
.contains(promoter.username)
.parents('.member')
.find('[data-cy="role"]')
.contains('Concierge');
.contains('Promoter');
cy.get('[data-cy="member"]')
.contains(usher.username)
.parents('.member')
Expand Down
4 changes: 2 additions & 2 deletions funnel/assets/js/event.js
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ const Queue = function (queueName) {

const ParticipantTable = {
init({
isConcierge,
IsPromoter,
isUsher,
checkinUrl,
participantlistUrl,
Expand All @@ -119,7 +119,7 @@ const ParticipantTable = {
checkinUrl,
checkinQ: new Queue(`${ticketEventName}-checkin-queue`),
cancelcheckinQ: new Queue(`${ticketEventName}-cancelcheckin-queue`),
isConcierge,
IsPromoter,
isUsher,
getCsrfToken() {
return $('meta[name="csrf-token"]').attr('content');
Expand Down
2 changes: 1 addition & 1 deletion funnel/assets/js/membership.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ const Membership = {
rolesCount(member) {
let count = 0;
if (member.is_editor) count += 1;
if (member.is_concierge) count += 1;
if (member.is_promoter) count += 1;
if (member.is_usher) count += 1;
return count - 1;
},
Expand Down
6 changes: 3 additions & 3 deletions funnel/forms/membership.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,8 @@ class ProjectCrewMembershipForm(forms.Form):
"Can edit project details, proposal guidelines, schedule, labels and venues"
),
)
is_concierge = forms.BooleanField(
__("Concierge"),
is_promoter = forms.BooleanField(
__("Promoter"),
default=False,
description=__("Can manage participants and see contact info"),
)
Expand All @@ -63,7 +63,7 @@ class ProjectCrewMembershipForm(forms.Form):

def validate(self, extra_validators=None):
is_valid = super(ProjectCrewMembershipForm, self).validate(extra_validators)
if not any([self.is_editor.data, self.is_concierge.data, self.is_usher.data]):
if not any([self.is_editor.data, self.is_promoter.data, self.is_usher.data]):
self.is_usher.errors.append("Please select one or more roles")
is_valid = False
return is_valid
Expand Down
4 changes: 2 additions & 2 deletions funnel/models/notification_types.py
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,7 @@ class ProposalReceivedNotification(DocumentHasProfile, Notification):


class RegistrationReceivedNotification(DocumentHasProfile, Notification):
"""Notification to concierges of new registrations."""
"""Notification to promoters of new registrations."""

__mapper_args__ = {'polymorphic_identity': 'rsvp_received'}
active = False
Expand All @@ -241,7 +241,7 @@ class RegistrationReceivedNotification(DocumentHasProfile, Notification):

document: Project
fragment: Rsvp
roles = ['project_concierge']
roles = ['project_promoter']
exclude_actor = True


Expand Down
6 changes: 3 additions & 3 deletions funnel/models/project.py
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ class Project(UuidMixin, BaseScopedNameMixin, db.Model):
db.Column(JsonDict, nullable=False, server_default='{}'),
# This is an attribute, but we deliberately use `call` instead of `read` to
# block this from dictionary enumeration. FIXME: Break up this dictionary into
# individual columns with `all` access for ticket embed id and `concierge`
# individual columns with `all` access for ticket embed id and `promoter`
# access for ticket sync access token.
call={'all'},
)
Expand Down Expand Up @@ -410,13 +410,13 @@ def __init__(self, **kwargs) -> None:
super(Project, self).__init__(**kwargs)
self.voteset = Voteset(settype=SET_TYPE.PROJECT)
self.commentset = Commentset(settype=SET_TYPE.PROJECT)
# Add the creator as editor and concierge
# Add the creator as editor and promoter
new_membership = ProjectCrewMembership(
parent=self,
user=self.user,
granted_by=self.user,
is_editor=True,
is_concierge=True,
is_promoter=True,
)
db.session.add(new_membership)

Expand Down
30 changes: 15 additions & 15 deletions funnel/models/project_membership.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
# Roles in a project and their remapped names in objects attached to a project
project_child_role_map: Dict[str, str] = {
'editor': 'project_editor',
'concierge': 'project_concierge',
'promoter': 'project_promoter',
'usher': 'project_usher',
'crew': 'project_crew',
'participant': 'project_participant',
Expand All @@ -30,11 +30,11 @@ class ProjectCrewMembership(ImmutableMembershipMixin, db.Model):
__tablename__ = 'project_crew_membership'

# List of is_role columns in this model
__data_columns__ = ('is_editor', 'is_concierge', 'is_usher')
__data_columns__ = ('is_editor', 'is_promoter', 'is_usher')

__roles__ = {
'all': {
'read': {'urls', 'user', 'is_editor', 'is_concierge', 'is_usher', 'project'}
'read': {'urls', 'user', 'is_editor', 'is_promoter', 'is_usher', 'project'}
}
}
__datasets__ = {
Expand All @@ -43,7 +43,7 @@ class ProjectCrewMembership(ImmutableMembershipMixin, db.Model):
'uuid_b58',
'offered_roles',
'is_editor',
'is_concierge',
'is_promoter',
'is_usher',
'user',
'project',
Expand All @@ -53,7 +53,7 @@ class ProjectCrewMembership(ImmutableMembershipMixin, db.Model):
'uuid_b58',
'offered_roles',
'is_editor',
'is_concierge',
'is_promoter',
'is_usher',
'user',
},
Expand All @@ -62,7 +62,7 @@ class ProjectCrewMembership(ImmutableMembershipMixin, db.Model):
'uuid_b58',
'offered_roles',
'is_editor',
'is_concierge',
'is_promoter',
'is_usher',
},
}
Expand All @@ -85,10 +85,10 @@ class ProjectCrewMembership(ImmutableMembershipMixin, db.Model):

#: Editors can edit all common and editorial details of an event
is_editor = db.Column(db.Boolean, nullable=False, default=False)
#: Concierges are responsible for logistics and have write access
#: Promoters are responsible for promotion and have write access
#: to common details plus read access to everything else. Unlike
#: editors, they cannot edit the schedule
is_concierge = db.Column(db.Boolean, nullable=False, default=False)
is_promoter = db.Column(db.Boolean, nullable=False, default=False)
#: Ushers help participants find their way around an event and have
#: the ability to scan badges at the door
is_usher = db.Column(db.Boolean, nullable=False, default=False)
Expand All @@ -101,7 +101,7 @@ def __table_args__(cls):
db.CheckConstraint(
db.or_(
cls.is_editor.is_(True),
cls.is_concierge.is_(True),
cls.is_promoter.is_(True),
cls.is_usher.is_(True),
),
name='project_crew_membership_has_role',
Expand All @@ -115,8 +115,8 @@ def offered_roles(self):
roles = set()
if self.is_editor:
roles.add('editor')
if self.is_concierge:
roles.add('concierge')
if self.is_promoter:
roles.add('promoter')
if self.is_usher:
roles.add('usher')
roles.add('crew')
Expand Down Expand Up @@ -145,7 +145,7 @@ class Project: # type: ignore[no-redef] # skipcq: PYL-E0102
),
viewonly=True,
),
grants_via={'user': {'editor', 'concierge', 'usher', 'participant', 'crew'}},
grants_via={'user': {'editor', 'promoter', 'usher', 'participant', 'crew'}},
)

active_editor_memberships = db.relationship(
Expand All @@ -159,13 +159,13 @@ class Project: # type: ignore[no-redef] # skipcq: PYL-E0102
viewonly=True,
)

active_concierge_memberships = db.relationship(
active_promoter_memberships = db.relationship(
ProjectCrewMembership,
lazy='dynamic',
primaryjoin=db.and_(
ProjectCrewMembership.project_id == Project.id,
ProjectCrewMembership.is_active,
ProjectCrewMembership.is_concierge.is_(True),
ProjectCrewMembership.is_promoter.is_(True),
),
viewonly=True,
)
Expand All @@ -183,7 +183,7 @@ class Project: # type: ignore[no-redef] # skipcq: PYL-E0102

crew = DynamicAssociationProxy('active_crew_memberships', 'user')
editors = DynamicAssociationProxy('active_editor_memberships', 'user')
concierges = DynamicAssociationProxy('active_concierge_memberships', 'user')
promoters = DynamicAssociationProxy('active_promoter_memberships', 'user')
ushers = DynamicAssociationProxy('active_usher_memberships', 'user')


Expand Down
10 changes: 5 additions & 5 deletions funnel/models/rsvp.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ class Rsvp(UuidMixin, NoIdMixin, db.Model):
db.relationship(
Project, backref=db.backref('rsvps', cascade='all', lazy='dynamic')
),
read={'owner', 'project_concierge'},
read={'owner', 'project_promoter'},
grants_via={None: project_child_role_map},
)
user_id = db.Column(
Expand All @@ -46,7 +46,7 @@ class Rsvp(UuidMixin, NoIdMixin, db.Model):
db.relationship(
User, backref=db.backref('rsvps', cascade='all', lazy='dynamic')
),
read={'owner', 'project_concierge'},
read={'owner', 'project_promoter'},
grants={'owner'},
)

Expand All @@ -59,12 +59,12 @@ class Rsvp(UuidMixin, NoIdMixin, db.Model):
)
state = with_roles(
StateManager('_state', RSVP_STATUS, doc="RSVP answer"),
call={'owner', 'project_concierge'},
call={'owner', 'project_promoter'},
)

__datasets__ = {'primary': {'project', 'user', 'response'}, 'related': {'response'}}

@with_roles(read={'owner', 'project_concierge'}) # type: ignore[misc]
@with_roles(read={'owner', 'project_promoter'}) # type: ignore[misc]
@property
def response(self):
"""Return RSVP response as a raw value."""
Expand Down Expand Up @@ -105,7 +105,7 @@ def rsvp_no(self, unsubscribe_comments: bool = False):
def rsvp_maybe(self):
pass

@with_roles(call={'owner', 'project_concierge'})
@with_roles(call={'owner', 'project_promoter'})
def user_email(self):
"""User's preferred email address for this registration."""
return self.user.transport_for_email(self.project.profile)
Expand Down
Loading

0 comments on commit 65764f9

Please sign in to comment.