<commit_before>class type data = object
  method name : Js.js_string Js.t Js.prop
  method email : Js.js_string Js.t Js.prop
end
let data_row name email =
  let constr : data Js.t Js.constr = Js.Unsafe.variable "Object" in
  let instance = jsnew constr () in
  instance##name <- Js.string name;
  instance##email <- Js.string email;
  instance

class type t = object
  inherit Ext_Class.t
  inherit Ext_grid_Panel.t
end

let () =
  let view_constr : t Js.t Js.constr = Js.Unsafe.variable "Object" in
  let view_conf = jsnew view_constr () in
  view_conf##extend <- Js.string "Ext.grid.Panel";
  view_conf##alias <- Js.array [|Js.string "widget.userlist"|];
  view_conf##title <- Js.string "All Users";
  let init_component (this : t Js.t) () =
    this##store_string <- Js.string "Users";

    let columns = [|
      Ext_grid_column_Column.config
        ~text:"Name" ~dataIndex:"name" ~flex:1 ();
      Ext_grid_column_Column.config
        ~text:"Email" ~dataIndex:"email" ~flex:1 ();
    |] in
    this##columns <- Js.array columns;

    (* Cannot call "this##callParent ()" because ExtJs uses call stack to figure
     * out which method to call in which superclass *)
    let t1 = Js.Unsafe.coerce this in
    t1##superclass##initComponent##apply (t1, Js.Unsafe.variable "arguments")
  in
  view_conf##initComponent <- Js.wrap_meth_callback init_component;
  Ext.define
    ~className:"AM.view.user.List"
    ~data:view_conf
    ()
<commit_msg>Refactor view List.ml (account manager)<commit_after>class type t = object
  inherit Ext_Class.t
  inherit Ext_grid_Panel.t
end

let () =
  let view : t Js.t =
    {| extend = Js.string "Ext.grid.Panel";
       alias = Js.array [|Js.string "widget.userlist"|];
       title = Js.string "All Users";
    |}
  in
  let init_component (this : t Js.t) () =
    this##store_string <- Js.string "Users";

    let column1 : Ext_grid_column_Column.t Js.t =
      {| text = Js.string "Name";
         dataIndex = Js.string "name";
         flex = 1;
      |}
    in
    let column2 : Ext_grid_column_Column.t Js.t =
      {| text = Js.string "Email";
         dataIndex = Js.string "email";
         flex = 1;
      |}
    in
    this##columns <- Js.array [|column1; column2|];

    (* Cannot call "this##callParent ()" because ExtJs uses call stack to figure
     * out which method to call in which superclass *)
    let t1 = Js.Unsafe.coerce this in
    t1##superclass##initComponent##apply (t1, Js.Unsafe.variable "arguments")
  in
  view##initComponent <- Js.wrap_meth_callback init_component;
  Ext.define
    ~className:"AM.view.user.List"
    ~data:view
    ()

{'fraction_non_alphanumeric': 0.12916826370256804, 'fraction_numerical': 0.005366040628593331, 'mean_word_length': 2.996937212863706, 'pattern_counts': {'":': 0, '<': 14, '<?xml version=': 0, '>': 3, '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': '3512267', 'n_tokens_mistral': 936, 'n_tokens_neox': 905, 'n_words': 233}