Commit 2ad6b053 authored by Jerome Chauveau's avatar Jerome Chauveau
Browse files

refactoring messages alertes info/erreur

parent bf1531ac
Loading
Loading
Loading
Loading
+2 −23
Original line number Diff line number Diff line
@@ -138,15 +138,8 @@
                  <v-icon color="grey darken-1">
                    mdi-delete
                  </v-icon>
                  <!--                  <span v-if="ancestors.length>1">{{ $t('remove_from_collection') }}</span>-->
                  <span>{{ $t('remove') }}</span>
                </span>
                <!--                <v-tooltip left>-->
                <!--                  <template v-slot:activator="{ on }">-->
                <!--                    <v-icon x-small class="ml-5" color="black" dark v-on="on">mdi-help</v-icon>-->
                <!--                  </template>-->
                <!--                  <span v-html="$t('remove_help')"/>-->
                <!--                </v-tooltip>-->
              </v-list-item-title>
            </v-list-item>
          </v-list>
@@ -170,10 +163,6 @@
            :resource="resource"
          />

          <!--          <v-container v-if="resource.title!=resource.original_name">
            <label class="text-h6 ml-1">Nom original</label><span class="ml-5">{{ resource.original_name }}</span>
          </v-container>-->

          <jama-tag-editor
            :item="resource"
            :concepts-config="conceptsConfig"
@@ -445,12 +434,7 @@ export default {
          "Nom de la ressource",
          (val) => {
            this.$store.dispatch('renameResource',{resourceId: this.resource.id, name : val}).then(() => {
              EventBus.$emit('JAMA_NOTIFICATION', {
                type: 'info',
                timeout: 2000,
                message: "Ressource renommée",
                visible: true
              })
              this.$alertInfo("Ressource renommée");
            })
          },
          this.resource.title
@@ -483,12 +467,7 @@ export default {
          from : replaceId,
          to : this.resource.id
        });
        EventBus.$emit('JAMA_NOTIFICATION', {
          type: 'info',
          timeout: 2000,
          message: "Ressource remplacée",
          visible: true
        })
        this.$alertInfo("Ressource remplacée");
        EventBus.$emit('goto-resource', this.currentCollection.id, replaceId);
      }
      else {
+5 −6
Original line number Diff line number Diff line
@@ -152,12 +152,11 @@ export default {
        this.items.splice(this.items.indexOf(this.restoringItem),1);
        EventBus.$emit('reload-current-collection');
      }
      EventBus.$emit('JAMA_NOTIFICATION', {
        type: res ? 'success' : 'error',
        timeout: 2000,
        message: res ? this.$t('restore_success') : this.$t('restore_fail') ,
        visible: true
      })
      if(res)
        this.$alertInfo(this.$t('restore_success'));
      else
        this.$alertError(this.$t('restore_fail'));

      this.restoringItem = null;
      this.restoringDest = null;
    }
+27 −21
Original line number Diff line number Diff line
@@ -50,7 +50,11 @@
          v-for="(upload, hash) in uncompletedUploads"
          :key="'uncomplete-'+hash"
        >
          <v-row>
            <v-col cols="6">
              {{ upload.name }} : {{ Math.min(Math.round(Number(upload.available_chunks.length)/Number(upload.nb_chunks) * 100),100) }}%
            </v-col>
            <v-col cols="6">
              <v-btn
                small
                class="ml-5"
@@ -64,6 +68,8 @@
                style="display: none"
                @change="resume('resume-input-'+hash, upload)"
              >
            </v-col>
          </v-row>
        </v-list-item>
      </v-list>
    </div>
@@ -75,7 +81,6 @@
import {upload_events} from '../utils/JamaClient';

const JAMA_LSTORAGE_INCOMPLETED_KEY = 'jama_uncompleted_upload';
import EventBus from '../events/event-bus';
import {mapGetters} from "vuex";

export default {
@@ -153,12 +158,12 @@ export default {

    endFileUploadEvent(e) {
      this.done ++;
      EventBus.$emit('JAMA_NOTIFICATION', {
        type: e.detail.ok ? 'success' : 'error',
        timeout: 2000,
        message: e.detail.message,
        visible: true
      })
      if(e.detail.ok){
        this.$alertInfo(e.detail.message);
      }
      else {
        this.$alertError(e.detail.message);
      }
      if(e.detail.status === 'available') {
        delete this.uncompletedUploads[e.detail.hash];
        localStorage.setItem(JAMA_LSTORAGE_INCOMPLETED_KEY, JSON.stringify(this.uncompletedUploads));
@@ -203,6 +208,7 @@ export default {
        localStorage.setItem(JAMA_LSTORAGE_INCOMPLETED_KEY, JSON.stringify(this.uncompletedUploads));
        this.$forceUpdate();
      }

    }
  }
}
+3 −1
Original line number Diff line number Diff line
@@ -430,6 +430,8 @@ export default {
    this.$store.commit('setCurrentProjectId', this.options.defaultProjectId || null);
    this.$store.commit('setAppTitle', this.options.appTitle || this.$t('jama_title') + 'JAMA',);
    Vue.prototype.$jamaClient = jamaClient;
    Vue.prototype.$alertInfo = this.alertInfo;
    Vue.prototype.$alertError = this.alertError;
    return {
      permissionsReady: false,
      //overridable by config (options property)
@@ -591,7 +593,7 @@ export default {
        this.fetchUserPermissions().then(() => this.initJamaPermissions())
      }
      else{
        alert('Une erreur est survenue. Service indisponible.')
        alert('Une erreur est survenue. Service indisponible.');
      }
    })
    if (!this.currentProjectId) {