<commit_before>//
// Copyright (c) 2013-2016 SKYARCH NETWORKS INC.
//
// This software is released under the MIT License.
//
// http://opensource.org/licenses/mit-license.php
//
const queryString = require('query-string');
const modal = require('./modal');
const demoGrid = require('./demo-grid.js');

(() => {
  'use_strict';

  const queryStringParams = queryString.parse(window.location.search);

  Vue.component('demo-grid', demoGrid);

  if (!$('#indexElement').length) {
    return;
  }
  new Vue({
    el: '#indexElement',
    data: {
      searchQuery: '',
      gridColumns: ['code', 'name'],
      gridData: [],
      lang: queryStringParams.lang,
      url: `clients?lang=${queryStringParams.lang}`,
      is_empty: false,
      loading: true,
      picked: {
        edit_client_path: null,
        code: null,
      },
      index: 'clients',
    },
    computed: {
      can_edit() {
        if (this.picked.edit_client_path) {
          return !!this.picked.edit_client_path;
        }
        return undefined;
      },
      can_delete() {
        if (this.picked.code) {
          return (this.picked.code[1] === 0);
        }
        return undefined;
      },
    },
    methods: {
      delete_entry() {
        const self = this;
        modal.Confirm(t('clients.client'), t('clients.msg.delete_client'), 'danger').done(() => {
          $.ajax({
            type: 'POST',
            url: self.picked.delete_client_path,
            dataType: 'json',
            data: { _method: 'delete' },
            success(data) {
              self.gridData = data;
              self.picked = {};
            },
          }).fail(() => {
            window.location.reload();
          });
        });
      },
      reload() {
        this.loading = true;
        this.$children[0].load_ajax(this.url);
        this.picked = {};
      },
    },
  });
})();
<commit_msg>Fix: 顧客一覧画面で顧客を削除したときに画面に即座に反映されない不具合を修正<commit_after>//
// Copyright (c) 2013-2016 SKYARCH NETWORKS INC.
//
// This software is released under the MIT License.
//
// http://opensource.org/licenses/mit-license.php
//
const queryString = require('query-string');
const modal = require('./modal');
const demoGrid = require('./demo-grid.js');

(() => {
  'use_strict';

  const queryStringParams = queryString.parse(window.location.search);

  Vue.component('demo-grid', demoGrid);

  if (!$('#indexElement').length) {
    return;
  }
  new Vue({
    el: '#indexElement',
    data: {
      searchQuery: '',
      gridColumns: ['code', 'name'],
      gridData: [],
      lang: queryStringParams.lang,
      url: `clients?lang=${queryStringParams.lang}`,
      is_empty: false,
      loading: true,
      picked: {
        edit_client_path: null,
        code: null,
      },
      index: 'clients',
    },
    computed: {
      can_edit() {
        if (this.picked.edit_client_path) {
          return !!this.picked.edit_client_path;
        }
        return undefined;
      },
      can_delete() {
        if (this.picked.code) {
          return (this.picked.code[1] === 0);
        }
        return undefined;
      },
    },
    methods: {
      delete_entry() {
        const self = this;
        modal.Confirm(t('clients.client'), t('clients.msg.delete_client'), 'danger').done(() => {
          $.ajax({
            type: 'POST',
            url: self.picked.delete_client_path,
            dataType: 'json',
            data: { _method: 'delete' },
            success(data) {
              self.gridData = data;
              self.picked = {};

              self.$children[0].tbl_data = data;
              self.$children[0].pages = data.length;
              self.$children[0].close_loading();
            },
          }).fail(() => {
            window.location.reload();
          });
        });
      },
      reload() {
        this.loading = true;
        this.$children[0].load_ajax(this.url);
        this.picked = {};
      },
    },
  });
})();

{'fraction_non_alphanumeric': 0.16518875095008867, 'fraction_numerical': 0.006333924499619965, 'mean_word_length': 1.8712727272727272, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2210193', 'n_tokens_mistral': 1253, 'n_tokens_neox': 1236, 'n_words': 214}