Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/sort title alphabetical #31

Merged
merged 3 commits into from
Dec 11, 2020
Merged
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
25 changes: 19 additions & 6 deletions public/build/bundle.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 5 additions & 1 deletion public/build/bundle.js.map

Large diffs are not rendered by default.

5 changes: 5 additions & 0 deletions public/js/sortByAlphabeticalOrder.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
export function sortByAlphabeticalOrder(taskList) {
return taskList.sort((a, b) =>
a.title.localeCompare(b.title)
)
}
2 changes: 1 addition & 1 deletion public/js/sortByTaskOrder.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
export function sortByTaskOrder(taskList) {
taskList.sort((a, b) => {
return taskList.sort((a, b) => {
return a.sprint - b.sprint
})
}
9 changes: 7 additions & 2 deletions src/App.svelte
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
<script>
import { onMount } from "svelte"
import { searchList } from "../public/js/searchList.js"
// import { sortByTaskOrder } from "../public/js/sortByTaskOrder.js"
// import { sortByTaskOrder } from "../public/js/sortByTaskOrder.js" /* SPRINT SORT */
// import { sortByAlphabeticalOrder } from "../public/js/sortByAlphabeticalOrder.js" /* ALPHABETICAL SORT */
import { getTaskTitles } from "../public/js/getTaskTitles.js"

import TaskList from "./components/TaskList.svelte"
Expand All @@ -21,7 +22,11 @@
/* SPRINT SORT */
// displayTaskList = sortByTaskOrder(taskList)
/* SPRINT SORT */


/* ALPHABETICAL SORT */
// displayTaskList = sortByAlphabeticalOrder(taskList)
/* ALPHABETICAL SORT */

// Create a list of titles for the datalist search
taskTitles = getTaskTitles(displayTaskList)

Expand Down
1 change: 0 additions & 1 deletion src/components/TaskSearch.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
const dispatcher = createEventDispatcher()
export let searchTerm
export let taskTitles
console.log(taskTitles)

</script>

Expand Down