Raw Source
kalpdev.1 / UTC Workflow - D.O.D

// ==UserScript==
// @name     UTC Workflow - D.O.D
// @author   @shjaisw
// @version     1.00
// @run-at   document-body
// @match    https://argus.aka.amazon.com/*
// @include  https://argus.aka.amazon.com/*
// @require  http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js
// @require  https://gist.github.com/raw/2625891/waitForKeyElements.js
// @require      https://cdnjs.cloudflare.com/ajax/libs/mark.js/8.11.1/jquery.mark.es6.min.js
// @require      https://cdn.datatables.net/1.10.19/js/jquery.dataTables.min.js
// @updateURL https://openuserjs.org/meta/kalpdev.1/UTC_Workflow_-_D.O.D.meta.js
// @downloadURL https://openuserjs.org/install/kalpdev.1/UTC_Workflow_-_D.O.D.user.js
// @license MIT
//@require https://cdn.jsdelivr.net/npm/sweetalert2@10
// @grant    GM_addStyle
// @match    http://pnq-412gv7q.ant.amazon.com:8087/*
// @grant    GM_xmlhttpRequest
// @grant    GM_registerMenuCommand
// @grant    GM_setValue
// @grant    GM_getValue
// ==/UserScript==
/*- The @grant directive is needed to work around a design change
    introduced in GM 1.0.   It restores the sandbox.
*/
  const swalWithBootstrapButtons = Swal.mixin({
  customClass: {
    confirmButton: 'btn btn-success',
    cancelButton: 'btn btn-danger'
  },
  buttonsStyling: false
})
function addCustomSearchResult (jNode) {
    //$(".submit-product-card-classification").hide ();


    $('#dt-select-100-UTC').click(function(){

        var resources_container = $("#resources_container").text();
        resources_container = resources_container.trim();
        if(resources_container!="")
        {setTimeout(function(){ add_description();   }, 100);}
else {Swal.fire('Classsify only U or Ub'); }

	function add_description(){


swalWithBootstrapButtons.fire({

  text: "Select the UTC Flow chart- ( Uploaded By)",
showCancelButton: true,
  confirmButtonText: 'Seller/ASHA',
       cancelButtonText: 'ARGUS/SCOT',
      allowOutsideClick: true,
      allowEscapeKey: true,
  reverseButtons: true
}).then((result) => {
  if (result.isConfirmed) {
     swalWithBootstrapButtons.fire({


  text: "Product Type",
  showCancelButton: true,
  confirmButtonText: 'KIT ',
       cancelButtonText: 'Single Product',
       allowOutsideClick: true,
      allowEscapeKey: true,
  reverseButtons: true
}).then((result) => {
  if (result.isConfirmed) {
    swalWithBootstrapButtons.fire({

  text: "Document Type",
  showCancelButton: true,
  confirmButtonText: 'Valid Doc',
       cancelButtonText: 'InValid Doc',
      allowOutsideClick: true,
      allowEscapeKey: true,
  reverseButtons: true
}).then((result) => {
  if (result.isConfirmed) {
    swal.fire(
     'Classify U or UB or U3A or U3B',
    )
  } else if (
    /* Read more about handling dismissals below */
    result.dismiss === Swal.DismissReason.cancel
  ) {
    swalWithBootstrapButtons.fire(
     'Classify U3A or U3B',


    )
  }
})
  } else if (
    /* Read more about handling dismissals below */
    result.dismiss === Swal.DismissReason.cancel
  ) {
    swalWithBootstrapButtons.fire(
      'Classify U or UB',


    )
  }
})
  } else if (
    /* Read more about handling dismissals below */
    result.dismiss === Swal.DismissReason.cancel
  ) {
    swalWithBootstrapButtons.fire(
      'Classify U or UB',


    )
  }
})
 
  }
});

        //console.log("Heyyyyyyy");
      

     

        ////var active_data = $('.ng-isolate-scope').text();
        //console.log("Active string is : " + active_data);

        ////var batt = $('.md-dg-theme').text();
        ////console.log("Bat Attri is : " + batt);
	}
//alert("Hey");
//console.log("Heyyyyyyy");



  


var url= window.location.href;
var isArgusDG = /^https:\/\/argus.aka.amazon.com\/#!\/dg(.*)/i.test(url);

if (isArgusDG){
    console.log("This is an Argus DG Page!");
              waitForKeyElements ("#dt-select-100-UTC", addCustomSearchResult);
}else{
    console.log("This is not an Argus DG Page!");
}