Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
D
diaspora
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Milan
diaspora
Commits
caeaf23d
Unverified
Commit
caeaf23d
authored
Aug 30, 2017
by
Steffen van Bergerem
Committed by
Benjamin Neff
Aug 31, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Replace aspect_dropdown with aspect-dropdown
parent
3df47497
Changes
17
Hide whitespace changes
Inline
Side-by-side
Showing
17 changed files
with
32 additions
and
32 deletions
+32
-32
app/assets/javascripts/app/pages/settings.js
app/assets/javascripts/app/pages/settings.js
+1
-1
app/assets/javascripts/app/views/aspect_membership_view.js
app/assets/javascripts/app/views/aspect_membership_view.js
+1
-1
app/assets/javascripts/app/views/publisher_view.js
app/assets/javascripts/app/views/publisher_view.js
+2
-2
app/assets/stylesheets/aspects.scss
app/assets/stylesheets/aspects.scss
+1
-1
app/assets/stylesheets/color_themes/_color_theme_override_dark.scss
.../stylesheets/color_themes/_color_theme_override_dark.scss
+1
-1
app/assets/stylesheets/profile.scss
app/assets/stylesheets/profile.scss
+1
-1
app/assets/stylesheets/publisher.scss
app/assets/stylesheets/publisher.scss
+3
-3
app/views/aspect_memberships/_aspect_membership_dropdown.mobile.haml
...spect_memberships/_aspect_membership_dropdown.mobile.haml
+1
-1
app/views/aspects/_aspect_dropdown.html.haml
app/views/aspects/_aspect_dropdown.html.haml
+1
-1
features/desktop/change_settings.feature
features/desktop/change_settings.feature
+3
-3
features/desktop/search.feature
features/desktop/search.feature
+1
-1
features/desktop/signs_up.feature
features/desktop/signs_up.feature
+1
-1
features/step_definitions/aspects_steps.rb
features/step_definitions/aspects_steps.rb
+2
-2
features/step_definitions/posts_steps.rb
features/step_definitions/posts_steps.rb
+1
-1
features/step_definitions/user_steps.rb
features/step_definitions/user_steps.rb
+1
-1
spec/javascripts/app/views/aspects_dropdown_view_spec.js
spec/javascripts/app/views/aspects_dropdown_view_spec.js
+1
-1
spec/javascripts/app/views/publisher_view_spec.js
spec/javascripts/app/views/publisher_view_spec.js
+10
-10
No files found.
app/assets/javascripts/app/pages/settings.js
View file @
caeaf23d
...
...
@@ -11,7 +11,7 @@ app.pages.Settings = Backbone.View.extend({
new
Diaspora
.
ProfilePhotoUploader
();
this
.
viewAspectSelector
=
new
app
.
views
.
PublisherAspectSelector
({
el
:
$
(
"
.aspect
_
dropdown
"
),
el
:
$
(
"
.aspect
-
dropdown
"
),
form
:
$
(
"
#post-default-aspects
"
)
});
$
(
"
#update_profile_form
"
).
areYouSure
();
...
...
app/assets/javascripts/app/views/aspect_membership_view.js
View file @
caeaf23d
...
...
@@ -9,7 +9,7 @@
*/
app
.
views
.
AspectMembership
=
app
.
views
.
Base
.
extend
({
templateName
:
"
aspect_membership_dropdown
"
,
className
:
"
btn-group aspect
_
dropdown aspect_membership_dropdown
"
,
className
:
"
btn-group aspect
-
dropdown aspect_membership_dropdown
"
,
subviews
:
{
"
.newAspectContainer
"
:
"
aspectCreateView
"
...
...
app/assets/javascripts/app/views/publisher_view.js
View file @
caeaf23d
...
...
@@ -101,13 +101,13 @@ app.views.Publisher = Backbone.View.extend({
});
this
.
viewAspectSelector
=
new
app
.
views
.
PublisherAspectSelector
({
el
:
this
.
$
(
"
.public_toggle .aspect
_
dropdown
"
),
el
:
this
.
$
(
"
.public_toggle .aspect
-
dropdown
"
),
form
:
form
});
this
.
viewGettingStarted
=
new
app
.
views
.
PublisherGettingStarted
({
firstMessageEl
:
this
.
inputEl
,
visibilityEl
:
this
.
$
(
"
.public_toggle .aspect
_
dropdown > .dropdown-toggle
"
),
visibilityEl
:
this
.
$
(
"
.public_toggle .aspect
-
dropdown > .dropdown-toggle
"
),
streamEl
:
$
(
"
#main-stream
"
)
});
...
...
app/assets/stylesheets/aspects.scss
View file @
caeaf23d
.aspect
_
dropdown
{
.aspect
-
dropdown
{
li
{
@include
selectable-list
;
...
...
app/assets/stylesheets/color_themes/_color_theme_override_dark.scss
View file @
caeaf23d
...
...
@@ -15,7 +15,7 @@ body {
.md-input
,
.md-preview
{
background-color
:
$gray
;
}
.aspect
_
dropdown
li
a
.text
{
color
:
$dropdown-link-color
;
}
.aspect
-
dropdown
li
a
.text
{
color
:
$dropdown-link-color
;
}
.info
.tag
{
background-color
:
$gray-light
;
}
...
...
app/assets/stylesheets/profile.scss
View file @
caeaf23d
...
...
@@ -8,7 +8,7 @@
margin-top
:
-20px
;
box-shadow
:
$card-shadow
;
#edit_profile
,
#unblock_user_button
,
.aspect
_
dropdown
{
#edit_profile
,
#unblock_user_button
,
.aspect
-
dropdown
{
margin-top
:
15px
;
}
...
...
app/assets/stylesheets/publisher.scss
View file @
caeaf23d
...
...
@@ -53,8 +53,8 @@
.btn-toolbar
{
width
:
100%
;
display
:
flex
;
.btn
,
.aspect
_
dropdown
{
flex-grow
:
1
;
}
.aspect
_
dropdown
.btn
{
width
:
100%
;
}
.btn
,
.aspect
-
dropdown
{
flex-grow
:
1
;
}
.aspect
-
dropdown
.btn
{
width
:
100%
;
}
}
.btn-group
:first-child
{
margin
:
0
;
}
.dropdown-menu.pull-right
{
...
...
@@ -183,7 +183,7 @@
}
}
.aspect
_
dropdown
{
.aspect
-
dropdown
{
.radio
{
min-height
:
0
;
padding-left
:
0
;
...
...
app/views/aspect_memberships/_aspect_membership_dropdown.mobile.haml
View file @
caeaf23d
%div
%select
.aspect
_
dropdown.form-control.user_aspects
{
"name"
=>
"user_aspects"
,
"data-person-id"
=>
@person
.
id
}
%select
.aspect
-
dropdown.form-control.user_aspects
{
"name"
=>
"user_aspects"
,
"data-person-id"
=>
@person
.
id
}
%option
{
value:
'list_cover'
,
class:
'list_cover'
,
disabled:
'true'
,
selected:
'true'
}
=
t
(
"contacts.index.add_contact"
)
-
contact
=
current_user
.
contact_for
(
@person
)
...
...
app/views/aspects/_aspect_dropdown.html.haml
View file @
caeaf23d
...
...
@@ -6,7 +6,7 @@
dropdown_css
[
"data-content"
]
=
t
(
"shared.public_explain.visibility_dropdown"
)
end
.btn-group.aspect
_
dropdown
.btn-group.aspect
-
dropdown
%button
.btn.btn-default.dropdown-toggle
{
dropdown_css
}
-
if
public_selected?
(
selected_aspects
)
%i
.entypo-globe.small
#visibility-icon
...
...
features/desktop/change_settings.feature
View file @
caeaf23d
...
...
@@ -36,7 +36,7 @@ Feature: Change settings
Scenario
:
Change my post default aspects
When
I go to the stream page
And
I expand the publisher
Then
I should see
"All aspects"
within
".aspect
_
dropdown"
Then
I should see
"All aspects"
within
".aspect
-
dropdown"
When
I go to the edit user page
And
I press the aspect dropdown
And
I toggle the aspect
"Family"
...
...
@@ -44,7 +44,7 @@ Feature: Change settings
And
I press
"Change"
within
"#post-default-aspects"
And
I go to the stream page
And
I expand the publisher
Then
I should see
"Family"
within
".aspect
_
dropdown"
Then
I should see
"Family"
within
".aspect
-
dropdown"
Scenario
:
Change my post default to public
When
I press the aspect dropdown
...
...
@@ -52,7 +52,7 @@ Feature: Change settings
And
I press
"Change"
within
"#post-default-aspects"
And
I go to the stream page
And
I expand the publisher
Then
I should see
"Public"
within
".aspect
_
dropdown"
Then
I should see
"Public"
within
".aspect
-
dropdown"
Scenario
:
exporting profile data
When
I click on the first selector
"#account_data a"
...
...
features/desktop/search.feature
View file @
caeaf23d
...
...
@@ -31,7 +31,7 @@ Scenario: search for a user in background
And
I search for
"user@pod.tld"
And
a person with ID
"user@pod.tld"
has been discovered
Then
I should see
"user@pod.tld"
within
".stream .info.diaspora_handle"
And
I should see a
".aspect
_
dropdown"
within
".stream"
And
I should see a
".aspect
-
dropdown"
within
".stream"
Scenario
:
search for a not searchable user
When
I sign in as
"carol@example.com"
...
...
features/desktop/signs_up.feature
View file @
caeaf23d
...
...
@@ -42,7 +42,7 @@ Feature: new user registration
When
I confirm the alert after I follow
"awesome_button"
Then
I should be on the stream page
And
the publisher should be expanded
And
I should see
"Public"
within
".aspect
_
dropdown"
And
I should see
"Public"
within
".aspect
-
dropdown"
Scenario
:
new user without any tags posts first status message
When
I confirm the alert after I follow
"awesome_button"
...
...
features/step_definitions/aspects_steps.rb
View file @
caeaf23d
module
AspectCukeHelpers
def
click_aspect_dropdown
find
(
".aspect
_
dropdown .dropdown-toggle"
).
trigger
"click"
find
(
".aspect
-
dropdown .dropdown-toggle"
).
trigger
"click"
end
def
toggle_aspect
(
a_name
)
...
...
@@ -9,7 +9,7 @@ module AspectCukeHelpers
else
@me
.
aspects
.
where
(
name:
a_name
).
pluck
(
:id
).
first
end
aspect_css
=
".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
...
...
features/step_definitions/posts_steps.rb
View file @
caeaf23d
...
...
@@ -128,7 +128,7 @@ end
When
/^I select "([^"]*)" on the aspect dropdown$/
do
|
text
|
page
.
execute_script
(
"$('#publisher .dropdown .dropdown_list, #publisher .aspect
_
dropdown .dropdown-menu')
"$('#publisher .dropdown .dropdown_list, #publisher .aspect
-
dropdown .dropdown-menu')
.find('li').each(function(i,el){
var elem = $(el);
if ('"
+
text
+
"' == $.trim(elem.text()) ) {
...
...
features/step_definitions/user_steps.rb
View file @
caeaf23d
...
...
@@ -233,7 +233,7 @@ end
And
/^I should be able to friend "([^\"]*)"$/
do
|
email
|
user
=
User
.
find_by_email
(
email
)
step
'I should see a ".aspect
_
dropdown"'
step
'I should see a ".aspect
-
dropdown"'
step
"I should see
\"
#{
user
.
name
}
\"
"
end
...
...
spec/javascripts/app/views/aspects_dropdown_view_spec.js
View file @
caeaf23d
describe
(
"
app.views.AspectsDropdown
"
,
function
(){
beforeEach
(
function
()
{
spec
.
loadFixture
(
"
bookmarklet
"
);
this
.
view
=
new
app
.
views
.
AspectsDropdown
({
el
:
$
(
'
.aspect
_
dropdown
'
)});
this
.
view
=
new
app
.
views
.
AspectsDropdown
({
el
:
$
(
'
.aspect
-
dropdown
'
)});
});
context
(
'
_toggleCheckbox
'
,
function
()
{
...
...
spec/javascripts/app/views/publisher_view_spec.js
View file @
caeaf23d
...
...
@@ -112,7 +112,7 @@ describe("app.views.Publisher", function() {
expect
(
"
#publisher
"
).
not
.
toHaveClass
(
"
closed
"
);
$
(
"
#publisher
"
).
find
(
"
.publisher-textarea-wrapper
"
).
click
();
expect
(
"
#publisher
"
).
not
.
toHaveClass
(
"
closed
"
);
$
(
"
#publisher
"
).
find
(
"
.aspect
_
dropdown button
"
).
click
();
$
(
"
#publisher
"
).
find
(
"
.aspect
-
dropdown button
"
).
click
();
expect
(
"
#publisher
"
).
not
.
toHaveClass
(
"
closed
"
);
});
...
...
@@ -121,10 +121,10 @@ describe("app.views.Publisher", function() {
// that take the whole page when it detects a mobile.
// Clicking on this element should not close the publisher.
// See https://github.com/diaspora/diaspora/issues/6979.
$
(
"
#publisher
"
).
find
(
"
.aspect
_
dropdown
"
).
append
(
"
<div class='dropdown-backdrop'></div>
"
)
$
(
"
#publisher
"
).
find
(
"
.aspect
-
dropdown
"
).
append
(
"
<div class='dropdown-backdrop'></div>
"
)
.
css
({
position
:
"
fixed
"
,
left
:
0
,
right
:
0
,
bottom
:
0
,
top
:
0
,
"
z-index
"
:
990
});
expect
(
"
#publisher
"
).
not
.
toHaveClass
(
"
closed
"
);
$
(
"
#publisher
"
).
find
(
"
.aspect
_
dropdown button
"
).
click
();
$
(
"
#publisher
"
).
find
(
"
.aspect
-
dropdown button
"
).
click
();
expect
(
"
#publisher
"
).
not
.
toHaveClass
(
"
closed
"
);
$
(
"
#publisher
"
).
find
(
"
.dropdown-backdrop
"
).
click
();
expect
(
"
#publisher
"
).
not
.
toHaveClass
(
"
closed
"
);
...
...
@@ -403,13 +403,13 @@ describe("app.views.Publisher", function() {
describe
(
"
toggles the selected entry visually
"
,
function
(){
it
(
"
click on the first aspect
"
,
function
(){
this
.
view
.
$
(
"
.aspect
_
dropdown li.aspect_selector:first
"
).
click
();
this
.
view
.
$
(
"
.aspect
-
dropdown li.aspect_selector:first
"
).
click
();
expect
(
$
(
"
#publisher #visibility-icon
"
)).
not
.
toHaveClass
(
"
entypo-globe
"
);
expect
(
$
(
"
#publisher #visibility-icon
"
)).
toHaveClass
(
"
entypo-lock
"
);
});
it
(
"
click on public
"
,
function
(){
this
.
view
.
$
(
"
.aspect
_
dropdown li.public
"
).
click
();
this
.
view
.
$
(
"
.aspect
-
dropdown li.public
"
).
click
();
expect
(
$
(
"
#publisher #visibility-icon
"
)).
toHaveClass
(
"
entypo-globe
"
);
expect
(
$
(
"
#publisher #visibility-icon
"
)).
not
.
toHaveClass
(
"
entypo-lock
"
);
});
...
...
@@ -430,7 +430,7 @@ describe("app.views.Publisher", function() {
expect
(
selected
.
length
).
toBe
(
1
);
expect
(
selected
.
first
().
val
()).
toBe
(
'
all_aspects
'
);
var
evt
=
$
.
Event
(
"
click
"
,
{
target
:
$
(
'
.aspect
_
dropdown li.aspect_selector:last
'
)
});
var
evt
=
$
.
Event
(
"
click
"
,
{
target
:
$
(
'
.aspect
-
dropdown li.aspect_selector:last
'
)
});
this
.
view
.
viewAspectSelector
.
toggleAspect
(
evt
);
selected
=
$
(
'
input[name="aspect_ids[]"]
'
);
...
...
@@ -441,20 +441,20 @@ describe("app.views.Publisher", function() {
it
(
"
toggles the same item
"
,
function
()
{
expect
(
$
(
'
input[name="aspect_ids[]"][value="42"]
'
).
length
).
toBe
(
0
);
var
evt
=
$
.
Event
(
"
click
"
,
{
target
:
$
(
'
.aspect
_
dropdown li.aspect_selector:last
'
)
});
var
evt
=
$
.
Event
(
"
click
"
,
{
target
:
$
(
'
.aspect
-
dropdown li.aspect_selector:last
'
)
});
this
.
view
.
viewAspectSelector
.
toggleAspect
(
evt
);
expect
(
$
(
'
input[name="aspect_ids[]"][value="42"]
'
).
length
).
toBe
(
1
);
evt
=
$
.
Event
(
"
click
"
,
{
target
:
$
(
'
.aspect
_
dropdown li.aspect_selector:last
'
)
});
evt
=
$
.
Event
(
"
click
"
,
{
target
:
$
(
'
.aspect
-
dropdown li.aspect_selector:last
'
)
});
this
.
view
.
viewAspectSelector
.
toggleAspect
(
evt
);
expect
(
$
(
'
input[name="aspect_ids[]"][value="42"]
'
).
length
).
toBe
(
0
);
});
it
(
"
keeps other fields with different values
"
,
function
()
{
$
(
'
.dropdown-menu
'
).
append
(
'
<li data-aspect_id="99" class="aspect_selector" />
'
);
var
evt
=
$
.
Event
(
"
click
"
,
{
target
:
$
(
'
.aspect
_
dropdown li.aspect_selector:eq(-2)
'
)
});
var
evt
=
$
.
Event
(
"
click
"
,
{
target
:
$
(
'
.aspect
-
dropdown li.aspect_selector:eq(-2)
'
)
});
this
.
view
.
viewAspectSelector
.
toggleAspect
(
evt
);
evt
=
$
.
Event
(
"
click
"
,
{
target
:
$
(
'
.aspect
_
dropdown li.aspect_selector:eq(-1)
'
)
});
evt
=
$
.
Event
(
"
click
"
,
{
target
:
$
(
'
.aspect
-
dropdown li.aspect_selector:eq(-1)
'
)
});
this
.
view
.
viewAspectSelector
.
toggleAspect
(
evt
);
expect
(
$
(
'
input[name="aspect_ids[]"][value="42"]
'
).
length
).
toBe
(
1
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment