Skip to content
GitLab
Menu
Why GitLab
Pricing
Contact Sales
Explore
Why GitLab
Pricing
Contact Sales
Explore
Sign in
Get free trial
Commits on Source (3)
(chore): increase boost outlets and lower latency
· 196bd999
Mark Harding
authored
Jul 24, 2019
196bd999
(chore): some small changes to in feed boosts
· ac7bc7cb
Mark Harding
authored
Jul 24, 2019
ac7bc7cb
Merge remote-tracking branch 'origin/master' into feat/disable-comments-526
· 1b7b3d3d
Brian Hatchet
authored
Jul 24, 2019
1b7b3d3d
Hide whitespace changes
Inline
Side-by-side
src/app/common/components/featured-content/featured-content.component.ts
View file @
1b7b3d3d
...
...
@@ -66,12 +66,13 @@ export class FeaturedContentComponent implements OnInit {
update
()
{
this
.
clear
();
const
{
component
,
injector
}
=
this
.
resolve
();
if
(
!
this
.
dynamicHost
)
{
console
.
log
(
'
tried to load a boost but no dynamicHost found
'
,
this
.
entity
);
return
;
}
const
{
component
,
injector
}
=
this
.
resolve
();
if
(
component
)
{
const
componentFactory
=
this
.
componentFactoryResolver
.
resolveComponentFactory
(
component
);
...
...
src/app/common/components/featured-content/featured-content.service.ts
View file @
1b7b3d3d
import
{
Injectable
}
from
"
@angular/core
"
;
import
{
filter
,
first
,
map
,
switchMap
}
from
'
rxjs/operators
'
;
import
{
filter
,
first
,
map
,
switchMap
,
mergeMap
,
skip
,
take
}
from
'
rxjs/operators
'
;
import
{
FeedsService
}
from
"
../../services/feeds.service
"
;
@
Injectable
()
...
...
@@ -11,21 +11,27 @@ export class FeaturedContentService {
protected
feedsService
:
FeedsService
,
)
{
this
.
feedsService
.
setLimit
(
50
)
.
setLimit
(
12
)
.
setOffset
(
0
)
.
setEndpoint
(
'
api/v2/boost/feed
'
)
.
fetch
();
}
async
fetch
()
{
if
(
this
.
offset
>=
this
.
feedsService
.
rawFeed
.
getValue
().
length
)
{
this
.
offset
=
-
1
;
}
return
await
this
.
feedsService
.
feed
.
pipe
(
filter
(
feed
=>
feed
.
length
>
0
),
first
(),
map
(
feed
=>
feed
[
this
.
offset
++
]),
mergeMap
(
feed
=>
feed
),
skip
(
this
.
offset
++
),
take
(
1
),
switchMap
(
async
entity
=>
{
if
(
!
entity
)
if
(
!
entity
)
{
return
false
;
}
return
await
entity
.
pipe
(
first
()).
toPromise
();
}),
).
toPromise
();
...
...
src/app/modules/newsfeed/feeds/sorted.component.ts
View file @
1b7b3d3d
...
...
@@ -295,10 +295,10 @@ export class NewsfeedSortedComponent implements OnInit, OnDestroy {
}
shouldShowBoost
(
i
:
number
)
{
if
(
this
.
query
)
{
return
false
;
}
//
if (this.query) {
//
return false;
//
}
return
(
i
>
0
&&
(
i
%
8
)
===
0
&&
i
<=
4
0
)
||
i
===
2
;
return
(
i
>
0
&&
(
i
%
5
)
===
0
&&
i
<=
8
0
)
||
i
===
1
;
}
}