Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $(document).ready(function(){
- $("#addNewTag").click(function(){
- var total_child_divs = $(".route_form form").children('div').length;
- $(".new_guide_item").append("<div class=\"new-ibox inner clearfix\" id=\"product_$total_child_divs">" + $(".new-ibox").html() + "</div>");
- });
- });
- var count = 1;
- $('.new-ibox').each(function() {
- $(this).attr('id', 'product_' + count);
- count++;
- });
- $(document).ready(function(){
- $("#addNewProduct").click(function(){
- var total_child_divs = $(".route_form form").children('div').length;
- $(".new_guide_item").append("<div class=\"new-ibox inner clearfix\" id=\"product_" + total_child_divs + "\">" + $(".new-ibox").html() + "<div class='col-md-12 text-right' style='padding: 10px'><a class='btn btn-danger' style='text-decoration: none' onclick=\"$("#product_" + total_child_divs").remove()\" id=\"button_" + total_child_divs + "\">Remove Product</a></div></div>");
- });
- });
- $(document).ready(function(){
- $("#addNewProduct").click(function(){
- var total_child_divs = $(".route_form form").children('div').length;
- var remove_el = $('#product_' + total_child_divs').remove();
- $(".new_guide_item").append("<div class=\"new-ibox inner clearfix\" id=\"product_" + total_child_divs + "\">" + $(".new-ibox").html() + "<div class='col-md-12 text-right' style='padding: 10px'><a class='btn btn-danger' style='text-decoration: none' id=\"button_" + total_child_divs + "\">Remove Product</a></div></div>");
- }
- console.log(remove_el);
- );
- });
- @data.each{|x| x["importer_attributes"].sort_by{|im| im["col"].to_i }.each{|im_a| im_a.to_a.each{|k| pp k[1] } unless x["importer_attributes"].nil? } }
- *************************************************************
- Get Importer's Config By Account
- http://localhost:3000/api/importer/v1/get_account_importer/1
- [
- {
- "_id": {
- "$oid": "5cdc939f75a9e6646cebd379"
- },
- "account_id": 1,
- "append_routes": false,
- "cache_policy": "none",
- "check_guide_no_route": true,
- "check_status": false,
- "col_step": "",
- "create_routes": true,
- "encoding": "UTF-8",
- "extension": "",
- "header_row": 0,
- "importer_attributes": [
- {
- "_id": {
- "$oid": "5cdc93ab75a9e6646cebd37a"
- },
- "col": 1,
- "force_create": false,
- "is_group": false,
- "is_tag": false,
- "label": "Contact ID",
- "multiple_columns": [],
- "name": "contact_id",
- "row": null
- },
- {
- "_id": {
- "$oid": "5cdc93ac75a9e6646cebd37b"
- },
- "col": 2,
- "force_create": false,
- "is_group": false,
- "is_tag": false,
- "label": "identifier",
- "multiple_columns": [],
- "name": "identifier",
- "row": null
- }
- ],
- "is_default": true,
- "matrix_example": null,
- "row_step": null,
- "version": null
- },
- {
- "_id": {
- "$oid": "5cdc950875a9e67200487868"
- },
- "account_id": 1,
- "append_routes": false,
- "cache_policy": "none",
- "check_guide_no_route": true,
- "check_status": false,
- "col_step": "",
- "create_routes": false,
- "encoding": "UTF-8",
- "extension": "",
- "header_row": 0,
- "importer_attributes": [
- {
- "_id": {
- "$oid": "5cdc93ab75a9e6646cebd37a"
- },
- "col": 1,
- "force_create": false,
- "is_group": false,
- "is_tag": true,
- "label": "identifier",
- "multiple_columns": [],
- "name": "contact_phone",
- "row": null
- },
- {
- "_id": {
- "$oid": "5cdda37675a9e6093b882274"
- },
- "col": 2,
- "force_create": true,
- "is_group": false,
- "is_tag": false,
- "label": "service_time",
- "multiple_columns": [],
- "name": "service_time",
- "row": null
- },
- {
- "_id": {
- "$oid": "5cdd800175a9e6822a930747"
- },
- "col": 3,
- "force_create": false,
- "is_group": false,
- "is_tag": false,
- "label": "priority",
- "multiple_columns": [],
- "name": "priority",
- "row": null
- },
- {
- "_id": {
- "$oid": "5ce5482575a9e66ee595ecae"
- },
- "col": 4,
- "force_create": false,
- "is_group": true,
- "is_tag": false,
- "label": "load",
- "multiple_columns": [],
- "name": "load",
- "row": null
- },
- {
- "_id": {
- "$oid": "5ce559d275a9e6aad8ffef4d"
- },
- "col": 5,
- "force_create": false,
- "is_group": true,
- "is_tag": false,
- "label": "status",
- "multiple_columns": [],
- "name": "substatus_code",
- "row": null
- }
- ],
- "is_default": null,
- "matrix_example": null,
- "row_step": null,
- "version": null
- }
- ]
- *** Get Importer Config ***
- http://localhost:3000/api/importer/v1/importer_config/5cdc939f75a9e6646cebd379
- [
- {
- "_id": {
- "$oid": "5cdc939f75a9e6646cebd379"
- },
- "account_id": 1,
- "append_routes": false,
- "cache_policy": "none",
- "check_guide_no_route": true,
- "check_status": false,
- "col_step": "",
- "create_routes": true,
- "encoding": "UTF-8",
- "extension": "",
- "header_row": 0,
- "importer_attributes": [
- {
- "_id": {
- "$oid": "5cdc93ab75a9e6646cebd37a"
- },
- "col": 1,
- "force_create": false,
- "is_group": false,
- "is_tag": false,
- "label": "Contact ID",
- "multiple_columns": [],
- "name": "contact_id",
- "row": null
- },
- {
- "_id": {
- "$oid": "5cdc93ac75a9e6646cebd37b"
- },
- "col": 2,
- "force_create": false,
- "is_group": false,
- "is_tag": false,
- "label": "identifier",
- "multiple_columns": [],
- "name": "identifier",
- "row": null
- }
- ],
- "is_default": true,
- "matrix_example": null,
- "row_step": null,
- "version": null
- }
- ]
- *** Update Importer Config ***
- http://localhost:3000/api/importer/v1/importer_config/5cdc939f75a9e6646cebd379
- {
- "importer_config": {
- "append_routes": true,
- "cache_policy": "none",
- "check_guide_no_route": true,
- "check_status": false,
- "col_step": "",
- "create_routes": "false",
- "encoding": "UTF-8",
- "extension": "",
- "header_row": 0,
- "importer_attributes": [
- {
- "_id": "5cdc93ab75a9e6646cebd37a",
- "col": 1,
- "force_create": false,
- "is_group": false,
- "is_tag": false,
- "label": "Contact ID",
- "multiple_columns": [],
- "name": "contact_id",
- "row": null
- },
- {
- "_id": "5cdc93ac75a9e6646cebd37b",
- "col": 2,
- "force_create": false,
- "is_group": false,
- "is_tag": false,
- "label": "identifier",
- "multiple_columns": [],
- "name": "identifier",
- "row": null
- }
- ],
- "is_default": true,
- "matrix_example": [],
- "row_step": null,
- "version": null
- }
- }
- {
- "status": "ok",
- "response": {
- "update": "El importador ha sido actualizado"
- }
- }
- {
- "status": "error",
- "response": {
- "update": "Error la columna 1 esta en uso"
- }
- }
- {
- "status": "error",
- "response": {
- "update": "Error contact_id ya esta en uso"
- }
- }
- *** Create Custom Importer ***
- http://localhost:3000/api/importer/v1/create_custom_importer/1
- {
- "status": "ok",
- "response": {
- "update": "El importador Custom ha sido creado correctamente"
- }
- }
- {
- "status": "error",
- "response": {
- "create_custom_importer": "Error! La cuenta 1 ya posee un importador customizado"
- }
- }
- ***** Create Custom Attribute *****
- http://localhost:3000/api/importer/v1/create_custom_attribute/1
- {
- "importer_attribute": {
- "col": 25,
- "label": "priority",
- "name": "priority"
- }
- }
- {
- "status": "error",
- "response": {
- "create_custom_attribute": "La columna seleccionada se encuentra ocupada"
- }
- }
- {
- "status": "error",
- "response": {
- "update": "Error priority ya esta en uso"
- }
- }
- {
- "status": "ok",
- "response": {
- "create_custom_attribute": "La columna ha sido agregada correctamente"
- }
- }
Add Comment
Please, Sign In to add comment