<commit_before>import { Feature } from 'toolkit/extension/features/feature';
import { isCurrentRouteBudgetPage } from 'toolkit/extension/utils/ynab';
import { getEmberView } from 'toolkit/extension/utils/ember';
import { formatCurrency } from 'toolkit/extension/utils/currency';

export class DisplayUpcomingAmount extends Feature {
  injectCSS() { return require('./index.css'); }

  shouldInvoke() {
    return isCurrentRouteBudgetPage();
  }

  invoke() {
    $('.budget-table-row.is-sub-category').each((_, element) => {
      const { monthlySubCategoryBudgetCalculation, subCategory } = getEmberView(element.id).category;

      if (monthlySubCategoryBudgetCalculation && monthlySubCategoryBudgetCalculation.upcomingTransactions) {
        $('.budget-table-cell-activity', element)
          .addClass('toolkit-activity-upcoming')
          .prepend($('<div>', {
            class: 'toolkit-activity-upcoming-amount',
            title: `Total upcoming transaction amount in this month for ${subCategory.get('name')}`,
            text: formatCurrency(monthlySubCategoryBudgetCalculation.upcomingTransactions)
          }));
      }
    });
  }
<commit_msg>Fix upcoming amount privacy missing (#1424)<commit_after>import { Feature } from 'toolkit/extension/features/feature';
import { isCurrentRouteBudgetPage } from 'toolkit/extension/utils/ynab';
import { getEmberView } from 'toolkit/extension/utils/ember';
import { formatCurrency } from 'toolkit/extension/utils/currency';

export class DisplayUpcomingAmount extends Feature {
  injectCSS() { return require('./index.css'); }

  shouldInvoke() {
    return isCurrentRouteBudgetPage();
  }

  invoke() {
    $('.budget-table-row.is-sub-category').each((_, element) => {
      const { monthlySubCategoryBudgetCalculation, subCategory } = getEmberView(element.id).category;

      if (monthlySubCategoryBudgetCalculation && monthlySubCategoryBudgetCalculation.upcomingTransactions) {
        $('.budget-table-cell-activity', element)
          .addClass('toolkit-activity-upcoming')
          .prepend($('<div>', {
            class: 'toolkit-activity-upcoming-amount currency',
            title: `Total upcoming transaction amount in this month for ${subCategory.get('name')}`,
            text: formatCurrency(monthlySubCategoryBudgetCalculation.upcomingTransactions)
          }));
      }
    });
  }

{'fraction_non_alphanumeric': 0.1290732120186204, 'fraction_numerical': 0.0016927634363097758, 'mean_word_length': 3.914760914760915, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 7, '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': '3018759', 'n_tokens_mistral': 675, 'n_tokens_neox': 652, 'n_words': 116}