Skip to content

feat: Create team and permissions page #5027

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

Merged
merged 3 commits into from
Sep 9, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
3 changes: 3 additions & 0 deletions app/router.js
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,9 @@ Router.map(function() {
this.route('create');
});
this.route('scheduler');
this.route('team', function() {
this.route('permissions');
});
});
this.route('list', { path: '/:event_state' });
this.route('import');
Expand Down
8 changes: 3 additions & 5 deletions app/routes/events/view/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,10 @@ export default class extends Route.extend(EmberTableRouteMixin) {
const statisticsPromise = eventDetails.query('generalStatistics', {});
const orderStatPromise = eventDetails.query('orderStatistics', {});
const ticketsPromise = eventDetails.query('tickets', {});
const rolesPromise = this.store.findAll('role');

const [sponsors, roleInvites, sessionTypes, socialLinks,
statistics, orderStat, tickets, roles] = (await allSettled([sponsorsPromise, roleInvitesPromise, sessionTypesPromise, socialLinksPromise,
statisticsPromise, orderStatPromise, ticketsPromise, rolesPromise])).map(result => result.value);
statistics, orderStat, tickets] = (await allSettled([sponsorsPromise, roleInvitesPromise, sessionTypesPromise, socialLinksPromise,
statisticsPromise, orderStatPromise, ticketsPromise])).map(result => result.value);


return {
Expand All @@ -37,8 +36,7 @@ export default class extends Route.extend(EmberTableRouteMixin) {
socialLinks,
statistics,
orderStat,
tickets,
roles
tickets
};
}
}
9 changes: 9 additions & 0 deletions app/routes/events/view/team.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import Route from '@ember/routing/route';

export default class EventsViewTeam extends Route.extend({
// anything which *must* be merged to prototype here
}) {
titleToken(): string {
return this.l10n.t('Team');
}
}
16 changes: 16 additions & 0 deletions app/routes/events/view/team/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import Route from '@ember/routing/route';
import { hash } from 'rsvp';
import DS from 'ember-data';

export default class EventsViewTeamIndex extends Route.extend({
// anything which *must* be merged to prototype here
}) {
model(): unknown {
const event = this.modelFor('events.view') as DS.Store;
return hash({
event,
roleInvites : event.query('roleInvites', {}),
roles : this.store.findAll('role')
});
}
}
223 changes: 223 additions & 0 deletions app/routes/events/view/team/permissions.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,223 @@
import Route from '@ember/routing/route';

