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
261 logout pop up #427
Merged
arturtamborski
merged 25 commits into
CodeForPoznan:develop
from
pniedzwiedzinski:261-logout-pop-up
Mar 5, 2020
Merged
261 logout pop up #427
Changes from 15 commits
Commits
Show all changes
25 commits
Select commit
Hold shift + click to select a range
bd4d2b8
Add UserDetails
pniedzwiedzinski 473a3e0
Add LogoutModal
pniedzwiedzinski 6e1a0f2
Add routes
pniedzwiedzinski 94a3635
Add modal to UserDetails
pniedzwiedzinski 981d7e3
Add redirect after logout
pniedzwiedzinski 33d3417
Fix lint errors
pniedzwiedzinski 8b5ca0c
Open logout model if offline
pniedzwiedzinski 4a71e28
Add translations
pniedzwiedzinski 15aafc0
Fix router location
pniedzwiedzinski 62f85ce
Move logout action to logout path
pniedzwiedzinski c38a35b
Logout on router push
pniedzwiedzinski c314343
Remove unnecessary logout progress
pniedzwiedzinski 8486bd2
Add danger button
pniedzwiedzinski 3676009
Fix lint errors
pniedzwiedzinski aa10413
Remove comment
pniedzwiedzinski 3da7ee8
Update frontend/src/translations.json
pniedzwiedzinski d1a7fee
Update translations
pniedzwiedzinski eb166fd
Fix lint errors
pniedzwiedzinski 2fe1bb2
Merge branch '261-logout-pop-up' of github.com:pniedzwiedzinski/pah-f…
pniedzwiedzinski 6641c73
Remove comment
pniedzwiedzinski 5a71dac
Fix lint errors
pniedzwiedzinski d6b0ac9
Fix eslint ignore name
pniedzwiedzinski f6c31ab
Revert GroupGuardMixin
pniedzwiedzinski 7d85b21
Add pop-up for online users
pniedzwiedzinski 8caa7cb
Fix lint errors
pniedzwiedzinski File filter
Filter by extension
Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
<template> | ||
<b-modal | ||
id="logout-modal" | ||
:title="$t('common.are_you_sure')" | ||
:ok-title="$t('common.logout')" | ||
:cancel-title="$t('common.cancel')" | ||
ok-variant="danger" | ||
@ok="logout" | ||
class="logout-modal" | ||
> | ||
<p> | ||
{{ $t('logout.offline_logout_warning') }} | ||
</p> | ||
</b-modal> | ||
</template> | ||
|
||
<script> | ||
import router from '../router'; | ||
import { logoutRoute } from '../router/routes'; | ||
|
||
export default { | ||
name: 'LogoutModal', | ||
methods: { | ||
logout() { | ||
router.push(logoutRoute); | ||
}, | ||
}, | ||
}; | ||
</script> | ||
|
||
<style scoped> | ||
.logout-modal { | ||
color: black; | ||
} | ||
</style> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
<template> | ||
<div> | ||
<b-nav-item | ||
v-if="user" | ||
v-b-modal.logout-modal | ||
@click="logout" | ||
key="logout" | ||
class="username" | ||
> | ||
{{ $t('common.logout') }} | ||
<p>{{ user.username }}</p> | ||
</b-nav-item> | ||
<logout-modal v-if="!isOnline" /> | ||
</div> | ||
</template> | ||
|
||
<script> | ||
import { mapGetters, mapState } from 'vuex'; | ||
|
||
import router from '../router'; | ||
import { logoutRoute } from '../router/routes'; | ||
import { USER } from '../store'; | ||
import { IS_ONLINE } from '../store/constants'; | ||
|
||
import LogoutModal from './LogoutModal.vue'; | ||
|
||
export default { | ||
name: 'UserDetails', | ||
components: { | ||
LogoutModal, | ||
}, | ||
computed: { | ||
...mapState([USER]), | ||
...mapGetters([IS_ONLINE]), | ||
}, | ||
methods: { | ||
logout() { | ||
if (this.isOnline) { | ||
router.push(logoutRoute); | ||
} | ||
}, | ||
}, | ||
}; | ||
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
?