Skip to content

Commit

Permalink
Merge branch 'feature/multitenancy' into #2313-Set-DR-Status-Endpoint
Browse files Browse the repository at this point in the history
  • Loading branch information
Peyton-McKee authored May 18, 2024
2 parents 34d3637 + 80077b4 commit fe6d4c7
Show file tree
Hide file tree
Showing 7 changed files with 14 additions and 14 deletions.
7 changes: 5 additions & 2 deletions src/backend/src/prisma/seed-data/users.seed.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ import { RoleEnum } from 'shared';
import prisma from '../prisma';
import { getUserQueryArgs } from '../../prisma-query-args/user.query-args';

/** Gets the current content of the .env file */
const currentEnv = require('dotenv').config().parsed;

const thomasEmrax: Prisma.UserCreateInput = {
firstName: 'Thomas',
lastName: 'Emrax',
Expand All @@ -17,7 +20,7 @@ const thomasEmrax: Prisma.UserCreateInput = {
userSettings: {
create: {
defaultTheme: Theme.DARK,
slackId: 'emrax'
slackId: currentEnv && currentEnv.SLACK_ID ? currentEnv.SLACK_ID : 'emrax'
}
},
userSecureSettings: {
Expand Down Expand Up @@ -776,7 +779,7 @@ const regina: Prisma.UserCreateInput = {
userSettings: {
create: {
defaultTheme: Theme.DARK,
slackId: 'Queen Regina'
slackId: currentEnv && currentEnv.SLACK_ID ? currentEnv.SLACK_ID : 'Queen Regina'
}
}
};
Expand Down
13 changes: 9 additions & 4 deletions src/backend/src/prisma/seed.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,11 @@ const performSeed: () => Promise<void> = async () => {
include: { userSettings: true, userSecureSettings: true }
});

const regina = await prisma.user.create({
data: dbSeedAllUsers.regina,
include: { userSettings: true, userSecureSettings: true }
});

const ner = await prisma.organization.create({
data: {
name: 'NER',
Expand Down Expand Up @@ -173,7 +178,6 @@ const performSeed: () => Promise<void> = async () => {
const francis = await createUser(dbSeedAllUsers.francis, RoleEnum.LEADERSHIP, organizationId);
const victorPerkins = await createUser(dbSeedAllUsers.victorPerkins, RoleEnum.LEADERSHIP, organizationId);
const kingJulian = await createUser(dbSeedAllUsers.kingJulian, RoleEnum.LEADERSHIP, organizationId);
const regina = await createUser(dbSeedAllUsers.regina, RoleEnum.LEADERSHIP, organizationId);
const gretchen = await createUser(dbSeedAllUsers.gretchen, RoleEnum.LEADERSHIP, organizationId);
const karen = await createUser(dbSeedAllUsers.karen, RoleEnum.LEADERSHIP, organizationId);
const janis = await createUser(dbSeedAllUsers.janis, RoleEnum.LEADERSHIP, organizationId);
Expand Down Expand Up @@ -274,6 +278,7 @@ const performSeed: () => Promise<void> = async () => {
/** If the .env file exists, set the FINANCE_TEAM_ID */
if (currentEnv) {
currentEnv.FINANCE_TEAM_ID = financeTeam.teamId;

/** Write the new .env file */
let stringifiedEnv = '';
Object.keys(currentEnv).forEach((key) => {
Expand Down Expand Up @@ -606,7 +611,7 @@ const performSeed: () => Promise<void> = async () => {
const { projectWbsNumber: project7WbsNumber, projectId: project7Id } = await seedProject(
lexLuther,
changeRequest1.crId,
1,
0,
'Laser Cannon Prototype',
'Develop a prototype of a laser cannon for the Justice League',
[justiceLeague.teamId],
Expand Down Expand Up @@ -634,7 +639,7 @@ const performSeed: () => Promise<void> = async () => {
const { projectWbsNumber: project8WbsNumber, projectId: project8Id } = await seedProject(
ryanGiggs,
changeRequest1.crId,
1,
0,
'Stadium Renovation',
`Renovate the team's stadium to improve fan experience`,
[ravens.teamId],
Expand Down Expand Up @@ -662,7 +667,7 @@ const performSeed: () => Promise<void> = async () => {
const { projectWbsNumber: project9WbsNumber, projectId: project9Id } = await seedProject(
glen,
changeRequest1.crId,
1,
0,
'Community Outreach Program',
'Initiate a community outreach program to engage with local schools',
[slackBotTeam.teamId],
Expand Down
3 changes: 0 additions & 3 deletions src/backend/src/services/work-packages.services.ts
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,6 @@ export default class WorkPackagesService {
if (await userHasPermission(user.userId, organizationId, isGuest))
throw new AccessDeniedGuestException('create work packages');

console.log(descriptionBullets);
const changeRequest = await validateChangeRequestAccepted(crId);

const wbsElem = await prisma.wBS_Element.findUnique({
Expand Down Expand Up @@ -402,8 +401,6 @@ export default class WorkPackagesService {
});
}

console.log(changes.addedDescriptionBullets);

// Add the new description bullets to the workpackage
await addRawDescriptionBullets(
changes.addedDescriptionBullets,
Expand Down
1 change: 0 additions & 1 deletion src/frontend/src/apis/work-packages.api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,6 @@ export const createSingleWorkPackage = (payload: WorkPackageApiInputs) => {
* @returns Promise that will resolve to either a success status code or a fail status code.
*/
export const editWorkPackage = (payload: WorkPackageApiInputs) => {
console.log(payload);
return axios.post<{ message: string }>(apiUrls.workPackagesEdit(), {
...payload
});
Expand Down
1 change: 0 additions & 1 deletion src/frontend/src/hooks/users.hooks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,6 @@ export const useSingleUser = (id: number) => {
export const useLogUserIn = () => {
return useMutation<AuthenticatedUser, Error, string>(['users', 'login'], async (id_token: string) => {
const { data } = await logUserIn(id_token);
console.log(data);
return data;
});
};
Expand Down
1 change: 0 additions & 1 deletion src/frontend/src/pages/LoginPage/Login.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,6 @@ const Login = () => {
}
if (authedUser.organizations.length > 0) {
const defaultOrganization = authedUser.organizations[0];
console.log(defaultOrganization);
organizationContext.selectOrganization(defaultOrganization);
}
redirectAfterLogin();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@ const ScopeTab = ({ workPackage }: { workPackage: WorkPackage }) => {
descriptoinBulletsSplitByType.get(bullet.type)!.push(bullet);
}

console.log(workPackage.descriptionBullets);

return (
<>
{Array.from(descriptoinBulletsSplitByType.entries()).map(([type, bullets]) => (
Expand Down

0 comments on commit fe6d4c7

Please sign in to comment.