export default class EventsViewTeamPermissions extends Route.extend({
// anything which *must* be merged to prototype here
}) {
titleToken(): string {
return this.l10n.t('Permissions');
}

model() { // eslint-disable-line @typescript-eslint/explicit-module-boundary-types
return {
permissions: [
{
title : 'Manage Events Page',
header : true
},
{
title : 'Show event on manage events page',
owner : true,
organizer : true
},
{
title : 'Overview',
header : true
},
{
title : 'Update/Edit event',
owner : true,
organizer : true
},
{
title : 'View event dashboard',
owner : true,
organizer : true
},
{
title : 'Team',
header : true
},
{
title : 'View team members',
owner : true,
organizer : true
},
{
title : 'Invite team members',
owner : true,
organizer : true
},
{
title : 'Cancel invitations',
owner : true,
organizer : true
},
{
title : 'Delete team members',
owner : true,
organizer : true
},
{
title : 'Manage roles',
owner : true,
organizer : true
},
{
title : 'Tickets',
header : true
},
{
title : 'View orders and attendees',
owner : true,
organizer : true
},
{
title : 'Create discount codes',
owner : true,
organizer : true
},
{
title : 'Edit discount codes',
owner : true,
organizer : true
},
{
title : 'Create view codes',
owner : true,
organizer : true
},
{
title : 'Edit view codes',
owner : true,
organizer : true
},
{
title : 'Check-in attendees',
owner : true,
organizer : true
},
{
title : 'Change attendee check-in status',
owner : true,
organizer : true
},
{
title : 'Scheduler',
header : true
},
{
title : 'View scheduler',
owner : true,
organizer : true
},
{
title : 'Edit schedule',
owner : true,
organizer : true
},
{
title : 'Publish schedule',
owner : true,
organizer : true
},
{
title : 'Unpublish schedule',
owner : true,
organizer : true
},
{
title : 'Sessions and Speakers',
header : true
},
{
title : 'View speaker profiles',
owner : true,
organizer : true
},
{
title : 'Edit speaker profiles',
owner : true,
organizer : true
},
{
title : 'Create speaker profiles',
owner : true,
organizer : true
},
{
title : 'Feature speakers',
owner : true,
organizer : true
},
{
title : 'View session submissions',
owner : true,
organizer : true
},
{
title : 'Edit session submissions',
owner : true,
organizer : true
},
{
title : 'Create sessions',
owner : true,
organizer : true
},
{
title : 'Change session status',
owner : true,
organizer : true
},
{
title : 'Notify speakers of status change',
owner : true,
organizer : true
},
{
title : 'View ratings',
owner : true,
organizer : true
},
{
title : 'Rate session submissions',
owner : true,
organizer : true
},
{
title : 'Lock/Unlock session submissions',
owner : true,
organizer : true
},
{
title : 'Export',
header : true
},
{
title : 'View Export Info',
owner : true,
organizer : true
},
{
title : 'Settings',
header : true
},
{
title : 'View settings',
owner : true,
organizer : false
},
{
title : 'Delete event',
owner : true,
organizer : false
},
{
title : 'Transfer ownership',
owner : true,
organizer : false
}
]
};
}
}
63 changes: 37 additions & 26 deletions app/templates/components/events/view/overview/manage-roles.hbs
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
<div class="content">
<button class="ui right floated blue button" {{action 'openAddUserRoleModal'}}>{{t 'Add People'}}</button>
<div class="header">{{t 'Manage roles'}}</div>
<div class="content d-flex" style="align-items: center;">
<div class="header">{{t 'Team Members'}}</div>
{{#if @editable}}
<button class="ui blue button ml-auto" {{action 'openAddUserRoleModal'}}>{{t 'Add People'}}</button>
{{/if}}
{{#if @showLink}}
<LinkTo @route="events.view.team.index" class="item ml-auto">
<button class="ui blue button">{{t 'Edit'}}</button>
</LinkTo>
{{/if}}
</div>
<div class="content">
<button class="ui {{if (eq this.roleType 'accepted') 'active'}} button" {{action 'filter' 'accepted'}}>{{t 'Accepted'}}</button>
Expand All @@ -12,39 +19,43 @@
<tr>
<th>{{t 'User(Email)'}}</th>
<th>{{t 'Role'}}</th>
<th>{{t 'Options'}}</th>
{{#if editable}}
<th>{{t 'Options'}}</th>
{{/if}}
</tr>
</thead>
<tbody>
{{#each this.roleInvites as |roleInvite|}}
<tr>
<td>{{roleInvite.email}}</td>
<td>{{roleInvite.roleName}}</td>
<td>
<div class="ui horizontal compact basic buttons">
<UiPopup
@content={{t "Edit"}}
@class="ui icon button"
@click={{action "openAddUserRoleModal" roleInvite}}>
<i class="edit icon"></i>
</UiPopup>
{{#if (eq this.roleType 'accepted')}}
<UiPopup
@content={{t "Delete"}}
@class="ui icon button"
@click={{action (confirm (t "Are you sure you would like to delete this role?") (action "deleteUserRole" roleInvite))}}>
<i class="trash icon"></i>
</UiPopup>
{{else}}
{{#if @editable}}
<td>
<div class="ui horizontal compact basic buttons">
<UiPopup
@content={{t "Delete"}}
@content={{t "Edit"}}
@class="ui icon button"
@click={{action (confirm (t "Are you sure you would like to cancel this invite?") (action "deleteUserRole" roleInvite))}}>
<i class="trash icon"></i>
@click={{action "openAddUserRoleModal" roleInvite}}>
<i class="edit icon"></i>
</UiPopup>
{{/if}}
</div>
</td>
{{#if (eq this.roleType 'accepted')}}
<UiPopup
@content={{t "Delete"}}
@class="ui icon button"
@click={{action (confirm (t "Are you sure you would like to delete this role?") (action "deleteUserRole" roleInvite))}}>
<i class="trash icon"></i>
</UiPopup>
{{else}}
<UiPopup
@content={{t "Delete"}}
@class="ui icon button"
@click={{action (confirm (t "Are you sure you would like to cancel this invite?") (action "deleteUserRole" roleInvite))}}>
<i class="trash icon"></i>
</UiPopup>
{{/if}}
</div>
</td>
{{/if}}
</tr>
{{else}}
<div class="ui basic segment">
Expand Down
2 changes: 1 addition & 1 deletion app/templates/components/modals/add-user-role-modal.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
</div>
<div class="menu">
{{#each this.data.roles as |role|}}
{{#if (not-eq role.name 'owner')}}
{{#if (eq role.name 'organizer')}}
<div class="item" data-value="{{map-value mapper role}}">
{{role.name}}
</div>
Expand Down
3 changes: 3 additions & 0 deletions app/templates/events/view.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,9 @@
<LinkTo @route="events.view.speakers" class="item">
{{t 'Speakers'}}
</LinkTo>
<LinkTo @route="events.view.team" class="item">
{{t 'Team'}}
</LinkTo>
<LinkTo @route="events.view.export" class="item">
{{t 'Export'}}
</LinkTo>
Expand Down
2 changes: 1 addition & 1 deletion app/templates/events/view/index.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<Events::View::Overview::GeneralInfo @data={{this.model}} />
</div>
<div class="eight wide column">
<Events::View::Overview::ManageRoles @data={{this.model}} />
<Events::View::Overview::ManageRoles @data={{this.model}} @showLink={{true}} />
</div>
<div class="eight wide column">
<Events::View::Overview::EventSponsors
Expand Down
Loading