Skip to content

Feature-9082: Enhance language dropdown button #9131

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 23 commits into from Aug 18, 2023
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
2ae1b25
feature-9082: Enhance language dropdown button
nnhathung Aug 14, 2023
ea82eaf
feature-9082: Enhance language dropdown button
nnhathung Aug 14, 2023
da17766
Merge branch 'development' into nnhathung_tma/feature-9082
nnhathung Aug 14, 2023
bce4e15
fix css
nnhathung Aug 14, 2023
0682dcc
Merge branch 'development' into nnhathung_tma/feature-9082
nnhathung Aug 14, 2023
ff2268a
Merge branch 'development' into nnhathung_tma/feature-9082
khangon Aug 15, 2023
6df3e9c
fix UI
nnhathung Aug 15, 2023
1b3f796
fix missing header
nnhathung Aug 15, 2023
8098d93
fix missing header
nnhathung Aug 15, 2023
613025b
fix missing header
nnhathung Aug 15, 2023
8b97d2a
fix missing header
nnhathung Aug 15, 2023
8e2e0d2
fix missing header
nnhathung Aug 16, 2023
ab98598
Merge branch 'development' into nnhathung_tma/feature-9082
khangon Aug 16, 2023
ac63b55
fix missing header
nnhathung Aug 16, 2023
9bdb2bf
Merge branch 'nnhathung_tma/feature-9082' of github.com:lthanhhieu/op…
nnhathung Aug 16, 2023
85ae504
avoid using css inline
nnhathung Aug 16, 2023
7706e8a
feature-9082: Fix css dropdown side panel
ntthitrinh Aug 16, 2023
fdbe3b4
feature-9082: Fix css dropdown side panel
ntthitrinh Aug 16, 2023
c29dc32
feature-9082: Fix css dropdown side panel
ntthitrinh Aug 16, 2023
c6b7aca
fix-9082
nnhathung Aug 17, 2023
c7b6dd2
fix-9082
nnhathung Aug 17, 2023
34aa430
Merge branch 'development' into nnhathung_tma/feature-9082
nnhathung Aug 17, 2023
82544f1
Merge branch 'development' into nnhathung_tma/feature-9082
khangon Aug 17, 2023
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
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('languageList.@each.streamId')
get streamList() {
return this.streams;
}
}
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