Skip to content
Closed
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
1 change: 0 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ build: src/
rm -rf node_modules/aws-crt/dist/bin/{darwin*,linux-x64*,linux-arm64-musl} && \
rm -rf node_modules/argon2/prebuilds/{darwin*,freebsd*,linux-arm,linux-x64*,win32-x64*} && \
rm -rf node_modules/argon2/prebuilds/linux-arm64/argon2.armv8.musl.node"

local:
VITE_BUILD_HASH=$(GIT_HASH) yarn run dev

Expand Down
2 changes: 1 addition & 1 deletion infracost-usage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -356,7 +356,7 @@ resource_type_default_usage:
monthly_bulk_data_retrieval_gb: 0 # Monthly data retrievals in GB (for bulk level of S3 Glacier).
early_delete_gb: 0 # If an archive is deleted within 6 months of being uploaded, you will be charged an early deletion fee per GB.
aws_secretsmanager_secret:
monthly_requests: 1000000 # Monthly API requests to Secrets Manager.
monthly_requests: 20000 # Monthly API requests to Secrets Manager.
aws_sfn_state_machine:
monthly_transitions: 200000 # Monthly number of state transitions. Only applicable for Standard Workflows.
monthly_requests: 5000000 # Monthly number of workflow requests. Only applicable for Express Workflows.
Expand Down
5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,14 @@
"workspaces": [
"src/api",
"src/ui",
"src/archival"
"src/archival",
"src/dirsync"
],
"packageManager": "yarn@1.22.22",
"scripts": {
"postinstall": "npm run setup",
"setup": "git config blame.ignoreRevsFile .git-blame-ignore-revs",
"build": "concurrently --names 'api,ui,archival' 'yarn workspace infra-core-api run build' 'yarn workspace infra-core-ui run build' 'yarn workspace infra-core-archival run build'",
"build": "concurrently --names 'api,ui,archival,dirsync' 'yarn workspace infra-core-api run build' 'yarn workspace infra-core-ui run build' 'yarn workspace infra-core-archival run build' 'yarn workspace infra-core-gsuite-dirsync run build'",
"postbuild": "node src/api/createLambdaPackage.js && yarn lockfile-manage",
"dev": "cross-env DISABLE_AUDIT_LOG=true concurrently --names 'api,ui' 'yarn workspace infra-core-api run dev' 'yarn workspace infra-core-ui run dev'",
"lockfile-manage": "synp --with-workspace --source-file yarn.lock",
Expand Down
10 changes: 6 additions & 4 deletions src/archival/build.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,13 @@ const commonParams = {
esbuild
.build({
...commonParams,
entryPoints: ["archival/dynamoStream.js"],
outdir: "../../dist/archival/",
entryPoints: ["dirsync/sync.js"],
outdir: "../../dist/dirsync/",
})
.then(() => console.log("Archival lambda build completed successfully!"))
.then(() =>
console.log("Directory sync lambda build completed successfully!"),
)
.catch((error) => {
console.error("Archival lambda build failed:", error);
console.error("Directory sync lambda build failed:", error);
process.exit(1);
});
51 changes: 51 additions & 0 deletions src/common/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,3 +60,54 @@ export const getAllUserEmails = (username?: string) => {
}
return [username.replace("@illinois.edu", "@acm.illinois.edu")]
}


/**
* Parses a display name into first and last name components
* Handles common formats:
* - "First Last"
* - "Last, First"
* - "First Middle Last" (treats everything except last word as first name)
* - Single names (treated as first name)
*/
export const parseDisplayName = (displayName: string): { givenName: string; familyName: string } => {
if (!displayName || displayName.trim() === '') {
return { givenName: '', familyName: '' };
}

const trimmed = displayName.trim();

// Handle "Last, First" format
if (trimmed.includes(',')) {
const parts = trimmed.split(',').map(p => p.trim());
return {
familyName: parts[0] || '',
givenName: parts[1] || ''
};
}

// Handle "First Last" or "First Middle Last" format
const parts = trimmed.split(/\s+/);

if (parts.length === 1) {
// Single name - treat as first name
return {
givenName: parts[0],
familyName: ''
};
}

if (parts.length === 2) {
// Simple "First Last"
return {
givenName: parts[0],
familyName: parts[1]
};
}

// Multiple parts - last part is family name, rest is given name
const familyName = parts[parts.length - 1];
const givenName = parts.slice(0, -1).join(' ');

return { givenName, familyName };
};
1 change: 1 addition & 0 deletions terraform/envs/qa/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ module "archival" {
})
}


resource "aws_cloudfront_key_value_store" "linkry_kv" {
name = "${var.ProjectId}-cloudfront-linkry-kv"
}
Expand Down
Loading
Loading