Skip to content
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
3 changes: 2 additions & 1 deletion frontend/js/components/Browser.vue
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@
endpoint: state => state.browser.endpoint,
endpointName: state => state.browser.endpointName,
endpoints: state => state.browser.endpoints,
params: state => state.browser.params,
browserTitle: state => state.browser.title,
browserNote: state => state.browser.note,
selected: state => state.browser.selected
Expand Down Expand Up @@ -150,7 +151,7 @@

const form = this.$refs.form
const list = this.$refs.list
const formdata = this.getFormData(form)
const formdata = { ...this.getFormData(form), ...this.params }

this.$http.get(this.endpoint, { params: formdata }).then((resp) => {
// add items here
Expand Down
5 changes: 5 additions & 0 deletions frontend/js/components/BrowserField.vue
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,10 @@
type: Array,
default: () => []
},
params: {
type: Array,
default: () => []
},
draggable: {
type: Boolean,
default: true
Expand Down Expand Up @@ -187,6 +191,7 @@
label: this.name
})
}
this.$store.commit(BROWSER.UPDATE_BROWSER_PARAMS, this.params)
this.$store.commit(BROWSER.UPDATE_BROWSER_MAX, this.max)
this.$store.commit(BROWSER.UPDATE_BROWSER_TITLE, this.browserTitle)
this.$store.commit(BROWSER.UPDATE_BROWSER_NOTE, this.browserNote)
Expand Down
8 changes: 8 additions & 0 deletions frontend/js/store/modules/browser.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ const state = {
endpoint: '',
endpointName: '',
endpoints: [],
params: [],
max: 0,
selected: window[process.env.VUE_APP_NAME].STORE.browser.selected || {}
}
Expand Down Expand Up @@ -102,6 +103,13 @@ const mutations = {
[BROWSER.DESTROY_BROWSER_ENDPOINTS] (state) {
state.endpoints = []
},
[BROWSER.UPDATE_BROWSER_PARAMS] (state, params) {
if (!params && !params.length > 0) return
state.params = params
},
[BROWSER.DESTROY_BROWSER_PARAMS] (state) {
state.params = []
},
[BROWSER.ADD_BROWSERS] (state, { browsers }) {
state.selected = Object.assign({}, state.selected, browsers)
}
Expand Down
4 changes: 4 additions & 0 deletions frontend/js/store/mutations/browser.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ export const UPDATE_BROWSER_ENDPOINT = 'updateBrowserEndpoint'
export const UPDATE_BROWSER_ENDPOINTS = 'updateBrowserEndpoints'
export const DESTROY_BROWSER_ENDPOINT = 'destroyBrowserEndpoint'
export const DESTROY_BROWSER_ENDPOINTS = 'destroyBrowserEndpoints'
export const UPDATE_BROWSER_PARAMS = 'updateBrowserParams'
export const DESTROY_BROWSER_PARAMS = 'destroyBrowserParams'
export const ADD_BROWSERS = 'addBrowsers'

export default {
Expand All @@ -28,5 +30,7 @@ export default {
DESTROY_BROWSER_ENDPOINT,
UPDATE_BROWSER_ENDPOINTS,
DESTROY_BROWSER_ENDPOINTS,
UPDATE_BROWSER_PARAMS,
DESTROY_BROWSER_PARAMS,
ADD_BROWSERS
}
1 change: 1 addition & 0 deletions views/partials/form/_browser.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
:wide="{{ json_encode($wide) }}"
endpoint="{{ $endpoint }}"
:endpoints="{{ json_encode($endpoints) }}"
:params="{{ json_encode($params) }}"
modal-title="{{ twillTrans('twill::lang.fields.browser.attach') . ' ' . strtolower($label) }}"
:draggable="{{ json_encode($sortable) }}"
browser-note="{{ $browserNote }}"
Expand Down
Loading