Include speechLocale to graphql
This commit is contained in:
parent
4be594d8db
commit
e31ae5d7de
@ -25,11 +25,12 @@ case class UserStateDbModel(
|
||||
presenter: Boolean = false,
|
||||
pinned: Boolean = false,
|
||||
locked: Boolean = false,
|
||||
speechLocale: String,
|
||||
)
|
||||
|
||||
class UserStateDbTableDef(tag: Tag) extends Table[UserStateDbModel](tag, None, "user") {
|
||||
override def * = (
|
||||
userId,emoji,away,raiseHand,guestStatus,guestStatusSetByModerator,guestLobbyMessage,mobile,clientType,disconnected,expired,ejected,ejectReason,ejectReasonCode,ejectedByModerator,presenter,pinned,locked) <> (UserStateDbModel.tupled, UserStateDbModel.unapply)
|
||||
userId,emoji,away,raiseHand,guestStatus,guestStatusSetByModerator,guestLobbyMessage,mobile,clientType,disconnected,expired,ejected,ejectReason,ejectReasonCode,ejectedByModerator,presenter,pinned,locked,speechLocale) <> (UserStateDbModel.tupled, UserStateDbModel.unapply)
|
||||
val userId = column[String]("userId", O.PrimaryKey)
|
||||
val emoji = column[String]("emoji")
|
||||
val away = column[Boolean]("away")
|
||||
@ -48,6 +49,7 @@ class UserStateDbTableDef(tag: Tag) extends Table[UserStateDbModel](tag, None, "
|
||||
val presenter = column[Boolean]("presenter")
|
||||
val pinned = column[Boolean]("pinned")
|
||||
val locked = column[Boolean]("locked")
|
||||
val speechLocale = column[String]("speechLocale")
|
||||
}
|
||||
|
||||
object UserStateDAO {
|
||||
@ -55,8 +57,8 @@ object UserStateDAO {
|
||||
DatabaseConnection.db.run(
|
||||
TableQuery[UserStateDbTableDef]
|
||||
.filter(_.userId === userState.intId)
|
||||
.map(u => (u.presenter, u.pinned, u.locked, u.emoji, u.away, u.raiseHand, u.mobile, u.clientType, u.disconnected))
|
||||
.update((userState.presenter, userState.pin, userState.locked, userState.emoji, userState.away, userState.raiseHand, userState.mobile, userState.clientType, userState.userLeftFlag.left))
|
||||
.map(u => (u.presenter, u.pinned, u.locked, u.speechLocale, u.emoji, u.away, u.raiseHand, u.mobile, u.clientType, u.disconnected))
|
||||
.update((userState.presenter, userState.pin, userState.locked, userState.speechLocale, userState.emoji, userState.away, userState.raiseHand, userState.mobile, userState.clientType, userState.userLeftFlag.left))
|
||||
).onComplete {
|
||||
case Success(rowsAffected) => DatabaseConnection.logger.debug(s"$rowsAffected row(s) updated on user table!")
|
||||
case Failure(e) => DatabaseConnection.logger.error(s"Error updating user: $e")
|
||||
|
@ -253,6 +253,7 @@ object Users2x {
|
||||
u <- findWithIntId(users, intId)
|
||||
} yield {
|
||||
val newUser = u.modify(_.speechLocale).setTo(locale)
|
||||
UserStateDAO.update(newUser)
|
||||
users.save(newUser)
|
||||
newUser
|
||||
}
|
||||
|
@ -285,6 +285,7 @@ CREATE TABLE "user" (
|
||||
"presenter" bool,
|
||||
"pinned" bool,
|
||||
"locked" bool,
|
||||
"speechLocale" varchar(255),
|
||||
"hasDrawPermissionOnCurrentPage" bool default FALSE
|
||||
);
|
||||
CREATE INDEX "idx_user_meetingId" ON "user"("meetingId");
|
||||
@ -371,6 +372,7 @@ AS SELECT "user"."userId",
|
||||
"user"."presenter",
|
||||
"user"."pinned",
|
||||
"user"."locked",
|
||||
"user"."speechLocale",
|
||||
"user"."hasDrawPermissionOnCurrentPage",
|
||||
CASE WHEN "user"."role" = 'MODERATOR' THEN true ELSE false END "isModerator",
|
||||
CASE WHEN "user"."joined" IS true AND "user"."expired" IS false AND "user"."loggedOut" IS false THEN true ELSE false END "isOnline"
|
||||
@ -419,6 +421,7 @@ AS SELECT "user"."userId",
|
||||
"user"."presenter",
|
||||
"user"."pinned",
|
||||
"user"."locked",
|
||||
"user"."speechLocale",
|
||||
"user"."hasDrawPermissionOnCurrentPage",
|
||||
CASE WHEN "user"."role" = 'MODERATOR' THEN true ELSE false END "isModerator"
|
||||
FROM "user";
|
||||
@ -462,6 +465,7 @@ AS SELECT "user"."userId",
|
||||
"user"."presenter",
|
||||
"user"."pinned",
|
||||
"user"."locked",
|
||||
"user"."speechLocale",
|
||||
"user"."hasDrawPermissionOnCurrentPage",
|
||||
CASE WHEN "user"."role" = 'MODERATOR' THEN true ELSE false END "isModerator",
|
||||
CASE WHEN "user"."joined" IS true AND "user"."expired" IS false AND "user"."loggedOut" IS false THEN true ELSE false END "isOnline"
|
||||
|
@ -77,6 +77,7 @@ select_permissions:
|
||||
- disconnected
|
||||
- emoji
|
||||
- emojiTime
|
||||
- expired
|
||||
- extId
|
||||
- guest
|
||||
- guestStatus
|
||||
@ -95,6 +96,7 @@ select_permissions:
|
||||
- raiseHandTime
|
||||
- registeredOn
|
||||
- role
|
||||
- speechLocale
|
||||
- userId
|
||||
filter:
|
||||
_and:
|
||||
|
@ -123,6 +123,7 @@ select_permissions:
|
||||
- ejectReasonCode
|
||||
- ejected
|
||||
- emoji
|
||||
- expired
|
||||
- extId
|
||||
- guest
|
||||
- hasDrawPermissionOnCurrentPage
|
||||
@ -138,6 +139,7 @@ select_permissions:
|
||||
- raiseHand
|
||||
- registeredOn
|
||||
- role
|
||||
- speechLocale
|
||||
- userId
|
||||
filter:
|
||||
_and:
|
||||
|
@ -18,6 +18,7 @@ select_permissions:
|
||||
- color
|
||||
- disconnected
|
||||
- emoji
|
||||
- expired
|
||||
- extId
|
||||
- guest
|
||||
- guestStatus
|
||||
@ -35,6 +36,7 @@ select_permissions:
|
||||
- raiseHand
|
||||
- registeredOn
|
||||
- role
|
||||
- speechLocale
|
||||
- userId
|
||||
filter:
|
||||
meetingId:
|
||||
|
Loading…
Reference in New Issue
Block a user