diff --git a/app/assets/javascripts/app/views/publisher_view.js b/app/assets/javascripts/app/views/publisher_view.js index 48574bfe4..b3457916d 100644 --- a/app/assets/javascripts/app/views/publisher_view.js +++ b/app/assets/javascripts/app/views/publisher_view.js @@ -7,7 +7,6 @@ //= require ./publisher/services_view //= require ./publisher/aspect_selector_view -//= require ./publisher/aspect_selector_blueprint_view //= require ./publisher/getting_started_view //= require ./publisher/uploader_view //= require jquery-textchange @@ -97,6 +96,7 @@ app.views.Publisher = Backbone.View.extend({ }); this.initSubviews(); + this.checkSubmitAvailability(); return this; }, @@ -114,14 +114,9 @@ app.views.Publisher = Backbone.View.extend({ form: form }); - this.view_aspect_selector_blueprint = new app.views.PublisherAspectSelectorBlueprint({ - el: this.$('.public_toggle > .dropdown'), - form: form - }); - this.view_getting_started = new app.views.PublisherGettingStarted({ el_first_msg: this.el_input, - el_visibility: this.$('.public_toggle > .dropdown'), + el_visibility: this.$('.public_toggle .aspect_dropdown > .dropdown-toggle'), el_stream: $('#gs-shim') }); @@ -136,13 +131,11 @@ app.views.Publisher = Backbone.View.extend({ }); this.view_poll_creator.on('change', this.checkSubmitAvailability, this); this.view_poll_creator.render(); - }, // set the selected aspects in the dropdown by their ids setSelectedAspects: function(ids) { this.view_aspect_selector.updateAspectsSelector(ids); - this.view_aspect_selector_blueprint.updateAspectsSelector(ids); }, // inject content into the publisher textarea @@ -461,15 +454,23 @@ app.views.Publisher = Backbone.View.extend({ }, setButtonsEnabled: function(bool) { - bool = !bool; - this.el_submit.prop({disabled: bool}); - this.el_preview.prop({disabled: bool}); + if (bool) { + this.el_submit.removeProp('disabled'); + this.el_preview.removeProp('disabled'); + } else { + this.el_submit.prop('disabled', true); + this.el_preview.prop('disabled', true); + } }, setInputEnabled: function(bool) { - bool = !bool; - this.el_input.prop({disabled: bool}); - this.el_hiddenInput.prop({disabled: bool}); + if (bool) { + this.el_input.removeProp('disabled'); + this.el_hiddenInput.removeProp('disabled'); + } else { + this.el_input.prop('disabled', true); + this.el_hiddenInput.prop('disabled', true); + } }, // determine submit availability diff --git a/app/assets/stylesheets/colors.scss b/app/assets/stylesheets/colors.scss index e915ba9b8..caa7fa90c 100644 --- a/app/assets/stylesheets/colors.scss +++ b/app/assets/stylesheets/colors.scss @@ -15,6 +15,7 @@ $link-disabled-grey: #999999; $text-grey: #999999; $text-dark-grey: #666666; +$text: #333333; $white: white; $black: black; diff --git a/app/assets/stylesheets/invitations.scss b/app/assets/stylesheets/invitations.scss index 568e3c600..606f67dc4 100644 --- a/app/assets/stylesheets/invitations.scss +++ b/app/assets/stylesheets/invitations.scss @@ -5,19 +5,16 @@ } #invitationsModal { - #paste_link_wrapper { - font-size: 12px; - padding: 10px; + .modal-header, .modal-body { + color: $text; + font-size: 14px; + text-align: initial; } #paste_link { font-weight: 700; } - #invite_code { - padding: 5px; - display: block; - height: auto; - } + #invite_code { margin-top: 10px; } #codes_left { color: $text-grey; } - .control-label { width: 200px; } - .controls { margin-left: 220px; } + .control-label { width: 120px; } + .controls { margin-left: 140px; } #email_invitation { padding-top: 10px; margin-top: 20px; diff --git a/app/assets/stylesheets/new_styles/_interactions.scss b/app/assets/stylesheets/new_styles/_interactions.scss index b58a0e040..cff767085 100644 --- a/app/assets/stylesheets/new_styles/_interactions.scss +++ b/app/assets/stylesheets/new_styles/_interactions.scss @@ -2,27 +2,25 @@ .controls { z-index: 6; float: right; - .post_report, .comment_report { + + .block_user, + .comment_report, + .create_participation, + .delete, + .destroy_participation, + .post_report { display: inline-block; + + .icons-create_participation, + .icons-deletelabel, + .icons-destroy_participation, + .icons-ignoreuser, .icons-report { height: 14px; width: 14px; } } - .block_user { - display: inline-block; - .icons-ignoreuser { - height: 14px; - width: 14px; - } - } - .delete { - display: inline-block; - .icons-deletelabel { - height: 14px; - width: 14px; - } - } + & > a:hover { text-decoration: none; } diff --git a/app/assets/stylesheets/profile.scss b/app/assets/stylesheets/profile.scss index 2f98bf3f4..c7078af50 100644 --- a/app/assets/stylesheets/profile.scss +++ b/app/assets/stylesheets/profile.scss @@ -1,6 +1,5 @@ #profile_container { .profile_header { - border-bottom: 1px solid $border-grey; margin-bottom: 20px; border-left: 1px solid #dddddd; padding-left: 10px; @@ -54,6 +53,7 @@ #profile_horizontal_bar { border-top: 1px dashed $border-grey; + border-bottom: 1px solid $border-grey; min-height: 50px; margin-top: 10px; #profile_buttons { diff --git a/app/assets/stylesheets/sidebar.scss b/app/assets/stylesheets/sidebar.scss index d28b1418f..42af9ec5a 100644 --- a/app/assets/stylesheets/sidebar.scss +++ b/app/assets/stylesheets/sidebar.scss @@ -140,7 +140,7 @@ } } - #invite_code { + & > #invite_code { width: 100%; box-sizing: border-box; font-size: 11px; diff --git a/app/views/invitations/new.html.haml b/app/views/invitations/new.html.haml index d4e332328..b39bb12b0 100644 --- a/app/views/invitations/new.html.haml +++ b/app/views/invitations/new.html.haml @@ -1,9 +1,11 @@ -#paste_link_wrapper - #paste_link - = t('.paste_link') - %span#codes_left - = '(' + t('.codes_left', :count => @invite_code.count) + ')' - = invite_link(@invite_code) +#paste_link + = t('.paste_link') + %span#codes_left + = '(' + t('.codes_left', :count => @invite_code.count) + ')' +.form-horizontal + .control-group + .controls + = invite_link(@invite_code) #email_invitation = form_tag new_user_invitation_path, :class => 'form-horizontal' do diff --git a/features/desktop/accepts_invitation.feature b/features/desktop/accepts_invitation.feature index 5588bc806..02a02a7ef 100644 --- a/features/desktop/accepts_invitation.feature +++ b/features/desktop/accepts_invitation.feature @@ -31,13 +31,13 @@ Feature: invitation acceptance And I close the publisher And I log out And I sign in as "bob@bob.bob" - And I follow "By email" + And I click on selector ".btn-link[data-target='#invitationsModal']" Then I should see one less invite Scenario: sends an invitation Given a user with email "bob@bob.bob" When I sign in as "bob@bob.bob" - And I follow "By email" + And I click on selector ".btn-link[data-target='#invitationsModal']" And I fill in the following: | email_inviter_emails | alex@example.com | And I press "Send an invitation" diff --git a/features/desktop/connects_users.feature b/features/desktop/connects_users.feature index 7c7e1b203..a5904a3ce 100644 --- a/features/desktop/connects_users.feature +++ b/features/desktop/connects_users.feature @@ -10,16 +10,10 @@ Feature: following and being followed When I sign in as "bob@bob.bob" And I am on "alice@alice.alice"'s page And I add the person to my "Besties" aspect - - When I am on the home page - And I expand the publisher - And I fill in the following: - | status_message_fake_text | I am following you | - And I press "Share" - Then I should see "I am following you" within "#main_stream" And I sign out Scenario: seeing a follower's posts on their profile page, but not in your stream + Given "bob@bob.bob" has a non public post with text "I am following you" When I sign in as "alice@alice.alice" And I am on "bob@bob.bob"'s page Then I should see "I am following you" @@ -28,16 +22,7 @@ Feature: following and being followed Then I should not see "I am following you" Scenario: seeing public posts of someone you follow - Given I sign in as "alice@alice.alice" - And I am on the home page - And I expand the publisher - And I fill in the following: - | status_message_fake_text | I am ALICE | - And I press the first ".toggle" within "#publisher" - And I press the first ".public" within "#publisher" - And I press "Share" - Then I should see "I am ALICE" within "#main_stream" - And I sign out + Given "alice@alice.alice" has a public post with text "I am ALICE" When I sign in as "bob@bob.bob" And I am on "alice@alice.alice"'s page diff --git a/features/desktop/post_preview.feature b/features/desktop/post_preview.feature index 7513d6203..34df1604a 100644 --- a/features/desktop/post_preview.feature +++ b/features/desktop/post_preview.feature @@ -75,7 +75,7 @@ Feature: preview posts in the stream Given I expand the publisher When I fill in the following: | status_message_fake_text | I am eating yogurt | - And I press the element "#poll_creator" + And I click on selector "#poll_creator" When I fill in the following: | status_message_fake_text | I am eating yogurt | | poll_question | What kind of yogurt do you like? | diff --git a/features/desktop/post_with_a_poll.feature b/features/desktop/post_with_a_poll.feature index 89fa8d506..b6a34a9d3 100644 --- a/features/desktop/post_with_a_poll.feature +++ b/features/desktop/post_with_a_poll.feature @@ -16,13 +16,13 @@ Feature: posting with a poll Scenario: expanding the poll creator Given "#poll_creator_container" is hidden When I expand the publisher - And I press the element "#poll_creator" + And I click on selector "#poll_creator" Then I should see an element "#poll_creator_container" Scenario: adding option to poll Given "#poll_creator_container" is hidden When I expand the publisher - And I press the element "#poll_creator" + And I click on selector "#poll_creator" And I fill in values for the first two options And I lose focus Then I should see 3 options @@ -30,7 +30,7 @@ Feature: posting with a poll Scenario: delete an option Given "#poll_creator_container" is hidden When I expand the publisher - And I press the element "#poll_creator" + And I click on selector "#poll_creator" And I fill in values for the first two options And I lose focus And I delete the last option @@ -39,7 +39,7 @@ Feature: posting with a poll Scenario: post with an attached poll Given I expand the publisher - And I press the element "#poll_creator" + And I click on selector "#poll_creator" When I fill in the following: | status_message_fake_text | I am eating yogurt | | poll_question | What kind of yogurt do you like? | @@ -52,7 +52,7 @@ Feature: posting with a poll Scenario: vote for an option Given I expand the publisher - And I press the element "#poll_creator" + And I click on selector "#poll_creator" When I fill in the following: | status_message_fake_text | I am eating yogurt | | poll_question | What kind of yogurt do you like? | @@ -69,7 +69,7 @@ Feature: posting with a poll Scenario: click to show result Given I expand the publisher - And I press the element "#poll_creator" + And I click on selector "#poll_creator" When I fill in the following: | status_message_fake_text | I am eating yogurt | | poll_question | What kind of yogurt do you like? | @@ -77,18 +77,18 @@ Feature: posting with a poll | normal | | not normal | And I press "Share" - And I press the element ".toggle_result" + And I click on selector ".toggle_result" Then I should see an element ".percentage" Scenario: validate answer input Given I expand the publisher - And I press the element "#poll_creator" + And I click on selector "#poll_creator" When I fill in the following: | status_message_fake_text | I am eating yogurt | | poll_question | What kind of yogurt do you like? | And I fill in the following for the options: | normal | | | - And I press the element "#poll_creator_container" - And I press the element "input[type=submit]" + And I click on selector "#poll_creator_container" + And I click on selector "#publisher button#submit" Then I should see an element ".poll-answer input.error" diff --git a/features/desktop/posts_from_main_page.feature b/features/desktop/posts_from_main_page.feature index e2f778ce2..95c611521 100644 --- a/features/desktop/posts_from_main_page.feature +++ b/features/desktop/posts_from_main_page.feature @@ -22,7 +22,7 @@ Feature: posting from the main page Given ".markdownIndications" is hidden And ".options_and_submit" is hidden When I expand the publisher - Then I should see "You can use Markdown to format your post" within "#publisher-images" + Then I should see "You can use Markdown to format your post" within ".markdownIndications" Then I should see "All aspects" within ".options_and_submit" Then I should see "Preview" within ".options_and_submit" diff --git a/features/step_definitions/aspects_steps.rb b/features/step_definitions/aspects_steps.rb index 742ab63dc..10357c4d4 100644 --- a/features/step_definitions/aspects_steps.rb +++ b/features/step_definitions/aspects_steps.rb @@ -1,13 +1,11 @@ module AspectCukeHelpers def click_aspect_dropdown - # blueprint: .dropdown .button, bootstrap: .aspect_dropdown .dropdown-toggle - find('.dropdown .button, .aspect_dropdown .dropdown-toggle').click + find('.aspect_dropdown .dropdown-toggle').click end def toggle_aspect(a_name) - # blueprint: .dropdown li, bootstrap: .aspect_dropdown li a_id = @me.aspects.where(name: a_name).pluck(:id).first - aspect_css = ".dropdown li[data-aspect_id='#{a_id}'], .aspect_dropdown li[data-aspect_id='#{a_id}']" + aspect_css = ".aspect_dropdown li[data-aspect_id='#{a_id}']" expect(page).to have_selector(aspect_css) find(aspect_css).click end @@ -30,7 +28,7 @@ module AspectCukeHelpers end def aspect_dropdown_visible? - expect(find('.aspect_membership.dropdown.active')).to be_visible + expect(find('.aspect_membership_dropdown.open')).to be_visible end end World(AspectCukeHelpers) diff --git a/features/step_definitions/post_with_poll_steps.rb b/features/step_definitions/post_with_poll_steps.rb index cee8f77d3..523e60dc7 100644 --- a/features/step_definitions/post_with_poll_steps.rb +++ b/features/step_definitions/post_with_poll_steps.rb @@ -23,12 +23,6 @@ When /^I check the first option$/ do first(".poll_form input").click end -When(/^I press the element "(.*?)"$/) do |selector| - page.should have_css(selector) - find(selector).click -end - - When(/^I fill in values for the first two options$/) do all(".poll-answer input").each_with_index do |answer, i| answer.set "answer option #{i}" diff --git a/features/step_definitions/user_steps.rb b/features/step_definitions/user_steps.rb index 37e555755..5c9c55164 100644 --- a/features/step_definitions/user_steps.rb +++ b/features/step_definitions/user_steps.rb @@ -126,6 +126,10 @@ When /^I post a status with the text "([^\"]*)"$/ do |text| @me.post(:status_message, :text => text, :public => true, :to => 'all') end +When /^I post a limited status with the text "([^\"]*)"$/ do |text| + @me.post(:status_message, :text => text, :public => false, :to => @me.aspect_ids) +end + And /^I follow the "([^\"]*)" link from the last sent email$/ do |link_text| email_text = Devise.mailer.deliveries.first.body.to_s email_text = Devise.mailer.deliveries.first.html_part.body.raw_source if email_text.blank? diff --git a/features/support/publishing_cuke_helpers.rb b/features/support/publishing_cuke_helpers.rb index a49f3101c..5d8e50244 100644 --- a/features/support/publishing_cuke_helpers.rb +++ b/features/support/publishing_cuke_helpers.rb @@ -45,7 +45,7 @@ module PublishingCukeHelpers end def publisher_submittable? - submit_btn = find("#publisher input[type=submit]") + submit_btn = find("#publisher button#submit") !submit_btn[:disabled] end diff --git a/spec/javascripts/app/views/publisher_view_spec.js b/spec/javascripts/app/views/publisher_view_spec.js index b52e9d678..9f1d98cf0 100644 --- a/spec/javascripts/app/views/publisher_view_spec.js +++ b/spec/javascripts/app/views/publisher_view_spec.js @@ -150,8 +150,6 @@ describe("app.views.Publisher", function() { }); it("disables submitting", function() { - this.view.togglePollCreator(); - this.view.setText('TESTING'); expect(this.view.el_submit.prop('disabled')).toBeFalsy(); expect(this.view.el_preview.prop('disabled')).toBeFalsy();