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
864
Issues
864
List
Boards
Labels
Service Desk
Milestones
Merge Requests
46
Merge Requests
46
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
Commits
4e8253fb
Commit
4e8253fb
authored
17 minutes ago
by
Emiliano Balbuena
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
(wip): Pro home
parent
cc328524
epic/minds-pro
1 merge request
!486
WIP: (feat): Minds Pro (development branch) - Release 2
Pipeline
#75261491
failed with stages
in 14 minutes and 17 seconds
Changes
6
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
96 additions
and
6 deletions
+96
-6
entities.ts
src/app/interfaces/entities.ts
+1
-0
channel.service.ts
src/app/modules/pro/channel/channel.service.ts
+36
-4
home.component.html
src/app/modules/pro/channel/home/home.component.html
+9
-0
home.component.scss
src/app/modules/pro/channel/home/home.component.scss
+11
-0
home.component.ts
src/app/modules/pro/channel/home/home.component.ts
+36
-0
pro.module.ts
src/app/modules/pro/pro.module.ts
+3
-2
No files found.
src/app/interfaces/entities.ts
View file @
4e8253fb
...
...
@@ -84,6 +84,7 @@ export interface MindsUser {
footer_links
:
{
href
:
string
,
title
:
string
}[],
scheme
:
string
,
styles
?:
{
[
key
:
string
]:
string
},
featured_content
?:
Array
<
string
>
,
};
}
...
...
This diff is collapsed.
Click to expand it.
src/app/modules/pro/channel/channel.service.ts
View file @
4e8253fb
...
...
@@ -2,21 +2,23 @@ import { EventEmitter, Injectable } from '@angular/core';
import
{
MindsChannelResponse
}
from
'
../../../interfaces/responses
'
;
import
{
MindsUser
,
Tag
}
from
'
../../../interfaces/entities
'
;
import
{
Client
}
from
'
../../../services/api/client
'
;
import
{
EntitiesService
}
from
'
../../../common/services/entities.service
'
;
import
normalizeUrn
from
'
../../../helpers/normalize-urn
'
;
@
Injectable
()
export
class
ProChannelService
{
currentChannel
:
MindsUser
;
selectedHashtag
:
Tag
;
selectedHashtagChange
:
EventEmitter
<
Tag
>
=
new
EventEmitter
<
Tag
>
();
setSelectedHashtag
(
value
:
Tag
)
{
this
.
selectedHashtag
=
value
;
this
.
selectedHashtagChange
.
emit
(
this
.
selectedHashtag
);
}
protected
featuredContent
:
Array
<
any
>
|
null
;
constructor
(
protected
client
:
Client
,
protected
entitiesService
:
EntitiesService
,
)
{
}
async
load
(
id
:
string
)
{
...
...
@@ -26,6 +28,7 @@ export class ProChannelService {
const
response
:
MindsChannelResponse
=
await
this
.
client
.
get
(
`api/v1/channel/
${
id
}
`
)
as
MindsChannelResponse
;
this
.
currentChannel
=
response
.
channel
;
this
.
featuredContent
=
null
;
return
this
.
currentChannel
;
}
catch
(
e
)
{
...
...
@@ -38,6 +41,35 @@ export class ProChannelService {
}
}
async
getFeaturedContent
():
Promise
<
Array
<
any
>>
{
if
(
!
this
.
currentChannel
)
{
this
.
featuredContent
=
null
;
return
[];
}
if
(
!
this
.
featuredContent
)
{
if
(
this
.
currentChannel
.
pro_settings
.
featured_content
&&
this
.
currentChannel
.
pro_settings
.
featured_content
.
length
)
{
try
{
const
urns
=
this
.
currentChannel
.
pro_settings
.
featured_content
.
map
(
guid
=>
normalizeUrn
(
guid
));
const
{
entities
}
=
await
this
.
entitiesService
.
fetch
(
urns
)
as
any
;
this
.
featuredContent
=
entities
;
}
catch
(
e
)
{
this
.
featuredContent
=
null
;
return
[];
}
}
else
{
this
.
featuredContent
=
[];
}
}
return
this
.
featuredContent
;
}
setSelectedHashtag
(
value
:
Tag
)
{
this
.
selectedHashtag
=
value
;
this
.
selectedHashtagChange
.
emit
(
this
.
selectedHashtag
);
}
linkTo
(
to
,
query
,
algorithm
?)
{
let
route
=
[
'
/pro
'
,
this
.
currentChannel
.
username
,
to
];
...
...
This diff is collapsed.
Click to expand it.
src/app/modules/pro/channel/home/home.component.html
0 → 100644
View file @
4e8253fb
<div
class=
"m-pro--channel-home"
>
<div
class=
"m-pro--channel-home--featured-content"
>
<m-pro--channel-tile
*ngFor=
"let entity of featuredContent"
[entity]=
"entity"
(click)=
"onFeaturedContentClick(entity)"
></m-pro--channel-tile>
</div>
</div>
This diff is collapsed.
Click to expand it.
src/app/modules/pro/channel/home/home.component.scss
0 → 100644
View file @
4e8253fb
.m-pro--channel-home
{
.m-pro--channel-home--featured-content
{
display
:
grid
;
grid-gap
:
24px
;
grid-template-columns
:
repeat
(
2
,
1fr
);
*
:first-child
{
grid-column
:
span
2
;
}
}
}
This diff is collapsed.
Click to expand it.
src/app/modules/pro/channel/home/home.component.ts
0 → 100644
View file @
4e8253fb
import
{
ChangeDetectionStrategy
,
ChangeDetectorRef
,
Component
,
OnInit
}
from
'
@angular/core
'
;
import
{
ProChannelService
}
from
'
../channel.service
'
;
@
Component
({
selector
:
'
m-pro--channel-home
'
,
changeDetection
:
ChangeDetectionStrategy
.
OnPush
,
templateUrl
:
'
home.component.html
'
,
})
export
class
ProChannelHomeComponent
implements
OnInit
{
featuredContent
:
Array
<
any
>
=
[];
constructor
(
protected
channelService
:
ProChannelService
,
protected
cd
:
ChangeDetectorRef
,
)
{
}
ngOnInit
()
{
this
.
load
();
}
async
load
()
{
this
.
featuredContent
=
await
this
.
channelService
.
getFeaturedContent
();
this
.
detectChanges
();
}
onFeaturedContentClick
(
entity
)
{
}
detectChanges
()
{
this
.
cd
.
markForCheck
();
this
.
cd
.
detectChanges
();
}
}
This diff is collapsed.
Click to expand it.
src/app/modules/pro/pro.module.ts
View file @
4e8253fb
...
...
@@ -21,6 +21,7 @@ import { WireModule } from "../wire/wire.module";
import
{
ProContentModalComponent
}
from
"
./channel/content-modal/modal.component
"
;
import
{
VideoModule
}
from
"
../media/components/video/video.module
"
;
import
{
ProChannelListModal
}
from
'
./channel/list-modal/list-modal.component
'
;
import
{
ProChannelHomeComponent
}
from
'
./channel/home/home.component
'
;
const
routes
:
Routes
=
[
{
...
...
@@ -40,8 +41,7 @@ const routes: Routes = [
children
:
[
{
path
:
''
,
redirectTo
:
'
articles
'
,
pathMatch
:
'
full
'
component
:
ProChannelHomeComponent
,
},
{
path
:
'
donate
'
,
...
...
@@ -83,6 +83,7 @@ const routes: Routes = [
ProSubscriptionComponent
,
ProTileComponent
,
ProContentModalComponent
,
ProChannelHomeComponent
,
ProChannelListModal
,
ProChannelComponent
,
ProChannelSignupComponent
,
...
...
This diff is collapsed.
Click to expand it.
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