Skip to content
Next
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Switch to GitLab Next
Sign in / Register
Toggle navigation
Minds Frontend
Project
Project
Details
Activity
Releases
Cycle Analytics
Insights
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Locked Files
Issues
859
Issues
859
List
Boards
Labels
Service Desk
Milestones
Merge Requests
54
Merge Requests
54
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
List
Container Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Minds
Minds Frontend
Compare Revisions
d533ef8591308e34cded3ae503e9ac90658c93dc...01017e3152e735e14c16559913ba96a158797c6f
Source
01017e3152e735e14c16559913ba96a158797c6f
Select Git revision
...
Target
d533ef8591308e34cded3ae503e9ac90658c93dc
Select Git revision
Compare
Commits (2)
(feat): Pro homepage content
· 1466efd3
Emiliano Balbuena
authored
42 minutes ago
1466efd3
(feat): Pro homepage mobile view
· 01017e31
Emiliano Balbuena
authored
22 minutes ago
01017e31
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
88 additions
and
7 deletions
+88
-7
channel.service.ts
src/app/modules/pro/channel/channel.service.ts
+25
-3
home.component.html
src/app/modules/pro/channel/home/home.component.html
+9
-1
home.component.scss
src/app/modules/pro/channel/home/home.component.scss
+26
-1
home.component.ts
src/app/modules/pro/channel/home/home.component.ts
+28
-2
No files found.
src/app/modules/pro/channel/channel.service.ts
View file @
01017e31
...
...
@@ -14,7 +14,6 @@ export class ProChannelService {
childParamsChange
:
EventEmitter
<
any
>
=
new
EventEmitter
<
any
>
();
protected
featuredContent
:
Array
<
any
>
|
null
;
constructor
(
...
...
@@ -46,8 +45,7 @@ export class ProChannelService {
async
getFeaturedContent
():
Promise
<
Array
<
any
>>
{
if
(
!
this
.
currentChannel
)
{
this
.
featuredContent
=
null
;
return
[];
throw
new
Error
(
'
No channel
'
);
}
if
(
!
this
.
featuredContent
)
{
...
...
@@ -69,6 +67,30 @@ export class ProChannelService {
return
this
.
featuredContent
;
}
async
getContent
({
limit
,
offset
}:
{
limit
?:
number
,
offset
?
}
=
{}):
Promise
<
{
content
:
Array
<
any
>
,
offset
:
any
}
>
{
if
(
!
this
.
currentChannel
)
{
throw
new
Error
(
'
No channel
'
);
}
const
endpoint
=
`api/v2/feeds/channel/
${
this
.
currentChannel
.
guid
}
/all/top`
;
const
qs
=
{
limit
:
limit
||
24
,
from_timestamp
:
offset
||
''
,
sync
:
1
,
exclude
:
((
this
.
currentChannel
.
pro_settings
.
featured_content
||
[]).
join
(
'
,
'
))
||
''
,
};
const
{
entities
:
feedSyncEntities
,
'
load-next
'
:
loadNext
}
=
await
this
.
client
.
get
(
endpoint
,
qs
)
as
any
;
const
{
entities
}
=
await
this
.
entitiesService
.
fetch
(
feedSyncEntities
.
map
(
feedSyncEntity
=>
normalizeUrn
(
feedSyncEntity
.
guid
)))
as
any
;
let
nextOffset
=
feedSyncEntities
&&
feedSyncEntities
.
length
?
loadNext
:
''
;
return
{
content
:
entities
,
offset
:
nextOffset
,
};
}
setChildParams
(
params
:
any
)
{
this
.
childParams
=
params
;
this
.
childParamsChange
.
emit
(
this
.
childParams
);
...
...
This diff is collapsed.
Click to expand it.
src/app/modules/pro/channel/home/home.component.html
View file @
01017e31
...
...
@@ -3,7 +3,15 @@
<m-pro--channel-tile
*ngFor=
"let entity of featuredContent"
[entity]=
"entity"
(click)=
"onFeaturedContentClick(entity)"
(click)=
"onContentClick(entity)"
></m-pro--channel-tile>
</div>
<div
class=
"m-pro--channel-home--content"
>
<m-pro--channel-tile
*ngFor=
"let entity of content"
[entity]=
"entity"
(click)=
"onContentClick(entity)"
></m-pro--channel-tile>
</div>
</div>
This diff is collapsed.
Click to expand it.
src/app/modules/pro/channel/home/home.component.scss
View file @
01017e31
...
...
@@ -14,15 +14,40 @@
font-size
:
46px
;
}
.m-pro--channel-home--featured-content
{
.m-pro--channel-home--featured-content
,
.m-pro--channel-home--content
{
width
:
80%
;
margin
:
0
auto
;
display
:
grid
;
grid-gap
:
24px
;
@media
screen
and
(
max-width
:
$max-mobile
)
{
width
:
100%
;
}
}
.m-pro--channel-home--featured-content
{
grid-template-columns
:
repeat
(
2
,
1fr
);
*
:first-child
{
grid-column
:
span
2
;
}
@media
screen
and
(
max-width
:
$max-mobile
)
{
grid-template-columns
:
repeat
(
1
,
1fr
);
*
:first-child
{
grid-column
:
initial
;
}
}
}
.m-pro--channel-home--content
{
margin
:
24px
auto
;
grid-template-columns
:
repeat
(
3
,
1fr
);
@media
screen
and
(
max-width
:
$max-mobile
)
{
grid-template-columns
:
repeat
(
1
,
1fr
);
}
}
}
This diff is collapsed.
Click to expand it.
src/app/modules/pro/channel/home/home.component.ts
View file @
01017e31
...
...
@@ -8,8 +8,14 @@ import { ProChannelService } from '../channel.service';
})
export
class
ProChannelHomeComponent
implements
OnInit
{
inProgress
:
boolean
=
false
;
featuredContent
:
Array
<
any
>
=
[];
content
:
Array
<
any
>
=
[];
moreData
:
boolean
=
true
;
constructor
(
protected
channelService
:
ProChannelService
,
protected
cd
:
ChangeDetectorRef
,
...
...
@@ -22,11 +28,31 @@ export class ProChannelHomeComponent implements OnInit {
}
async
load
()
{
this
.
featuredContent
=
await
this
.
channelService
.
getFeaturedContent
();
this
.
inProgress
=
true
;
this
.
featuredContent
=
[];
this
.
content
=
[];
this
.
moreData
=
true
;
this
.
detectChanges
();
try
{
this
.
featuredContent
=
await
this
.
channelService
.
getFeaturedContent
();
this
.
detectChanges
();
const
{
content
}
=
await
this
.
channelService
.
getContent
({
limit
:
24
,
});
this
.
content
.
push
(...
content
);
this
.
detectChanges
();
}
catch
(
e
)
{
this
.
moreData
=
false
;
}
this
.
inProgress
=
false
;
this
.
detectChanges
();
}
on
Featured
ContentClick
(
entity
)
{
onContentClick
(
entity
)
{
}
...
...
This diff is collapsed.
Click to expand it.