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
382
Merge Requests
61
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
e587a303
Commit
e587a303
authored
1 hour ago
by
Mark Harding
Browse files
Options
Download
(feat): adds metrics to posts
parent
09ec8d8d
feat/2511-activity-v2
No related merge requests found
Pipeline
#115209381
failed with stages
in 12 minutes and 27 seconds
Changes
9
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
44 additions
and
2 deletions
+44
-2
src/app/common/components/post-menu/v2/menu.component.scss
View file @
e587a303
...
...
@@ -8,7 +8,7 @@
i
{
font-size
:
32px
;
@include
m-theme
()
{
color
:
themed
(
$m-textColor--
second
ary
);
color
:
themed
(
$m-textColor--
terti
ary
);
}
}
}
This diff is collapsed.
src/app/modules/newsfeed/activity/activity.component.html
View file @
e587a303
<m-activity
__ownerBlock
*ngIf=
"service.displayOptions.showOwnerBlock"
>
<ng-container
class=
"m-activityOwnerBlock__right"
>
<m-activity
__metrics
></m-activity
__metrics
>
<m-activity
__menu
></m-activity
__menu
>
</ng-container>
</m-activity
__ownerBlock
>
...
...
This diff is collapsed.
src/app/modules/newsfeed/activity/activity.module.ts
View file @
e587a303
...
...
@@ -20,6 +20,7 @@ import { LegacyModule } from '../../legacy/legacy.module';
import
{
ActivityMenuComponent
}
from
'
./menu/menu.component
'
;
import
{
PostMenuModule
}
from
'
../../../common/components/post-menu/post-menu.module
'
;
import
{
ActivityNsfwConsentComponent
}
from
'
./nsfw-consent/nsfw-consent.component
'
;
import
{
ActivityMetricsComponent
}
from
'
./metrics/metrics.component
'
;
@
NgModule
({
imports
:
[
...
...
@@ -43,6 +44,7 @@ import { ActivityNsfwConsentComponent } from './nsfw-consent/nsfw-consent.compon
ActivityToolbarComponent
,
ActivityMenuComponent
,
ActivityNsfwConsentComponent
,
ActivityMetricsComponent
,
],
providers
:
[],
exports
:
[
ActivityComponent
],
...
...
This diff is collapsed.
src/app/modules/newsfeed/activity/activity.service.ts
View file @
e587a303
...
...
@@ -33,6 +33,7 @@ export type ActivityEntity = {
ephemeral
?:
boolean
;
nsfw
:
Array
<
number
>
;
paywall
:
boolean
;
impressions
:
number
;
};
@
Injectable
()
...
...
This diff is collapsed.
src/app/modules/newsfeed/activity/metrics/metrics.component.html
0 → 100644
View file @
e587a303
<span
class=
"m-activityMetrics__views"
>
{{ views | async }} views
</span>
This diff is collapsed.
src/app/modules/newsfeed/activity/metrics/metrics.component.scss
0 → 100644
View file @
e587a303
m-activity__metrics
>
span
{
font-size
:
14px
;
@include
m-theme
()
{
color
:
themed
(
$m-textColor--tertiary
);
}
}
This diff is collapsed.
src/app/modules/newsfeed/activity/metrics/metrics.component.ts
0 → 100644
View file @
e587a303
import
{
Component
,
HostListener
,
ViewChild
,
Input
,
ElementRef
,
}
from
'
@angular/core
'
;
import
{
Observable
}
from
'
rxjs
'
;
import
{
ActivityService
,
ActivityEntity
}
from
'
../activity.service
'
;
import
{
map
}
from
'
rxjs/operators
'
;
@
Component
({
selector
:
'
m-activity__metrics
'
,
templateUrl
:
'
metrics.component.html
'
,
})
export
class
ActivityMetricsComponent
{
views
:
Observable
<
number
>
=
this
.
service
.
entity$
.
pipe
(
map
((
entity
:
ActivityEntity
)
=>
{
return
entity
.
impressions
;
})
);
constructor
(
public
service
:
ActivityService
)
{}
}
This diff is collapsed.
src/app/modules/newsfeed/activity/owner-block/owner-block.component.html
View file @
e587a303
...
...
@@ -56,7 +56,7 @@
</ng-container>
</div>
<div
class=
"
.
m-activityOwnerBlock__right"
>
<div
class=
"m-activityOwnerBlock__right"
>
<ng-content
select=
".m-activityOwnerBlock__right"
></ng-content>
</div>
...
...
This diff is collapsed.
src/app/modules/newsfeed/activity/owner-block/owner-block.component.scss
View file @
e587a303
...
...
@@ -32,6 +32,12 @@ m-activity__ownerBlock {
}
}
.m-activityOwnerBlock__right
{
display
:
inline-flex
;
align-items
:
center
;
flex-direction
:
row
;
}
.m-activityOwnerBlock__displayName
{
display
:
block
;
font-size
:
16px
;
...
...
This diff is collapsed.
Please
register
or
sign in
to comment