Skip to content

Commit

Permalink
feat(agora): gene-search and nomination form migration (AG-1585) (#2926)
Browse files Browse the repository at this point in the history
  • Loading branch information
sagely1 authored Nov 26, 2024
1 parent 5b9a29f commit 25068e5
Show file tree
Hide file tree
Showing 82 changed files with 2,130 additions and 761 deletions.
12 changes: 2 additions & 10 deletions apps/agora/api/src/components/teams.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,11 +56,7 @@ export function sortNullProgramsForTeamsLast(teams: Team[]): void {
});
}

export async function teamsRoute(
req: Request,
res: Response,
next: NextFunction,
) {
export async function teamsRoute(req: Request, res: Response, next: NextFunction) {
try {
const teams = await getTeams();
setHeaders(res);
Expand Down Expand Up @@ -88,11 +84,7 @@ export async function getTeamMemberImage(name: string) {
return files[0] || undefined;
}

export async function teamMemberImageRoute(
req: Request,
res: Response,
next: NextFunction,
) {
export async function teamMemberImageRoute(req: Request, res: Response, next: NextFunction) {
if (!req.params || !req.params.name) {
res.status(404).send('Not found');
return;
Expand Down
1 change: 0 additions & 1 deletion apps/agora/app/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@
"styles": [
"apps/agora/app/src/styles.scss",
"node_modules/primeicons/primeicons.css",
"node_modules/primeng/resources/themes/lara-light-blue/theme.css",
"node_modules/primeng/resources/primeng.min.css"
],
"scripts": []
Expand Down
22 changes: 14 additions & 8 deletions apps/agora/app/src/app/app.routes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,20 +30,26 @@ export const routes: Route[] = [
{
path: 'genes/nominated-targets',
loadChildren: () =>
import('@sagebionetworks/agora/nominated-targets').then((routes) => routes.routes),
import('@sagebionetworks/agora/nominated-targets').then(
(routes) => routes.nominatedTargetsRoute,
),
data: {
title: 'Nominated Targets | Candidate genes for AD treatment or prevention',
description:
'Browse a list of genes that researchers have identified using computational analyses of high-dimensional human genomic, proteomic and metabolomic data.',
},
},
// {
// path: 'nomination-form', component: NominationFormPageComponent,
// data: {
// title: 'Nominate a Target | Suggest a new AD therapeutic target',
// description: 'Nominate a gene as a new candidate for AD treatment or prevention.'
// }
// },
{
path: 'nomination-form',
loadChildren: () =>
import('@sagebionetworks/agora/nominated-targets').then(
(routes) => routes.nominationFormRoute,
),
data: {
title: 'Nominate a Target | Suggest a new AD therapeutic target',
description: 'Nominate a gene as a new candidate for AD treatment or prevention.',
},
},
{
path: 'not-found',
loadChildren: () => import('@sagebionetworks/agora/not-found').then((routes) => routes.routes),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ model/gCTGeneNominations.ts
model/gCTGeneTissue.ts
model/gCTGenesList.ts
model/gene.ts
model/genesList.ts
model/medianExpression.ts
model/models.ts
model/neuropathologicCorrelation.ts
Expand Down
24 changes: 15 additions & 9 deletions libs/agora/api-client-angular/src/lib/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,15 @@
### Building

To install the required dependencies and to build the typescript sources run:

```
npm install
npm run build
```

### publishing

First build the package then run ```npm publish dist``` (don't forget to specify the `dist` folder!)
First build the package then run `npm publish dist` (don't forget to specify the `dist` folder!)

### consuming

Expand All @@ -33,25 +34,25 @@ _It's important to take the tgz file, otherwise you'll get trouble with links on
_using `npm link`:_

In PATH_TO_GENERATED_PACKAGE/dist:

```
npm link
```

In your project:

```
npm link
npm link
```

__Note for Windows users:__ The Angular CLI has troubles to use linked npm packages.
**Note for Windows users:** The Angular CLI has troubles to use linked npm packages.
Please refer to this issue https://github.com/angular/angular-cli/issues/8284 for a solution / workaround.
Published packages are not effected by this issue.


#### General usage

In your Angular project:


```
// without configuring providers
import { ApiModule } from '';
Expand Down Expand Up @@ -128,9 +129,11 @@ Note: The ApiModule is restricted to being instantiated once app wide.
This is to ensure that all services are treated as singletons.

#### Using multiple OpenAPI files / APIs / ApiModules

In order to use multiple `ApiModules` generated from different OpenAPI files,
you can create an alias name when importing the modules
in order to avoid naming conflicts:

```
import { ApiModule } from 'my-api-path';
import { ApiModule as OtherApiModule } from 'my-other-api-path';
Expand All @@ -150,8 +153,8 @@ export class AppModule {
}
```


### Set service base path

If different than the generated base path, during app bootstrap, you can provide the base path to your service.

```
Expand All @@ -161,6 +164,7 @@ bootstrap(AppComponent, [
{ provide: BASE_PATH, useValue: 'https://your-web-service.com' },
]);
```

or

```
Expand All @@ -175,8 +179,8 @@ import { BASE_PATH } from '';
export class AppModule {}
```


#### Using @angular/cli

First extend your `src/environments/*.ts` files by adding the corresponding base path:

```
Expand All @@ -187,6 +191,7 @@ export const environment = {
```

In the src/app/app.module.ts:

```
import { BASE_PATH } from '';
import { environment } from '../environments/environment';
Expand Down Expand Up @@ -215,10 +220,11 @@ pass an arrow-function or method-reference to the `encodeParam` property of the
(see [General Usage](#general-usage) above).

Example value for use in your Configuration-Provider:

```typescript
new Configuration({
encodeParam: (param: Param) => myFancyParamEncoder(param),
})
encodeParam: (param: Param) => myFancyParamEncoder(param),
});
```

[parameter-locations-url]: https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#parameter-locations
Expand Down
Loading

0 comments on commit 25068e5

Please sign in to comment.