Skip to content
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
4 changes: 4 additions & 0 deletions people-service/PeopleService.WebApi/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@

var builder = WebApplication.CreateBuilder(args);

// Configure port from environment variable
var port = Environment.GetEnvironmentVariable("PEOPLE_SERVICE_PORT") ?? "18089";
builder.WebHost.UseUrls($"http://0.0.0.0:{port}");

// Add services to the container.

builder.Services.AddControllers();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@
"dotnetRunMessages": true,
"launchBrowser": true,
"launchUrl": "swagger",
"applicationUrl": "http://0.0.0.0:18089",
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development"
"ASPNETCORE_ENVIRONMENT": "Development",
"PEOPLE_SERVICE_PORT": "18089"
}
},
"IIS Express": {
Expand Down
8 changes: 7 additions & 1 deletion people-service/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,20 @@ The people service is used for managing users in the system, and associating the

Default Port is 18089.

TODO: Get this port configurable by env var PEOPLE_SERVICE_PORT
The port can be configured using the `PEOPLE_SERVICE_PORT` environment variable.

## Building and Running
```bash
$ cd PeopleService.WebApi
$ dotnet run
```

To run on a different port:
```bash
$ export PEOPLE_SERVICE_PORT=8080
$ dotnet run
```

## Accessing the Swagger URL

Visit the forwarded port `/swagger` to open the SwaggerUI.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,8 @@ export class PositionBlotterComponent implements OnChanges, OnDestroy {
}

update(data: any) {
const row = this.gridApi.getRowNode(data.security);
const rowId = `Position-${data.security}`;
const row = this.gridApi.getRowNode(rowId);
let positionData;
if (row) {
positionData = {
Expand Down
14 changes: 12 additions & 2 deletions web-front-end/react/src/Datatable/Datatable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,17 @@ export const Datatable = () => {
}
if (data.topic === `/accounts/${event.target.value}/positions`) {
console.log("INCOMING POSITION DATA: ", data);
setPositionRowData((current: PositionData[]) => [...current, data.payload]);
setPositionRowData((current: PositionData[]) => {
const existingIndex = current.findIndex(
(pos: PositionData) => pos.security === data.payload.security
);
if (existingIndex >= 0) {
const updated = [...current];
updated[existingIndex] = data.payload;
return updated;
}
return [...current, data.payload];
});
}
});
}, [selectedId])
Expand Down Expand Up @@ -86,4 +96,4 @@ return (
</div>
</>
);
}
}