Commit 957a9a5c authored by Jerome Chauveau's avatar Jerome Chauveau
Browse files

option for editable tags

parent e5b0e731
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -46,6 +46,7 @@ export default {
        pickerMode : config.PICKER_MODE ? config.PICKER_MODE === 'true' : false,
        rpcPrefix : null,
        showHiddenCollections : true,
        editableTags: false
        // multiSelectActionAddons: [
        //   {
        //     title :  'Marquer la sélection comme "à traiter"',
+1 −0
Original line number Diff line number Diff line
@@ -627,6 +627,7 @@ export default {
    this.$store.commit('setShowHiddenCollections', this.options.showHiddenCollections == null ? true : this.options.showHiddenCollections);
    this.$store.commit('setAcceptedFormats', this.options.acceptedFormats || []);
    this.$store.commit('setMultiSelectActionAddons', this.options.multiSelectActionAddons || [])
    this.$store.commit('setEditableTags', this.options.editableTags === undefined ? true : this.options.editableTags)
    this.fetchPermissions().then((r) => {
      if (r) {
        this.fetchUserPermissions().then(() => this.initJamaPermissions())
+2 −1
Original line number Diff line number Diff line
@@ -16,7 +16,8 @@
          defaultCollectionId: options.defaultCollectionId,
          showHiddenCollections : options.showHiddenCollections,
          multiSelectActionAddons: options.multiSelectActionAddons,
          plugins: plugins
          plugins: plugins,
          editableTags : options.editableTags
        }"
        @resource-selected="resourceSelected"
      />
+1 −0
Original line number Diff line number Diff line
@@ -164,6 +164,7 @@ export default {
      this.currentClient.doQuery(val).then((res) => {
        this.entries = [...res];
        this.isLoading = false;
        if(this.$store.getters.editableTags)
          this.entries.push({id: val, label: val});
      }).catch((e) => {
        console.error('tag fetch error', e)
+7 −1
Original line number Diff line number Diff line
@@ -68,6 +68,7 @@ export default new Vuex.Store({
        acceptedFormats: [],
        preferences: {},//{...DEFAULT_PREFERENCES}
        showHiddenCollections: true,
        editableTags: true,
        sortOptions: {
            order: ASC_SORT,
            type: 'title'
@@ -103,7 +104,8 @@ export default new Vuex.Store({
        filter: state => state.filter,
        public_access_filter: state => state.public_access_filter,
        multiSelectActionAddons: state => state.multiSelectActionAddons,
        uploads : state => state.uploads
        uploads : state => state.uploads,
        editableTags : state => state.editableTags
    },
    mutations: {

@@ -155,6 +157,10 @@ export default new Vuex.Store({
            state.multiSelectActionAddons = actionAddons
        },

        setEditableTags: (state, editable) => {
            state.editableTags = editable
        },

        addCollection: (state, collection) => {
            state.collections = [...state.collections, collection];
        },