FEATURE: Enable contact picker on new invite modal (#12364)
This commit is contained in:
parent
7036346965
commit
52810713d3
|
@ -5,6 +5,7 @@ import discourseComputed from "discourse-common/utils/decorators";
|
|||
import { extractError } from "discourse/lib/ajax-error";
|
||||
import { bufferedProperty } from "discourse/mixins/buffered-content";
|
||||
import ModalFunctionality from "discourse/mixins/modal-functionality";
|
||||
import { getNativeContact } from "discourse/lib/pwa-utils";
|
||||
import Group from "discourse/models/group";
|
||||
import Invite from "discourse/models/invite";
|
||||
import I18n from "I18n";
|
||||
|
@ -161,5 +162,12 @@ export default Controller.extend(
|
|||
|
||||
this.save({ sendEmail });
|
||||
},
|
||||
|
||||
@action
|
||||
searchContact() {
|
||||
getNativeContact(this.capabilities, ["email"], false).then((result) => {
|
||||
this.set("buffered.email", result[0].email[0]);
|
||||
});
|
||||
},
|
||||
}
|
||||
);
|
||||
|
|
|
@ -44,6 +44,13 @@
|
|||
value=buffered.email
|
||||
placeholderKey="topic.invite_reply.email_placeholder"
|
||||
}}
|
||||
{{#if capabilities.hasContactPicker}}
|
||||
{{d-button
|
||||
icon="address-book"
|
||||
action=(action "searchContact")
|
||||
class="btn-primary open-contact-picker"
|
||||
}}
|
||||
{{/if}}
|
||||
</div>
|
||||
{{/if}}
|
||||
|
||||
|
|
|
@ -856,7 +856,8 @@
|
|||
input[type="text"] {
|
||||
width: 100%;
|
||||
|
||||
&.invite-link {
|
||||
&.invite-link,
|
||||
&#invite-email {
|
||||
width: 85%;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue