From 4e1592daa41f81667f914f37d36795e8c6c046c3 Mon Sep 17 00:00:00 2001 From: Ms Kimsible <1877318+kimsible@users.noreply.github.com> Date: Wed, 25 Aug 2021 11:38:10 +0200 Subject: Alert user for low quota and video auto-block on upload page (#4336) * Replace wording of instance contact * Add contact-us button to no-quota alert on upload page * Add alert for accounts with auto-blocked videos on upload page * Add alert for accounts without enough quota + refacto on upload page * Using ng-container and ng-template * Add alert for daily quota * Add hook filter for upload page alert messages * Add instance name as subtitle in contact modal * Fix eslint max-len on string * Fix missing word in quota left daily message - upload page Co-authored-by: Kimsible --- server/models/user/user.ts | 2 +- server/tests/api/users/users.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'server') diff --git a/server/models/user/user.ts b/server/models/user/user.ts index 20696b1f4..069d7266e 100644 --- a/server/models/user/user.ts +++ b/server/models/user/user.ts @@ -958,7 +958,7 @@ export class UserModel extends Model>> { } toMeFormattedJSON (this: MMyUserFormattable): MyUser { - const formatted = this.toFormattedJSON() + const formatted = this.toFormattedJSON({ withAdminFlags: true }) const specialPlaylists = this.Account.VideoPlaylists .map(p => ({ id: p.id, name: p.name, type: p.type })) diff --git a/server/tests/api/users/users.ts b/server/tests/api/users/users.ts index 1419ae820..318ff832a 100644 --- a/server/tests/api/users/users.ts +++ b/server/tests/api/users/users.ts @@ -290,7 +290,7 @@ describe('Test users', function () { expect(user.account.description).to.be.null } - expect(userMe.adminFlags).to.be.undefined + expect(userMe.adminFlags).to.equal(UserAdminFlag.BYPASS_VIDEO_AUTO_BLACKLIST) expect(userGet.adminFlags).to.equal(UserAdminFlag.BYPASS_VIDEO_AUTO_BLACKLIST) expect(userMe.specialPlaylists).to.have.lengthOf(1) -- cgit v1.2.3