소스 검색

Small bug fixes

Lee Morgan 6 년 전
부모
커밋
02e533c73f
4개의 변경된 파일1개의 추가작업 그리고 21개의 파일을 삭제
  1. 1 15
      views/dashboardPage/Merchant.js
  2. 0 2
      views/dashboardPage/components/components.js
  3. 0 2
      views/dashboardPage/dashboard.ejs
  4. 0 2
      views/dashboardPage/home.js

+ 1 - 15
views/dashboardPage/Merchant.js

@@ -396,6 +396,7 @@ class Merchant{
 
         return dataList;
     }
+    
     /*
     Groups all of the merchant's ingredients by their category
     Return: [{
@@ -466,19 +467,4 @@ class Merchant{
 
         return recipes;
     }
-}
-
-let isSanitary =  (str, createBanner = true)=>{
-    let disallowed = ["\\", "<", ">", "$", "{", "}", "(", ")"];
-
-    for(let char of disallowed){
-        if(str.includes(char)){
-            if(createBanner){
-                banner.createError("Your string contains illegal characters");
-            }
-            return false;
-        }
-    }
-
-    return true;
 }

+ 0 - 2
views/dashboardPage/components/components.js

@@ -607,7 +607,6 @@ let ingredientDetailsComp = {
 
         let quantities = [];
         let now = new Date();
-        console.time("Single Ingredient Sold");
         for(let i = 1; i < 31; i++){
             let endDay = new Date(now.getFullYear(), now.getMonth(), now.getDate() - i)
             let startDay = new Date(now.getFullYear(), now.getMonth(), now.getDate() - i - 1);
@@ -619,7 +618,6 @@ let ingredientDetailsComp = {
                 quantities.push(merchant.singleIngredientSold(indices, ingredient));
             }
         }
-        console.timeEnd("Single Ingredient Sold");
 
         let sum = 0;
         for(let quantity of quantities){

+ 0 - 2
views/dashboardPage/dashboard.ejs

@@ -212,12 +212,10 @@
 
         <script src="/dashboardPage/Merchant.js"></script>
         <script>
-            console.time("Classify");
             let merchant = new Merchant(
                 <%- JSON.stringify(merchant) %>,
                 <%- JSON.stringify(transactions) %>
             );
-            console.timeEnd("Classify");
         </script>
         <script src="../shared/graphs.js"></script>
         <script src="/dashboardPage/home.js"></script>

+ 0 - 2
views/dashboardPage/home.js

@@ -109,9 +109,7 @@ window.homeStrandObj = {
         let now = new Date();
         let thisMonth = new Date(now.getFullYear(), now.getMonth(), 1);
 
-        console.time("Ingredients Sold");
         let ingredientList = merchant.ingredientsSold(merchant.transactionIndices(thisMonth));
-        console.timeEnd("Ingredients Sold");
         if(ingredientList){
             for(let i = 0; i < 5; i++){
                 let max = ingredientList[0].quantity