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

fix-9126: Delete option to show events on the current day #9146

Closed
wants to merge 15 commits into from
Closed
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
18 changes: 18 additions & 0 deletions app/components/nav-bar.js
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,23 @@ export default class NavBar extends Component {
return !(String(this.session.currentRouteName).includes('events.view'));
}

@computed('isNotPublicPageRoute')
get checkShowClassCssPublic() {
if (this.session.isAuthenticated) {
if (this.isNotPublicPageRoute) {
return 'au-home-page';
} else {
return 'au-public-page';
}
} else {
if (this.isNotPublicPageRoute) {
return 'un-home-page';
} else {
return 'un-public-page';
}
}
}

@action
handleKeyPress() {
if (event.keyCode === 13 || event.which === 13) {
Expand Down Expand Up @@ -120,6 +137,7 @@ export default class NavBar extends Component {
});
}


@action
handleClick() {
this.router.replaceWith('public.index', this.globalData.idEvent);
Expand Down
2 changes: 1 addition & 1 deletion app/components/public/stream/side-panel.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@
<div class="chat-video-room">
<div>
<div class="ui inverted vertical fluid menu borderless stream-side-menu">
{{#each this.streams as |stream|}}
{{#each this.streamList as |stream|}}
<a href={{href-to 'public.stream.view' @event stream.slugName stream.id }} class="{{if (eq @currentRoom.microlocationId stream.microlocationId) 'video-active'}} item stream-item d-flex items-center" {{on "click" (fn @setupRoomChat stream) }} >
<span class="stream-preview-letter" style={{css background-color=(object-at (abs (mod stream.hash this.colors.length)) this.colors)}}>{{truncate (uppercase stream.name) 1 false}}</span>
<span class="ml-2">{{stream.name}}</span>
Expand Down
26 changes: 20 additions & 6 deletions app/components/public/stream/side-panel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ export default class PublicStreamSidePanel extends Component<Args> {
@tracked showChat = false;
@tracked showRoomChat = false;
@tracked showVideoRoom = false;
@tracked languageList: any = [];

@tracked translationChannels = [{
id : '0',
Expand Down Expand Up @@ -147,14 +148,22 @@ export default class PublicStreamSidePanel extends Component<Args> {
isGlobalEventRoom : rooms.data.filter((room: any) => room.relationships['video-stream'].data ? room.relationships['video-stream'].data.id === stream.id : null).map((room: any) => room.attributes['is-global-event-room'])[0],
chatRoomName : rooms.data.filter((room: any) => room.relationships['video-stream'].data ? room.relationships['video-stream'].data.id === stream.id : null).map((room: any) => room.attributes['chat-room-name'])[0],
microlocationId : rooms.data.filter((room: any) => room.relationships['video-stream'].data ? room.relationships['video-stream'].data.id === stream.id : null).map((room: any) => room.id)[0],
hash : stringHashCode(stream.attributes.name + stream.id)
})).forEach(async(stream: any) => {
hash : stringHashCode(stream.attributes.name + stream.id),
translations : []
})).forEach((stream: any) => {
this.addStream(stream)
});
this.streams.forEach(async(stream: any) => {
const res = await this.fetchTranslationChannels(stream.id)
stream.translations = res
});
const languageLists: any = [];
Promise.all(this.streams.map(async(stream: any) => {
const res = await this.fetchTranslationChannels(stream.id);
const item = {
streamId: stream.id
}
languageLists.push(item);
stream.translations = res;
})).then(() => {
this.languageList = languageLists;
})
} catch (e) {
console.error('Error while loading rooms in video stream', e);
}
Expand All @@ -174,4 +183,9 @@ export default class PublicStreamSidePanel extends Component<Args> {
this.loading = false;
this.streams = [...this.streams];
}

@computed('[email protected]')
get streamList() {
return this.streams;
}
}
15 changes: 6 additions & 9 deletions app/components/public/stream/video-stream.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -8,19 +8,16 @@
<iframe style="position: absolute;width: 100%; height: 100%; border: 0px;" src="{{this.iframeUrl}}" title="{{this.iframeTitle}}" allow="camera; microphone; display-capture" allowfullscreen="true"/>
{{/if}}

{{#if this.selectingLanguage.selectingLanguage}}

<iframe style="position: absolute;width: 50%; height: 100%; z-index: -1" id="video-player-translation" width="50%" height="50%" frameborder="0" title="YouTube Live Stream Translation"
src="https://www.youtube.com/embed/{{this.selectingLanguage.translationYoutubeId}}?enablejsapi=1&autoplay=1&modestbranding=1&loop=1&controls=0&disablekb=1"
gesture="media" allow="autoplay; encrypted-media" allowfullscreen="true"></iframe>
{{/if}}

{{#if (eq @videoStream.videoChannel.provider 'jitsi')}}
<Public::Stream::JitsiStream @videoStream={{@videoStream}} />
{{/if}}
{{#if (eq this.provider 'youtube')}}
<iframe style="position: absolute;width: 100%; height: 100%;" id="video-player" width="50%" height="50%" frameborder="0" title="YouTube Live Stream"
src="https://www.youtube.com/embed/{{this.youtubeId}}?enablejsapi=1&playlist={{this.youtubeId}}&autoplay=1&modestbranding=1&loop={{if @videoStream.extra.loop 1 0}}&mute={{if (eq this.selectingLanguage.selectingLanguage null) 0 1}}&controls=0&disablekb=1"
<iframe
style="position: absolute; width: 100%; height: 100%;"
id="video-player"
frameborder="0"
title="YouTube Live Stream"
src="https://www.youtube.com/embed/{{this.youtubeId}}?enablejsapi=1&playlist={{this.youtubeId}}&autoplay=1&modestbranding=1&loop={{if @videoStream.extra.loop 1 0}}&controls=0&disablekb=1"
gesture="media" allow="autoplay; encrypted-media" allowfullscreen="true"></iframe>
{{/if}}
{{#if (and (eq @videoStream.videoChannel.provider 'vimeo') this.vimeoId)}}
Expand Down
62 changes: 62 additions & 0 deletions app/controllers/events/view/tickets/attendees.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,19 @@ import classic from 'ember-classic-decorator';
import { action } from '@ember/object';
import Controller from '@ember/controller';
import { run } from '@ember/runloop';
import { tracked } from '@glimmer/tracking';

@classic
export default class AttendeesController extends Controller {
isLoadingcsv = false;
isLoadingpdf = false;

@tracked
start_date = this.router.currentRoute.queryParams?.start_date;

@tracked
end_date = this.router.currentRoute.queryParams?.end_date;

@action
export(mode) {
this.set(`isLoading${mode}`, true);
Expand All @@ -23,6 +30,61 @@ export default class AttendeesController extends Controller {
});
}

@action
attendeeFilter(name) {
if (name === 'date') {
if (!this.start_date || !this.end_date) {
this.router.transitionTo('events.view.tickets.attendees.list', {
queryParams: {
filter: name
}
});
return;
}
this.router.transitionTo('events.view.tickets.attendees.list', {
queryParams: {
start_date : this.start_date,
end_date : this.end_date,
filter : name
}
});
} else {
this.router.transitionTo('events.view.tickets.attendees.list', {
queryParams: {
filter: name
}
});
}
}

@action
onChangeStartDate() {
if (!this.end_date) {
return;
}
this.router.transitionTo('events.view.tickets.attendees.list', {
queryParams: {
start_date : this.start_date,
end_date : this.end_date,
filter : 'date'
}
});
}

@action
onChangeEndDate() {
if (!this.start_date) {
return;
}
this.router.transitionTo('events.view.tickets.attendees.list', {
queryParams: {
start_date : this.start_date,
end_date : this.end_date,
filter : 'date'
}
});
}

requestLoop(exportJobInfo, mode) {
run.later(() => {
this.loader
Expand Down
62 changes: 62 additions & 0 deletions app/controllers/events/view/tickets/orders.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,19 @@ import classic from 'ember-classic-decorator';
import { action } from '@ember/object';
import Controller from '@ember/controller';
import { run } from '@ember/runloop';
import { tracked } from '@glimmer/tracking';

@classic
export default class OrdersController extends Controller {
isLoadingcsv = false;
isLoadingpdf = false;

@tracked
start_date = this.router.currentRoute.queryParams?.start_date;

@tracked
end_date = this.router.currentRoute.queryParams?.end_date;

@action
export(mode) {
this.set(`isLoading${mode}`, true);
Expand All @@ -23,6 +30,61 @@ export default class OrdersController extends Controller {
});
}

@action
orderFilter(name) {
if (name === 'date') {
if (!this.start_date || !this.end_date) {
this.router.transitionTo('events.view.tickets.orders.list', {
queryParams: {
filter: name
}
});
return;
}
this.router.transitionTo('events.view.tickets.orders.list', {
queryParams: {
start_date : this.start_date,
end_date : this.end_date,
filter : name
}
});
} else {
this.router.transitionTo('events.view.tickets.orders.list', {
queryParams: {
filter: name
}
});
}
}

@action
onChangeStartDate() {
if (!this.end_date) {
return;
}
this.router.transitionTo('events.view.tickets.orders.list', {
queryParams: {
start_date : this.start_date,
end_date : this.end_date,
filter : 'date'
}
});
}

@action
onChangeEndDate() {
if (!this.start_date) {
return;
}
this.router.transitionTo('events.view.tickets.orders.list', {
queryParams: {
start_date : this.start_date,
end_date : this.end_date,
filter : 'date'
}
});
}

requestLoop(exportJobInfo, mode) {
run.later(() => {
this.loader
Expand Down
12 changes: 12 additions & 0 deletions app/helpers/value-field-link.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import { helper } from '@ember/component/helper';
import { htmlSafe } from '@ember/string';

export function valueFieldLink(data) {
let field = '';
if(data){
field = data;
}
return htmlSafe(field);
}

export default helper(valueFieldLink);
14 changes: 12 additions & 2 deletions app/mixins/ember-table-route.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,23 @@ export default Mixin.create({
search: {
refreshModel: true
},
filter: {
refreshModel: true
},
start_date: {
refreshModel: true
},
end_date: {
refreshModel: true
},
sort_dir: {
refreshModel: true
},
sort_by: {
refreshModel: true
}
},
per_page: 10,

applySearchFilters(options, params, searchFields) {
if (!Array.isArray(searchFields)) {
Expand Down Expand Up @@ -109,8 +119,8 @@ export default Mixin.create({
if (isNaN(params.search)) {
continue;
}
condition = 'eq';
value = params.search;
condition = params.search && Number(params.search) !== 0 ? 'eq' : 'is_';
value = params.search && Number(params.search) !== 0 ? params.search : null;
}
const filter = {
name : splitField[0],
Expand Down
1 change: 1 addition & 0 deletions app/models/video-stream.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ export default class VideoStream extends ModelBase.extend() {
@attr() additionalInformation!: string;
@attr() extra!: Extra;
@attr() chatRoomName?: string;
@attr() translations?: any[];

@hasMany('microlocation') rooms!: Microlocation[];
@hasMany('video-recording') videoRecordings!: VideoRecording[];
Expand Down
Loading