-
-
Notifications
You must be signed in to change notification settings - Fork 61
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
433-365 : dropdown on navbar and profile #963
Changes from 2 commits
82858fa
ee5213b
4635254
10d2abf
5501b69
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,39 +13,51 @@ | |
</template> | ||
|
||
<template slot="end"> | ||
<b-navbar-item tag="div" v-if="visible('Feedback')"> | ||
<FeedbackButton action="software_feedbacks/new">Feedback</FeedbackButton> | ||
</b-navbar-item> | ||
<b-navbar-item href="/glossary" v-if="visible('Glossary')">Glossary</b-navbar-item> | ||
<b-navbar-item href="/contributions" v-if="visible('Contributions')" | ||
>Contributions</b-navbar-item | ||
> | ||
<b-navbar-item href="/matches" v-if="visible('Matches')">Matches</b-navbar-item> | ||
<b-navbar-item href="/admin" v-if="visible('Admin')">Admin</b-navbar-item> | ||
<b-navbar-item tag="div" v-if="visible('Login')"> | ||
<a href="/users/sign_in" class="button is-outlined">Login</a> | ||
</b-navbar-item> | ||
<b-navbar-item tag="div" v-if="visible('Sign Up')"> | ||
<a href="/users/sign_up" class="button is-outlined">Sign Up</a> | ||
</b-navbar-item> | ||
<b-navbar-item tag="div" v-if="visible('Logout')"> | ||
<DeleteButton action="/users/sign_out">Logout</DeleteButton> | ||
<b-navbar-item href="/admin" v-if="visible('Admin')"> | ||
Admin | ||
</b-navbar-item> | ||
|
||
<b-navbar-dropdown label="Account" collapsible right v-if="visible('Logout')"> | ||
<div class="sub-item"> | ||
<a class="navbar-item" href="/users/edit">My profile</a> | ||
</div> | ||
<div class="sub-item"> | ||
<FeedbackButton | ||
classes="navbar-item" | ||
action="software_feedbacks/new" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This |
||
v-if="visible('Feedback')" | ||
>Feedback</FeedbackButton | ||
> | ||
</div> | ||
<div class="sub-item"> | ||
<DeleteLink classes="navbar-item" action="/users/sign_out">Logout</DeleteLink> | ||
</div> | ||
</b-navbar-dropdown> | ||
</template> | ||
</b-navbar> | ||
</template> | ||
|
||
<script> | ||
import {DeleteButton} from 'components/forms' | ||
import {DeleteLink} from 'components/forms' | ||
import {FeedbackButton} from 'components/forms' | ||
|
||
export default { | ||
props: { | ||
logoUrl: {type: String}, | ||
visibleButtons: {type: Array, default: []}, | ||
}, | ||
components: { | ||
DeleteButton, | ||
DeleteLink, | ||
FeedbackButton, | ||
}, | ||
methods: { | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
<template> | ||
<form :action="action" method="post" ref="form"> | ||
<AuthTokenInput /> | ||
<input type="hidden" name="_method" value="delete" /> | ||
<a href="#" :class="classes" v-on:click="submit"><slot /></a> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Minor: i have a slight preference to put |
||
</form> | ||
</template> | ||
|
||
<script> | ||
import AuthTokenInput from './AuthTokenInput' | ||
export default { | ||
components: {AuthTokenInput}, | ||
props: { | ||
action: String, | ||
classes: { | ||
default: '', | ||
type: String, | ||
}, | ||
}, | ||
methods: { | ||
submit: function () { | ||
this.$refs.form.submit() | ||
}, | ||
}, | ||
computed: { | ||
authenticityToken() { | ||
return document.querySelector('meta[name="csrf-token"]').content | ||
}, | ||
}, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't think this |
||
} | ||
</script> |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,17 @@ | ||
import AuthTokenInput from './AuthTokenInput' | ||
import CategoryFields from './CategoryFields' | ||
import CommentsField from './CommentsField' | ||
import ContactFields from './ContactFields' | ||
import CustomQuestions from './CustomQuestions' | ||
import DeleteButton from './DeleteButton' | ||
import ErrorMessages from './ErrorMessages' | ||
import FeedbackButton from './FeedbackButton' | ||
import LocationFields from './LocationFields' | ||
import NameField from './NameField' | ||
import AuthTokenInput from './AuthTokenInput' | ||
import CategoryFields from './CategoryFields' | ||
import CommentsField from './CommentsField' | ||
import ContactFields from './ContactFields' | ||
import CustomQuestions from './CustomQuestions' | ||
import DeleteButton from './DeleteButton' | ||
import ErrorMessages from './ErrorMessages' | ||
import FeedbackButton from './FeedbackButton' | ||
import LocationFields from './LocationFields' | ||
import NameField from './NameField' | ||
import ServiceAreaField from './ServiceAreaField' | ||
import SpacerField from './SpacerField' | ||
import SubmitButton from './SubmitButton' | ||
import SpacerField from './SpacerField' | ||
import SubmitButton from './SubmitButton' | ||
import DeleteLink from './DeleteLink' | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm guessing you have |
||
|
||
export { | ||
AuthTokenInput, | ||
|
@@ -26,5 +27,5 @@ export { | |
ServiceAreaField, | ||
SpacerField, | ||
SubmitButton, | ||
DeleteLink, | ||
} | ||
|
Original file line number | Diff line number | Diff line change | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
|
@@ -33,6 +33,14 @@ | |||||||||||
get "/users/#{user.id}/edit" | ||||||||||||
expect(response).to be_successful | ||||||||||||
end | ||||||||||||
|
||||||||||||
it "must redirect to the sign in page if the user is not authenticated" do | ||||||||||||
sign_out :user | ||||||||||||
get "/users/1/edit" | ||||||||||||
expect(response).not_to be_successful | ||||||||||||
expect(response.response_code).to eq(302) # Redirection | ||||||||||||
expect(response.header["Location"]).to eq('http://www.example.com/users/sign_in') | ||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thanks for adding this spec! I think the expectations above can be simplified to:
Suggested change
|
||||||||||||
end | ||||||||||||
end | ||||||||||||
|
||||||||||||
describe "POST /create" do | ||||||||||||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wasn't able to recreate the problem you mentioned with the 'burger' showing up in the wrong place. When i comment out this z-index, everything still seems to work fine. Could you double check and describe steps to recreate if you're still seeing it happen?