Unverified Commit 0960fa0e authored by Penar Musaraj's avatar Penar Musaraj
Browse files

UX: Randomize passwords, remove password inputs, disallow adding entry without a meeting ID

parent 04d29231
import Controller from "@ember/controller";
import ModalFunctionality from "discourse/mixins/modal-functionality";
import discourseComputed from "discourse-common/utils/decorators";
import { isEmpty } from "@ember/utils";
export default Controller.extend(ModalFunctionality, {
keyDown(e) {
......@@ -21,11 +23,26 @@ export default Controller.extend(ModalFunctionality, {
});
},
randomID() {
return Math.random()
.toString(36)
.slice(-8);
},
@discourseComputed("meetingID")
insertDisabled(meetingID) {
return isEmpty(meetingID);
},
actions: {
insert() {
const btnTxt = this.buttonText ? ` label="${this.buttonText}"` : "";
this.toolbarEvent.addText(
`[wrap=discourse-bbb meetingID="${this.meetingID}"${btnTxt} attendeePW="${this.attendeePW}" moderatorPW="${this.moderatorPW}" mobileIframe="${this.mobileIframe}" desktopIframe="${this.desktopIframe}"][/wrap]`
`[wrap=discourse-bbb meetingID="${
this.meetingID
}"${btnTxt} attendeePW="${this.randomID()}" moderatorPW="${this.randomID()}" mobileIframe="${
this.mobileIframe
}" desktopIframe="${this.desktopIframe}"][/wrap]`
);
this.send("closeModal");
},
......
......@@ -5,21 +5,11 @@
{{text-field value=meetingID}}
</div>
<div class="insert-bbb-input">
<div class="insert-bbb-input bbb-button-text">
<label>{{i18n "bbb.button_text"}}</label>
{{text-field value=buttonText placeholderKey="bbb.launch"}}
</div>
<div class="insert-bbb-input">
<label>{{i18n "bbb.attendeePW"}}</label>
{{text-field value=attendeePW}}
</div>
<div class="insert-bbb-input">
<label>{{i18n "bbb.moderatorPW"}}</label>
{{text-field value=moderatorPW}}
</div>
<div class="insert-bbb-input">
<label class='checkbox-label'>
{{input type="checkbox" checked=mobileIframe}}
......
......@@ -6,3 +6,7 @@
.bbb-status img {
margin-left: 0.5em;
}
.bbb-button-text {
margin-bottom: 1em;
}
......@@ -4,8 +4,6 @@ en:
composer_title: Add BigBlueButton
meetingID: Meeting ID
button_text: Button label (optional)
attendeePW: Attendee password
moderatorPW: Moderator password
launch: Start Video Conference
modal:
insert: Insert
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment