Skip to content

Sb rt addition #45

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 4 commits into
base: sandbox
Choose a base branch
from
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
25 changes: 24 additions & 1 deletion app/api/onboarding.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ module.exports = (api) => {
UcdIamModel.init(config.ucdIamApi);

const payload = req.body;

if ( !payload.additionalData ) payload.additionalData = {};

payload.submittedBy = req.auth.token.id;
Expand Down Expand Up @@ -99,8 +100,8 @@ module.exports = (api) => {
if ( config.rt.user ){
ticket.addOwner(config.rt.user);
}

if ( !config.rt.forbidCc) {

if ( notifySupervisor ) {
ticket.addCc( ad.supervisorEmail );
if ( transfer.isTransfer ) {
Expand Down Expand Up @@ -182,6 +183,28 @@ module.exports = (api) => {
}
}

if ( notifyEmployee ) {
const employeeName = ad.employeeFirstName && ad.employeeLastName ? `${ad.employeeFirstName} ${ad.employeeLastName}` : 'Prospective Employee';
const accessLink = `https://aggieaccess.ucdavis.edu/request-credentials`;

const Emreply = ticket.createReply();
Emreply.addSubject(`New Employee Access Credential Requests`);
Emreply.addContent(`Hi ${employeeName},`);
Emreply.addContent('');
Emreply.addContent(`To proceed with your onboarding, please go here to go get Aggie Access credentials:`);
Emreply.addContent('');
Emreply.addContent(`<a href='${accessLink}'>Aggie Access Credentials</a>`);
Emreply.addContent(`Select either AggieAccess Card or AggieAccess Mobile Credentials and fill out the form given. For Key Control Manager please write Dale Snapp.`);

const emReplyResponse = await rtClient.sendCorrespondence(Emreply);
if ( emReplyResponse.err ) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Probably can remove. If it fails for some reason, probably not enough of a reason to tank the whole process.

console.error(emReplyResponse);
await UcdlibOnboarding.delete(output.id);
res.json({error: true, message: 'Unable to send RT request to employee.'});
return;
}
}

await UcdlibOnboarding.update(output.id, {rtTicketId: rtResponse.res.id});
return res.json(output);

Expand Down
4 changes: 2 additions & 2 deletions deploy/config.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,12 @@ fi

# Main version number we are tagging the app with. Always update
# this when you cut a new version of the app!
APP_VERSION=v1.4.1.${BUILD_NUM}
APP_VERSION=v1.4.2.${BUILD_NUM}

# Repository tags/branchs
# Tags should always be used for production deployments
# Branches can be used for development deployments
REPO_TAG=sandbox
REPO_TAG=v1.4.2
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

REPO_TAG should always be sandbox for the sandbox branch. If you are merging from main, you have to reset this value, and then regenerate your deployment files.

POSTGRES_TAG=15.3

DEPLOY_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
Expand Down
10 changes: 5 additions & 5 deletions deploy/docker-compose.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
version: '3'
services:
app:
image: gcr.io/ucdlib-pubreg/itis-iam-support-app:sandbox
image: gcr.io/ucdlib-pubreg/itis-iam-support-app:v1.4.2
env_file:
- .env
ports:
Expand All @@ -11,7 +11,7 @@ services:
- db
command: node index.js
cli:
image: gcr.io/ucdlib-pubreg/itis-iam-support-utils:sandbox
image: gcr.io/ucdlib-pubreg/itis-iam-support-utils:v1.4.2
deploy:
restart: always
env_file:
Expand All @@ -22,7 +22,7 @@ services:
- ./utils/db-entrypoint:/cli/sql
command: /cli/cli.sh
backup:
image: gcr.io/ucdlib-pubreg/itis-iam-support-utils:sandbox
image: gcr.io/ucdlib-pubreg/itis-iam-support-utils:v1.4.2
restart: always
env_file:
- .env
Expand All @@ -36,7 +36,7 @@ services:
volumes:
- ../gc-itis-iam-writer-key.json:/etc/service-account.json
init:
image: gcr.io/ucdlib-pubreg/itis-iam-support-utils:sandbox
image: gcr.io/ucdlib-pubreg/itis-iam-support-utils:v1.4.2
env_file:
- .env
depends_on:
Expand All @@ -49,7 +49,7 @@ services:
volumes:
- ../gc-itis-iam-reader-key.json:/etc/service-account.json
maintenance:
image: gcr.io/ucdlib-pubreg/itis-iam-support-utils:sandbox
image: gcr.io/ucdlib-pubreg/itis-iam-support-utils:v1.4.2
restart: always
env_file:
- .env
Expand Down
Loading