-
Notifications
You must be signed in to change notification settings - Fork 3
WIP - Dev work for #9 #10
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
Draft
krushiraj
wants to merge
9
commits into
master
Choose a base branch
from
dev-issue-9
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
6a14838
WIP - Inital commit for #9
krushiraj a91079e
DataListContainer added
krushiraj ac21f6b
Update DataDetails.vue
krushiraj a52ea0f
Update DataFilter.vue
krushiraj db51f22
update 2
krushiraj 61ae15e
Fixed for mobile view
krushiraj 4e895ce
Merge branch 'master' into dev-issue-9
pbteja1998 01c6b47
Added state to store
krushiraj 4c0487b
Merge branch 'master' into dev-issue-9
pbteja1998 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
<template> | ||
<v-card | ||
:loading="false" | ||
class="mx-auto my-0" | ||
> | ||
<v-card-title> | ||
<slot name="title"> | ||
This is Detailed View | ||
</slot> | ||
</v-card-title> | ||
<v-card-text> | ||
<slot> | ||
Here we can show some more information about the selected data item from the middle container. | ||
</slot> | ||
</v-card-text> | ||
<v-divider class="mx-4"></v-divider> | ||
<v-card-actions> | ||
<slot name="actions"> | ||
Here we can have some actions related to the item. | ||
</slot> | ||
</v-card-actions> | ||
</v-card> | ||
</template> | ||
|
||
<script> | ||
export default { | ||
name: 'DataDetails', | ||
}; | ||
</script> | ||
|
||
<style scoped> | ||
|
||
</style> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
<template> | ||
<v-card | ||
class="mx-auto" | ||
> | ||
<v-list> | ||
<v-list-item class="ma-auto"> | ||
<v-list-item-title>Filter</v-list-item-title> | ||
</v-list-item> | ||
<ORFilterSectionsContainer | ||
v-for="(section, index) in sections" | ||
:key="index" | ||
v-bind="{...section, index }" | ||
/> | ||
</v-list> | ||
</v-card> | ||
</template> | ||
|
||
<script> | ||
import ORFilterSectionsContainer from './ORFilterSectionsContainer'; | ||
|
||
export default { | ||
name: 'DataFilter', | ||
components: { | ||
ORFilterSectionsContainer, | ||
}, | ||
data() { | ||
return {}; | ||
}, | ||
props: ['sections'], | ||
}; | ||
</script> | ||
|
||
<style scoped> | ||
|
||
</style> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,94 @@ | ||
<template> | ||
<v-container> | ||
<v-data-iterator | ||
:items="items" | ||
:footer-props="{ itemsPerPageOptions }" | ||
:search="search" | ||
:custom-filter="customFilter" | ||
> | ||
<!-- Search bar to search from filtered items --> | ||
<template v-slot:header> | ||
<v-toolbar | ||
dark | ||
color="blue darken-3" | ||
class="mb-1" | ||
> | ||
<v-text-field | ||
class="mx-4" | ||
v-model="search" | ||
clearable | ||
flat | ||
solo-inverted | ||
hide-details | ||
prepend-inner-icon="search" | ||
label="Search" | ||
></v-text-field> | ||
</v-toolbar> | ||
</template> | ||
|
||
<!-- Filtered rows/items --> | ||
<template v-slot:default="props"> | ||
<template v-for="({ child, props }, index) in props.items"> | ||
<component | ||
:is="getChildComponent(child)" | ||
v-bind="props" | ||
:key="index"> | ||
</component> | ||
</template> | ||
</template> | ||
</v-data-iterator> | ||
</v-container> | ||
</template> | ||
|
||
<script> | ||
export default { | ||
name: 'DataListContainer', | ||
props: { | ||
childComponent: { | ||
type: Object, | ||
default: () => {}, | ||
}, | ||
itemsPerPageOptions: { | ||
type: Array, | ||
default: () => [5, 10, 15, 20], | ||
}, | ||
items: { | ||
type: Array, | ||
default: () => [], | ||
}, | ||
customFilter: { | ||
type: Function, | ||
default: (items, search) => items.filter(({ props }) => { | ||
for (const key in props) { | ||
const val = props[key]; | ||
if ( | ||
typeof val === 'string' && | ||
val.toLowerCase() | ||
.match(search.toLowerCase()) !== null | ||
) return true; | ||
} | ||
return false; | ||
}), | ||
}, | ||
}, | ||
computed: { | ||
search: { | ||
get() { | ||
return this.$store.getters['data/dashboard/getSearch']; | ||
}, | ||
set(search) { | ||
this.$store.commit('data/dashboard/setSearch', search); | ||
} | ||
}, | ||
}, | ||
methods: { | ||
getChildComponent(child) { | ||
return child || this.childComponent; | ||
}, | ||
}, | ||
}; | ||
</script> | ||
|
||
<style scoped> | ||
|
||
</style> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,128 @@ | ||
<template> | ||
<v-data-iterator | ||
:items="items" | ||
:search="search" | ||
:sort-by="sortBy" | ||
:custom-filter="customFilter" | ||
:sort-desc="sortDesc" | ||
hide-default-footer | ||
> | ||
<!-- Section Search bar --> | ||
<template v-if="enableSearch" v-slot:header> | ||
<v-text-field | ||
class="mr-2 ml-6" | ||
v-model="search" | ||
clearable | ||
flat | ||
solo-inverted | ||
hide-details | ||
prepend-inner-icon="search" | ||
label="Search" | ||
></v-text-field> | ||
</template> | ||
|
||
<!-- Section Items --> | ||
<template v-slot:default="props"> | ||
<v-list-item-group | ||
class="mx-2 ml-6" | ||
v-model="model" | ||
multiple | ||
v-for="(item, i) in props.items" | ||
:key="i" | ||
link | ||
> | ||
<v-list-item | ||
:key="`item-${i}`" | ||
:value="item" | ||
active-class="deep-purple--text text--accent-4" | ||
> | ||
<template v-slot:default="{ active, toggle }"> | ||
<v-list-item-content> | ||
<v-list-item-title v-text="item[0]"></v-list-item-title> | ||
</v-list-item-content> | ||
<v-list-item-action> | ||
<v-checkbox | ||
:input-value="active" | ||
:true-value="item[1] || item[0].toLowerCase()" | ||
color="deep-purple accent-4" | ||
@click="toggle" | ||
></v-checkbox> | ||
</v-list-item-action> | ||
</template> | ||
</v-list-item> | ||
</v-list-item-group> | ||
</template> | ||
</v-data-iterator> | ||
</template> | ||
|
||
<script> | ||
export default { | ||
name: 'ORFilterSection', | ||
// data() { | ||
// return {}; | ||
// }, | ||
props: { | ||
name: { | ||
type: String, | ||
default: '', | ||
}, | ||
index: { | ||
type: Number, | ||
default: -1, | ||
}, | ||
enableSearch: { | ||
type: Boolean, | ||
default: false, | ||
}, | ||
items: { | ||
type: Array, | ||
default: () => [], | ||
}, | ||
sortBy: { | ||
type: Array | String, | ||
default: () => [], | ||
}, | ||
customFilter: { | ||
type: Function, | ||
default: (items, search) => items.filter(item => { | ||
for (const val of Object.values(item)) { | ||
if ( | ||
typeof val === 'string' && | ||
val.toLowerCase().match(search.toLowerCase()) !== null | ||
) { | ||
return true; | ||
} | ||
} | ||
return false; | ||
}), | ||
}, | ||
sortDesc: { | ||
type: Boolean, | ||
default: false, | ||
}, | ||
}, | ||
computed: { | ||
search: { | ||
get() { | ||
return this.$store.getters[`filterSection-${this.name}/getSearch`]; | ||
}, | ||
set(search) { | ||
this.$store.commit(`filterSection-${this.name}/setSearch`, search); | ||
}, | ||
}, | ||
model: { | ||
get() { | ||
return this.$store.getters[`filterSection-${this.name}/getModel`]; | ||
}, | ||
set(model) { | ||
this.$store.commit(`filterSection-${this.name}/setModel`, model); | ||
this.$store.commit('data/dashboard/setFilters', { key: this.name, val: model }); | ||
}, | ||
}, | ||
} | ||
}; | ||
</script> | ||
|
||
<style scoped> | ||
|
||
</style> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
<template> | ||
<v-list-group | ||
sub-group | ||
multiple | ||
> | ||
<!-- Section Name --> | ||
<template v-slot:activator> | ||
<v-list-item-content> | ||
<v-list-item-title class="text-uppercase">{{name}}</v-list-item-title> | ||
</v-list-item-content> | ||
</template> | ||
<!-- Section items --> | ||
<ORFilterSection v-bind="{ items, name, index, enableSearch }" /> | ||
</v-list-group> | ||
</template> | ||
|
||
<script> | ||
import ORFilterSection from './ORFilterSection'; | ||
|
||
export default { | ||
name: 'ORFilterSectionsContainer', | ||
components: { | ||
ORFilterSection, | ||
}, | ||
data() { | ||
return {}; | ||
}, | ||
props: ['name', 'index', 'items', 'enableSearch'], | ||
}; | ||
</script> | ||
|
||
<style scoped> | ||
|
||
</style> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
<template> | ||
<v-card | ||
class="mx-auto" | ||
:flat="isFlat" | ||
:outlined="isOutlined" | ||
:width="width" | ||
:height="height" | ||
> | ||
<v-card-title>{{title}}</v-card-title> | ||
<v-card-text>Category: {{category}}</v-card-text> | ||
<span class="ml-4"> | ||
<v-icon left>mdi-label</v-icon> | ||
<v-chip | ||
v-for="(tag, index) in tags" | ||
:key="index" | ||
class="ma-2" | ||
label | ||
> | ||
{{tag}} | ||
</v-chip> | ||
</span> | ||
<br/> | ||
<v-chip class="ml-4 mb-2" v-if="subCategory">{{subCategory}}</v-chip> | ||
</v-card> | ||
</template> | ||
|
||
<script> | ||
export default { | ||
name: 'QuestionListItem', | ||
props: { | ||
title: String, | ||
category: String, | ||
tags: Array, | ||
subCategory: String, | ||
isFlat: { | ||
type: Boolean, | ||
default: true, | ||
}, | ||
isOutlined: { | ||
type: Boolean, | ||
default: true, | ||
}, | ||
width: { | ||
value: [Number, String], | ||
default: '100%', | ||
}, | ||
height: { | ||
value: [Number, String], | ||
default: 'auto', | ||
}, | ||
}, | ||
}; | ||
</script> | ||
|
||
<style scoped> | ||
|
||
</style> |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.