Merge branch 'main' into yaml-fixes

This commit is contained in:
Matthew Alan Gray 2022-11-10 08:29:34 -06:00 коммит произвёл GitHub
Родитель e81be6a128 966c748623
Коммит 3a9a668513
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
7 изменённых файлов: 143 добавлений и 69 удалений

Просмотреть файл

@ -505,6 +505,8 @@ Refer to the [Before the hands-on lab setup guide](Before%20the%20Hands-On%20Lab
dockerauth
```
> Note: An example of this YAML file can be located in the `./actions` folder of this lab as `deployToAksCluster.yml`.
3. The workflow will fail on the intial run because it requires some secrets to be setup in the repository. Navigate to the repository in GitHub then select "Settings > Secrets > Actions". Finally use the "New Repository Secret" button to create secrets.
![Create a new repository secret.](media/github-new-repository-secret.png "New Repository Secret")

Просмотреть файл

@ -33,15 +33,74 @@ export class AddHealthCheck extends Component {
this.createHealthCheck();
}
handleAddSymptom = () => {
this.setState({ symptoms: [...this.state.symptoms, ""] });
}
handleSymptomInput = (index, event) => {
const symptoms = [...this.state.symptoms];
symptoms[index] = event.target.value;
this.setState({ symptoms });
}
handleDeleteSymptom = (index) => {
return () => {
const symptoms = this.state.symptoms;
symptoms.splice(index, 1);
this.setState({ symptoms });
}
}
render() {
return (
<div>
<h4>Submit a HealthCheck:</h4>
<form onSubmit={this.handleSubmit}>
<input type="hidden" name="id" placeholder="Id" value="id" />
<div>
<label>
Patient ID:
<input type="text" name="patientid" placeholder="Patient Id" value={this.state.patientid} onChange={this.handleInput} />
<input type="text" name="date" placeholder="Date" value={this.state.date} onChange={this.handleInput} />
<input type="text" name="healthstatus" placeholder="Health Status" value={this.state.healthstatus} onChange={this.handleInput} />
</label>
</div>
<div>
<label>
Date:
<input type="date" name="date" placeholder="Date" value={this.state.date} onChange={this.handleInput} />
</label>
</div>
<div>
<label>
Health Status:
<input type="text" name="healthstatus" placeholder="Health Status" onChange={this.handleInput} />
</label>
</div>
<div>
<table className='table table-striped' aria-labelledby="tabelLabel">
<thead>
<tr>
<th>Symptom</th>
</tr>
</thead>
<tbody>
{this.state.symptoms.map((symptom, index) =>
<tr key={index}>
<td>
<input type="text" name="symptom" placeholder="Symptom" value={symptom || ""} onChange={e => this.handleSymptomInput(index, e)} />
</td>
<td><button className="button delete" type="button" onClick={this.handleDeleteSymptom(index)}>Delete</button></td>
</tr>
)}
</tbody>
<tfoot>
<tr>
<td>
<button className="button add" type="button" onClick={this.handleAddSymptom}>Add Symptom</button>
</td>
</tr>
</tfoot>
</table>
</div>
<button type="submit">Submit</button>
</form>
</div>

Просмотреть файл

@ -25,7 +25,7 @@ export class HealthCheck extends Component {
<td>{this.state.healthstatus}</td>
<td>
<ul>
{this.state.symptoms.map(symptom, index =>
{this.state.symptoms.map((symptom, index) =>
<li key={index}>{symptom}</li>
)}
</ul>

Просмотреть файл

@ -14,7 +14,9 @@
"applicationUrl": "https://localhost:7258;http://localhost:5271",
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development",
"ASPNETCORE_HOSTINGSTARTUPASSEMBLIES": "Microsoft.AspNetCore.SpaProxy"
"ASPNETCORE_HOSTINGSTARTUPASSEMBLIES": "Microsoft.AspNetCore.SpaProxy",
"REACT_APP_API_URL": "https://localhost:5001/HealthCheck",
"REACT_APP_API_KEY": "SECRETKEY"
}
},
"IIS Express": {

Просмотреть файл

@ -22,7 +22,7 @@
"dotnetRunMessages": "true",
"launchBrowser": true,
"launchUrl": "swagger",
"applicationUrl": "http://localhost:5000",
"applicationUrl": "http://localhost:5000;https://localhost:5001",
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development"
}

Просмотреть файл

@ -33,6 +33,15 @@ namespace Humongous.Healthcare
c.SwaggerDoc("v1", new OpenApiInfo { Title = "Humongous.Healthcare", Version = "v1" });
});
services.AddSingleton<ICosmosDbService>(InitializeCosmosClientInstanceAsync(Configuration.GetSection("CosmosDb")).GetAwaiter().GetResult());
services.AddCors(options =>
{
options.AddDefaultPolicy(policy =>
{
policy.AllowAnyOrigin()
.AllowAnyHeader()
.AllowAnyMethod();
});
});
}
// This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
@ -47,6 +56,8 @@ namespace Humongous.Healthcare
app.UseRouting();
app.UseCors();
app.UseAuthorization();
app.UseEndpoints(endpoints =>