Skip to content

Commit

Permalink
Moves sorting to loadConfiguration.
Browse files Browse the repository at this point in the history
  • Loading branch information
Robert McMahan committed Jun 28, 2024
1 parent 0019dd9 commit 65542ed
Showing 1 changed file with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,11 @@ export class MlModelFormComponent implements OnInit {
try {
const mlModel = await this.mlModelsService.get(id);
this.mlModel = plainToClass(MlModel, mlModel as MlModel);
this.mlModel.variables.sort((a: Variable, b: Variable) => {
const aCompare = `${a.role + a.source + a.name}`;
const bCompare = `${b.role + b.source + b.name}`;
return aCompare.localeCompare(bCompare);
});
this.assignMlModelToForm();
} catch (error) {
if (error && error.status === 404) {
Expand Down Expand Up @@ -417,11 +422,6 @@ export class MlModelFormComponent implements OnInit {
const dataset = this.value('bigQueryDataset');
const ts = this.value('timespans');
variables = await this.mlModelsService.getVariables(input, dataset, ts);
variables.sort((a: Variable, b: Variable) => {
const aCompare = `${a.role + a.source + a.name}`;
const bCompare = `${b.role + b.source + a.name}`;
return aCompare.localeCompare(bCompare);
});
this.cachedVariables = variables;
this.errorMessage = '';
this.refreshVariables();
Expand Down

0 comments on commit 65542ed

Please sign in to comment.