/**
 * mSupply Mobile
 * Sustainable Solutions (NZ) Ltd. 2019
 */

import { modalStrings, buttonStrings } from '../localization';

export const MODAL_KEYS = {
  COMMENT_EDIT: 'commentEdit',
  THEIR_REF_EDIT: 'theirRefEdit',
  REQUISITION_COMMENT_EDIT: 'comment',
  ITEM_SELECT: 'itemSelect',
  SELECT_SUPPLIER: 'selectSupplier',
  PROGRAM_REQUISITION: 'programRequisition',
  MONTHS_SELECT: 'monthsToSupply',
  VIEW_REGIMEN_DATA: 'viewRegimenData',
  PROGRAM_STOCKTAKE: 'programStocktake',
  STOCKTAKE_COMMENT_EDIT: 'stocktakeComment',
  EDIT_STOCKTAKE_BATCH: 'editStocktakeBatch',
  STOCKTAKE_OUTDATED_ITEM: 'stocktakeOutdatedItems',
  STOCKTAKE_REASON: 'stocktakeReason',
  ENFORCE_STOCKTAKE_REASON: 'enforceStocktakeReason',
};

export const getModalTitle = modalKey => {
  switch (modalKey) {
    default:
      return '';
    case MODAL_KEYS.STOCKTAKE_COMMENT_EDIT:
      return modalStrings.edit_the_stocktake_comment;
    case MODAL_KEYS.REQUISITION_COMMENT_EDIT:
      return modalStrings.edit_the_requisition_comment;
    case MODAL_KEYS.ITEM_SELECT:
      return modalStrings.search_for_an_item_to_add;
    case MODAL_KEYS.COMMENT_EDIT:
      return modalStrings.edit_the_invoice_comment;
    case MODAL_KEYS.THEIR_REF_EDIT:
      return modalStrings.edit_their_reference;
    case MODAL_KEYS.SELECT_CUSTOMER:
      return modalStrings.search_for_the_customer;
    case MODAL_KEYS.SELECT_SUPPLIER:
      return modalStrings.search_for_the_supplier;
    case MODAL_KEYS.VIEW_REGIMEN_DATA:
      return buttonStrings.view_regimen_data;
    case MODAL_KEYS.ENFORCE_STOCKTAKE_REASON:
    case MODAL_KEYS.STOCKTAKE_REASON:
      return modalStrings.select_a_reason;
  }
};

@@ -154,16 +154,26 @@
 S = %7B%0A  
+STOCKTAKE_
 COMMENT_
@@ -175,25 +175,34 @@
 MENT_EDIT: '
-c
+stocktakeC
 ommentEdit',
@@ -209,32 +209,52 @@
 %0A  T
-HEIR_REF_EDIT: 'theirRef
+RANSACTION_COMMENT_EDIT: 'transactionComment
 Edit
@@ -289,288 +289,404 @@
 T: '
-c
+requisitionC
 omment
+Edit
 ',%0A  
-ITEM_SELECT: 'itemSelect',%0A  SELECT_SUPPLIER: 'selectSupplier',%0A  PROGRAM_REQUISITION: 'programRequisition',%0A  MONTHS_SELECT: 'monthsToSupply',%0A  VIEW_REGIMEN_DATA: 'viewRegimenData',%0A  PROGRAM_STOCKTAKE: 'programStocktake',%0A  STOCKTAKE_COMMENT_EDIT: 'stocktakeComment
+TRANSACTION_THEIR_REF_EDIT: 'transactionTheirRefEdit',%0A  REQUISITION_THEIR_REF_EDIT: 'requisitionTheirRefEdit',%0A  SELECT_ITEM: 'selectItem',%0A  SELECT_MONTH: 'selectMonth',%0A  SELECT_CUSTOMER: 'selectCustomer',%0A  SELECT_SUPPLIER: 'selectSupplier',%0A  PROGRAM_REQUISITION: 'programRequisition',%0A  PROGRAM_STOCKTAKE: 'programStocktake',%0A  VIEW_REGIMEN_DATA: 'viewRegimenData
 ',%0A 
@@ -1199,18 +1199,31 @@
 EYS.
-ITEM_SELEC
+TRANSACTION_COMMENT_EDI
 T:%0A 
@@ -1251,33 +1251,32 @@
 ngs.
-search_for_an_item_to_add
+edit_the_invoice_comment
 ;%0A  
@@ -1293,28 +1293,27 @@
 AL_KEYS.
-COMMENT_EDIT
+SELECT_ITEM
 :%0A      
@@ -1336,32 +1336,33 @@
 ngs.
-edit_the_invoice_comment
+search_for_an_item_to_add
 ;%0A  

Add adjustments and cleanup of MODAL_KEYS and getModalTitle