Skip to content
Merged
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
482 changes: 427 additions & 55 deletions package-lock.json

Large diffs are not rendered by default.

12 changes: 10 additions & 2 deletions packages/client/src/graphql/graphql.ts
Original file line number Diff line number Diff line change
Expand Up @@ -548,7 +548,7 @@ export type ProjectPermissionModel = {
__typename?: 'ProjectPermissionModel';
editable: Scalars['Boolean']['output'];
isProjectAdmin: Scalars['Boolean']['output'];
user: UserModel;
user: User;
};

export type ProjectSettingsInput = {
Expand Down Expand Up @@ -749,7 +749,7 @@ export type StudyPermissionModel = {
isStudyAdminEditable: Scalars['Boolean']['output'];
isTrained: Scalars['Boolean']['output'];
isTrainedEditable: Scalars['Boolean']['output'];
user: UserModel;
user: User;
};

export type Tag = {
Expand Down Expand Up @@ -799,6 +799,14 @@ export enum UploadStatus {
Warning = 'WARNING'
}

export type User = {
__typename?: 'User';
displayName?: Maybe<Scalars['String']['output']>;
email?: Maybe<Scalars['String']['output']>;
photoURL?: Maybe<Scalars['String']['output']>;
uid: Scalars['String']['output'];
};

export type UserModel = {
__typename?: 'UserModel';
createdAt: Scalars['DateTime']['output'];
Expand Down
22 changes: 6 additions & 16 deletions packages/client/src/graphql/permission/permission.graphql
Original file line number Diff line number Diff line change
@@ -1,15 +1,10 @@
query getProjectPermissions($project: ID!) {
getProjectPermissions(project: $project) {
user {
id,
projectId,
fullname,
username,
uid,
email,
role,
createdAt,
updatedAt,
deletedAt
displayName,
photoURL,
},
isProjectAdmin,
editable
Expand All @@ -23,15 +18,10 @@ mutation grantProjectPermissions($project: ID!, $user: ID!, $isAdmin: Boolean!)
query getStudyPermissions($study: ID!) {
getStudyPermissions(study: $study) {
user {
id,
projectId,
fullname,
username,
uid,
email,
role,
createdAt,
updatedAt,
deletedAt
displayName,
photoURL,
},
isStudyAdmin,
isStudyAdminEditable,
Expand Down
26 changes: 8 additions & 18 deletions packages/client/src/graphql/permission/permission.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ export type GetProjectPermissionsQueryVariables = Types.Exact<{
}>;


export type GetProjectPermissionsQuery = { __typename?: 'Query', getProjectPermissions: Array<{ __typename?: 'ProjectPermissionModel', isProjectAdmin: boolean, editable: boolean, user: { __typename?: 'UserModel', id: string, projectId: string, fullname?: string | null, username?: string | null, email?: string | null, role: number, createdAt: any, updatedAt: any, deletedAt?: any | null } }> };
export type GetProjectPermissionsQuery = { __typename?: 'Query', getProjectPermissions: Array<{ __typename?: 'ProjectPermissionModel', isProjectAdmin: boolean, editable: boolean, user: { __typename?: 'User', uid: string, email?: string | null, displayName?: string | null, photoURL?: string | null } }> };

export type GrantProjectPermissionsMutationVariables = Types.Exact<{
project: Types.Scalars['ID']['input'];
Expand All @@ -26,7 +26,7 @@ export type GetStudyPermissionsQueryVariables = Types.Exact<{
}>;


export type GetStudyPermissionsQuery = { __typename?: 'Query', getStudyPermissions: Array<{ __typename?: 'StudyPermissionModel', isStudyAdmin: boolean, isStudyAdminEditable: boolean, isContributor: boolean, isContributorEditable: boolean, isTrained: boolean, isTrainedEditable: boolean, user: { __typename?: 'UserModel', id: string, projectId: string, fullname?: string | null, username?: string | null, email?: string | null, role: number, createdAt: any, updatedAt: any, deletedAt?: any | null } }> };
export type GetStudyPermissionsQuery = { __typename?: 'Query', getStudyPermissions: Array<{ __typename?: 'StudyPermissionModel', isStudyAdmin: boolean, isStudyAdminEditable: boolean, isContributor: boolean, isContributorEditable: boolean, isTrained: boolean, isTrainedEditable: boolean, user: { __typename?: 'User', uid: string, email?: string | null, displayName?: string | null, photoURL?: string | null } }> };

export type GrantStudyAdminMutationVariables = Types.Exact<{
study: Types.Scalars['ID']['input'];
Expand Down Expand Up @@ -84,15 +84,10 @@ export const GetProjectPermissionsDocument = gql`
query getProjectPermissions($project: ID!) {
getProjectPermissions(project: $project) {
user {
id
projectId
fullname
username
uid
email
role
createdAt
updatedAt
deletedAt
displayName
photoURL
}
isProjectAdmin
editable
Expand Down Expand Up @@ -164,15 +159,10 @@ export const GetStudyPermissionsDocument = gql`
query getStudyPermissions($study: ID!) {
getStudyPermissions(study: $study) {
user {
id
projectId
fullname
username
uid
email
role
createdAt
updatedAt
deletedAt
displayName
photoURL
}
isStudyAdmin
isStudyAdminEditable
Expand Down
6 changes: 3 additions & 3 deletions packages/client/src/pages/projects/ProjectUserPermissions.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ const EditAdminSwitch: React.FC<EditAdminSwitchProps> = (props) => {
grantProjectPermissions({
variables: {
project: props.project._id,
user: props.permission.user.id,
user: props.permission.user.uid,
isAdmin: event.target.checked
}
});
Expand All @@ -50,7 +50,7 @@ const EditAdminSwitch: React.FC<EditAdminSwitchProps> = (props) => {
<Switch
checked={props.permission.isProjectAdmin}
onChange={handleChange}
disabled={!props.permission.editable || props.permission.user.id === props.currentUser.user_id}
disabled={!props.permission.editable || props.permission.user.uid === props.currentUser.user_id}
/>
);
};
Expand Down Expand Up @@ -116,7 +116,7 @@ const UserPermissionTable: React.FC<{ project: Project }> = ({ project }) => {
getRowHeight={() => 'auto'}
rows={rows}
columns={columns}
getRowId={(row) => row.user.id}
getRowId={(row) => row.user.uid}
initialState={{
pagination: {
paginationModel: {
Expand Down
12 changes: 6 additions & 6 deletions packages/client/src/pages/studies/UserPermissions.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ const EditStudyAdminSwitch: React.FC<EditSwitchProps> = (props) => {
grantStudyAdmin({
variables: {
study: props.study._id,
user: props.permission.user.id,
user: props.permission.user.uid,
isAdmin: event.target.checked
}
});
Expand All @@ -53,7 +53,7 @@ const EditStudyAdminSwitch: React.FC<EditSwitchProps> = (props) => {
return (
<Switch
checked={props.permission.isStudyAdmin}
disabled={!props.permission.isStudyAdminEditable || props.permission.user.id === props.currentUser.user_id}
disabled={!props.permission.isStudyAdminEditable || props.permission.user.uid === props.currentUser.user_id}
onChange={handleChange}
/>
);
Expand All @@ -66,7 +66,7 @@ const EditContributorSwitch: React.FC<EditSwitchProps> = (props) => {
grantContributor({
variables: {
study: props.study._id,
user: props.permission.user.id,
user: props.permission.user.uid,
isContributor: event.target.checked
}
});
Expand All @@ -81,7 +81,7 @@ const EditContributorSwitch: React.FC<EditSwitchProps> = (props) => {
return (
<Switch
checked={props.permission.isContributor}
disabled={!props.permission.isContributorEditable || props.permission.user.id === props.currentUser.user_id}
disabled={!props.permission.isContributorEditable || props.permission.user.uid === props.currentUser.user_id}
onChange={handleChange}
/>
);
Expand All @@ -94,7 +94,7 @@ const EditTrainedSwitch: React.FC<EditSwitchProps> = (props) => {
grantTrainedContributor({
variables: {
study: props.study._id,
user: props.permission.user.id,
user: props.permission.user.uid,
isTrained: event.target.checked
}
});
Expand Down Expand Up @@ -183,7 +183,7 @@ const UserPermissionTable: React.FC<{ study: Study }> = ({ study }) => {
getRowHeight={() => 'auto'}
rows={permissions}
columns={columns}
getRowId={(row) => row.user.id}
getRowId={(row) => row.user.uid}
initialState={{
pagination: {
paginationModel: {
Expand Down
3 changes: 1 addition & 2 deletions packages/gateway/src/app.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,7 @@ import configuration from './config/configuration';
supergraphSdl: new IntrospectAndCompose({
subgraphs: [
{ name: 'signlab', url: configService.getOrThrow('signlab.uri') },
{ name: 'lex_service', url: configService.getOrThrow('lex_service.uri') },
{ name: 'auth', url: configService.getOrThrow('auth.uri') }
{ name: 'lex_service', url: configService.getOrThrow('lex_service.uri') }
]
})
}
Expand Down
3 changes: 0 additions & 3 deletions packages/gateway/src/config/configuration.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,5 @@ export default () => ({
},
lex_service: {
uri: process.env.LEX_URI
},
auth: {
uri: process.env.AUTH_URI
}
});
4 changes: 2 additions & 2 deletions packages/server/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,7 @@
"test:watch": "jest --watch",
"test:cov": "jest --coverage",
"test:debug": "node --inspect-brk -r tsconfig-paths/register -r ts-node/register node_modules/.bin/jest --runInBand",
"test:e2e": "jest --config ./test/jest-e2e.json",
"introspection": "graphql-codegen --config src/auth/graphql-codegen.yml"
"test:e2e": "jest --config ./test/jest-e2e.json"
},
"dependencies": {
"@apollo/subgraph": "^2.4.12",
Expand All @@ -40,6 +39,7 @@
"casbin": "^5.28.0",
"casbin-mongoose-adapter": "^5.3.1",
"csv-parser": "^3.0.0",
"firebase-admin": "^12.0.0",
"graphql-request": "^6.1.0",
"graphql-type-json": "^0.3.2",
"jsonschema": "^1.4.1",
Expand Down
4 changes: 2 additions & 2 deletions packages/server/src/app.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import { TagModule } from './tag/tag.module';
import { SharedModule } from './shared/shared.module';
import { JwtModule } from './jwt/jwt.module';
import { PermissionModule } from './permission/permission.module';
import { AuthModule } from './auth/auth.module';
import { UserModule } from './user/user.module';

@Module({
imports: [
Expand Down Expand Up @@ -44,7 +44,7 @@ import { AuthModule } from './auth/auth.module';
SharedModule,
JwtModule,
PermissionModule,
AuthModule
UserModule
]
})
export class AppModule {}
9 changes: 0 additions & 9 deletions packages/server/src/auth/auth.module.ts

This file was deleted.

24 changes: 0 additions & 24 deletions packages/server/src/auth/graphql-codegen.yml

This file was deleted.

Loading