FIX: Styling for feature topic on profile modal (#8727)

This commit is contained in:
Mark VanLandingham
2020-01-15 15:20:12 -06:00
committed by GitHub
parent f8e92298f2
commit 135d09d671
9 changed files with 27 additions and 20 deletions

View File

@ -13,6 +13,10 @@ export default Controller.extend(ModalFunctionality, {
this.set("newFeaturedTopic", null); this.set("newFeaturedTopic", null);
}, },
onShow() {
this.set("modal.modalClass", "choose-topic-modal");
},
actions: { actions: {
save() { save() {
return ajax(`/u/${this.model.username}/feature-topic`, { return ajax(`/u/${this.model.username}/feature-topic`, {

View File

@ -74,7 +74,7 @@ export default Controller.extend(ModalFunctionality, {
onShow() { onShow() {
this.setProperties({ this.setProperties({
"modal.modalClass": "move-to-modal", "modal.modalClass": "choose-topic-modal",
saving: false, saving: false,
selection: "new_topic", selection: "new_topic",
categoryId: null, categoryId: null,

View File

@ -1,4 +1,4 @@
{{#d-modal-body class="feature-topic-on-profile"}} {{#d-modal-body class="feature-topic-on-profile" id='choosing-topic'}}
{{choose-topic currentTopicId=model.featured_topic.id {{choose-topic currentTopicId=model.featured_topic.id
selectedTopicId=newFeaturedTopicId selectedTopicId=newFeaturedTopicId
additionalFilters="in:created status:public" additionalFilters="in:created status:public"
@ -6,8 +6,11 @@
topicChangedCallback=(action "newTopicSelected") topicChangedCallback=(action "newTopicSelected")
loadOnInit=true loadOnInit=true
}} }}
{{/d-modal-body}}
<div class="modal-footer">
{{d-button action=(action "save") {{d-button action=(action "save")
class="btn-primary save-featured-topic-on-profile" class="btn-primary save-featured-topic-on-profile"
disabled=noTopicSelected disabled=noTopicSelected
label="user.feature_topic_on_profile.save"}} label="user.feature_topic_on_profile.save"}}
{{/d-modal-body}} </div>

View File

@ -1,4 +1,4 @@
{{#d-modal-body id='move-selected'}} {{#d-modal-body id='choosing-topic'}}
{{#if model.isPrivateMessage}} {{#if model.isPrivateMessage}}
<div class="radios"> <div class="radios">

View File

@ -68,7 +68,7 @@
<div> <div>
{{d-button action=(action "showFeaturedTopicModal") {{d-button action=(action "showFeaturedTopicModal")
class="btn-primary feature-topic-on-profile-btn" class="btn-default feature-topic-on-profile-btn"
label="user.feature_topic_on_profile.open_search"}} label="user.feature_topic_on_profile.open_search"}}
{{#if model.featured_topic}} {{#if model.featured_topic}}
{{d-button action=(action "clearFeaturedTopicFromProfile") {{d-button action=(action "clearFeaturedTopicFromProfile")

View File

@ -619,7 +619,7 @@
} }
// move-to topic modal // move-to topic modal
.move-to-modal { .choose-topic-modal {
// move to existing topic // move to existing topic
.existing-topic { .existing-topic {
.radio { .radio {

View File

@ -110,13 +110,13 @@
} }
} }
.move-to-modal { .choose-topic-modal {
.modal-body { .modal-body {
position: relative; position: relative;
height: 350px; height: 350px;
} }
#move-selected { #choosing-topic {
// prevents content from moving when user selects different move options 525px // prevents content from moving when user selects different move options 525px
// is the same width we set on category edit modal // is the same width we set on category edit modal
width: 525px; width: 525px;

View File

@ -43,7 +43,7 @@
font-size: $font-up-4; font-size: $font-up-4;
} }
#move-selected { #choosing-topic {
p { p {
margin-top: 0; margin-top: 0;
} }

View File

@ -18,28 +18,28 @@ QUnit.test("default", async assert => {
await click(".selected-posts .move-to-topic"); await click(".selected-posts .move-to-topic");
assert.ok( assert.ok(
find(".move-to-modal .title") find(".choose-topic-modal .title")
.html() .html()
.includes(I18n.t("topic.move_to.title")), .includes(I18n.t("topic.move_to.title")),
"it opens move to modal" "it opens move to modal"
); );
assert.ok( assert.ok(
find(".move-to-modal .radios") find(".choose-topic-modal .radios")
.html() .html()
.includes(I18n.t("topic.split_topic.radio_label")), .includes(I18n.t("topic.split_topic.radio_label")),
"it shows an option to move to new topic" "it shows an option to move to new topic"
); );
assert.ok( assert.ok(
find(".move-to-modal .radios") find(".choose-topic-modal .radios")
.html() .html()
.includes(I18n.t("topic.merge_topic.radio_label")), .includes(I18n.t("topic.merge_topic.radio_label")),
"it shows an option to move to existing topic" "it shows an option to move to existing topic"
); );
assert.ok( assert.ok(
find(".move-to-modal .radios") find(".choose-topic-modal .radios")
.html() .html()
.includes(I18n.t("topic.move_to_new_message.radio_label")), .includes(I18n.t("topic.move_to_new_message.radio_label")),
"it shows an option to move to new message" "it shows an option to move to new message"
@ -54,28 +54,28 @@ QUnit.test("moving all posts", async assert => {
await click(".selected-posts .move-to-topic"); await click(".selected-posts .move-to-topic");
assert.ok( assert.ok(
find(".move-to-modal .title") find(".choose-topic-modal .title")
.html() .html()
.includes(I18n.t("topic.move_to.title")), .includes(I18n.t("topic.move_to.title")),
"it opens move to modal" "it opens move to modal"
); );
assert.not( assert.not(
find(".move-to-modal .radios") find(".choose-topic-modal .radios")
.html() .html()
.includes(I18n.t("topic.split_topic.radio_label")), .includes(I18n.t("topic.split_topic.radio_label")),
"it does not show an option to move to new topic" "it does not show an option to move to new topic"
); );
assert.ok( assert.ok(
find(".move-to-modal .radios") find(".choose-topic-modal .radios")
.html() .html()
.includes(I18n.t("topic.merge_topic.radio_label")), .includes(I18n.t("topic.merge_topic.radio_label")),
"it shows an option to move to existing topic" "it shows an option to move to existing topic"
); );
assert.not( assert.not(
find(".move-to-modal .radios") find(".choose-topic-modal .radios")
.html() .html()
.includes(I18n.t("topic.move_to_new_message.radio_label")), .includes(I18n.t("topic.move_to_new_message.radio_label")),
"it does not show an option to move to new message" "it does not show an option to move to new message"
@ -99,21 +99,21 @@ QUnit.test("moving posts from personal message", async assert => {
await click(".selected-posts .move-to-topic"); await click(".selected-posts .move-to-topic");
assert.ok( assert.ok(
find(".move-to-modal .title") find(".choose-topic-modal .title")
.html() .html()
.includes(I18n.t("topic.move_to.title")), .includes(I18n.t("topic.move_to.title")),
"it opens move to modal" "it opens move to modal"
); );
assert.ok( assert.ok(
find(".move-to-modal .radios") find(".choose-topic-modal .radios")
.html() .html()
.includes(I18n.t("topic.move_to_new_message.radio_label")), .includes(I18n.t("topic.move_to_new_message.radio_label")),
"it shows an option to move to new message" "it shows an option to move to new message"
); );
assert.ok( assert.ok(
find(".move-to-modal .radios") find(".choose-topic-modal .radios")
.html() .html()
.includes(I18n.t("topic.move_to_existing_message.radio_label")), .includes(I18n.t("topic.move_to_existing_message.radio_label")),
"it shows an option to move to existing message" "it shows an option to move to existing message"