Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
coopwire-hypothesis
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
孙灵跃 Leon Sun
coopwire-hypothesis
Commits
2d875fe1
Commit
2d875fe1
authored
Sep 25, 2017
by
Robert Knight
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove checks for `orphans_tab` feature flag
This has been enabled for all users for many months now.
parent
6cbad41e
Changes
8
Show whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
5 additions
and
50 deletions
+5
-50
annotation.js
src/sidebar/components/annotation.js
+0
-7
selection-tabs.js
src/sidebar/components/selection-tabs.js
+0
-4
sidebar-content.js
src/sidebar/components/sidebar-content.js
+2
-4
root-thread.js
src/sidebar/root-thread.js
+1
-2
tabs.js
src/sidebar/tabs.js
+0
-11
selection-tabs.html
src/sidebar/templates/selection-tabs.html
+1
-1
root-thread-test.js
src/sidebar/test/root-thread-test.js
+1
-1
tabs-test.js
src/sidebar/test/tabs-test.js
+0
-20
No files found.
src/sidebar/components/annotation.js
View file @
2d875fe1
...
@@ -447,14 +447,7 @@ function AnnotationController(
...
@@ -447,14 +447,7 @@ function AnnotationController(
return
serviceUrl
(
'search.tag'
,
{
tag
:
tag
});
return
serviceUrl
(
'search.tag'
,
{
tag
:
tag
});
};
};
// Note: We fetch the feature flag outside the `isOrphan` method to avoid a
// lookup on every $digest cycle
var
indicateOrphans
=
features
.
flagEnabled
(
'orphans_tab'
);
this
.
isOrphan
=
function
()
{
this
.
isOrphan
=
function
()
{
if
(
!
indicateOrphans
)
{
return
false
;
}
if
(
typeof
self
.
annotation
.
$orphan
===
'undefined'
)
{
if
(
typeof
self
.
annotation
.
$orphan
===
'undefined'
)
{
return
self
.
annotation
.
$anchorTimeout
;
return
self
.
annotation
.
$anchorTimeout
;
}
}
...
...
src/sidebar/components/selection-tabs.js
View file @
2d875fe1
...
@@ -19,10 +19,6 @@ module.exports = {
...
@@ -19,10 +19,6 @@ module.exports = {
annotationUI
.
selectTab
(
type
);
annotationUI
.
selectTab
(
type
);
};
};
this
.
orphansTabFlagEnabled
=
function
()
{
return
features
.
flagEnabled
(
'orphans_tab'
);
};
this
.
showAnnotationsUnavailableMessage
=
function
()
{
this
.
showAnnotationsUnavailableMessage
=
function
()
{
return
this
.
selectedTab
===
this
.
TAB_ANNOTATIONS
&&
return
this
.
selectedTab
===
this
.
TAB_ANNOTATIONS
&&
this
.
totalAnnotations
===
0
&&
this
.
totalAnnotations
===
0
&&
...
...
src/sidebar/components/sidebar-content.js
View file @
2d875fe1
...
@@ -48,8 +48,7 @@ function SidebarContentController(
...
@@ -48,8 +48,7 @@ function SidebarContentController(
self
.
rootThread
=
thread
();
self
.
rootThread
=
thread
();
self
.
selectedTab
=
state
.
selectedTab
;
self
.
selectedTab
=
state
.
selectedTab
;
var
separateOrphans
=
tabs
.
shouldSeparateOrphans
(
state
);
var
counts
=
tabs
.
counts
(
state
.
annotations
,
true
/* separate orphans */
);
var
counts
=
tabs
.
counts
(
state
.
annotations
,
separateOrphans
);
Object
.
assign
(
self
,
{
Object
.
assign
(
self
,
{
totalNotes
:
counts
.
notes
,
totalNotes
:
counts
.
notes
,
...
@@ -227,8 +226,7 @@ function SidebarContentController(
...
@@ -227,8 +226,7 @@ function SidebarContentController(
focusAnnotation
(
selectedAnnot
);
focusAnnotation
(
selectedAnnot
);
scrollToAnnotation
(
selectedAnnot
);
scrollToAnnotation
(
selectedAnnot
);
var
separateOrphans
=
tabs
.
shouldSeparateOrphans
(
annotationUI
.
getState
());
annotationUI
.
selectTab
(
tabs
.
tabForAnnotation
(
selectedAnnot
,
true
/* separate orphans */
));
annotationUI
.
selectTab
(
tabs
.
tabForAnnotation
(
selectedAnnot
,
separateOrphans
));
});
});
// Re-fetch annotations when focused group, logged-in user or connected frames
// Re-fetch annotations when focused group, logged-in user or connected frames
...
...
src/sidebar/root-thread.js
View file @
2d875fe1
...
@@ -66,9 +66,8 @@ function RootThread($rootScope, annotationUI, drafts, searchFilter, viewFilter)
...
@@ -66,9 +66,8 @@ function RootThread($rootScope, annotationUI, drafts, searchFilter, viewFilter)
return
false
;
return
false
;
}
}
var
separateOrphans
=
tabs
.
shouldSeparateOrphans
(
state
);
return
tabs
.
shouldShowInTab
(
thread
.
annotation
,
state
.
selectedTab
,
return
tabs
.
shouldShowInTab
(
thread
.
annotation
,
state
.
selectedTab
,
separateOrphans
);
true
/* separate orphans */
);
};
};
}
}
...
...
src/sidebar/tabs.js
View file @
2d875fe1
...
@@ -5,18 +5,8 @@
...
@@ -5,18 +5,8 @@
var
countIf
=
require
(
'./util/array-util'
).
countIf
;
var
countIf
=
require
(
'./util/array-util'
).
countIf
;
var
metadata
=
require
(
'./annotation-metadata'
);
var
metadata
=
require
(
'./annotation-metadata'
);
var
session
=
require
(
'./reducers/session'
);
var
uiConstants
=
require
(
'./ui-constants'
);
var
uiConstants
=
require
(
'./ui-constants'
);
/**
* Return true if Annotations and Orphans should be displayed in separate tabs.
*
* @param {object} state - The current application state.
*/
function
shouldSeparateOrphans
(
state
)
{
return
session
.
isFeatureEnabled
(
state
,
'orphans_tab'
);
}
/**
/**
* Return the tab in which an annotation should be displayed.
* Return the tab in which an annotation should be displayed.
*
*
...
@@ -78,7 +68,6 @@ function counts(annotations, separateOrphans) {
...
@@ -78,7 +68,6 @@ function counts(annotations, separateOrphans) {
module
.
exports
=
{
module
.
exports
=
{
counts
:
counts
,
counts
:
counts
,
shouldSeparateOrphans
:
shouldSeparateOrphans
,
shouldShowInTab
:
shouldShowInTab
,
shouldShowInTab
:
shouldShowInTab
,
tabForAnnotation
:
tabForAnnotation
,
tabForAnnotation
:
tabForAnnotation
,
};
};
src/sidebar/templates/selection-tabs.html
View file @
2d875fe1
...
@@ -22,7 +22,7 @@
...
@@ -22,7 +22,7 @@
</span>
</span>
</a>
</a>
<a
class=
"selection-tabs__type selection-tabs__type--orphan"
<a
class=
"selection-tabs__type selection-tabs__type--orphan"
ng-if=
"vm.
orphansTabFlagEnabled() && vm.
totalOrphans > 0"
ng-if=
"vm.totalOrphans > 0"
href=
"#"
href=
"#"
ng-class=
"{'is-selected': vm.selectedTab === vm.TAB_ORPHANS}"
ng-class=
"{'is-selected': vm.selectedTab === vm.TAB_ORPHANS}"
h-on-touch=
"vm.selectTab(vm.TAB_ORPHANS)"
>
h-on-touch=
"vm.selectTab(vm.TAB_ORPHANS)"
>
...
...
src/sidebar/test/root-thread-test.js
View file @
2d875fe1
...
@@ -46,7 +46,7 @@ describe('rootThread', function () {
...
@@ -46,7 +46,7 @@ describe('rootThread', function () {
isSidebar
:
true
,
isSidebar
:
true
,
selectedAnnotationMap
:
null
,
selectedAnnotationMap
:
null
,
session
:
{
session
:
{
features
:
{
'orphans_tab'
:
true
},
features
:
{},
},
},
sortKey
:
'Location'
,
sortKey
:
'Location'
,
sortKeysAvailable
:
[
'Location'
],
sortKeysAvailable
:
[
'Location'
],
...
...
src/sidebar/test/tabs-test.js
View file @
2d875fe1
...
@@ -6,26 +6,6 @@ var tabs = require('../tabs');
...
@@ -6,26 +6,6 @@ var tabs = require('../tabs');
var
unroll
=
require
(
'../../shared/test/util'
).
unroll
;
var
unroll
=
require
(
'../../shared/test/util'
).
unroll
;
describe
(
'tabs'
,
function
()
{
describe
(
'tabs'
,
function
()
{
describe
(
'shouldSeparateOrphans'
,
function
()
{
it
(
'returns true if the "orphans_tab" flag is enabled'
,
function
()
{
var
state
=
{
session
:
{
features
:
{
'orphans_tab'
:
true
},
},
};
assert
.
isTrue
(
tabs
.
shouldSeparateOrphans
(
state
));
});
it
(
'returns false if the "orphans_tab" flag is not enabled'
,
function
()
{
var
state
=
{
session
:
{
features
:
{
'orphans_tab'
:
false
},
},
};
assert
.
isFalse
(
tabs
.
shouldSeparateOrphans
(
state
));
});
});
describe
(
'tabForAnnotation'
,
function
()
{
describe
(
'tabForAnnotation'
,
function
()
{
unroll
(
'shows annotation in correct tab'
,
function
(
testCase
)
{
unroll
(
'shows annotation in correct tab'
,
function
(
testCase
)
{
var
ann
=
testCase
.
ann
;
var
ann
=
testCase
.
ann
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment