From 7dca45f99db58d9bb3423a3765aaee68c69bc9f2 Mon Sep 17 00:00:00 2001 From: Ms Kimsible <1877318+kimsible@users.noreply.github.com> Date: Thu, 26 Aug 2021 08:22:33 +0200 Subject: 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 --- .../misc/channels-setup-message.component.html | 8 ++++++ .../misc/channels-setup-message.component.scss | 32 ++++++++++++++++++++++ .../misc/channels-setup-message.component.ts | 32 ++++++++++++++++++++++ client/src/app/shared/shared-main/misc/index.ts | 1 + .../app/shared/shared-main/shared-main.module.ts | 10 ++++++- 5 files changed, 82 insertions(+), 1 deletion(-) create mode 100644 client/src/app/shared/shared-main/misc/channels-setup-message.component.html create mode 100644 client/src/app/shared/shared-main/misc/channels-setup-message.component.scss create mode 100644 client/src/app/shared/shared-main/misc/channels-setup-message.component.ts (limited to 'client/src/app/shared/shared-main') 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 @@ +
+ + +
+
Some of your channels are not fully set up. Make them welcoming and explicit about what you publish by adding a banner, an avatar and a description.
+ Set up my channels +
+
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 @@ +@use '_variables' as *; +@use '_mixins' as *; + +.channels-setup-message { + display: flex; + align-items: center; + justify-content: center; + + my-global-icon { + width: 32px; + align-self: flex-start; + + ::ng-deep { + svg { + fill: #0c5460; + } + } + + + div { + margin-left: 10px; + text-align: center; + + a.channels-settings-link { + @include peertube-button-link; + @include grey-button; + + height: fit-content; + margin-top: 10px; + } + } + } +} 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 @@ +import { Component, Input, OnInit } from '@angular/core' +import { AuthService, User } from '@app/core' +import { VideoChannel } from '@app/shared/shared-main' + +@Component({ + selector: 'my-channels-setup-message', + templateUrl: './channels-setup-message.component.html', + styleUrls: [ './channels-setup-message.component.scss' ] +}) +export class ChannelsSetupMessageComponent implements OnInit { + @Input() hideLink = false + + user: User = null + + constructor ( + private authService: AuthService + ) {} + + get userInformationLoaded () { + return this.authService.userInformationLoaded + } + + get hasChannelNotConfigured () { + return this.user.videoChannels + .filter((channel: VideoChannel) => (!channel.avatar || !channel.description)) + .length > 0 + } + + ngOnInit () { + this.user = this.authService.getUser() + } +} 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 @@ +export * from './channels-setup-message.component' export * from './help.component' export * from './list-overflow.component' export * 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' import { DateToggleComponent } from './date' import { FeedComponent } from './feeds' import { LoaderComponent, SmallLoaderComponent } from './loaders' -import { HelpComponent, ListOverflowComponent, SimpleSearchInputComponent, TopMenuDropdownComponent } from './misc' +import { + ChannelsSetupMessageComponent, + HelpComponent, + ListOverflowComponent, + SimpleSearchInputComponent, + TopMenuDropdownComponent +} from './misc' import { PluginPlaceholderComponent } from './plugins' import { ActorRedirectGuard } from './router' import { UserHistoryService, UserNotificationsComponent, UserNotificationService, UserQuotaComponent } from './users' @@ -91,6 +97,7 @@ import { VideoChannelService } from './video-channel' LoaderComponent, SmallLoaderComponent, + ChannelsSetupMessageComponent, HelpComponent, ListOverflowComponent, TopMenuDropdownComponent, @@ -146,6 +153,7 @@ import { VideoChannelService } from './video-channel' LoaderComponent, SmallLoaderComponent, + ChannelsSetupMessageComponent, HelpComponent, ListOverflowComponent, TopMenuDropdownComponent, -- cgit v1.2.3