Skip to content
Projects
Groups
Snippets
Help
Sign in / Register
Toggle navigation
Minds Frontend
Project overview
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Locked Files
Issues
408
Merge Requests
65
CI / CD
Security & Compliance
Packages
Analytics
Wiki
Snippets
Members
Collapse sidebar
Close sidebar
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Minds
Minds Frontend
Commits
1a2794da
Commit
1a2794da
authored
45 minutes ago
by
Mark Harding
Browse files
Options
Download
(fix): linting
parent
30a0f05e
feat/2546-pro-ui
1 merge request
!770
WIP: #2546 Pro UI unified tiles
Pipeline
#119606564
failed with stages
in 12 minutes and 1 second
Changes
18
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
18 changed files
with
100 additions
and
78 deletions
+100
-78
src/app/common/components/rich-embed/rich-embed.ts
View file @
1a2794da
...
...
@@ -38,7 +38,7 @@ export class MindsRichEmbed {
private
cd
:
ChangeDetectorRef
,
protected
featureService
:
FeaturesService
,
private
mediaProxy
:
MediaProxyService
,
private
configs
:
ConfigsService
,
private
configs
:
ConfigsService
)
{}
set
_src
(
value
:
any
)
{
...
...
@@ -154,8 +154,7 @@ export class MindsRichEmbed {
// Minds blog
const
siteUrl
=
this
.
configs
.
get
(
'
site_url
'
);
if
(
url
.
indexOf
(
siteUrl
)
===
0
)
this
.
mediaSource
=
'
minds
'
;
if
(
url
.
indexOf
(
siteUrl
)
===
0
)
this
.
mediaSource
=
'
minds
'
;
// YouTube
let
youtube
=
/^
(?:
https
?
:
\/\/)?(?:
www
\.)?(?:
youtu
\.
be
\/
|youtube
\.
com
\/(?:
embed
\/
|v
\/
|watch
\?
v=|watch
\?
.+&v=
))((\w
|-
){11})(?:\S
+
)?
$/i
;
...
...
This diff is collapsed.
src/app/modules/newsfeed/activity/content/content.component.scss
View file @
1a2794da
...
...
@@ -49,14 +49,15 @@ m-activity__content {
&
.m-activityContent__message--short
{
line-height
:
34px
;
font-size
:
28px
;
}
}
}
}
.m-activity--noOwnerBlock
.m-activityContent__message
{
padding-top
:
16px
;
}
.m-activityContent__message
,
.m-activityContent__mediaDescription
{
.m-activityContent__message
,
.m-activityContent__mediaDescription
{
@include
m-theme
()
{
color
:
themed
(
$m-textColor--primary
);
}
...
...
This diff is collapsed.
src/app/modules/newsfeed/activity/content/content.component.ts
View file @
1a2794da
...
...
@@ -85,9 +85,13 @@ export class ActivityContentComponent {
if
(
this
.
mediaDescription
)
return
''
;
// No message if the same as blog title
if
(
this
.
entity
.
perma_url
&&
(
!
this
.
entity
.
message
||
this
.
entity
.
title
===
this
.
entity
.
message
))
return
''
;
if
(
this
.
entity
.
perma_url
&&
(
!
this
.
entity
.
message
||
this
.
entity
.
title
===
this
.
entity
.
message
)
)
return
''
;
return
(
this
.
entity
.
message
||
this
.
entity
.
title
)
;
return
this
.
entity
.
message
||
this
.
entity
.
title
;
}
get
isRichEmbed
():
boolean
{
...
...
@@ -96,7 +100,7 @@ export class ActivityContentComponent {
get
mediaDescription
():
string
{
return
this
.
isImage
||
this
.
isVideo
?
(
this
.
entity
.
message
||
this
.
entity
.
title
)
?
this
.
entity
.
message
||
this
.
entity
.
title
:
''
;
}
...
...
@@ -111,7 +115,9 @@ export class ActivityContentComponent {
get
isImage
():
boolean
{
return
(
this
.
entity
.
custom_type
==
'
batch
'
||
(
this
.
entity
.
thumbnail_src
&&
!
this
.
entity
.
perma_url
&&
this
.
entity
.
custom_type
!==
'
video
'
)
(
this
.
entity
.
thumbnail_src
&&
!
this
.
entity
.
perma_url
&&
this
.
entity
.
custom_type
!==
'
video
'
)
);
}
...
...
@@ -142,7 +148,7 @@ export class ActivityContentComponent {
get
videoHeight
():
string
{
if
(
!
this
.
mediaEl
)
return
''
;
const
height
=
this
.
mediaEl
.
nativeElement
.
clientWidth
/
(
16
/
9
);
const
height
=
this
.
mediaEl
.
nativeElement
.
clientWidth
/
(
16
/
9
);
return
`
${
height
}
px`
;
}
...
...
This diff is collapsed.
src/app/modules/newsfeed/activity/metrics/metrics.component.html
View file @
1a2794da
<span
class=
"m-activityMetrics__views"
*ngIf=
"views$ | async as views"
>
{{ views | number }} views
</span>
<span
class=
"m-activityMetrics__views"
*ngIf=
"views$ | async as views"
>
{{ views | number }} views
</span
>
This diff is collapsed.
src/app/modules/newsfeed/activity/toolbar/toolbar.component.scss
View file @
1a2794da
...
...
@@ -39,7 +39,8 @@ m-activity__toolbar {
minds-button-comment
{
cursor
:
pointer
;
.selected
i
.material-icons
,
.selected
.minds-counter
{
.selected
i
.material-icons
,
.selected
.minds-counter
{
@include
m-theme
()
{
color
:
themed
(
$m-grey-500
);
}
...
...
This diff is collapsed.
src/app/modules/newsfeed/activity/toolbar/toolbar.component.ts
View file @
1a2794da
...
...
@@ -27,8 +27,8 @@ export class ActivityToolbarComponent {
}
toggleComments
():
void
{
this
.
service
.
displayOptions
.
showComments
=
!
this
.
service
.
displayOptions
.
showComments
;
this
.
service
.
displayOptions
.
showComments
=
!
this
.
service
.
displayOptions
.
showComments
;
this
.
service
.
displayOptions
.
showOnlyCommentsInput
=
false
;
}
}
This diff is collapsed.
src/app/modules/newsfeed/feed-grid/feed-grid.component.html
View file @
1a2794da
<div
class=
"m-feedGrid__column"
*ngFor=
"let entities of columns"
>
<ng-container
*ngFor=
"let entity$ of entities; let i = index"
>
<m-newsfeed
__entity
[entity]=
"entity"
*ngIf=
"entity$ | async as entity"
[displayOptions]=
"{ showComments: false, v2: true }"
[slot]=
"i"
></m-newsfeed
__entity
>
</ng-container>
<ng-container
*ngFor=
"let entity$ of entities; let i = index"
>
<m-newsfeed
__entity
[entity]=
"entity"
*ngIf=
"entity$ | async as entity"
[displayOptions]=
"{ showComments: false, v2: true }"
[slot]=
"i"
></m-newsfeed
__entity
>
</ng-container>
</div>
This diff is collapsed.
src/app/modules/newsfeed/feed-grid/feed-grid.component.scss
View file @
1a2794da
m-feedGrid
{
display
:
flex
;
flex-direction
:
row
;
list-style
:
none
;
padding
:
0
;
display
:
flex
;
flex-direction
:
row
;
list-style
:
none
;
padding
:
0
;
}
.m-feedGrid__column
{
flex
:
1
;
margin-right
:
$minds-margin
*
2
;
margin-right
:
$minds-margin
*
2
;
&
:last-of-type
()
{
margin-right
:
0
;
...
...
@@ -15,6 +15,6 @@ m-feedGrid {
>
m-newsfeed__entity
{
display
:
block
;
margin-bottom
:
$minds-margin
*
2
;
margin-bottom
:
$minds-margin
*
2
;
}
}
This diff is collapsed.
src/app/modules/newsfeed/feed-grid/feed-grid.component.ts
View file @
1a2794da
import
{
Component
,
Input
,
Inject
,
PLATFORM_ID
,
ChangeDetectorRef
}
from
'
@angular/core
'
;
import
{
Component
,
Input
,
Inject
,
PLATFORM_ID
,
ChangeDetectorRef
,
}
from
'
@angular/core
'
;
import
{
isPlatformServer
}
from
'
@angular/common
'
;
import
{
Observable
,
Subject
,
combineLatest
,
Subscription
,
fromEvent
}
from
'
rxjs
'
;
import
{
Observable
,
Subject
,
combineLatest
,
Subscription
,
fromEvent
,
}
from
'
rxjs
'
;
import
{
map
,
debounceTime
}
from
'
rxjs/operators
'
;
import
isMobile
from
'
../../../helpers/is-mobile
'
;
...
...
@@ -11,7 +23,6 @@ const MIN_COLUMN_SIZE: number = 300;
templateUrl
:
'
./feed-grid.component.html
'
,
})
export
class
FeedGridComponent
{
@
Input
()
maxColumns
=
3
;
columnCount$
:
Subject
<
number
>
=
new
Subject
();
@
Input
(
'
entities
'
)
entities$
;
...
...
@@ -21,17 +32,19 @@ export class FeedGridComponent {
columnsSubscription
:
Subscription
;
windowResizeSubscription
:
Subscription
;
constructor
(@
Inject
(
PLATFORM_ID
)
private
platformId
:
Object
,
private
cd
:
ChangeDetectorRef
)
{}
constructor
(
@
Inject
(
PLATFORM_ID
)
private
platformId
:
Object
,
private
cd
:
ChangeDetectorRef
)
{}
ngOnInit
()
{
this
.
columns$
=
combineLatest
(
this
.
entities$
,
this
.
columnCount$
)
.
pipe
(
map
(([
entities
,
columnCount
]:
[[
any
],
number
])
=>
{
this
.
columns$
=
combineLatest
(
this
.
entities$
,
this
.
columnCount$
).
pipe
(
map
(([
entities
,
columnCount
]:
[[
any
],
number
])
=>
{
let
cols
=
[];
for
(
let
i
=
0
;
i
<
columnCount
;
++
i
)
{
cols
.
push
([]);
}
let
currentCol
=
-
1
;
for
(
let
entity
of
entities
)
{
++
currentCol
;
...
...
@@ -51,9 +64,9 @@ export class FeedGridComponent {
this
.
windowResizeSubscription
=
fromEvent
(
window
,
'
resize
'
)
.
pipe
(
debounceTime
(
300
))
.
subscribe
(
(
event
)
=>
{
.
subscribe
(
event
=>
{
this
.
calculateColumnCount
();
});
});
this
.
calculateColumnCount
();
}
...
...
@@ -61,16 +74,18 @@ export class FeedGridComponent {
ngOnDestroy
()
{
this
.
columnsSubscription
.
unsubscribe
();
this
.
windowResizeSubscription
.
unsubscribe
();
}
}
calculateColumnCount
():
void
{
if
(
isPlatformServer
(
this
.
platformId
))
{
this
.
columnCount$
.
next
(
isMobile
()
?
1
:
this
.
maxColumns
);
this
.
columnCount$
.
next
(
isMobile
()
?
1
:
this
.
maxColumns
);
}
else
{
let
columns
:
number
=
this
.
maxColumns
;
const
maxCanFit
:
number
=
Math
.
max
(
1
,
Math
.
round
(
window
.
innerWidth
/
(
MIN_COLUMN_SIZE
*
1.25
)));
const
maxCanFit
:
number
=
Math
.
max
(
1
,
Math
.
round
(
window
.
innerWidth
/
(
MIN_COLUMN_SIZE
*
1.25
))
);
this
.
columnCount$
.
next
(
Math
.
min
(
maxCanFit
,
this
.
maxColumns
));
}
}
}
This diff is collapsed.
src/app/modules/newsfeed/feeds/entity.component.html
View file @
1a2794da
...
...
@@ -7,18 +7,22 @@
</ng-container>
<ng-container
*ngSwitchDefault
>
<m-activity
[entity]=
"entity"
[displayOptions]=
"displayOptions"
*ngIf=
"displayOptions.v2 === true; else v1"
>
<m-activity
[entity]=
"entity"
[displayOptions]=
"displayOptions"
*ngIf=
"displayOptions.v2 === true; else v1"
>
</m-activity>
<ng-template
#v1
>
<minds-activity
[object]=
"entity"
[boostToggle]=
"entity.boostToggle"
(delete)=
"delete(entity)"
[showRatingToggle]=
"true"
[slot]=
"slot"
class=
"mdl-card m-border item"
[attr.data-minds-activity-guid]=
"entity.guid"
></minds-activity>
<minds-activity
[object]=
"entity"
[boostToggle]=
"entity.boostToggle"
(delete)=
"delete(entity)"
[showRatingToggle]=
"true"
[slot]=
"slot"
class=
"mdl-card m-border item"
[attr.data-minds-activity-guid]=
"entity.guid"
></minds-activity>
</ng-template>
</ng-container>
</ng-container>
This diff is collapsed.
src/app/modules/pro/channel/content-list/content-list.component.html
View file @
1a2794da
<div
class=
"m-proChannelList__content"
>
<m-feedGrid
[maxColumns]=
"3"
[entities]=
"entities$"
>
</m-feedGrid>
<m-feedGrid
[maxColumns]=
"3"
[entities]=
"entities$"
>
</m-feedGrid>
<infinite-scroll
*ngIf=
"canAutoScroll"
...
...
This diff is collapsed.
src/app/modules/pro/channel/content-list/content-list.component.ts
View file @
1a2794da
...
...
@@ -26,7 +26,8 @@ import { OverlayModalService } from '../../../../services/ux/overlay-modal';
changeDetection
:
ChangeDetectionStrategy
.
OnPush
,
providers
:
[
FeedsService
],
})
export
class
ProChannelContentListComponent
implements
OnInit
,
OnDestroy
,
OnChanges
{
export
class
ProChannelContentListComponent
implements
OnInit
,
OnDestroy
,
OnChanges
{
@
Input
()
canAutoScroll
=
true
;
@
Input
()
category
:
string
;
@
Input
()
limit
:
number
=
12
;
...
...
@@ -56,8 +57,7 @@ export class ProChannelContentListComponent implements OnInit, OnDestroy, OnChan
this
.
load
(
true
);
}
ngOnDestroy
()
{
}
ngOnDestroy
()
{}
async
load
(
refresh
:
boolean
=
false
)
{
if
(
refresh
)
{
...
...
@@ -76,7 +76,7 @@ export class ProChannelContentListComponent implements OnInit, OnDestroy, OnChan
params
.
query
=
this
.
query
;
params
.
sync
=
1
;
}
params
.
force_public
=
1
;
let
url
=
`api/v2/pro/content/
${
this
.
channelService
.
currentChannel
.
guid
}
/
${
this
.
type
}
`
;
...
...
This diff is collapsed.
src/app/modules/pro/channel/home/category-content/category-content.component.html
View file @
1a2794da
<div
*ngFor=
"let category of categories$ | async"
>
<h2
i18n
>
<a
[routerLink]=
"getCategoryRoute(category.tag?.tag)"
>
{{
category.tag?.label
}}
</a>
</h2>
<h2
i18n
>
<a
[routerLink]=
"getCategoryRoute(category.tag?.tag)"
>
{{
category.tag?.label
}}
</a>
</h2>
<m-feedGrid
[entities]=
"category.entities$"
[maxColumns]=
"3"
></m-feedGrid>
<m-feedGrid
[entities]=
"category.entities$"
[maxColumns]=
"3"
></m-feedGrid>
</div>
This diff is collapsed.
src/app/modules/pro/channel/home/category-content/category-content.component.ts
View file @
1a2794da
...
...
@@ -12,7 +12,6 @@ import { Client } from '../../../../../services/api/client';
templateUrl
:
'
./category-content.component.html
'
,
})
export
class
ProChannelHomeCategoryContent
{
categories$
:
BehaviorSubject
<
any
>
=
new
BehaviorSubject
(
null
);
constructor
(
...
...
@@ -20,8 +19,7 @@ export class ProChannelHomeCategoryContent {
private
feedsService
:
FeedsService
,
protected
channelService
:
ProChannelService
,
protected
client
:
Client
)
{
}
)
{}
ngOnInit
()
{
this
.
load
();
...
...
@@ -46,7 +44,7 @@ export class ProChannelHomeCategoryContent {
return
entry
;
});
this
.
categories$
.
next
(
categories
);
}
}
getCategoryRoute
(
tag
)
{
if
(
!
this
.
channelService
.
currentChannel
||
!
tag
)
{
...
...
@@ -55,5 +53,4 @@ export class ProChannelHomeCategoryContent {
return
this
.
channelService
.
getRouterLink
(
'
all
'
,
{
hashtag
:
tag
});
}
}
This diff is collapsed.
src/app/modules/pro/channel/home/home.component.html
View file @
1a2794da
...
...
@@ -14,7 +14,7 @@
type=
"activities"
[limit]=
"12"
[canAutoScroll]=
"false"
>
>
</m-proChannel
__contentList
>
</div>
</div>
...
...
This diff is collapsed.
src/app/modules/pro/channel/home/home.component.scss
View file @
1a2794da
...
...
@@ -11,7 +11,8 @@ m-proChannel__home {
margin-bottom
:
0
;
}
>
h2
,
>
m-proChannelHome__categoryContent
>
div
>
h2
{
>
h2
,
>
m-proChannelHome__categoryContent
>
div
>
h2
{
margin
:
0
0
24px
;
padding
:
0
;
text-align
:
center
;
...
...
@@ -37,7 +38,7 @@ m-proChannel__home {
.m-proChannelHome__categoryContent
{
width
:
100%
;
margin
:
0
auto
;
@media
screen
and
(
max-width
:
$max-mobile
)
{
width
:
100%
;
}
...
...
@@ -49,7 +50,6 @@ m-proChannel__home {
}
.m-proChannelHome__featuredContent
{
&
.m-proChannelHome__featuredContent--prominent
{
*
:nth-child
(
1
)
{
grid-column
:
span
2
;
...
...
This diff is collapsed.
src/app/modules/pro/channel/list/list.component.ts
View file @
1a2794da
...
...
@@ -39,8 +39,7 @@ export class ProChannelListComponent implements OnInit, OnDestroy {
protected
router
:
Router
,
protected
cd
:
ChangeDetectorRef
,
protected
injector
:
Injector
)
{
}
)
{}
ngOnInit
()
{
this
.
params$
=
this
.
route
.
params
.
subscribe
(
params
=>
{
...
...
@@ -123,9 +122,7 @@ export class ProChannelListComponent implements OnInit, OnDestroy {
}
get
shouldShowCategories
()
{
return
(
this
.
paramsType
!==
'
groups
'
&&
!
this
.
query
);
return
this
.
paramsType
!==
'
groups
'
&&
!
this
.
query
;
}
detectChanges
()
{
...
...
This diff is collapsed.
src/app/modules/pro/channel/tiles/media/tile.component.html
View file @
1a2794da
...
...
@@ -4,5 +4,5 @@
fixedHeight: false,
showComments: false,
showOwnerBlock: true
}"
}"
></m-activity>
This diff is collapsed.
Please
register
or
sign in
to comment