Unverified Commit bd831601 authored by Robert Knight's avatar Robert Knight Committed by GitHub

Merge pull request #697 from hypothesis/remove-public-from-annotation

Remove `group.public` property from annotation component
parents 694e27b2 65c78edb
...@@ -547,7 +547,7 @@ function AnnotationController( ...@@ -547,7 +547,7 @@ function AnnotationController(
if (!self.editing() || !self.isShared()) { if (!self.editing() || !self.isShared()) {
return false; return false;
} }
return self.group().public; return self.group().type !== 'private';
}; };
init(); init();
......
...@@ -20,12 +20,17 @@ var groupFixtures = { ...@@ -20,12 +20,17 @@ var groupFixtures = {
private: { private: {
id: 'private', id: 'private',
url: 'https://example.org/g/private', url: 'https://example.org/g/private',
public: false, type: 'private',
}, },
public: { open: {
id: 'world', id: 'world',
url: 'https://example.org/g/public', url: 'https://example.org/g/open',
public: true, type: 'open',
},
restricted: {
id: 'restricto',
url: 'https://example.org/g/restricto',
type: 'restricted',
}, },
}; };
...@@ -213,8 +218,8 @@ describe('annotation', function() { ...@@ -213,8 +218,8 @@ describe('annotation', function() {
fakeServiceUrl = sinon.stub(); fakeServiceUrl = sinon.stub();
fakeGroups = { fakeGroups = {
focused: sinon.stub().returns(groupFixtures.public), focused: sinon.stub().returns(groupFixtures.open),
get: sinon.stub().returns(groupFixtures.public), get: sinon.stub().returns(groupFixtures.open),
}; };
fakeSettings = { fakeSettings = {
...@@ -878,12 +883,12 @@ describe('annotation', function() { ...@@ -878,12 +883,12 @@ describe('annotation', function() {
}, [{ }, [{
case_: 'the annotation is not being edited', case_: 'the annotation is not being edited',
draft: null, draft: null,
group: groupFixtures.public, group: groupFixtures.open,
expected: false, expected: false,
},{ },{
case_: 'the draft is private', case_: 'the draft is private',
draft: draftFixtures.private, draft: draftFixtures.private,
group: groupFixtures.public, group: groupFixtures.open,
expected: false, expected: false,
},{ },{
case_: 'the group is private', case_: 'the group is private',
...@@ -891,9 +896,14 @@ describe('annotation', function() { ...@@ -891,9 +896,14 @@ describe('annotation', function() {
group: groupFixtures.private, group: groupFixtures.private,
expected: false, expected: false,
},{ },{
case_: 'the draft is shared and the group is public', case_: 'the draft is shared and the group is open',
draft: draftFixtures.shared,
group: groupFixtures.open,
expected: true,
},{
case_: 'the draft is shared and the group is restricted',
draft: draftFixtures.shared, draft: draftFixtures.shared,
group: groupFixtures.public, group: groupFixtures.restricted,
expected: true, expected: true,
}]); }]);
}); });
......
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