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) {
if (userid) {
var parsed = parseAccountID(userid);
return {
status: 'signed-in',
status: 'logged-in',
userid: userid,
username: parsed.username,
provider: parsed.provider,
};
} else {
return {status: 'signed-out'};
return {status: 'logged-out'};
}
}
......
......@@ -64,7 +64,7 @@ describe('groupList', function () {
function createGroupList() {
return util.createDirective(document, 'groupList', {
auth: {
status: 'signed-in',
status: 'logged-in',
},
});
}
......
......@@ -140,20 +140,20 @@ describe('AppController', function () {
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();
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 () {
return Promise.resolve({userid: 'acct:jim@hypothes.is'});
};
createController();
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 () {
userid: 'acct:john@hypothes.is',
});
assert.deepEqual($scope.auth, {
status: 'signed-in',
status: 'logged-in',
userid: 'acct:john@hypothes.is',
username: 'john',
provider: 'hypothes.is',
......
......@@ -394,7 +394,7 @@ describe('WidgetController', function () {
it('shows logged out message if selection is available', function () {
$scope.auth = {
status: 'signed-out'
status: 'logged-out'
};
annotationUI.addAnnotations([{id: '123'}]);
annotationUI.selectAnnotations(['123']);
......@@ -404,7 +404,7 @@ describe('WidgetController', function () {
it('does not show loggedout message if selection is unavailable', function () {
$scope.auth = {
status: 'signed-out'
status: 'logged-out'
};
annotationUI.selectAnnotations(['missing']);
$scope.$digest();
......@@ -413,7 +413,7 @@ describe('WidgetController', function () {
it('does not show loggedout message if there is no selection', function () {
$scope.auth = {
status: 'signed-out'
status: 'logged-out'
};
annotationUI.selectAnnotations([]);
$scope.$digest();
......@@ -422,7 +422,7 @@ describe('WidgetController', function () {
it('does not show loggedout message if user is not logged out', function () {
$scope.auth = {
status: 'signed-in'
status: 'logged-in'
};
annotationUI.addAnnotations([{id: '123'}]);
annotationUI.selectAnnotations(['123']);
......@@ -432,7 +432,7 @@ describe('WidgetController', function () {
it('does not show loggedout message if not a direct link', function () {
$scope.auth = {
status: 'signed-out'
status: 'logged-out'
};
delete fakeSettings.annotations;
annotationUI.addAnnotations([{id: '123'}]);
......
......@@ -361,7 +361,7 @@ module.exports = function WidgetController(
$scope.shouldShowLoggedOutMessage = function () {
// If user is not logged out, don't show CTA.
if ($scope.auth.status !== 'signed-out') {
if ($scope.auth.status !== 'logged-out') {
return false;
}
......
<span ng-if="auth.status === 'signed-out'"
<span ng-if="auth.status === 'logged-out'"
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-group" ng-switch-default></i>
......@@ -6,7 +6,7 @@
</span>
<div class="pull-right"
ng-if="auth.status === 'signed-in'"
ng-if="auth.status === 'logged-in'"
dropdown
keyboard-nav>
<div class="dropdown-toggle"
......
......@@ -2,7 +2,7 @@
<span class="login-text"
ng-if="vm.newStyle && vm.auth.status === 'unknown'"></span>
<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="" ng-click="vm.onLogin()">Log in</a>
</span>
......@@ -15,23 +15,23 @@
data-toggle="dropdown"
dropdown-toggle
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>
</a>
<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}}"
class="dropdown-menu__link"
title="View all your annotations"
target="_blank">{{vm.auth.username}}</a>
</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>
</li>
<li class="dropdown-menu__row">
<a class="dropdown-menu__link" ng-click="vm.onShowHelpPanel()">Help</a>
</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"
href="" ng-click="vm.onLogout()">Log out</a>
</li>
......@@ -40,7 +40,7 @@
<!-- Old controls -->
<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>
</span>
<div ng-if="!vm.newStyle"
......@@ -54,17 +54,17 @@
--><i class="h-icon-arrow-drop-down"></i>
</span>
<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>
</li>
<li class="dropdown-menu__row" >
<a class="dropdown-menu__link" ng-click="vm.onShowHelpPanel()">Help</a>
</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}}"
target="_blank">My Annotations</a>
</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>
</li>
</ul>
......
......@@ -32,14 +32,14 @@
ng-if="selectedAnnotationUnavailable()">
<div class="annotation-unavailable-message__icon"></div>
<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.
<br>
You may need to
<a class="loggedout-message__link" href="" ng-click="login()">log in</a>
to see it.
</span>
<span ng-if="auth.status === 'signed-in'">
<span ng-if="auth.status === 'logged-in'">
You do not have permission to view this annotation.
</span>
</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