FEATURE: Enable contact picker on new invite modal (#12364)

This commit is contained in:
Rafael dos Santos Silva 2021-03-11 17:10:18 -03:00 committed by GitHub
parent 7036346965
commit 52810713d3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 17 additions and 1 deletions

View File

@ -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]);
});
},
}
);

View File

@ -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}}

View File

@ -856,7 +856,8 @@
input[type="text"] {
width: 100%;
&.invite-link {
&.invite-link,
&#invite-email {
width: 85%;
}
}