mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-10-06 19:28:16 +00:00
Merge pull request #4401 from Infisical/fix-secret-change-request-header
fix(frontend): fix secret change request sticky header positioning and fix request query to return all commits on list page
This commit is contained in:
@@ -697,14 +697,15 @@ export const secretApprovalRequestDALFactory = (db: TDbClient) => {
|
|||||||
db.ref("firstName").withSchema("committerUser").as("committerUserFirstName"),
|
db.ref("firstName").withSchema("committerUser").as("committerUserFirstName"),
|
||||||
db.ref("lastName").withSchema("committerUser").as("committerUserLastName")
|
db.ref("lastName").withSchema("committerUser").as("committerUserLastName")
|
||||||
)
|
)
|
||||||
.distinctOn(`${TableName.SecretApprovalRequest}.id`)
|
|
||||||
.as("inner");
|
.as("inner");
|
||||||
|
|
||||||
const query = (tx || db)
|
const countQuery = (await (tx || db)
|
||||||
.select("*")
|
|
||||||
.select(db.raw("count(*) OVER() as total_count"))
|
.select(db.raw("count(*) OVER() as total_count"))
|
||||||
.from(innerQuery)
|
.from(innerQuery.clone().distinctOn(`${TableName.SecretApprovalRequest}.id`))) as Array<{
|
||||||
.orderBy("createdAt", "desc") as typeof innerQuery;
|
total_count: number;
|
||||||
|
}>;
|
||||||
|
|
||||||
|
const query = (tx || db).select("*").from(innerQuery).orderBy("createdAt", "desc") as typeof innerQuery;
|
||||||
|
|
||||||
if (search) {
|
if (search) {
|
||||||
void query.where((qb) => {
|
void query.where((qb) => {
|
||||||
@@ -730,8 +731,7 @@ export const secretApprovalRequestDALFactory = (db: TDbClient) => {
|
|||||||
.where("w.rank", ">=", rankOffset)
|
.where("w.rank", ">=", rankOffset)
|
||||||
.andWhere("w.rank", "<", rankOffset + limit);
|
.andWhere("w.rank", "<", rankOffset + limit);
|
||||||
|
|
||||||
// @ts-expect-error knex does not infer
|
const totalCount = Number(countQuery[0]?.total_count || 0);
|
||||||
const totalCount = Number(docs[0]?.total_count || 0);
|
|
||||||
|
|
||||||
const formattedDoc = sqlNestRelationships({
|
const formattedDoc = sqlNestRelationships({
|
||||||
data: docs,
|
data: docs,
|
||||||
|
|||||||
+1
-1
@@ -233,7 +233,7 @@ export const SecretApprovalRequestChanges = ({
|
|||||||
return (
|
return (
|
||||||
<div className="flex flex-col space-x-6 lg:flex-row">
|
<div className="flex flex-col space-x-6 lg:flex-row">
|
||||||
<div className="flex-1 lg:max-w-[calc(100%-17rem)]">
|
<div className="flex-1 lg:max-w-[calc(100%-17rem)]">
|
||||||
<div className="sticky top-0 z-20 flex items-center space-x-4 bg-bunker-800 pb-6 pt-2">
|
<div className="sticky -top-8 z-20 flex items-center space-x-4 bg-bunker-800 pb-6 pt-2">
|
||||||
<IconButton variant="outline_bg" ariaLabel="go-back" onClick={onGoBack}>
|
<IconButton variant="outline_bg" ariaLabel="go-back" onClick={onGoBack}>
|
||||||
<FontAwesomeIcon icon={faArrowLeft} />
|
<FontAwesomeIcon icon={faArrowLeft} />
|
||||||
</IconButton>
|
</IconButton>
|
||||||
|
|||||||
Reference in New Issue
Block a user