aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/app/shared
diff options
context:
space:
mode:
authorMs Kimsible <1877318+kimsible@users.noreply.github.com>2021-08-26 08:22:33 +0200
committerGitHub <noreply@github.com>2021-08-26 08:22:33 +0200
commit7dca45f99db58d9bb3423a3765aaee68c69bc9f2 (patch)
tree6bdf45c304a58dca51a8e856a8d35238e7bc9bbb /client/src/app/shared
parent8729a87024fc837f7dd6f13afeec90cf6dda1c06 (diff)
downloadPeerTube-7dca45f99db58d9bb3423a3765aaee68c69bc9f2.tar.gz
PeerTube-7dca45f99db58d9bb3423a3765aaee68c69bc9f2.tar.zst
PeerTube-7dca45f99db58d9bb3423a3765aaee68c69bc9f2.zip
Inform user to fill account profile and channels (#4352)
* Add account-setup modal when login * Add channels-setup alert into my-channels, my-playlists and upload page Co-authored-by: Ms Kimsible <kimsible@users.noreply.github.com>
Diffstat (limited to 'client/src/app/shared')
-rw-r--r--client/src/app/shared/shared-icons/global-icon.component.ts1
-rw-r--r--client/src/app/shared/shared-main/misc/channels-setup-message.component.html8
-rw-r--r--client/src/app/shared/shared-main/misc/channels-setup-message.component.scss32
-rw-r--r--client/src/app/shared/shared-main/misc/channels-setup-message.component.ts32
-rw-r--r--client/src/app/shared/shared-main/misc/index.ts1
-rw-r--r--client/src/app/shared/shared-main/shared-main.module.ts10
6 files changed, 83 insertions, 1 deletions
diff --git a/client/src/app/shared/shared-icons/global-icon.component.ts b/client/src/app/shared/shared-icons/global-icon.component.ts
index 70d672306..a4c62c234 100644
--- a/client/src/app/shared/shared-icons/global-icon.component.ts
+++ b/client/src/app/shared/shared-icons/global-icon.component.ts
@@ -16,6 +16,7 @@ const icons = {
16 'playlist-add': require('!!raw-loader?!../../../assets/images/misc/playlist-add.svg').default, // material ui 16 'playlist-add': require('!!raw-loader?!../../../assets/images/misc/playlist-add.svg').default, // material ui
17 follower: require('!!raw-loader?!../../../assets/images/misc/account-arrow-left.svg').default, // material ui 17 follower: require('!!raw-loader?!../../../assets/images/misc/account-arrow-left.svg').default, // material ui
18 following: require('!!raw-loader?!../../../assets/images/misc/account-arrow-right.svg').default, // material ui 18 following: require('!!raw-loader?!../../../assets/images/misc/account-arrow-right.svg').default, // material ui
19 tip: require('!!raw-loader?!../../../assets/images/misc/tip.svg').default, // material ui
19 flame: require('!!raw-loader?!../../../assets/images/misc/flame.svg').default, 20 flame: require('!!raw-loader?!../../../assets/images/misc/flame.svg').default,
20 local: require('!!raw-loader?!../../../assets/images/misc/local.svg').default, 21 local: require('!!raw-loader?!../../../assets/images/misc/local.svg').default,
21 22
diff --git a/client/src/app/shared/shared-main/misc/channels-setup-message.component.html b/client/src/app/shared/shared-main/misc/channels-setup-message.component.html
new file mode 100644
index 000000000..3f94fa04c
--- /dev/null
+++ b/client/src/app/shared/shared-main/misc/channels-setup-message.component.html
@@ -0,0 +1,8 @@
1<div *ngIf="hasChannelNotConfigured" class="channels-setup-message alert alert-info">
2 <my-global-icon iconName="tip"></my-global-icon>
3
4 <div>
5 <div i18n>Some of your channels are not fully set up. Make them welcoming and explicit about what you publish by adding a <strong>banner</strong>, an <strong>avatar</strong> and a <strong>description</strong>.</div>
6 <a *ngIf="!hideLink" class="channels-settings-link" routerLink="/my-library/video-channels" i18n>Set up my channels</a>
7 </div>
8</div>
diff --git a/client/src/app/shared/shared-main/misc/channels-setup-message.component.scss b/client/src/app/shared/shared-main/misc/channels-setup-message.component.scss
new file mode 100644
index 000000000..7dcba2ca5
--- /dev/null
+++ b/client/src/app/shared/shared-main/misc/channels-setup-message.component.scss
@@ -0,0 +1,32 @@
1@use '_variables' as *;
2@use '_mixins' as *;
3
4.channels-setup-message {
5 display: flex;
6 align-items: center;
7 justify-content: center;
8
9 my-global-icon {
10 width: 32px;
11 align-self: flex-start;
12
13 ::ng-deep {
14 svg {
15 fill: #0c5460;
16 }
17 }
18
19 + div {
20 margin-left: 10px;
21 text-align: center;
22
23 a.channels-settings-link {
24 @include peertube-button-link;
25 @include grey-button;
26
27 height: fit-content;
28 margin-top: 10px;
29 }
30 }
31 }
32}
diff --git a/client/src/app/shared/shared-main/misc/channels-setup-message.component.ts b/client/src/app/shared/shared-main/misc/channels-setup-message.component.ts
new file mode 100644
index 000000000..50b98841a
--- /dev/null
+++ b/client/src/app/shared/shared-main/misc/channels-setup-message.component.ts
@@ -0,0 +1,32 @@
1import { Component, Input, OnInit } from '@angular/core'
2import { AuthService, User } from '@app/core'
3import { VideoChannel } from '@app/shared/shared-main'
4
5@Component({
6 selector: 'my-channels-setup-message',
7 templateUrl: './channels-setup-message.component.html',
8 styleUrls: [ './channels-setup-message.component.scss' ]
9})
10export class ChannelsSetupMessageComponent implements OnInit {
11 @Input() hideLink = false
12
13 user: User = null
14
15 constructor (
16 private authService: AuthService
17 ) {}
18
19 get userInformationLoaded () {
20 return this.authService.userInformationLoaded
21 }
22
23 get hasChannelNotConfigured () {
24 return this.user.videoChannels
25 .filter((channel: VideoChannel) => (!channel.avatar || !channel.description))
26 .length > 0
27 }
28
29 ngOnInit () {
30 this.user = this.authService.getUser()
31 }
32}
diff --git a/client/src/app/shared/shared-main/misc/index.ts b/client/src/app/shared/shared-main/misc/index.ts
index dc8ef9754..24134d7cd 100644
--- a/client/src/app/shared/shared-main/misc/index.ts
+++ b/client/src/app/shared/shared-main/misc/index.ts
@@ -1,3 +1,4 @@
1export * from './channels-setup-message.component'
1export * from './help.component' 2export * from './help.component'
2export * from './list-overflow.component' 3export * from './list-overflow.component'
3export * from './top-menu-dropdown.component' 4export * from './top-menu-dropdown.component'
diff --git a/client/src/app/shared/shared-main/shared-main.module.ts b/client/src/app/shared/shared-main/shared-main.module.ts
index e5dfc59b2..80d0a84f3 100644
--- a/client/src/app/shared/shared-main/shared-main.module.ts
+++ b/client/src/app/shared/shared-main/shared-main.module.ts
@@ -34,7 +34,13 @@ import { CustomPageService } from './custom-page'
34import { DateToggleComponent } from './date' 34import { DateToggleComponent } from './date'
35import { FeedComponent } from './feeds' 35import { FeedComponent } from './feeds'
36import { LoaderComponent, SmallLoaderComponent } from './loaders' 36import { LoaderComponent, SmallLoaderComponent } from './loaders'
37import { HelpComponent, ListOverflowComponent, SimpleSearchInputComponent, TopMenuDropdownComponent } from './misc' 37import {
38 ChannelsSetupMessageComponent,
39 HelpComponent,
40 ListOverflowComponent,
41 SimpleSearchInputComponent,
42 TopMenuDropdownComponent
43} from './misc'
38import { PluginPlaceholderComponent } from './plugins' 44import { PluginPlaceholderComponent } from './plugins'
39import { ActorRedirectGuard } from './router' 45import { ActorRedirectGuard } from './router'
40import { UserHistoryService, UserNotificationsComponent, UserNotificationService, UserQuotaComponent } from './users' 46import { UserHistoryService, UserNotificationsComponent, UserNotificationService, UserQuotaComponent } from './users'
@@ -91,6 +97,7 @@ import { VideoChannelService } from './video-channel'
91 LoaderComponent, 97 LoaderComponent,
92 SmallLoaderComponent, 98 SmallLoaderComponent,
93 99
100 ChannelsSetupMessageComponent,
94 HelpComponent, 101 HelpComponent,
95 ListOverflowComponent, 102 ListOverflowComponent,
96 TopMenuDropdownComponent, 103 TopMenuDropdownComponent,
@@ -146,6 +153,7 @@ import { VideoChannelService } from './video-channel'
146 LoaderComponent, 153 LoaderComponent,
147 SmallLoaderComponent, 154 SmallLoaderComponent,
148 155
156 ChannelsSetupMessageComponent,
149 HelpComponent, 157 HelpComponent,
150 ListOverflowComponent, 158 ListOverflowComponent,
151 TopMenuDropdownComponent, 159 TopMenuDropdownComponent,