Commit ba7bded8 authored by Nick Stenning's avatar Nick Stenning

Rename 'signed-{in,out}' auth status to 'logged-{in,out}'

parent c30735ac
...@@ -10,13 +10,13 @@ function authStateFromUserID(userid) { ...@@ -10,13 +10,13 @@ function authStateFromUserID(userid) {
if (userid) { if (userid) {
var parsed = parseAccountID(userid); var parsed = parseAccountID(userid);
return { return {
status: 'signed-in', status: 'logged-in',
userid: userid, userid: userid,
username: parsed.username, username: parsed.username,
provider: parsed.provider, provider: parsed.provider,
}; };
} else { } else {
return {status: 'signed-out'}; return {status: 'logged-out'};
} }
} }
......
...@@ -64,7 +64,7 @@ describe('groupList', function () { ...@@ -64,7 +64,7 @@ describe('groupList', function () {
function createGroupList() { function createGroupList() {
return util.createDirective(document, 'groupList', { return util.createDirective(document, 'groupList', {
auth: { auth: {
status: 'signed-in', status: 'logged-in',
}, },
}); });
} }
......
...@@ -140,20 +140,20 @@ describe('AppController', function () { ...@@ -140,20 +140,20 @@ describe('AppController', function () {
assert.equal($scope.auth.status, 'unknown'); assert.equal($scope.auth.status, 'unknown');
}); });
it('sets auth.status to "signed-out" if userid is null', function () { it('sets auth.status to "logged-out" if userid is null', function () {
createController(); createController();
return fakeSession.load().then(function () { return fakeSession.load().then(function () {
assert.equal($scope.auth.status, 'signed-out'); assert.equal($scope.auth.status, 'logged-out');
}); });
}); });
it('sets auth.status to "signed-in" if userid is non-null', function () { it('sets auth.status to "logged-in" if userid is non-null', function () {
fakeSession.load = function () { fakeSession.load = function () {
return Promise.resolve({userid: 'acct:jim@hypothes.is'}); return Promise.resolve({userid: 'acct:jim@hypothes.is'});
}; };
createController(); createController();
return fakeSession.load().then(function () { return fakeSession.load().then(function () {
assert.equal($scope.auth.status, 'signed-in'); assert.equal($scope.auth.status, 'logged-in');
}); });
}); });
...@@ -177,7 +177,7 @@ describe('AppController', function () { ...@@ -177,7 +177,7 @@ describe('AppController', function () {
userid: 'acct:john@hypothes.is', userid: 'acct:john@hypothes.is',
}); });
assert.deepEqual($scope.auth, { assert.deepEqual($scope.auth, {
status: 'signed-in', status: 'logged-in',
userid: 'acct:john@hypothes.is', userid: 'acct:john@hypothes.is',
username: 'john', username: 'john',
provider: 'hypothes.is', provider: 'hypothes.is',
......
...@@ -394,7 +394,7 @@ describe('WidgetController', function () { ...@@ -394,7 +394,7 @@ describe('WidgetController', function () {
it('shows logged out message if selection is available', function () { it('shows logged out message if selection is available', function () {
$scope.auth = { $scope.auth = {
status: 'signed-out' status: 'logged-out'
}; };
annotationUI.addAnnotations([{id: '123'}]); annotationUI.addAnnotations([{id: '123'}]);
annotationUI.selectAnnotations(['123']); annotationUI.selectAnnotations(['123']);
...@@ -404,7 +404,7 @@ describe('WidgetController', function () { ...@@ -404,7 +404,7 @@ describe('WidgetController', function () {
it('does not show loggedout message if selection is unavailable', function () { it('does not show loggedout message if selection is unavailable', function () {
$scope.auth = { $scope.auth = {
status: 'signed-out' status: 'logged-out'
}; };
annotationUI.selectAnnotations(['missing']); annotationUI.selectAnnotations(['missing']);
$scope.$digest(); $scope.$digest();
...@@ -413,7 +413,7 @@ describe('WidgetController', function () { ...@@ -413,7 +413,7 @@ describe('WidgetController', function () {
it('does not show loggedout message if there is no selection', function () { it('does not show loggedout message if there is no selection', function () {
$scope.auth = { $scope.auth = {
status: 'signed-out' status: 'logged-out'
}; };
annotationUI.selectAnnotations([]); annotationUI.selectAnnotations([]);
$scope.$digest(); $scope.$digest();
...@@ -422,7 +422,7 @@ describe('WidgetController', function () { ...@@ -422,7 +422,7 @@ describe('WidgetController', function () {
it('does not show loggedout message if user is not logged out', function () { it('does not show loggedout message if user is not logged out', function () {
$scope.auth = { $scope.auth = {
status: 'signed-in' status: 'logged-in'
}; };
annotationUI.addAnnotations([{id: '123'}]); annotationUI.addAnnotations([{id: '123'}]);
annotationUI.selectAnnotations(['123']); annotationUI.selectAnnotations(['123']);
...@@ -432,7 +432,7 @@ describe('WidgetController', function () { ...@@ -432,7 +432,7 @@ describe('WidgetController', function () {
it('does not show loggedout message if not a direct link', function () { it('does not show loggedout message if not a direct link', function () {
$scope.auth = { $scope.auth = {
status: 'signed-out' status: 'logged-out'
}; };
delete fakeSettings.annotations; delete fakeSettings.annotations;
annotationUI.addAnnotations([{id: '123'}]); annotationUI.addAnnotations([{id: '123'}]);
......
...@@ -361,7 +361,7 @@ module.exports = function WidgetController( ...@@ -361,7 +361,7 @@ module.exports = function WidgetController(
$scope.shouldShowLoggedOutMessage = function () { $scope.shouldShowLoggedOutMessage = function () {
// If user is not logged out, don't show CTA. // If user is not logged out, don't show CTA.
if ($scope.auth.status !== 'signed-out') { if ($scope.auth.status !== 'logged-out') {
return false; return false;
} }
......
<span ng-if="auth.status === 'signed-out'" <span ng-if="auth.status === 'logged-out'"
ng-switch on="groups.focused().public"> ng-switch on="groups.focused().public">
<i class="group-list-label__icon h-icon-public" ng-switch-when="true"></i><!-- nospace <i class="group-list-label__icon h-icon-public" ng-switch-when="true"></i><!-- nospace
!--><i class="group-list-label__icon h-icon-group" ng-switch-default></i> !--><i class="group-list-label__icon h-icon-group" ng-switch-default></i>
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
</span> </span>
<div class="pull-right" <div class="pull-right"
ng-if="auth.status === 'signed-in'" ng-if="auth.status === 'logged-in'"
dropdown dropdown
keyboard-nav> keyboard-nav>
<div class="dropdown-toggle" <div class="dropdown-toggle"
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
<span class="login-text" <span class="login-text"
ng-if="vm.newStyle && vm.auth.status === 'unknown'"></span> ng-if="vm.newStyle && vm.auth.status === 'unknown'"></span>
<span class="login-text" <span class="login-text"
ng-if="vm.newStyle && vm.auth.status === 'signed-out'"> ng-if="vm.newStyle && vm.auth.status === 'logged-out'">
<a href="{{vm.serviceUrl}}register" target="_blank">Sign up</a> <a href="{{vm.serviceUrl}}register" target="_blank">Sign up</a>
/ <a href="" ng-click="vm.onLogin()">Log in</a> / <a href="" ng-click="vm.onLogin()">Log in</a>
</span> </span>
...@@ -15,23 +15,23 @@ ...@@ -15,23 +15,23 @@
data-toggle="dropdown" data-toggle="dropdown"
dropdown-toggle dropdown-toggle
title="{{vm.auth.username}}"> title="{{vm.auth.username}}">
<i class="h-icon-account" ng-if="vm.auth.status === 'signed-in'"></i><!-- <i class="h-icon-account" ng-if="vm.auth.status === 'logged-in'"></i><!--
!--><i class="h-icon-arrow-drop-down top-bar__dropdown-arrow"></i> !--><i class="h-icon-arrow-drop-down top-bar__dropdown-arrow"></i>
</a> </a>
<ul class="dropdown-menu pull-right" role="menu"> <ul class="dropdown-menu pull-right" role="menu">
<li class="dropdown-menu__row" ng-if="vm.auth.status === 'signed-in'"> <li class="dropdown-menu__row" ng-if="vm.auth.status === 'logged-in'">
<a href="{{vm.serviceUrl}}stream?q=user:{{vm.auth.username}}" <a href="{{vm.serviceUrl}}stream?q=user:{{vm.auth.username}}"
class="dropdown-menu__link" class="dropdown-menu__link"
title="View all your annotations" title="View all your annotations"
target="_blank">{{vm.auth.username}}</a> target="_blank">{{vm.auth.username}}</a>
</li> </li>
<li class="dropdown-menu__row" ng-if="vm.auth.status === 'signed-in'"> <li class="dropdown-menu__row" ng-if="vm.auth.status === 'logged-in'">
<a class="dropdown-menu__link" href="{{vm.serviceUrl}}profile" target="_blank">Account settings</a> <a class="dropdown-menu__link" href="{{vm.serviceUrl}}profile" target="_blank">Account settings</a>
</li> </li>
<li class="dropdown-menu__row"> <li class="dropdown-menu__row">
<a class="dropdown-menu__link" ng-click="vm.onShowHelpPanel()">Help</a> <a class="dropdown-menu__link" ng-click="vm.onShowHelpPanel()">Help</a>
</li> </li>
<li class="dropdown-menu__row" ng-if="vm.auth.status === 'signed-in'"> <li class="dropdown-menu__row" ng-if="vm.auth.status === 'logged-in'">
<a class="dropdown-menu__link dropdown-menu__link--subtle" <a class="dropdown-menu__link dropdown-menu__link--subtle"
href="" ng-click="vm.onLogout()">Log out</a> href="" ng-click="vm.onLogout()">Log out</a>
</li> </li>
...@@ -40,7 +40,7 @@ ...@@ -40,7 +40,7 @@
<!-- Old controls --> <!-- Old controls -->
<span ng-if="!vm.newStyle && vm.auth.status === 'unknown'"></span> <span ng-if="!vm.newStyle && vm.auth.status === 'unknown'"></span>
<span ng-if="!vm.newStyle && vm.auth.status === 'signed-out'"> <span ng-if="!vm.newStyle && vm.auth.status === 'logged-out'">
<a href="" ng-click="vm.onLogin()">Log in</a> <a href="" ng-click="vm.onLogin()">Log in</a>
</span> </span>
<div ng-if="!vm.newStyle" <div ng-if="!vm.newStyle"
...@@ -54,17 +54,17 @@ ...@@ -54,17 +54,17 @@
--><i class="h-icon-arrow-drop-down"></i> --><i class="h-icon-arrow-drop-down"></i>
</span> </span>
<ul class="dropdown-menu pull-right" role="menu"> <ul class="dropdown-menu pull-right" role="menu">
<li class="dropdown-menu__row" ng-if="vm.auth.status === 'signed-in'"> <li class="dropdown-menu__row" ng-if="vm.auth.status === 'logged-in'">
<a class="dropdown-menu__link" href="{{vm.serviceUrl}}profile" target="_blank">Account</a> <a class="dropdown-menu__link" href="{{vm.serviceUrl}}profile" target="_blank">Account</a>
</li> </li>
<li class="dropdown-menu__row" > <li class="dropdown-menu__row" >
<a class="dropdown-menu__link" ng-click="vm.onShowHelpPanel()">Help</a> <a class="dropdown-menu__link" ng-click="vm.onShowHelpPanel()">Help</a>
</li> </li>
<li class="dropdown-menu__row" ng-if="vm.auth.status === 'signed-in'"> <li class="dropdown-menu__row" ng-if="vm.auth.status === 'logged-in'">
<a class="dropdown-menu__link" href="{{vm.serviceUrl}}stream?q=user:{{vm.auth.username}}" <a class="dropdown-menu__link" href="{{vm.serviceUrl}}stream?q=user:{{vm.auth.username}}"
target="_blank">My Annotations</a> target="_blank">My Annotations</a>
</li> </li>
<li class="dropdown-menu__row" ng-if="vm.auth.status === 'signed-in'"> <li class="dropdown-menu__row" ng-if="vm.auth.status === 'logged-in'">
<a class="dropdown-menu__link" href="" ng-click="vm.onLogout()">Log out</a> <a class="dropdown-menu__link" href="" ng-click="vm.onLogout()">Log out</a>
</li> </li>
</ul> </ul>
......
...@@ -32,14 +32,14 @@ ...@@ -32,14 +32,14 @@
ng-if="selectedAnnotationUnavailable()"> ng-if="selectedAnnotationUnavailable()">
<div class="annotation-unavailable-message__icon"></div> <div class="annotation-unavailable-message__icon"></div>
<p class="annotation-unavailable-message__label"> <p class="annotation-unavailable-message__label">
<span ng-if="auth.status === 'signed-out'"> <span ng-if="auth.status === 'logged-out'">
This annotation is not available. This annotation is not available.
<br> <br>
You may need to You may need to
<a class="loggedout-message__link" href="" ng-click="login()">log in</a> <a class="loggedout-message__link" href="" ng-click="login()">log in</a>
to see it. to see it.
</span> </span>
<span ng-if="auth.status === 'signed-in'"> <span ng-if="auth.status === 'logged-in'">
You do not have permission to view this annotation. You do not have permission to view this annotation.
</span> </span>
</p> </p>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment