Skip to content

Commit

Permalink
feat(code-editor): add sorting of code editor files list (#4338)
Browse files Browse the repository at this point in the history
* add sorting of code editor files list

* camel case + use of lodash sortBy
  • Loading branch information
laurentlp committed Jan 5, 2021
1 parent 60003ae commit bd40eed
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion modules/code-editor/src/views/full/SidePanel.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { Icon } from '@blueprintjs/core'
import { lang } from 'botpress/shared'
import { SearchBar, SectionAction, SidePanel, SidePanelSection } from 'botpress/ui'
import _ from 'lodash'
import { inject, observer } from 'mobx-react'
import React from 'react'

Expand Down Expand Up @@ -48,7 +49,8 @@ class PanelContent extends React.Component<Props> {
const files = this.props.files[fileType]

if (files && files.length) {
fileList.push({ label, files })
const sortedFiles = _.sortBy(files, 'location')
fileList.push({ label, files: sortedFiles })
}
}

Expand Down

0 comments on commit bd40eed

Please sign in to comment.