-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into feat/qa-reporting-enhancements
- Loading branch information
Showing
49 changed files
with
11,614 additions
and
3,897 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -145,4 +145,4 @@ dist | |
terraform/.terraform | ||
.tool-versions | ||
|
||
localstack/volume | ||
localstack/volume/ |
11 changes: 11 additions & 0 deletions
11
api/db/migrations/20231217212515_relate_reporting_period_to_org/migration.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
/* | ||
Warnings: | ||
- Added the required column `organizationId` to the `ReportingPeriod` table without a default value. This is not possible if the table is not empty. | ||
*/ | ||
-- AlterTable | ||
ALTER TABLE "ReportingPeriod" ADD COLUMN "organizationId" INTEGER NOT NULL; | ||
|
||
-- AddForeignKey | ||
ALTER TABLE "ReportingPeriod" ADD CONSTRAINT "ReportingPeriod_organizationId_fkey" FOREIGN KEY ("organizationId") REFERENCES "Organization"("id") ON DELETE RESTRICT ON UPDATE CASCADE; |
28 changes: 28 additions & 0 deletions
28
api/db/migrations/20231217214528_updated_at_defaults_to_now/migration.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
-- AlterTable | ||
ALTER TABLE "ExpenditureCategory" ALTER COLUMN "updatedAt" SET DEFAULT CURRENT_TIMESTAMP; | ||
|
||
-- AlterTable | ||
ALTER TABLE "InputTemplate" ALTER COLUMN "updatedAt" SET DEFAULT CURRENT_TIMESTAMP; | ||
|
||
-- AlterTable | ||
ALTER TABLE "OutputTemplate" ALTER COLUMN "updatedAt" SET DEFAULT CURRENT_TIMESTAMP; | ||
|
||
-- AlterTable | ||
ALTER TABLE "Project" ALTER COLUMN "updatedAt" SET DEFAULT CURRENT_TIMESTAMP; | ||
|
||
-- AlterTable | ||
ALTER TABLE "ReportingPeriod" ALTER COLUMN "updatedAt" SET DEFAULT CURRENT_TIMESTAMP; | ||
|
||
-- AlterTable | ||
ALTER TABLE "Subrecipient" ALTER COLUMN "updatedAt" SET DEFAULT CURRENT_TIMESTAMP; | ||
|
||
-- AlterTable | ||
ALTER TABLE "Upload" ALTER COLUMN "updatedAt" SET DEFAULT CURRENT_TIMESTAMP; | ||
|
||
-- AlterTable | ||
ALTER TABLE "UploadValidation" ALTER COLUMN "updatedAt" SET DEFAULT CURRENT_TIMESTAMP; | ||
|
||
-- AlterTable | ||
ALTER TABLE "User" ALTER COLUMN "createdAt" SET DATA TYPE TIMESTAMPTZ(6), | ||
ALTER COLUMN "updatedAt" SET DEFAULT CURRENT_TIMESTAMP, | ||
ALTER COLUMN "updatedAt" SET DATA TYPE TIMESTAMPTZ(6); |
2 changes: 2 additions & 0 deletions
2
api/db/migrations/20231222193706_add_notes_on_upload/migration.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
-- AlterTable | ||
ALTER TABLE "Upload" ADD COLUMN "notes" TEXT; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
import { parseJWT, Decoded } from '@redwoodjs/api' | ||
import { Decoded } from '@redwoodjs/api' | ||
import { AuthenticationError, ForbiddenError } from '@redwoodjs/graphql-server' | ||
|
||
/** | ||
|
@@ -32,17 +32,12 @@ type RedwoodUser = Record<string, unknown> & { roles?: string[] } | |
export const getCurrentUser = async ( | ||
decoded: Decoded | ||
): Promise<RedwoodUser | null> => { | ||
if (!decoded) { | ||
return null | ||
console.log(decoded) | ||
return { | ||
id: 1, | ||
email: '[email protected]', | ||
roles: ['admin'], | ||
} | ||
|
||
const { roles } = parseJWT({ decoded }) | ||
|
||
if (roles) { | ||
return { ...decoded, roles } | ||
} | ||
|
||
return { ...decoded } | ||
} | ||
|
||
/** | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.