diff --git a/client/src/app/menu/menu.component.scss b/client/src/app/menu/menu.component.scss index fa9a006af..06baa52d3 100644 --- a/client/src/app/menu/menu.component.scss +++ b/client/src/app/menu/menu.component.scss @@ -75,22 +75,22 @@ menu { .logged-in-more { margin-right: 20px; - my-global-icon { - @include apply-svg-color(var(--mainBackgroundColor)); - + my-global-icon.dropdown-toggle { cursor: pointer; &::after { border: none; } + + /deep/ { + @include apply-svg-color(var(--menuForegroundColor)); + } } .dropdown-item { @include dropdown-with-icon-item; my-global-icon { - @include apply-svg-color(var(--mainForegroundColor)); - width: 22px; height: 22px; diff --git a/client/src/app/shared/buttons/action-dropdown.component.scss b/client/src/app/shared/buttons/action-dropdown.component.scss index 5073190b0..7c2b0db71 100644 --- a/client/src/app/shared/buttons/action-dropdown.component.scss +++ b/client/src/app/shared/buttons/action-dropdown.component.scss @@ -32,6 +32,10 @@ .more-icon { width: 21px; + + /deep/ { + @include apply-svg-color(var(--mainForegroundColor)); + } } &.small { diff --git a/client/src/app/shared/buttons/action-dropdown.component.ts b/client/src/app/shared/buttons/action-dropdown.component.ts index f5345831b..c9dbbfda2 100644 --- a/client/src/app/shared/buttons/action-dropdown.component.ts +++ b/client/src/app/shared/buttons/action-dropdown.component.ts @@ -41,10 +41,4 @@ export class ActionDropdownComponent { areActionsDisplayed (actions: DropdownAction[], entry: T) { return actions.some(a => a.isDisplayed === undefined || a.isDisplayed(entry)) } - - handleClick (event: Event, action: DropdownAction) { - event.preventDefault() - - // action.handler(entry) - } } diff --git a/client/src/app/shared/forms/form-reactive.ts b/client/src/app/shared/forms/form-reactive.ts index 0d40b6f4a..6aec2937d 100644 --- a/client/src/app/shared/forms/form-reactive.ts +++ b/client/src/app/shared/forms/form-reactive.ts @@ -57,7 +57,7 @@ export abstract class FormReactive { // Don't care if dirty on force check const isDirty = control.dirty || forceCheck === true - if (control && isDirty && !control.valid) { + if (control && isDirty && control.enabled && !control.valid) { const messages = validationMessages[ field ] for (const key of Object.keys(control.errors)) { formErrors[ field ] += messages[ key ] + ' ' diff --git a/client/src/app/shared/instance/instance-features-table.component.scss b/client/src/app/shared/instance/instance-features-table.component.scss index 90fbb5c94..f9bec038d 100644 --- a/client/src/app/shared/instance/instance-features-table.component.scss +++ b/client/src/app/shared/instance/instance-features-table.component.scss @@ -3,6 +3,7 @@ table { font-size: 14px; + color: var(--mainForegroundColor); .label { font-weight: $font-semibold; @@ -16,4 +17,4 @@ table { .glyphicon-remove { color: $red; } -} \ No newline at end of file +} diff --git a/client/src/app/shared/user-subscription/remote-subscribe.component.ts b/client/src/app/shared/user-subscription/remote-subscribe.component.ts index ba2a45df1..63e7cd5d9 100644 --- a/client/src/app/shared/user-subscription/remote-subscribe.component.ts +++ b/client/src/app/shared/user-subscription/remote-subscribe.component.ts @@ -11,7 +11,7 @@ import { styleUrls: ['./remote-subscribe.component.scss'] }) export class RemoteSubscribeComponent extends FormReactive implements OnInit { - @Input() account: string + @Input() uri: string @Input() interact = false @Input() showHelp = false @@ -42,19 +42,20 @@ export class RemoteSubscribeComponent extends FormReactive implements OnInit { fetch(`https://${hostname}/.well-known/webfinger?resource=acct:${username}@${hostname}`) .then(response => response.json()) .then(data => new Promise((resolve, reject) => { + console.log(data) + if (data && Array.isArray(data.links)) { - const link: { - template: string - } = data.links.find((link: any) => - link && typeof link.template === 'string' && link.rel === 'http://ostatus.org/schema/1.0/subscribe') + const link: { template: string } = data.links.find((link: any) => { + return link && typeof link.template === 'string' && link.rel === 'http://ostatus.org/schema/1.0/subscribe' + }) if (link && link.template.includes('{uri}')) { - resolve(link.template.replace('{uri}', `acct:${this.account}`)) + resolve(link.template.replace('{uri}', encodeURIComponent(this.uri))) } } reject() })) .then(window.open) - .catch(() => window.open(`https://${hostname}/authorize_interaction?acct=${this.account}`)) + .catch(err => console.error(err)) } } diff --git a/client/src/app/shared/user-subscription/subscribe-button.component.html b/client/src/app/shared/user-subscription/subscribe-button.component.html index dbf6a34f0..d32647b42 100644 --- a/client/src/app/shared/user-subscription/subscribe-button.component.html +++ b/client/src/app/shared/user-subscription/subscribe-button.component.html @@ -41,7 +41,7 @@ - + @@ -50,4 +50,4 @@ - \ No newline at end of file + diff --git a/client/src/app/shared/user-subscription/subscribe-button.component.ts b/client/src/app/shared/user-subscription/subscribe-button.component.ts index ef470ee44..25515f6ea 100644 --- a/client/src/app/shared/user-subscription/subscribe-button.component.ts +++ b/client/src/app/shared/user-subscription/subscribe-button.component.ts @@ -28,19 +28,19 @@ export class SubscribeButtonComponent implements OnInit { private videoService: VideoService ) { } - get uri () { + get channelHandle () { return this.videoChannel.name + '@' + this.videoChannel.host } - get uriAccount () { - return this.videoChannel.ownerAccount.name + '@' + this.videoChannel.host + get channelUri () { + return this.videoChannel.url } ngOnInit () { if (this.isUserLoggedIn()) { - this.userSubscriptionService.doesSubscriptionExist(this.uri) + this.userSubscriptionService.doesSubscriptionExist(this.channelHandle) .subscribe( - res => this.subscribed = res[this.uri], + res => this.subscribed = res[this.channelHandle], err => this.notifier.error(err.message) ) @@ -56,7 +56,7 @@ export class SubscribeButtonComponent implements OnInit { } localSubscribe () { - this.userSubscriptionService.addSubscription(this.uri) + this.userSubscriptionService.addSubscription(this.channelHandle) .subscribe( () => { this.subscribed = true @@ -78,7 +78,7 @@ export class SubscribeButtonComponent implements OnInit { } localUnsubscribe () { - this.userSubscriptionService.deleteSubscription(this.uri) + this.userSubscriptionService.deleteSubscription(this.channelHandle) .subscribe( () => { this.subscribed = false diff --git a/client/src/app/shared/video/video-actions-dropdown.component.ts b/client/src/app/shared/video/video-actions-dropdown.component.ts index 0bbc783c1..8d4e33697 100644 --- a/client/src/app/shared/video/video-actions-dropdown.component.ts +++ b/client/src/app/shared/video/video-actions-dropdown.component.ts @@ -188,19 +188,16 @@ export class VideoActionsDropdownComponent implements OnChanges { } private buildActions () { - this.videoActions = [] - - if (this.authService.isLoggedIn()) { - this.videoActions.push([ + this.videoActions = [ + [ { label: this.i18n('Save to playlist'), handler: () => this.playlistDropdown.toggle(), - isDisplayed: () => this.displayOptions.playlist, + isDisplayed: () => this.authService.isLoggedIn() && this.displayOptions.playlist, iconName: 'playlist-add' } - ]) - - this.videoActions.push([ + ], + [ { label: this.i18n('Download'), handler: () => this.showDownloadModal(), @@ -211,36 +208,35 @@ export class VideoActionsDropdownComponent implements OnChanges { label: this.i18n('Update'), linkBuilder: ({ video }) => [ '/videos/update', video.uuid ], iconName: 'edit', - isDisplayed: () => this.displayOptions.update && this.isVideoUpdatable() + isDisplayed: () => this.authService.isLoggedIn() && this.displayOptions.update && this.isVideoUpdatable() }, { label: this.i18n('Blacklist'), handler: () => this.showBlacklistModal(), iconName: 'no', - isDisplayed: () => this.displayOptions.blacklist && this.isVideoBlacklistable() + isDisplayed: () => this.authService.isLoggedIn() && this.displayOptions.blacklist && this.isVideoBlacklistable() }, { label: this.i18n('Unblacklist'), handler: () => this.unblacklistVideo(), iconName: 'undo', - isDisplayed: () => this.displayOptions.blacklist && this.isVideoUnblacklistable() + isDisplayed: () => this.authService.isLoggedIn() && this.displayOptions.blacklist && this.isVideoUnblacklistable() }, { label: this.i18n('Delete'), handler: () => this.removeVideo(), - isDisplayed: () => this.displayOptions.delete && this.isVideoRemovable(), + isDisplayed: () => this.authService.isLoggedIn() && this.displayOptions.delete && this.isVideoRemovable(), iconName: 'delete' } - ]) - - this.videoActions.push([ + ], + [ { label: this.i18n('Report'), handler: () => this.showReportModal(), - isDisplayed: () => this.displayOptions.report, + isDisplayed: () => this.authService.isLoggedIn() && this.displayOptions.report, iconName: 'alert' } - ]) - } + ] + ] } } diff --git a/client/src/app/videos/+video-edit/shared/video-edit.component.ts b/client/src/app/videos/+video-edit/shared/video-edit.component.ts index a2776b73d..cea352bfb 100644 --- a/client/src/app/videos/+video-edit/shared/video-edit.component.ts +++ b/client/src/app/videos/+video-edit/shared/video-edit.component.ts @@ -193,7 +193,7 @@ export class VideoEditComponent implements OnInit, OnDestroy { } private trackPrivacyChange () { - // We will update the "support" field depending on the channel + // We will update the schedule input and the wait transcoding checkbox validators this.form.controls[ 'privacy' ] .valueChanges .pipe(map(res => parseInt(res.toString(), 10))) diff --git a/client/src/app/videos/+video-watch/comment/video-comment-add.component.html b/client/src/app/videos/+video-watch/comment/video-comment-add.component.html index d8a7a78c4..916f5d0ff 100644 --- a/client/src/app/videos/+video-watch/comment/video-comment-add.component.html +++ b/client/src/app/videos/+video-watch/comment/video-comment-add.component.html @@ -41,7 +41,7 @@ If you have an account on Mastodon or Pleroma, you can open it directly in their interface: - +