mirror of
				https://github.com/mail-in-a-box/mailinabox.git
				synced 2025-11-03 19:30:54 +00:00 
			
		
		
		
	Fix model update on create and activate
This commit is contained in:
		
							parent
							
								
									606e5e0569
								
							
						
					
					
						commit
						0ec968c3b6
					
				@ -6,7 +6,7 @@
 | 
			
		||||
 | 
			
		||||
  <b-form @submit.prevent="getChartData()" class="d-flex">
 | 
			
		||||
    <b-input-group class="mb-3" style="width:30em">
 | 
			
		||||
      <b-form-input class="h-auto" :autofocus="data_user_id===null" list="panel-ua-users" @change="user_id_changed" placeholder="Enter a user id/email address"></b-form-input>
 | 
			
		||||
      <b-form-input ref="user_id_input" class="h-auto" :autofocus="data_user_id===null" list="panel-ua-users" @change="sync_user_id" placeholder="Enter a user id/email address"></b-form-input>
 | 
			
		||||
      <b-input-group-append>
 | 
			
		||||
        <b-button variant="primary" @click="change_user">Change user</b-button>
 | 
			
		||||
      </b-input-group-append>
 | 
			
		||||
 | 
			
		||||
@ -20,7 +20,8 @@ Vue.component('panel-user-activity', function(resolve, reject) {
 | 
			
		||||
                Number(this.$route.query.tab) :
 | 
			
		||||
                0;
 | 
			
		||||
            return {
 | 
			
		||||
                user_id: this.$route.query.user || '', /* v-model */
 | 
			
		||||
                //user_id: this.$route.query.user || '', /* v-model */
 | 
			
		||||
                user_id: '', /* v-model */
 | 
			
		||||
                tab_index: start_tab, /* v-model */
 | 
			
		||||
                show_only_flagged: false,
 | 
			
		||||
                show_only_flagged_filter: null,
 | 
			
		||||
@ -39,7 +40,7 @@ Vue.component('panel-user-activity', function(resolve, reject) {
 | 
			
		||||
            const new_user = this.$route.query.user;
 | 
			
		||||
            
 | 
			
		||||
            if (new_user && new_user != this.user_id) {
 | 
			
		||||
                this.user_id = new_user;
 | 
			
		||||
                this.sync_user_id(new_user);
 | 
			
		||||
                this.getChartData(isNaN(new_tab) ? 0 : new_tab);
 | 
			
		||||
                return;
 | 
			
		||||
            }
 | 
			
		||||
@ -66,6 +67,10 @@ Vue.component('panel-user-activity', function(resolve, reject) {
 | 
			
		||||
            }
 | 
			
		||||
        },
 | 
			
		||||
 | 
			
		||||
        mounted: function() {
 | 
			
		||||
            this.sync_user_id(this.$route.query.user || '');
 | 
			
		||||
        },
 | 
			
		||||
        
 | 
			
		||||
        methods: {
 | 
			
		||||
            update_route: function() {
 | 
			
		||||
                // ensure the route contains query element
 | 
			
		||||
@ -78,8 +83,11 @@ Vue.component('panel-user-activity', function(resolve, reject) {
 | 
			
		||||
                }
 | 
			
		||||
            },
 | 
			
		||||
 | 
			
		||||
            user_id_changed: function(evt) {
 | 
			
		||||
                this.user_id = evt;
 | 
			
		||||
            sync_user_id: function(user_id) {
 | 
			
		||||
                // manually update "model" for <input> to avoid
 | 
			
		||||
                // slowness with large tables
 | 
			
		||||
                this.user_id = user_id;
 | 
			
		||||
                this.$refs.user_id_input.value = user_id;
 | 
			
		||||
            },
 | 
			
		||||
            
 | 
			
		||||
            change_user: function() {
 | 
			
		||||
 | 
			
		||||
		Loading…
	
		Reference in New Issue
	
	Block a user