mirror of
https://github.com/discourse/discourse.git
synced 2025-03-23 01:06:40 +08:00
FEATURE: Enable contact picker on new invite modal (#12364)
This commit is contained in:
parent
7036346965
commit
52810713d3
app/assets
javascripts/discourse/app
stylesheets/common/base
@ -5,6 +5,7 @@ import discourseComputed from "discourse-common/utils/decorators";
|
|||||||
import { extractError } from "discourse/lib/ajax-error";
|
import { extractError } from "discourse/lib/ajax-error";
|
||||||
import { bufferedProperty } from "discourse/mixins/buffered-content";
|
import { bufferedProperty } from "discourse/mixins/buffered-content";
|
||||||
import ModalFunctionality from "discourse/mixins/modal-functionality";
|
import ModalFunctionality from "discourse/mixins/modal-functionality";
|
||||||
|
import { getNativeContact } from "discourse/lib/pwa-utils";
|
||||||
import Group from "discourse/models/group";
|
import Group from "discourse/models/group";
|
||||||
import Invite from "discourse/models/invite";
|
import Invite from "discourse/models/invite";
|
||||||
import I18n from "I18n";
|
import I18n from "I18n";
|
||||||
@ -161,5 +162,12 @@ export default Controller.extend(
|
|||||||
|
|
||||||
this.save({ sendEmail });
|
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
|
value=buffered.email
|
||||||
placeholderKey="topic.invite_reply.email_placeholder"
|
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>
|
</div>
|
||||||
{{/if}}
|
{{/if}}
|
||||||
|
|
||||||
|
@ -856,7 +856,8 @@
|
|||||||
input[type="text"] {
|
input[type="text"] {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
|
|
||||||
&.invite-link {
|
&.invite-link,
|
||||||
|
&#invite-email {
|
||||||
width: 85%;
|
width: 85%;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user