Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Framasoft
PeerTube
PeerTube
Commits
bc48e33b
Verified
Commit
bc48e33b
authored
Jan 13, 2023
by
Chocobozzz
Browse files
Optimize custom markup angular tags
We can use the on push strategy with these components
parent
6a056bbe
Changes
5
Hide whitespace changes
Inline
Side-by-side
client/src/app/shared/shared-custom-markup/peertube-custom-tags/button-markup.component.ts
View file @
bc48e33b
import
{
Component
,
Input
}
from
'
@angular/core
'
import
{
ChangeDetectionStrategy
,
Component
,
Input
}
from
'
@angular/core
'
import
{
VideoChannel
}
from
'
../../shared-main
'
import
{
CustomMarkupComponent
}
from
'
./shared
'
...
...
@@ -9,7 +9,8 @@ import { CustomMarkupComponent } from './shared'
@
Component
({
selector
:
'
my-button-markup
'
,
templateUrl
:
'
button-markup.component.html
'
,
styleUrls
:
[
'
button-markup.component.scss
'
]
styleUrls
:
[
'
button-markup.component.scss
'
],
changeDetection
:
ChangeDetectionStrategy
.
OnPush
})
export
class
ButtonMarkupComponent
implements
CustomMarkupComponent
{
@
Input
()
theme
:
'
primary
'
|
'
secondary
'
...
...
client/src/app/shared/shared-custom-markup/peertube-custom-tags/channel-miniature-markup.component.ts
View file @
bc48e33b
import
{
from
}
from
'
rxjs
'
import
{
finalize
,
map
,
switchMap
,
tap
}
from
'
rxjs/operators
'
import
{
Component
,
EventEmitter
,
Input
,
OnInit
,
Output
}
from
'
@angular/core
'
import
{
ChangeDetectionStrategy
,
Component
,
EventEmitter
,
Input
,
OnInit
,
Output
}
from
'
@angular/core
'
import
{
MarkdownService
,
Notifier
,
UserService
}
from
'
@app/core
'
import
{
FindInBulkService
}
from
'
@app/shared/shared-search
'
import
{
VideoSortField
}
from
'
@shared/models
'
...
...
@@ -14,7 +14,8 @@ import { CustomMarkupComponent } from './shared'
@
Component
({
selector
:
'
my-channel-miniature-markup
'
,
templateUrl
:
'
channel-miniature-markup.component.html
'
,
styleUrls
:
[
'
channel-miniature-markup.component.scss
'
]
styleUrls
:
[
'
channel-miniature-markup.component.scss
'
],
changeDetection
:
ChangeDetectionStrategy
.
OnPush
})
export
class
ChannelMiniatureMarkupComponent
implements
CustomMarkupComponent
,
OnInit
{
@
Input
()
name
:
string
...
...
client/src/app/shared/shared-custom-markup/peertube-custom-tags/playlist-miniature-markup.component.ts
View file @
bc48e33b
import
{
finalize
}
from
'
rxjs/operators
'
import
{
Component
,
EventEmitter
,
Input
,
OnInit
,
Output
}
from
'
@angular/core
'
import
{
ChangeDetectionStrategy
,
Component
,
EventEmitter
,
Input
,
OnInit
,
Output
}
from
'
@angular/core
'
import
{
Notifier
}
from
'
@app/core
'
import
{
FindInBulkService
}
from
'
@app/shared/shared-search
'
import
{
MiniatureDisplayOptions
}
from
'
../../shared-video-miniature
'
...
...
@@ -13,7 +13,8 @@ import { CustomMarkupComponent } from './shared'
@
Component
({
selector
:
'
my-playlist-miniature-markup
'
,
templateUrl
:
'
playlist-miniature-markup.component.html
'
,
styleUrls
:
[
'
playlist-miniature-markup.component.scss
'
]
styleUrls
:
[
'
playlist-miniature-markup.component.scss
'
],
changeDetection
:
ChangeDetectionStrategy
.
OnPush
})
export
class
PlaylistMiniatureMarkupComponent
implements
CustomMarkupComponent
,
OnInit
{
@
Input
()
uuid
:
string
...
...
client/src/app/shared/shared-custom-markup/peertube-custom-tags/video-miniature-markup.component.ts
View file @
bc48e33b
import
{
finalize
}
from
'
rxjs/operators
'
import
{
Component
,
EventEmitter
,
Input
,
OnInit
,
Output
}
from
'
@angular/core
'
import
{
ChangeDetectionStrategy
,
Component
,
EventEmitter
,
Input
,
OnInit
,
Output
}
from
'
@angular/core
'
import
{
AuthService
,
Notifier
}
from
'
@app/core
'
import
{
FindInBulkService
}
from
'
@app/shared/shared-search
'
import
{
Video
}
from
'
../../shared-main
'
...
...
@@ -13,7 +13,8 @@ import { CustomMarkupComponent } from './shared'
@
Component
({
selector
:
'
my-video-miniature-markup
'
,
templateUrl
:
'
video-miniature-markup.component.html
'
,
styleUrls
:
[
'
video-miniature-markup.component.scss
'
]
styleUrls
:
[
'
video-miniature-markup.component.scss
'
],
changeDetection
:
ChangeDetectionStrategy
.
OnPush
})
export
class
VideoMiniatureMarkupComponent
implements
CustomMarkupComponent
,
OnInit
{
@
Input
()
uuid
:
string
...
...
client/src/app/shared/shared-custom-markup/peertube-custom-tags/videos-list-markup.component.ts
View file @
bc48e33b
import
{
finalize
}
from
'
rxjs/operators
'
import
{
Component
,
EventEmitter
,
Input
,
OnInit
,
Output
}
from
'
@angular/core
'
import
{
ChangeDetectionStrategy
,
Component
,
EventEmitter
,
Input
,
OnInit
,
Output
}
from
'
@angular/core
'
import
{
AuthService
,
Notifier
}
from
'
@app/core
'
import
{
VideoSortField
}
from
'
@shared/models
'
import
{
Video
,
VideoService
}
from
'
../../shared-main
'
...
...
@@ -13,7 +13,8 @@ import { CustomMarkupComponent } from './shared'
@
Component
({
selector
:
'
my-videos-list-markup
'
,
templateUrl
:
'
videos-list-markup.component.html
'
,
styleUrls
:
[
'
videos-list-markup.component.scss
'
]
styleUrls
:
[
'
videos-list-markup.component.scss
'
],
changeDetection
:
ChangeDetectionStrategy
.
OnPush
})
export
class
VideosListMarkupComponent
implements
CustomMarkupComponent
,
OnInit
{
@
Input
()
sort
:
string
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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