Skip to content
This repository was archived by the owner on Mar 31, 2021. It is now read-only.
Open
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
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]
### Added
- added archive button
- added automatic latitude longitude fill provided by OpenStreetMap
- added RSS source type

Expand Down
2 changes: 1 addition & 1 deletion src/components/ProposedEvents.vue
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ export default {
},
methods: {
paginatedProposedEvents () {
return this.$store.state.proposed_events.slice((this.page - 1) * 10, this.page * 10)
return this.$store.getters.proposed_events.slice((this.page - 1) * 10, this.page * 10)
},
acceptEvent(url) {
this.$store.commit('updateEventURL', url)
Expand Down
8 changes: 8 additions & 0 deletions src/components/modals/proposed_events/Accept.vue
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,14 @@
>
Eintragen
</button>
<button
type="button"
class="btn btn-danger"
data-dismiss="modal"
@click="$store.commit('archiveEvent', $store.state.selection.eventURL)"
>
Archivieren
</button>
</div>
</div>
</div>
Expand Down
7 changes: 6 additions & 1 deletion src/store/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,16 @@ export default new Vuex.Store({
state.proposed_events = state.proposed_events.filter((e) => e.url !== url)
}
},
getters: {
proposed_events(state, getters) {
return state.proposed_events.filter((event) => !getters.archivedEvents.has(event.url))
}
},
modules: {
auth,
selection
},
plugins: [createPersistedState({
paths: ['auth']
paths: ['auth', 'selection.archivedEvents']
})]
})
11 changes: 10 additions & 1 deletion src/store/selection.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,18 @@ export default {
state: {
locationName: null,
sourceURL: null,
eventURL: null
eventURL: null,
archivedEvents: []
},
getters: {
archivedEvents (state) {
return new Set(state.archivedEvents)
}
},
mutations: {
archiveEvent(state, url) {
state.archivedEvents.push(url)
},
updateLocationName(state, name) {
state.locationName = name
},
Expand Down