Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ class ServletAwareConfigurator extends ServerEndpointConfig.Configurator with La
null,
null,
null,
null,
null
)
)
Expand Down Expand Up @@ -108,6 +109,7 @@ class ServletAwareConfigurator extends ServerEndpointConfig.Configurator with La
null,
null,
null,
null,
null
)
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ import javax.ws.rs.core.SecurityContext
}

val GUEST: User =
new User(null, "guest", null, null, null, null, UserRoleEnum.REGULAR, null, null, null, null)
new User(null, "guest", null, null, null, null, UserRoleEnum.REGULAR, null, null, null, null, null)
}

@PreMatching
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,12 @@ case class UserInfo(
lastLogin: java.time.OffsetDateTime, // will be null if never logged in
accountCreation: java.time.OffsetDateTime,
affiliation: String,
joiningReason: String
joiningReason: String,
requestViewed: Boolean
)

case class MarkRequestsViewedRequest(uids: util.List[Integer])

object AdminUserResource {
private def context =
SqlServer
Expand Down Expand Up @@ -83,14 +86,47 @@ class AdminUserResource {
USER_LAST_ACTIVE_TIME.LAST_ACTIVE_TIME,
USER.ACCOUNT_CREATION_TIME,
USER.AFFILIATION,
USER.JOINING_REASON
USER.JOINING_REASON,
USER.REQUEST_VIEWED
)
.from(USER)
.leftJoin(USER_LAST_ACTIVE_TIME)
.on(USER.UID.eq(USER_LAST_ACTIVE_TIME.UID))
.fetchInto(classOf[UserInfo])
}

/**
* Mark the given pending user requests as viewed so the admin assistant
* stops re-surfacing them in the notification center.
*/
@POST
@Path("/mark-requests-viewed")
@Consumes(Array(MediaType.APPLICATION_JSON))
def markRequestsViewed(request: MarkRequestsViewedRequest): Unit = {
if (request.uids == null || request.uids.isEmpty) return
AdminUserResource.context
.update(USER)
.set(USER.REQUEST_VIEWED, java.lang.Boolean.TRUE)
.where(USER.UID.in(request.uids))
.execute()
}

/**
* Mark every currently-pending (INACTIVE) account request as viewed.
* Triggered by the "Clear" action on the Requests tab so admins can wipe
* the queue in one shot even if new requests arrived between polls.
*/
@POST
@Path("/mark-all-requests-viewed")
def markAllRequestsViewed(): Unit = {
AdminUserResource.context
.update(USER)
.set(USER.REQUEST_VIEWED, java.lang.Boolean.TRUE)
.where(USER.ROLE.eq(UserRoleEnum.INACTIVE))
.and(USER.REQUEST_VIEWED.eq(java.lang.Boolean.FALSE))
.execute()
}

@PUT
@Path("/update")
def updateUser(user: User): Unit = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ object JwtParser extends LazyLogging {
null,
null,
null,
null,
null
)
new SessionUser(user)
Expand Down
1 change: 1 addition & 0 deletions frontend/src/app/app.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ import { UntilDestroy } from "@ngneat/until-destroy";
<button (click)="retry()">Retry</button>
</div>
<router-outlet *ngIf="configLoaded"></router-outlet>
<texera-floating-agent *ngIf="configLoaded"></texera-floating-agent>
`,
standalone: false,
})
Expand Down
2 changes: 2 additions & 0 deletions frontend/src/app/app.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,7 @@ import { NzCheckboxModule } from "ng-zorro-antd/checkbox";
import { RegistrationRequestModalComponent } from "./common/service/user/registration-request-modal/registration-request-modal.component";
import { UserComputingUnitComponent } from "./dashboard/component/user/user-computing-unit/user-computing-unit.component";
import { UserComputingUnitListItemComponent } from "./dashboard/component/user/user-computing-unit/user-computing-unit-list-item/user-computing-unit-list-item.component";
import { FloatingAgentComponent } from "./common/component/floating-agent/floating-agent.component";

registerLocaleData(en);

Expand Down Expand Up @@ -358,6 +359,7 @@ registerLocaleData(en);
MarkdownDescriptionComponent,
UserComputingUnitComponent,
UserComputingUnitListItemComponent,
FloatingAgentComponent,
],
providers: [
provideNzI18n(en_US),
Expand Down
Loading
Loading