-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
17 changed files
with
136 additions
and
7 deletions.
There are no files selected for viewing
This file contains 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 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
57 changes: 57 additions & 0 deletions
57
app/javascript/vue/tasks/digitize/components/taskHeader/recent.vue
This file contains 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> | ||
<div> | ||
<button | ||
type="button" | ||
class="button normal-input button-default" | ||
@click="showModal = true">Recent</button> | ||
<modal-component | ||
v-if="showModal" | ||
@close="showModal = false"> | ||
<h3 slot="header">Recent collection objets</h3> | ||
<div slot="body"> | ||
<ul class="no_bullets"> | ||
<li | ||
v-for="item in list" | ||
:key="item.id"> | ||
<label | ||
@click="sendCO(item)"> | ||
<input | ||
type="radio" | ||
name="recent-co"> | ||
{{ item.object_tag }} | ||
</label> | ||
</li> | ||
</ul> | ||
</div> | ||
</modal-component> | ||
</div> | ||
</template> | ||
|
||
<script> | ||
import ModalComponent from 'components/modal' | ||
import { GetRecentCollectionObjects } from '../../request/resources.js' | ||
export default { | ||
components: { | ||
ModalComponent | ||
}, | ||
data() { | ||
return { | ||
showModal: false, | ||
list: [] | ||
} | ||
}, | ||
mounted() { | ||
GetRecentCollectionObjects().then(response => { | ||
this.list = response | ||
}) | ||
}, | ||
methods: { | ||
sendCO(item) { | ||
this.showModal = false | ||
this.$emit('selected', item) | ||
} | ||
} | ||
} | ||
</script> |
This file contains 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
2 changes: 2 additions & 0 deletions
2
app/javascript/vue/tasks/digitize/store/actions/actionNames.js
This file contains 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 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 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
11 changes: 11 additions & 0 deletions
11
app/javascript/vue/tasks/digitize/store/actions/getIdentifiers.js
This file contains 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,11 @@ | ||
import { GetIdentifiersFromCO } from '../../request/resources' | ||
import { MutationNames } from '../mutations/mutations' | ||
|
||
export default function ({ commit }, id) { | ||
return new Promise((resolve, reject) => { | ||
GetIdentifiersFromCO(id).then(response => { | ||
commit(MutationNames.SetIdentifiers, response) | ||
resolve(response) | ||
}) | ||
}) | ||
} |
11 changes: 11 additions & 0 deletions
11
app/javascript/vue/tasks/digitize/store/actions/getNamespace.js
This file contains 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,11 @@ | ||
import { GetNamespace } from '../../request/resources' | ||
import { MutationNames } from '../mutations/mutations' | ||
|
||
export default function ({ commit }, id) { | ||
return new Promise((resolve, reject) => { | ||
GetNamespace(id).then(namespace => { | ||
commit(MutationNames.SetNamespaceSelected, namespace.name) | ||
return resolve(namespace) | ||
}) | ||
}) | ||
} |
This file contains 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 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 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
3 changes: 3 additions & 0 deletions
3
app/javascript/vue/tasks/digitize/store/getters/getIdentifiers.js
This file contains 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,3 @@ | ||
export default function(state) { | ||
return state.identifiers | ||
} |
This file contains 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 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
3 changes: 3 additions & 0 deletions
3
app/javascript/vue/tasks/digitize/store/mutations/setIdentifiers.js
This file contains 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,3 @@ | ||
export default function(state, value) { | ||
state.identifiers = value | ||
} |
This file contains 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