Skip to content

Commit

Permalink
issue #121 Execution plan details :: all attribute list to be sorted … (
Browse files Browse the repository at this point in the history
#128)

* issue #121 Execution plan details :: all attribute list to be sorted by name

* issue #121 replace a mutable 'Array.sort' with an immutable '_.sortBy'. (Thanks sonar)
  • Loading branch information
wajda authored Sep 3, 2021
1 parent 19faaae commit 135e350
Showing 1 changed file with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
* limitations under the License.
*/

import _ from 'lodash'
import { Observable } from 'rxjs'
import { ExecutionPlan } from 'spline-api'
import { SplineDataViewSchema } from 'spline-common/data-view'
Expand All @@ -34,6 +35,8 @@ export namespace ExecutionPlanInfoStore {
}

export function toState(executionPlan: ExecutionPlan, selectedAttributeId$: Observable<string | null>): State {
const allAttributesSorted = _.sortBy(executionPlan.extraInfo.attributes, a => a.name)
const allDataTypes = executionPlan.extraInfo.dataTypes
return {
executionPlan: executionPlan,
executionPlanVs: PlanInfo.toDataViewSchema(executionPlan),
Expand All @@ -42,8 +45,8 @@ export namespace ExecutionPlanInfoStore {
outputAndInputsVs: PlanInfo.getOutputAndInputsDvs(executionPlan),
inputsNumber: executionPlan.inputDataSources.length,
attributesSchema: attributesSchemaToDataViewSchema(
executionPlan.extraInfo.attributes,
executionPlan.extraInfo.dataTypes,
allAttributesSorted,
allDataTypes,
selectedAttributeId$,
),
}
Expand Down

0 comments on commit 135e350

Please sign in to comment.