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AAO,OAASH,EAAaltD,GAAkB,GAAKktD,GAAe,IAAMH,EAAIM,OAAO,OAASH,EAAa1rE,EAAKnH,IAAI,uDAAyD,GAAK6yE,GAAgBH,EAAIM,OAAO,OAASH,EAAa5hB,GAAwB,GAAK4hB,GAGlYC,GAAwBJ,EAAIM,OAAO,OAASH,EAAa1rE,EAAKnH,IAAI,4DAA8D,GAAK6yE,GAAgBH,EAAIM,OAAO,OAASH,EAAa5hB,GAAwB,GAAK4hB,GAEnNC,GAAsB,sMAAoT,EAAEG,KAAK1zE,KAAK,mBAAoBwzE,EAAgBA,EAAgBptD,eAAuC,qBAAjBA,eAA6BA,oBAAexlB,EAAU,yBAA0B4yE,EAAgBA,EAAgB9hB,qBAAmD,qBAAvBA,qBAAmCA,0BAAqB9wD,EAAU,SAAU4yE,EAAgBA,EAAgB5rE,KAAmB,qBAAPA,KAAmBA,UAAKhH,EAAU,sBAAuB4yE,EAAgBA,EAAgBhzD,kBAA6C,qBAApBA,kBAAgCA,uBAAkB5f,GAAoB2yE,CAAS,C","sources":["../../../../client-import/packages/account-import-page/src/repository/default-import-user-preference.js","../../../../client-import/packages/account-import-page/src/repository/multi-account-google-import-repository.js","../../../../client-import/packages/account-import-page/src/step/bing-account-title/grid/bing-account-title-grid-viewmodel.js","../../../../client-import/packages/account-import-page/src/step/bing-account-title/grid/bing-account-title-grid-view.js","../../../../client-import/packages/account-import-page/src/step/bing-account-title/bing-account-title-step.js","../../../../client-import/packages/account-import-page/src/step/google-account/grid/multi-google-account-grid-viewmodel.js","../../../../client-import/packages/account-import-page/src/step/google-account/grid/bing-account-selection-col/bing-account-drop-down-menu.js","../../../../client-import/packages/account-import-page/src/step/google-account/grid/bing-account-selection-col/bing-account-list-dropdown-view.js","../../../../client-import/packages/account-import-page/src/step/google-account/grid/multi-google-account-grid-view.js","../../../../client-import/packages/account-import-page/src/step/google-account/grid/multi-google-account-grid-config.js","../../../../client-import/packages/account-import-page/src/step/google-account/multi-account-google-account-step.js","../../../../client-import/packages/account-import-page/src/step/google-campaign/grid/google-account-selector.js","../../../../client-import/packages/account-import-page/src/step/google-campaign/grid/multi-account-google-campaign-grid-viewmodel.js","../../../../client-import/packages/account-import-page/src/step/google-campaign/grid/multi-account-google-campaign-grid-view.js","../../../../client-import/packages/account-import-page/src/step/google-campaign/multi-account-google-campaign-step.js","../../../../client-import/packages/account-import-page/src/step/schedule-import/multi-account-schedule-import-step.js","../../../../client-import/packages/account-import-page/src/step/import-summary/multi-account-import-summary-step.js","../../../../client-import/packages/account-import-page/src/page/multi-account-google-import-step-factory.js","../../../../client-import/packages/account-import-page/src/page/multi-account-google-import-page.js","../../../../client-import/packages/amazon-import/src/page/step-config.js","../../../../client-import/packages/amazon-import/src/repository/amazon-import-repository.js","../../../../client-import/packages/amazon-import/src/repository/amazon-import-repository-utils.js","../../../../client-import/packages/amazon-import/src/repository/amazon-login-repository.js","../../../../client-import/packages/amazon-import/src/repository/permission-factory.js","../../../../client-import/packages/amazon-import/src/steps/amazon-account-step/prefetch.js","../../../../client-import/packages/amazon-import/src/steps/amazon-login-step/login-container.js","../../../../client-import/packages/amazon-import/src/steps/amazon-login-step/index.js","../../../../client-import/packages/amazon-import/src/steps/amazon-login-step/action-bar-config.js","../../../../client-import/packages/amazon-import/src/steps/amazon-login-step/prefetch.js","../../../../client-import/packages/amazon-import/src/steps/amazon-account-step/action-bar-config.js","../../../../client-import/packages/amazon-import/src/steps/amazon-account-step/account-selector.js","../../../../client-import/packages/amazon-import/src/steps/amazon-account-step/index.js","../../../../client-import/packages/amazon-import/src/steps/start-smart-import-step/action-bar-config.js","../../../../client-import/packages/amazon-import/src/steps/start-smart-import-step/smart-import-step-prefetch.js","../../../../client-import/packages/amazon-import/src/steps/helpers/create-schedule-runnow-job.js","../../../../client-import/packages/amazon-import/src/steps/start-smart-import-step/index.js","../../../../client-import/packages/amazon-import/src/steps/amazon-import-option-step/action-bar-config.js","../../../../client-import/packages/amazon-import/src/steps/amazon-import-option-step/amazon-import-option-config.js","../../../../client-import/packages/amazon-import/src/steps/amazon-import-option-step/import-options-step.js","../../../../client-import/packages/amazon-import/src/steps/start-import-advanced-step/action-bar-config.js","../../../../client-import/packages/amazon-import/src/steps/start-import-advanced-step/index.js","../../../../client-import/packages/amazon-import/src/steps/amazon-import-summary-step/save-schedule-info.js","../../../../client-import/packages/amazon-import/src/steps/amazon-import-summary-step/get-import-details-view.js","../../../../client-import/packages/amazon-import/src/steps/amazon-import-summary-step/index.js","../../../../client-import/packages/amazon-import/src/steps/import-status-step/index.js","../../../../client-import/packages/amazon-import/src/page/step-factory.js","../../../../client-import/packages/amazon-import/src/page/index.js","../../../../client-import/packages/facebook-import-page/src/page/facebook-import-step-factory.js","../../../../client-import/packages/facebook-import-page/src/page/facebook-import-page.js","../../../../client-import/packages/facebook-import-page/src/step/facebook-login/facebook-login-step.js","../../../../client-import/packages/file-import-page/src/repository/file-import-repository.js","../../../../client-import/packages/file-import-page/src/step/file-upload/file-format/file-format-view.js","../../../../client-import/packages/file-import-page/src/step/file-upload/file-upload-step-view.js","../../../../client-import/packages/file-import-page/src/step/column-matching/grid/column-matching-grid.js","../../../../client-import/packages/file-import-page/src/step/column-matching/grid/column-matching-grid-config.js","../../../../client-import/packages/file-import-page/src/step/column-matching/column-matching-step.js","../../../../client-import/packages/file-import-page/src/step/file-import-options/file-import-options-step.js","../../../../client-import/packages/file-import-page/src/step/import-preview/import-preview-step.js","../../../../client-import/packages/file-import-page/src/step/file-import-summary/file-import-summary-step.js","../../../../client-import/packages/file-import-page/src/page/file-import-step-factory.js","../../../../client-import/packages/file-import-page/src/page/file-import-page.js","../../../../client-import/packages/google-import-page/src/shared/plugin/instant-search-viewmodel.js","../../../../client-import/packages/google-import-page/src/shared/plugin/instant-search.js","../../../../client-import/packages/google-import-page/src/shared/plugin/show-paused-filter-viewmodel.js","../../../../client-import/packages/google-import-page/src/shared/plugin/show-paused-filter.js","../../../../client-import/packages/google-import-page/src/shared/plugin/set-memory-filter.js","../../../../client-import/packages/google-import-page/src/shared/plugin/filter-plugin.js","../../../../client-import/packages/google-import-page/src/shared/step/campaign-selection-step/grid/campaign-selection-grid-viewmodel.js","../../../../client-import/packages/google-import-page/src/shared/step/campaign-selection-step/grid/campaign-selection-grid-config.js","../../../../client-import/packages/google-import-page/src/shared/step/campaign-selection-step/grid/campaign-selection-grid-view.js","../../../../client-import/packages/google-import-page/src/shared/step/campaign-selection-step/ad-group-level-view/shapes.js","../../../../client-import/packages/google-import-page/src/shared/step/campaign-selection-step/ad-group-level-view/header.js","../../../../client-import/packages/google-import-page/src/shared/step/campaign-selection-step/ad-group-level-view/constants.js","../../../../client-import/packages/google-import-page/src/shared/step/campaign-selection-step/ad-group-level-view/list-node-renderer.js","../../../../client-import/packages/google-import-page/src/shared/step/campaign-selection-step/ad-group-level-view/tree-view.js","../../../../client-import/packages/google-import-page/src/shared/step/campaign-selection-step/ad-group-level-view/list-box.js","../../../../client-import/packages/google-import-page/src/shared/step/campaign-selection-step/ad-group-level-view/step.js","../../../../client-import/packages/google-import-page/src/shared/step/campaign-selection-step/ad-group-level-view/backbone-pipe-view.js","../../../../client-import/packages/google-import-page/src/shared/step/campaign-selection-step/campaign-selection-step.js","../../../../client-import/packages/google-import-page/src/shared/step/account-selection-step/validate-selected-account-campaigns.js","../../../../client-import/packages/google-import-page/src/shared/step/account-selection-step/grid/account-grid-viewmodel.js","../../../../client-import/packages/google-import-page/src/shared/step/account-selection-step/grid/account-grid-view.js","../../../../client-import/packages/google-import-page/src/shared/step/account-selection-step/grid/account-grid-config.js","../../../../client-import/packages/google-import-page/src/shared/step/account-selection-step/currency-conversion-control/currency-conversion-view-model.js","../../../../client-import/packages/google-import-page/src/shared/step/account-selection-step/currency-conversion-control/currency-conversion-view.js","../../../../client-import/packages/google-import-page/src/shared/step/account-selection-step/account-selection-step.js","../../../../client-import/packages/google-import-page/src/shared/step/import-options-step/import-options-summary-builder.js","../../../../client-import/packages/google-import-page/src/shared/step/import-options-step/import-options-step.js","../../../../client-import/packages/google-import-page/src/shared/step/import-schedule-step/form/ko-extension.js","../../../../client-import/packages/google-import-page/src/shared/step/import-schedule-step/util/cron-util.js","../../../../client-import/packages/google-import-page/src/shared/step/import-schedule-step/util/import-scheduling-options.js","../../../../client-import/packages/google-import-page/src/shared/step/import-schedule-step/util/time-zone-util.js","../../../../client-import/packages/google-import-page/src/shared/step/import-schedule-step/form/schedule-form-view-model.js","../../../../client-import/packages/google-import-page/src/shared/step/import-schedule-step/form/schedule-form-view.js","../../../../client-import/packages/google-import-page/src/shared/step/import-schedule-step/schedule-import-step.js","../../../../client-import/packages/google-import-page/src/shared/step/import-summary-step/import-summary-step.js","../../../../client-import/packages/google-import-page/src/step/google-login/google-login-step.js","../../../../client-import/packages/google-import-page/src/step/google-import-options/index.js","../../../../client-import/packages/google-import-page/src/step/schedule-import/index.js","../../../../client-import/packages/google-import-page/src/step/google-campaign-grid-view.js","../../../../client-import/packages/google-import-page/src/page/google-import-step-factory.js","../../../../client-import/packages/google-import-page/src/page/google-import-page.js","../../../../client-import/packages/google-import/src/repository/permission-factory.js","../../../../client-import/packages/google-import/src/page/step-config.js","../../../../client-import/packages/google-import/src/steps/google-login-step/login-step-prefetch.js","../../../../client-import/packages/google-import/src/steps/google-login-step/index.js","../../../../client-import/packages/google-import/src/steps/google-account-choose-step/bing-account-mapping-step/bing-account-dropdown-list.js","../../../../client-import/packages/google-import/src/steps/google-account-choose-step/bing-account-mapping-step/bing-account-selector.js","../../../../client-import/packages/google-import/src/steps/google-account-choose-step/bing-account-mapping-step/bing-account-step-prefetch.js","../../../../client-import/packages/google-import/src/steps/google-account-choose-step/bing-account-mapping-step/bing-account-selector-styles.js","../../../../client-import/packages/google-import/src/steps/google-account-choose-step/bing-account-mapping-step/bing-account-step.js","../../../../client-import/packages/google-import/src/steps/google-account-choose-step/bing-account-mapping-step/action-bar-config.js","../../../../client-import/packages/google-import/src/steps/google-account-choose-step/index.js","../../../../client-import/packages/google-import/src/steps/start-import-smart-step/index.js","../../../../client-import/packages/google-import/src/steps/google-campaign-step/campaign-selector.js","../../../../client-import/packages/google-import/src/steps/google-campaign-step/campaign-selection-styles.js","../../../../client-import/packages/google-import/src/steps/google-campaign-step/google-campaign-step.js","../../../../client-import/packages/google-import/src/steps/google-campaign-step/action-bar-config.js","../../../../client-import/packages/google-import/src/steps/google-import-options-step/action-bar-config.js","../../../../client-import/packages/google-import/src/steps/google-import-options-step/import-options-step.js","../../../../client-import/packages/google-import/src/steps/import-status-step/index.js","../../../../client-import/packages/google-import/src/steps/start-import-advanced-step/action-bar-config.js","../../../../client-import/packages/google-import/src/steps/start-import-advanced-step/index.js","../../../../client-import/packages/google-import/src/steps/merchant-center-store-mapping-step/merchant-center-mapping-step.js","../../../../client-import/packages/google-import/src/steps/merchant-center-store-mapping-step/action-bar-config.js","../../../../client-import/packages/google-import/src/steps/smart-campaign-google-login-step/index.js","../../../../client-import/packages/google-import/src/steps/esc-google-login-step/index.js","../../../../client-import/packages/google-import/src/page/step-factory.js","../../../../client-import/packages/google-import/src/page/index.js","../../../../client-import/packages/import-callout/src/import-callout.js","../../../../client-import/packages/import-callout/src/import-settings-callout.js","../../../../client-import/packages/import-callout/src/import-summary-callout.js","../../../../client-import/packages/import-callout/src/import-recommendation-constants.js","../../../../client-import/packages/import-callout/src/import-recommendation-callout.js","../../../../client-import/packages/pinterest-import/src/steps/pinterest-import-option-step/pinterest-import-option-config.js","../../../../client-import/packages/pinterest-import/src/page/step-config.js","../../../../client-import/packages/pinterest-import/src/repository/pinterest-import-repository.js","../../../../client-import/packages/pinterest-import/src/repository/pinterest-import-repository-utils.js","../../../../client-import/packages/pinterest-import/src/repository/pinterest-login-repository.js","../../../../client-import/packages/pinterest-import/src/repository/permission-factory.js","../../../../client-import/packages/pinterest-import/src/steps/pinterest-account-step/prefetch.js","../../../../client-import/packages/pinterest-import/src/steps/pinterest-login-step/login-container.js","../../../../client-import/packages/pinterest-import/src/steps/pinterest-login-step/index.js","../../../../client-import/packages/pinterest-import/src/steps/pinterest-login-step/action-bar-config.js","../../../../client-import/packages/pinterest-import/src/steps/pinterest-login-step/prefetch.js","../../../../client-import/packages/pinterest-import/src/steps/pinterest-account-step/action-bar-config.js","../../../../client-import/packages/pinterest-import/src/steps/pinterest-account-step/account-selector.js","../../../../client-import/packages/pinterest-import/src/steps/pinterest-account-step/index.js","../../../../client-import/packages/pinterest-import/src/steps/start-smart-import-step/action-bar-config.js","../../../../client-import/packages/pinterest-import/src/steps/start-smart-import-step/smart-import-step-prefetch.js","../../../../client-import/packages/pinterest-import/src/steps/helpers/create-schedule-runnow-job.js","../../../../client-import/packages/pinterest-import/src/steps/start-smart-import-step/index.js","../../../../client-import/packages/pinterest-import/src/steps/pinterest-import-option-step/action-bar-config.js","../../../../client-import/packages/pinterest-import/src/steps/pinterest-import-option-step/import-options-step.js","../../../../client-import/packages/pinterest-import/src/steps/start-import-advanced-step/action-bar-config.js","../../../../client-import/packages/pinterest-import/src/steps/start-import-advanced-step/index.js","../../../../client-import/packages/pinterest-import/src/steps/pinterest-import-summary-step/save-schedule-info.js","../../../../client-import/packages/pinterest-import/src/steps/pinterest-import-summary-step/get-import-details-view.js","../../../../client-import/packages/pinterest-import/src/steps/pinterest-import-summary-step/index.js","../../../../client-import/packages/pinterest-import/src/steps/import-status-step/index.js","../../../../client-import/packages/pinterest-import/src/page/step-factory.js","../../../../client-import/packages/pinterest-import/src/page/index.js","../../../../client-import/packages/account-import-page/src/step/bing-account-title/grid/bing-account-title-grid-view.pug","../../../../client-import/packages/account-import-page/src/step/bing-account-title/grid/itemContentTemplate.pug","../../../../client-import/packages/account-import-page/src/step/bing-account-title/grid/selectedItemTemplate.pug","../../../../client-import/packages/account-import-page/src/step/bing-account-title/grid/sourceItemTemplate.pug","../../../../client-import/packages/account-import-page/src/step/bing-account-title/grid/view-details-pop-up-view.pug","../../../../client-import/packages/account-import-page/src/step/google-account/grid/bing-account-selection-col/bing-account-selection-col-template.pug","../../../../client-import/packages/account-import-page/src/step/google-account/grid/multi-google-account-grid-template.pug","../../../../client-import/packages/account-import-page/src/step/google-account/multi-account-google-account-step.pug","../../../../client-import/packages/account-import-page/src/step/google-campaign/grid/multi-account-google-campaign-grid-template.pug","../../../../client-import/packages/account-import-page/src/step/google-campaign/multi-account-google-campaign-step.pug","../../../../client-import/packages/account-import-page/src/step/import-summary/multi-account-import-summary-template.pug","../../../../client-import/packages/facebook-import-page/src/step/facebook-login/facebook-login-template.pug","../../../../client-import/packages/file-import-page/src/step/column-matching/column-matching-step.pug","../../../../client-import/packages/file-import-page/src/step/column-matching/grid/column-matching-grid-header.pug","../../../../client-import/packages/file-import-page/src/step/file-import-options/file-import-options-step.pug","../../../../client-import/packages/file-import-page/src/step/file-upload/file-format/file-format-template.pug","../../../../client-import/packages/file-import-page/src/step/file-upload/file-upload-step-template.pug","../../../../client-import/packages/file-import-page/src/step/import-preview/import-preview-step.pug","../../../../client-import/packages/google-import-page/src/shared/plugin/instant-search.pug","../../../../client-import/packages/google-import-page/src/shared/plugin/show-paused-filter.pug","../../../../client-import/packages/google-import-page/src/shared/step/account-selection-step/account-selection-step.pug","../../../../client-import/packages/google-import-page/src/shared/step/account-selection-step/currency-conversion-control/currency-conversion-view-template.pug","../../../../client-import/packages/google-import-page/src/shared/step/account-selection-step/grid/account-grid-template.pug","../../../../client-import/packages/google-import-page/src/shared/step/campaign-selection-step/campaign-selection-step.pug","../../../../client-import/packages/google-import-page/src/shared/step/campaign-selection-step/grid/campaign-selection-grid-template.pug","../../../../client-import/packages/google-import-page/src/shared/step/import-schedule-step/form/schedule-form-done-template.pug","../../../../client-import/packages/google-import-page/src/shared/step/import-schedule-step/form/schedule-form-template.pug","../../../../client-import/packages/google-import-page/src/shared/step/import-schedule-step/schedule-import-step.pug","../../../../client-import/packages/google-import-page/src/shared/step/import-summary-step/scheduled-import-summary-template.pug","../../../../client-import/packages/google-import-page/src/step/google-login/google-login-template.pug"],"sourcesContent":["export const defaultOptions = {\r\n ImportNewEntities: true,\r\n ImportUpdatedEntities: true,\r\n};\r\n","import Promise from 'bluebird';\r\nimport _ from 'underscore';\r\n\r\nimport * as urlUtil from '@bingads-webui/url-util';\r\n\r\nimport { GoogleImportRepository } from '@bingads-webui-campaign/import-shared-repositories';\r\n\r\nimport { defaultOptions } from './default-import-user-preference';\r\n\r\nconst getGoogleSessionUrlTmpl =\r\n 'ImportSession/StartGoogleSession(CustomerId=:customer_id,AccountId={{AccountId}})?authCode={{AuthCode}}&redirectUri=postmessage';\r\nconst getGoogleSessionWithTokenUrlTmpl =\r\n 'ImportSession/StartGoogleSession(CustomerId=:customer_id,AccountId={{AccountId}})?refreshToken={{Token}}&redirectUri=postmessage';\r\nconst getGoogleLoginEmailUrlTmpl =\r\n 'ImportSession/GoogleLoginEmail(CustomerId=:customer_id,AccountId={{AccountId}},SessionId={{SessionId}})';\r\nconst getGoogleAccountsUrlTmpl =\r\n '/ImportSession/GoogleAccounts(CustomerId=:customer_id,AccountId={{AccountId}},SessionId={{SessionId}})';\r\nconst getGoogleCampaignsUrlTmpl =\r\n '/ImportSession/GoogleCampaigns(CustomerId=:customer_id,AccountId={{AccountId}},SessionId={{SessionId}})';\r\nconst getImportUserPreferenceUrlTmpl =\r\n '/ImportSession/MultiAccountGoogleImportUserPreference(CustomerId=:customer_id)';\r\nconst getGoogleAccountPropertiesUrlTmpl =\r\n '/ImportSession/MultiGoogleAccountProperties(CustomerId=:customer_id,AccountId={{AccountId}},SessionId={{SessionId}})';\r\nconst importType = 'GoogleAPIImport';\r\n\r\nexport class MultiAccountGoogleImportRepository extends GoogleImportRepository {\r\n constructor({ deps }) {\r\n super({ deps });\r\n }\r\n\r\n startGoogleSession(authCode) {\r\n const url = _.template(getGoogleSessionUrlTmpl)({ AccountId: this.aid, AuthCode: authCode });\r\n\r\n return this.startGoogleSessionInternal(url);\r\n }\r\n\r\n startGoogleSessionWithToken(token) {\r\n const url = _.template(getGoogleSessionWithTokenUrlTmpl)({ AccountId: this.aid, Token: token });\r\n\r\n return this.startGoogleSessionInternal(url);\r\n }\r\n\r\n fetchGoogleLoginEmail(sessionId) {\r\n // eslint-disable-next-line max-len\r\n const url = _.template(getGoogleLoginEmailUrlTmpl)({ AccountId: this.aid, SessionId: sessionId });\r\n\r\n return this.odata.get(url);\r\n }\r\n\r\n getGoogleAccounts(currentSessionId = null) {\r\n const sessionId = currentSessionId || this.getGoogleSessionIdFromCookie();\r\n const url = _.template(getGoogleAccountsUrlTmpl)({ AccountId: this.aid, SessionId: sessionId });\r\n\r\n return this.odata.get(url);\r\n }\r\n\r\n getGoogleCampaigns(googleCustomerId) {\r\n const sessionId = this.getGoogleSessionIdFromCookie();\r\n let url = _.template(getGoogleCampaignsUrlTmpl)({ AccountId: this.aid, SessionId: sessionId });\r\n\r\n url = this.formatUrl({\r\n url,\r\n queryParameters: {\r\n googleCustomerId,\r\n },\r\n });\r\n\r\n return this.getGoogleCampaignsInternal(url);\r\n }\r\n\r\n prepareSingleAccountGoogleImportTaskItem(\r\n timeZoneId,\r\n bingAccountInfo,\r\n adWordsImportContext\r\n ) {\r\n return {\r\n '@odata.type': '#Model.SingleAccountGoogleImportTaskItem',\r\n AccountId: bingAccountInfo.Id,\r\n AdWordsImportContext: adWordsImportContext,\r\n CampaignTimeZone: this.timeZoneEnumMapper.getEnumbyId(timeZoneId || this.config.get('AccountTimeZone')),\r\n CultureName: this.config.get('CultureName'),\r\n LCID: this.config.get('CultureLcid'),\r\n AdGroupMedium: this.adGroupMedium,\r\n Language: this.language,\r\n CustomerMarket: this.market,\r\n ImportType: importType,\r\n AccountName: bingAccountInfo.Name,\r\n AccountNumber: bingAccountInfo.AccountNumber,\r\n UserName: this.config.get('CurrentUser') && this.config.get('CurrentUser').Name,\r\n };\r\n }\r\n\r\n prepareMultiAccountGoogleImportTaskItem({\r\n importOptions,\r\n stepState,\r\n }) {\r\n const {\r\n importUserPreferences,\r\n notificationType,\r\n notificationEmailAddresses,\r\n timeZoneId,\r\n taskItemState,\r\n name,\r\n cron,\r\n } = importOptions;\r\n\r\n const {\r\n loginCustomerId,\r\n initialAdWordsAccount,\r\n selectedCampaignIds,\r\n selectedGoogleAccountToBingAccountMap,\r\n selectedGoogleAccounts,\r\n bingAccount,\r\n } = stepState;\r\n\r\n // get sessionId from state or cookie\r\n let sessionId;\r\n let googleAccountName;\r\n if (initialAdWordsAccount) {\r\n ({ sessionId } = initialAdWordsAccount);\r\n ({ googleAccountName } = initialAdWordsAccount);\r\n } else {\r\n const info = this.getGoogleImportInfoFromCookie();\r\n sessionId = info.googleSessionId;\r\n ({ googleAccountName } = info);\r\n }\r\n\r\n const importTaskItemList = [];\r\n selectedGoogleAccounts.forEach((googleAccount) => {\r\n // prepare singleAccountGoogleImportTaskItem for each account\r\n const campaignIds = _.findWhere(\r\n selectedCampaignIds,\r\n { googleCustomerId: googleAccount.CustomerId }\r\n ).selectedCampaignIds;\r\n const adWordsImportContext = {\r\n '@odata.type': '#Model.AdWordsImportContext',\r\n SessionId: sessionId,\r\n CustomerId: googleAccount.CustomerId,\r\n AccountName: googleAccountName,\r\n LoginCustomerId: loginCustomerId,\r\n CampaignIds: campaignIds,\r\n };\r\n\r\n const bingAccountId = _.findWhere(\r\n selectedGoogleAccountToBingAccountMap,\r\n { GoogleCustomerId: googleAccount.CustomerId }\r\n ).BingAccountId;\r\n const bingAccountInfo = _.findWhere(bingAccount, { Id: bingAccountId });\r\n\r\n const singleAccountGoogleImportTaskItem = this.prepareSingleAccountGoogleImportTaskItem(\r\n timeZoneId,\r\n bingAccountInfo,\r\n adWordsImportContext\r\n );\r\n\r\n importTaskItemList.push(singleAccountGoogleImportTaskItem);\r\n });\r\n\r\n const multiAccountGoogleImportTaskItem = _.extend(\r\n {\r\n '@odata.type': '#Model.MultiAccountGoogleImportTaskItem',\r\n SessionId: sessionId,\r\n LoginCustomerId: loginCustomerId,\r\n ImportUserPreference: importUserPreferences,\r\n NotificationEmailAddresses: notificationEmailAddresses,\r\n ImportTaskItemList: importTaskItemList,\r\n UserName: this.config.get('CurrentUser') && this.config.get('CurrentUser').Name,\r\n NotificationType: notificationType,\r\n Type: `MultiAccountGoogleImport${this.testTypeSuffix}`,\r\n NotificationMedium: 'Email',\r\n TimeZoneId: timeZoneId,\r\n },\r\n !!name && { Name: name },\r\n !!taskItemState && { State: taskItemState },\r\n !!cron && { Cron: cron }\r\n );\r\n\r\n return Promise.resolve(multiAccountGoogleImportTaskItem);\r\n }\r\n\r\n getMultiAccountGoogleImportUserPreferences(googleCustomerList) {\r\n let preferences = {};\r\n\r\n return this.getMultiAccountImportUserPreferenceWithBMCandMinInfo()\r\n .then((userPref) => {\r\n preferences = _.extend(preferences, userPref);\r\n const googleCustomerIdList = _.keys(googleCustomerList);\r\n return this.getMultiAccountGoogleAccountProperties(googleCustomerIdList.join());\r\n })\r\n .then((result) => {\r\n if (result === false) {\r\n return false;\r\n }\r\n const TrackingTemplate = [];\r\n const FinalUrlSuffix = [];\r\n _.each(googleCustomerList, (item) => {\r\n if (result[item.CustomerId]) {\r\n TrackingTemplate.push({\r\n googleCustomerId: item.CustomerId,\r\n googleAccountName: item.AccountName,\r\n trackingTemplate: result[item.CustomerId].TrackingTemplate,\r\n });\r\n FinalUrlSuffix.push({\r\n googleCustomerId: item.CustomerId,\r\n googleAccountName: item.AccountName,\r\n finalUrlSuffix: result[item.CustomerId].FinalUrlSuffix,\r\n });\r\n }\r\n });\r\n\r\n preferences = _.extend(\r\n preferences,\r\n {\r\n AdWordsAccountTrackingTemplate: TrackingTemplate,\r\n AdWordsAccountFinalUrlSuffix: FinalUrlSuffix,\r\n }\r\n );\r\n return preferences;\r\n });\r\n }\r\n\r\n getImportUserPreference() {\r\n const url = this.formatUrl({\r\n url: getImportUserPreferenceUrlTmpl,\r\n });\r\n\r\n return this.odata.get(url);\r\n }\r\n\r\n getMultiAccountImportUserPreferenceWithBMCandMinInfo() {\r\n const storeIds = _.map(\r\n _.pluck(this.storeList, 'Value'),\r\n id => parseInt(id, 10)\r\n );\r\n const preferences = _.extend(\r\n {},\r\n {\r\n AvailableStoreValues: storeIds,\r\n AvailableStoreValueMessages: _.pluck(this.storeList, 'Text'),\r\n }\r\n );\r\n\r\n return this.getImportUserPreference(importType)\r\n .then(userPref => (\r\n _.defaults(preferences, userPref, defaultOptions)\r\n ));\r\n }\r\n\r\n getMultiAccountGoogleAccountProperties(googleCustomerIdList) {\r\n const sessionId = this.getGoogleSessionIdFromCookie();\r\n\r\n if (sessionId) {\r\n let url = _.template(getGoogleAccountPropertiesUrlTmpl)({\r\n AccountId: this.aid,\r\n SessionId: sessionId,\r\n });\r\n\r\n url = this.formatUrl({\r\n url,\r\n queryParameters: {\r\n googleCustomerIdList,\r\n },\r\n });\r\n\r\n return this.odata.get(url);\r\n }\r\n\r\n this.logTrace('Did not send request in method getGoogleAccountProperties because no SessionId was found');\r\n\r\n return Promise.resolve(false);\r\n }\r\n\r\n // options: { url, routerValue, queryParameters }\r\n formatCustomerLevelUrl(options, addDefaultParameters = false) {\r\n let url;\r\n let queryParameters;\r\n let routerValue;\r\n\r\n if (_.isString(options)) {\r\n url = options;\r\n } else {\r\n ({ url } = options);\r\n ({ queryParameters } = options);\r\n ({ routerValue } = options);\r\n }\r\n if (addDefaultParameters) {\r\n queryParameters = _.extend({}, queryParameters, {\r\n cid: this.cid,\r\n uid: this.uid,\r\n });\r\n }\r\n\r\n if (!_.isEmpty(queryParameters)) {\r\n url = urlUtil.queryify(url, queryParameters);\r\n }\r\n\r\n if (routerValue) {\r\n url += `#customer/${this.cid}/${routerValue}`;\r\n }\r\n\r\n return url;\r\n }\r\n\r\n redirectToAccountsSummary() {\r\n if (this.deps.isForVNext) {\r\n this.deps.router.navigateToRoute('accounts_performance');\r\n } else {\r\n const url = this.formatCustomerLevelUrl({\r\n url: '/Campaign/AccountsSummary',\r\n routerValue: 'accounts-summary/performance',\r\n }, true);\r\n\r\n this.navigateToUrl(url);\r\n }\r\n }\r\n\r\n redirectToImportScheduleAndHistory() {\r\n if (this.deps.isForVNext) {\r\n this.deps.router.navigateToRoute('importschedule');\r\n } else {\r\n const url = this.formatCustomerLevelUrl({\r\n url: '/Campaign/AccountsSummary',\r\n routerValue: 'import-accounts/importschedule',\r\n }, true);\r\n\r\n this.navigateToUrl(url);\r\n }\r\n }\r\n}\r\n","/* eslint-disable no-param-reassign */\r\nimport ko from 'knockout';\r\nimport _ from 'underscore';\r\n\r\nexport function BingAccountGridViewModel(i18n, AccountSelectionList, SelectedAccountIdList) {\r\n this.selectedlists = ko.observableArray();\r\n\r\n this.listDataCallBack = (options, cb) => {\r\n const accountlist = new AccountSelectionList();\r\n // filter out deleted and inactive accounts.\r\n accountlist.url += \"&$filter=Status ne Enum.AccountStatus'Inactive' and Status ne Enum.AccountStatus'Deleted'\";\r\n accountlist\r\n .fetch()\r\n .done((response) => {\r\n let accounts = response.value;\r\n\r\n if (!_.isEmpty(accounts)) {\r\n // DEFAULT: null,\r\n // EXPERT: 0,\r\n // SMART: 1,\r\n // UNIFIED_SMART: 2,\r\n // UNIFIED_EXPERT: 3,\r\n accounts = _.filter(accounts, account =>\r\n account.AccountMode === null || account.AccountMode === 0 || account.AccountMode === 3);\r\n _.each(accounts, (account) => {\r\n this.setStatusCssClass(account);\r\n });\r\n\r\n cb(null, {\r\n items: accounts,\r\n total: accounts.length,\r\n });\r\n this.setSelectedList(accounts, SelectedAccountIdList);\r\n }\r\n });\r\n };\r\n\r\n this.setStatusCssClass = (account) => {\r\n if (!_.isEmpty(account)) {\r\n if (account.Status === 'Active') {\r\n account.StatusCssClass = 'Enabled';\r\n } else if (account.Status === 'Inactive' || account.Status === 'Deleted') {\r\n account.StatusCssClass = 'Deleted';\r\n } else if (account.Status === 'Pause' || account.Status === 'Paused' || account.Status === 'BudgetPaused') {\r\n account.StatusCssClass = 'Paused';\r\n } else if (account.Status === 'Pending' || account.Status === 'PendingPaymentInstrument' || account.Status === 'PendingCreditCheck') {\r\n account.StatusCssClass = 'Pending';\r\n } else if (account.Status === 'Suspended') {\r\n account.StatusCssClass = 'Suspended';\r\n } else if (account.Status === 'Processing') {\r\n account.StatusCssClass = 'Processing';\r\n } else {\r\n account.StatusCssClass = 'Header';\r\n }\r\n\r\n account.StatusCssClass = `status${account.StatusCssClass}_icon`;\r\n }\r\n };\r\n\r\n this.setSelectedList = (accounts, selectedAccountNumbers) => {\r\n if (!_.isEmpty(accounts) && !_.isEmpty(selectedAccountNumbers)) {\r\n const accountSelectionHash = {};\r\n _.each(selectedAccountNumbers, (selectedAccountNumber) => {\r\n accountSelectionHash[selectedAccountNumber] = true;\r\n });\r\n\r\n _.each(accounts, (account) => {\r\n if (account.Id in accountSelectionHash) {\r\n this.selectedlists.push(account);\r\n }\r\n });\r\n }\r\n };\r\n\r\n this.showValidationError = ko.computed(() => _.isEmpty(this.selectedlists()));\r\n this.hasError = ko.computed(() => this.showValidationError());\r\n\r\n this.stringsMapping = {\r\n sourceItems: i18n.get('Bulk_Download_Edit_Data_AccountTitle'),\r\n selectedItems: i18n.get('Bulk_Download_Edit_Data_SelectedAccountTitle'),\r\n };\r\n}\r\n","/* eslint-disable indent */\r\nimport ko from 'knockout';\r\nimport Backbone from 'backbone';\r\nimport sourceItemTemplate from './sourceItemTemplate.pug';\r\nimport selectedItemTemplate from './selectedItemTemplate.pug';\r\nimport itemContentTemplate from './itemContentTemplate.pug';\r\nimport template from './bing-account-title-grid-view.pug';\r\nimport { BingAccountGridViewModel } from './bing-account-title-grid-viewmodel';\r\n\r\nexport class BingAccountTitleGridView extends Backbone.View {\r\n initialize({\r\n i18n,\r\n DoubleListBox,\r\n AccountSelectionList,\r\n SelectedAccountIdList,\r\n }) {\r\n this.i18n = i18n;\r\n this.DoubleListBox = DoubleListBox;\r\n this.AccountSelectionList = AccountSelectionList;\r\n this.SelectedAccountIdList = SelectedAccountIdList;\r\n }\r\n\r\n render() {\r\n this.$el.html(template({\r\n i18n: this.i18n,\r\n }));\r\n // eslint-disable-next-line max-len\r\n this.koModel = new BingAccountGridViewModel(this.i18n, this.AccountSelectionList, this.SelectedAccountIdList);\r\n ko.applyBindings(this.koModel, this.el);\r\n this.koModel.showValidationError.subscribe((value) => {\r\n this.trigger('change:error', value);\r\n });\r\n const doubleListControlOptions = {\r\n el: this.$('.multi-bing-account-grid'),\r\n strings: this.koModel.stringsMapping,\r\n data: {\r\n sourceItems: this.koModel.listDataCallBack,\r\n itemIdField: 'Id',\r\n itemFilterField: 'Name',\r\n selectedPageSize: 10,\r\n pageSize: 10,\r\n selectedItems: this.koModel.selectedlists,\r\n useCallbackForFetchOnly: true,\r\n },\r\n features: {\r\n selectAll: true,\r\n deselectAll: true,\r\n filtering: true,\r\n paging: true,\r\n },\r\n templates: {\r\n sourceItemLayoutTemplate: sourceItemTemplate({ i18n: this.i18n }),\r\n selectedItemLayoutTemplate: selectedItemTemplate({ i18n: this.i18n }),\r\n sourceItemContentTemplate: itemContentTemplate({ i18n: this.i18n }),\r\n selectedItemContentTemplate: itemContentTemplate({ i18n: this.i18n }),\r\n },\r\n itemActions: {},\r\n };\r\n this.doubleListBox = new this.DoubleListBox(doubleListControlOptions);\r\n this.doubleListBox.render();\r\n this.koModel.selectedlists.subscribe((newValue) => {\r\n this.doubleListBox.selectedItems(newValue);\r\n });\r\n this.doubleListBox.selectedItems.subscribe((newValue) => {\r\n this.koModel.selectedlists(newValue);\r\n\r\n // set tab index to -1 when there is no selected account otherwise set it to 0\r\n if (newValue.length === 0) {\r\n this.$('.dlb-selected').attr('tabIndex', -1);\r\n } else {\r\n this.$('.dlb-selected').attr('tabIndex', 0);\r\n }\r\n\r\n this.trigger('change:select');\r\n }, this);\r\n return this;\r\n }\r\n\r\n isValid() {\r\n if (this.doubleListBox.selectedItems().length <= 0) {\r\n return false;\r\n }\r\n return true;\r\n }\r\n}\r\n","import _ from 'underscore';\r\nimport { get, set } from '@bingads-webui/cookie';\r\nimport { BaseImportStep } from '@bingads-webui-campaign/import-components';\r\nimport { BingAccountTitleGridView } from './grid/bing-account-title-grid-view';\r\n\r\nexport class BingAccountTitleStep extends BaseImportStep {\r\n initialize({\r\n deps,\r\n }) {\r\n super.initialize({\r\n deps,\r\n });\r\n this.isContinueButtonEnabled = false;\r\n }\r\n\r\n get title() {\r\n return this.buildTitle({\r\n activeTitle: this.i18n.get('GoogleImport_MicrosoftAdvertising_Account'),\r\n summaryTitle: this.i18n.get('GoogleImport_MicrosoftAdvertising_Account_Summary'),\r\n });\r\n }\r\n\r\n willShow() {\r\n if (!this.state.bingAccount) {\r\n const state = this.getState();\r\n const { isEditingScheduledImport, initialSettings } = state;\r\n\r\n let selectedBingAccountIds = [];\r\n if (isEditingScheduledImport && initialSettings) {\r\n selectedBingAccountIds = _.pluck(initialSettings.ImportTaskItemList, 'AccountId');\r\n }\r\n if (_.size(selectedBingAccountIds) === 0) {\r\n const strMultiAccountPreSelectedAccountIds = 'multi-account-presseleced-account-ids';\r\n const preSelectedAccountIds = get(strMultiAccountPreSelectedAccountIds);\r\n if (_.size(preSelectedAccountIds)) {\r\n selectedBingAccountIds = _.map(preSelectedAccountIds.split(','), accontId => parseInt(accontId, 10));\r\n set(strMultiAccountPreSelectedAccountIds, '');\r\n }\r\n }\r\n\r\n this.grid = new BingAccountTitleGridView({\r\n i18n: this.i18n,\r\n DoubleListBox: this.deps.doubleListBox,\r\n AccountSelectionList: this.deps.accountSelectionLists,\r\n SelectedAccountIdList: selectedBingAccountIds,\r\n });\r\n this.grid.on('change:error', (hasError) => {\r\n this.isContinueButtonEnabled = !hasError;\r\n this.isEdited = true;\r\n this.trigger('change:action');\r\n });\r\n this.grid.on('change:select', () => {\r\n this.isEdited = true;\r\n });\r\n\r\n this.$el.html(this.grid.render().$el);\r\n\r\n // set tab index to -1 when there is no selected account otherwise set it to 0\r\n if (this.grid.doubleListBox.selectedItems().length === 0) {\r\n this.$('.dlb-selected').attr('tabIndex', -1);\r\n } else {\r\n this.$('.dlb-selected').attr('tabIndex', 0);\r\n }\r\n } else {\r\n this.logTrace('not edited, directly expand bing account selection step');\r\n }\r\n }\r\n\r\n wizardShouldGoNext() {\r\n if (this.grid.isValid()) {\r\n this.patchState({\r\n bingAccount: _.map(\r\n this.grid.doubleListBox.selectedItems(),\r\n singleAccount => _.pick(singleAccount, 'AccountNumber', 'Id', 'Name', 'Currency')\r\n ),\r\n });\r\n return true;\r\n }\r\n return false;\r\n }\r\n\r\n get actions() {\r\n const original = super.actions;\r\n\r\n original[0].enabled = this.isContinueButtonEnabled;\r\n return original;\r\n }\r\n}\r\n","import _ from 'underscore';\r\nimport ko from 'knockout';\r\n\r\nexport class MultiGoogleAccountGridViewModel {\r\n constructor() {\r\n this.SelectedAcountMaxCount = 5; // const value for account count limitation\r\n this.selectedAccount = ko.observableArray([]);\r\n this.accountMap = ko.observableArray([\r\n // { GoogleCustomerId: 17, BingAccountId: 7 },\r\n ]);\r\n\r\n this.selectedAccountsHasCampaigns = ko.observable(true);\r\n this.hasNoCampaignsCustomerNameList = ko.observable('');\r\n this.isDropdownMenuExpanded = ko.observable(false);\r\n\r\n this.showNoSelectedGoogleAccountError = ko.computed(() => _.isEmpty(this.selectedAccount()));\r\n this.showNoSelectedBingAccountError = ko.computed(() => (\r\n !this.showNoSelectedGoogleAccountError() &&\r\n (_.size(this.accountMap()) < _.size(this.selectedAccount()))\r\n ));\r\n this.showSelectedAccountCountExceedLimitError = ko.computed(() => (\r\n !this.showNoSelectedGoogleAccountError() &&\r\n !this.showNoSelectedBingAccountError() &&\r\n (_.size(this.selectedAccount()) > this.SelectedAcountMaxCount)\r\n ));\r\n this.showSelectedGoogleAccountNoCampaignError = ko.computed(() => (\r\n !this.showNoSelectedGoogleAccountError() &&\r\n !this.showNoSelectedBingAccountError() &&\r\n !this.showSelectedAccountCountExceedLimitError() &&\r\n !this.selectedAccountsHasCampaigns()\r\n ));\r\n\r\n this.hasError = ko.computed(() => this.showNoSelectedGoogleAccountError() ||\r\n this.showNoSelectedBingAccountError() ||\r\n this.showSelectedAccountCountExceedLimitError() ||\r\n this.showSelectedGoogleAccountNoCampaignError());\r\n }\r\n}\r\n","import _ from 'underscore';\r\nimport React from 'react';\r\nimport PropTypes from 'prop-types';\r\nimport { FocusLock } from '@bingads-webui-react/focus-lock';\r\nimport { EntitySelector } from '@bingads-webui-react/entity-selector';\r\n\r\nconst PageSize = 10;\r\n\r\nexport class BingAccountDropDownMenu extends React.PureComponent {\r\n static propTypes = {\r\n i18n: PropTypes.shape({\r\n getString: PropTypes.func.isRequired,\r\n }).isRequired,\r\n bingAccountList: PropTypes.arrayOf(PropTypes.shape({\r\n Id: PropTypes.number,\r\n Name: PropTypes.string,\r\n })).isRequired,\r\n selectedBingAccountId: PropTypes.number,\r\n updateSelection: PropTypes.func.isRequired,\r\n };\r\n\r\n static defaultProps = {\r\n selectedBingAccountId: undefined,\r\n }\r\n\r\n constructor(props) {\r\n super(props);\r\n\r\n this.state = {\r\n selectedItem: this.props.selectedBingAccountId ?\r\n _.findWhere(this.props.bingAccountList, { Id: this.props.selectedBingAccountId }) :\r\n null,\r\n totalCount: _.size(this.props.bingAccountList),\r\n items: this.props.bingAccountList,\r\n };\r\n\r\n this.enableArrowKeysSupport = true;\r\n this.ariaLabel = this.props.i18n.getString('GoogleImport_MultiAccount_GoogleAccountGrid_MicrosoftAdvertisingAccountList');\r\n }\r\n\r\n componentDidMount() {\r\n this.onFetch({ query: '', pageNumber: 0 });\r\n }\r\n\r\n onSelect = (selectedItem) => {\r\n this.setState({ selectedItem });\r\n this.props.updateSelection(selectedItem.Id);\r\n };\r\n\r\n onFetch = ({ query = '', pageNumber }) => {\r\n const filterItems = _.filter(this.props.bingAccountList, item => item && item.Name &&\r\n item.Name.toLowerCase().indexOf(query.toLowerCase()) !== -1);\r\n this.setState({\r\n items: filterItems.slice(pageNumber * PageSize, (pageNumber * PageSize) + PageSize),\r\n totalCount: filterItems.length,\r\n });\r\n }\r\n\r\n renderEmptyList = () => (\r\n
\r\n {this.props.i18n.getString('GoogleImport_SearchBingAccount_NoResult')}\r\n
\r\n )\r\n\r\n renderItem = item => (\r\n
\r\n {item.Name} (\r\n {item.Currency})\r\n
\r\n )\r\n\r\n render() {\r\n return (\r\n \r\n \r\n \r\n );\r\n }\r\n}\r\n","/* eslint-disable max-len */\r\nimport _ from 'underscore';\r\nimport $ from 'jquery';\r\nimport Backbone from 'backbone';\r\nimport React from 'react';\r\nimport ReactDOM from 'react-dom';\r\nimport { BingAccountDropDownMenu } from './bing-account-drop-down-menu';\r\n\r\nexport class BingAccountListDropDownView extends Backbone.View {\r\n initialize({\r\n i18n,\r\n bingAccountList,\r\n googleCustomerId,\r\n selectedBingAccountId,\r\n accountMap,\r\n eventName,\r\n }) {\r\n this.i18n = i18n;\r\n this.googleCustomerId = googleCustomerId;\r\n this.selectedBingAccountId = selectedBingAccountId;\r\n this.accountMap = accountMap;\r\n // eslint-disable-next-line new-cap\r\n this.dropDownMenu = new React.createRef();\r\n\r\n // For bing account which has already been selected for linking, will not show it in dropdown list\r\n const unavailableBingAccountIdList = _.without(_.pluck(accountMap(), 'BingAccountId'), selectedBingAccountId);\r\n this.bingAccountList = _.reject(bingAccountList, item => _.contains(unavailableBingAccountIdList, item.Id));\r\n this.eventName = eventName;\r\n\r\n this.key = this.googleCustomerId.toString();\r\n this.dropdownToggleString = `tr.row-selected[data-key=${this.key}] div.bing-account-selector button.dropdown-toggle`;\r\n this.dropdownToggleSelector = $(this.dropdownToggleString);\r\n }\r\n\r\n render(element) {\r\n // eslint-disable-next-line prefer-destructuring\r\n this.grandparentEle = $('.import-grid .ba-dropdown-list-popup')[0];\r\n this.parentEle = document.createElement('div');\r\n this.parentEle.className = 'dropdown-menu';\r\n this.grandparentEle.appendChild(this.parentEle);\r\n\r\n const {\r\n top, left, height, width,\r\n } = element.getBoundingClientRect();\r\n this.parentEle.style.top = `${(top + height).toString()}px`;\r\n this.parentEle.style.left = `${left.toString()}px`;\r\n this.parentEle.style.width = `${width.toString()}px`;\r\n this.dropdownToggleSelector[0].setAttribute('aria-expanded', 'true');\r\n\r\n ReactDOM.render(\r\n ,\r\n this.parentEle\r\n );\r\n }\r\n\r\n updateSelection = (selectedItemId) => {\r\n const updateBingAccountId = selectedItemId;\r\n\r\n const updatedAccountMap = _.reject(\r\n this.accountMap(),\r\n item => item.GoogleCustomerId === this.googleCustomerId || item.BingAccountId === updateBingAccountId\r\n );\r\n updatedAccountMap.push({ GoogleCustomerId: this.googleCustomerId, BingAccountId: updateBingAccountId });\r\n\r\n this.accountMap(updatedAccountMap);\r\n\r\n // update selected bing account name in dropdown toggle button\r\n const selectorString = `tr.row-selected[data-key=${this.key}] div.bing-account-selector button.dropdown-toggle span.truncated`;\r\n const bingAccountSelectionPlaceholder = $(selectorString);\r\n if (bingAccountSelectionPlaceholder.length) {\r\n const updateBingAccountName = _.findWhere(this.bingAccountList, { Id: updateBingAccountId }).Name;\r\n bingAccountSelectionPlaceholder[0].innerText = updateBingAccountName;\r\n this.dropdownToggleSelector[0].setAttribute('aria-label', updateBingAccountName);\r\n }\r\n this.remove();\r\n this.dropdownToggleSelector[0].setAttribute('aria-expanded', 'false');\r\n $(document).off(this.eventName);\r\n }\r\n\r\n remove() {\r\n if (this.parentEle) {\r\n this.parentEle.remove();\r\n this.parentEle = null;\r\n }\r\n }\r\n}\r\n","import _ from 'underscore';\r\nimport $ from 'jquery';\r\nimport Backbone from 'backbone';\r\nimport ko from 'knockout';\r\n\r\nimport projectionGrid from 'projection-grid';\r\nimport { a11yPlugin } from '@bingads-webui/projection-grid-a11y';\r\nimport { placeholderPlugin } from '@bingads-webui/projection-grid-placeholder';\r\nimport { assistedSelectionPlugin } from '@bingads-webui/projection-grid-assisted-selection';\r\nimport { uiBlockerPlugin } from '@bingads-webui/projection-grid-uiblocker';\r\nimport { generateFilterPlugin } from '@bingads-webui-campaign/google-import-page';\r\n\r\nimport template from './multi-google-account-grid-template.pug';\r\nimport { MultiGoogleAccountGridViewModel } from './multi-google-account-grid-viewmodel';\r\n\r\nimport { generateConfig } from './multi-google-account-grid-config';\r\n\r\nimport { BingAccountListDropDownView } from './bing-account-selection-col/bing-account-list-dropdown-view';\r\n\r\nexport class MultiGoogleAccountGridView extends Backbone.View {\r\n initialize({\r\n parentElement,\r\n googleAccountData,\r\n bingAccountData,\r\n i18n,\r\n initialAccountMap,\r\n }) {\r\n this.googleAccountData = googleAccountData;\r\n this.bingAccountData = bingAccountData;\r\n this.parentElement = parentElement;\r\n this.i18n = i18n;\r\n this.initialAccountMap = initialAccountMap;\r\n }\r\n\r\n isRowSelected = {\r\n get: key => !!_.findWhere(this.koModel.selectedAccount(), { CustomerId: key }),\r\n }\r\n\r\n selectedBingAccount = {\r\n get: (key) => {\r\n const accountPair = _.findWhere(this.koModel.accountMap(), { GoogleCustomerId: key });\r\n return accountPair ? accountPair.BingAccountId : undefined;\r\n },\r\n }\r\n\r\n events() {\r\n return {\r\n 'click .dropdown-toggle': 'dropDownBingAccountList',\r\n };\r\n }\r\n\r\n dropDownBingAccountList(event) {\r\n event.stopPropagation();\r\n\r\n const googleCustomerId = parseInt($(event.target).closest('tr')[0].getAttribute('data-key'), 10);\r\n const accountPair = _.findWhere(\r\n this.koModel.accountMap(),\r\n { GoogleCustomerId: googleCustomerId }\r\n );\r\n const selectedBingAccountId = accountPair ? accountPair.BingAccountId : null;\r\n\r\n if (this.bingAccountListView) {\r\n this.bingAccountListView.remove();\r\n this.bingAccountListView = null;\r\n }\r\n\r\n const eventName = _.uniqueId('click.import.google.account.grid.bing.account.selection');\r\n this.bingAccountListView = new BingAccountListDropDownView({\r\n i18n: this.i18n,\r\n bingAccountList: this.bingAccountData,\r\n googleCustomerId,\r\n selectedBingAccountId,\r\n accountMap: this.koModel.accountMap,\r\n eventName,\r\n });\r\n this.bingAccountListView.render($(event.target).closest('.ba-dropdown-selector')[0]);\r\n let view = this.bingAccountListView;\r\n\r\n function hideDropDownList(e) {\r\n const key = googleCustomerId.toString();\r\n const dropdownToggleString = `tr.row-selected[data-key=${key}] div.bing-account-selector button.dropdown-toggle`;\r\n const dropdownToggleSelector = $(dropdownToggleString);\r\n\r\n if ($(e.target).hasClass('dropdown-menu')) {\r\n return false;\r\n }\r\n\r\n if ($(e.target).parents('.dropdown-menu').length) {\r\n return true;\r\n }\r\n\r\n $(document).off(eventName);\r\n if (view) {\r\n view.remove();\r\n view = null;\r\n }\r\n dropdownToggleSelector[0].setAttribute('aria-expanded', 'false');\r\n return false;\r\n }\r\n\r\n $(document).on(eventName, hideDropDownList);\r\n this.trigger('change:select');\r\n }\r\n\r\n render() {\r\n // eslint-disable-next-line max-len\r\n this.koModel = new MultiGoogleAccountGridViewModel();\r\n\r\n this.isRowSelected.koModel = this.koModel;\r\n this.selectedBingAccount.koModel = this.koModel;\r\n\r\n this.el.innerHTML = template({\r\n i18n: this.i18n,\r\n SelectedAcountMaxCount: this.koModel.SelectedAcountMaxCount,\r\n });\r\n ko.applyBindings(this.koModel, this.el);\r\n this.koModel.hasError.subscribe((value) => {\r\n this.trigger('change:error', value);\r\n });\r\n this.koModel.accountMap.subscribe(() => {\r\n this.trigger('change:select');\r\n });\r\n\r\n // this is to ensure grid container element is on DOM tree before rendering grid.\r\n this.parentElement.append(this.el);\r\n\r\n const config = generateConfig({\r\n i18n: this.i18n,\r\n isRowSelected: this.isRowSelected,\r\n selectedBingAccount: this.selectedBingAccount,\r\n bingAccountData: this.bingAccountData,\r\n isDropdownMenuExpanded: this.koModel.isDropdownMenuExpanded,\r\n });\r\n\r\n config.dataSource.data = _.sortBy(\r\n this.googleAccountData,\r\n obj => (obj.AccountName ? obj.AccountName.toString().toLowerCase() : '')\r\n );\r\n this.grid = projectionGrid\r\n .factory({ vnext: true })\r\n .use(a11yPlugin)\r\n .use(placeholderPlugin)\r\n .use(generateFilterPlugin({\r\n i18n: this.i18n,\r\n }))\r\n .use(assistedSelectionPlugin)\r\n .use(uiBlockerPlugin)\r\n .create(config);\r\n\r\n this.gridView = this.grid.gridView;\r\n this.gridView.render();\r\n this.grid.memoryFilter.render();\r\n\r\n this.gridView.on('willUpdate', (changes) => {\r\n $(config.el).addClass('fixed-height');\r\n // only update koModel if the change is a selection/deselection rather than a query\r\n if (changes && changes.selection) {\r\n const selectedItems = _.filter(\r\n _.union(this.gridView.itemArray, this.koModel.selectedAccount()),\r\n item => _.contains(changes.selection.selected, item.CustomerId.toString())\r\n );\r\n this.koModel.selectedAccount(selectedItems);\r\n this.koModel.accountMap(_.filter(\r\n this.koModel.accountMap(),\r\n item => _.contains(_.pluck(selectedItems, 'CustomerId'), item.GoogleCustomerId)\r\n ));\r\n }\r\n }, this);\r\n\r\n this.gridView.on('didUpdate', () => {\r\n $(config.el).removeClass('fixed-height');\r\n this.koModel.selectedAccountsHasCampaigns(true); // clean up error message\r\n this.trigger('change:select');\r\n }, this);\r\n\r\n this.gridView.once('didUpdate', () => {\r\n // render initial selection for edit schedule import scenario\r\n let initialSelectedAccount = [];\r\n if (_.size(this.initialAccountMap)) {\r\n initialSelectedAccount = _.filter(this.googleAccountData, item => _.contains(_.pluck(this.initialAccountMap, 'GoogleCustomerId'), item.CustomerId));\r\n this.koModel.selectedAccount(initialSelectedAccount);\r\n this.koModel.accountMap(this.initialAccountMap);\r\n }\r\n initialSelectedAccount.forEach(item => this.gridView.selectRow(item.CustomerId));\r\n }, this);\r\n\r\n return this;\r\n }\r\n\r\n isValid() {\r\n return !this.koModel.hasError();\r\n }\r\n\r\n remove() {\r\n if (this.grid) {\r\n this.grid.memoryFilter.remove();\r\n this.gridView.remove();\r\n }\r\n\r\n return super.remove();\r\n }\r\n\r\n validateSelectedAccountsHasCampaigns(googleCampaignsForSelectedAccounts) {\r\n let isValid = true;\r\n const invalidCustomerNameList = [];\r\n googleCampaignsForSelectedAccounts.forEach((item) => {\r\n if (!_.size(item.googleCampaigns)) {\r\n isValid = false;\r\n const invalidCustomerName = _.findWhere(\r\n this.koModel.selectedAccount(),\r\n { CustomerId: item.googleCustomerId }\r\n ).AccountName;\r\n invalidCustomerNameList.push(invalidCustomerName);\r\n }\r\n });\r\n this.koModel.hasNoCampaignsCustomerNameList(`${invalidCustomerNameList.join()}.`);\r\n this.koModel.selectedAccountsHasCampaigns(isValid);\r\n return isValid;\r\n }\r\n}\r\n","\r\nimport _ from 'underscore';\r\nimport $ from 'jquery';\r\n\r\nimport BingAccountSelectionColTemplate from './bing-account-selection-col/bing-account-selection-col-template.pug';\r\n\r\nexport function generateConfig({\r\n i18n,\r\n isRowSelected,\r\n selectedBingAccount,\r\n bingAccountData,\r\n isDropdownMenuExpanded,\r\n}) {\r\n const columnsConfig = _.compact([{\r\n name: 'AccountName',\r\n title: i18n.get('GoogleImport_SelectAccount_AccountName'),\r\n sortable: (item) => {\r\n const accountName = item.AccountName;\r\n return accountName ? accountName.toString().toLowerCase() : '';\r\n },\r\n bodyClasses: 'truncated',\r\n }, {\r\n name: 'CustomerId',\r\n title: i18n.get('GoogleImport_SelectAccount_CustomerId'),\r\n }, {\r\n name: 'Currency',\r\n title: i18n.get('GoogleImport_SelectAccount_CurrencyName'),\r\n bodyClasses: 'truncated',\r\n }, {\r\n name: 'bingAccountList',\r\n field: 'CustomerId',\r\n property: 'CustomerId',\r\n helpId: 'pop_BA_Import_Acct_MAA_Name',\r\n html: `${i18n.get('GoogleImport_MultiAccountImport_BingAccountCurrencyName')}`,\r\n template: (local) => {\r\n const enableToggleButton = isRowSelected.get(local.value);\r\n const selectedBingAccountId = selectedBingAccount.get(local.value);\r\n const selectedBingAccountName = selectedBingAccountId ?\r\n _.findWhere(bingAccountData, { Id: selectedBingAccountId }).Name :\r\n i18n.get('GoogleImport_SelectMultiGoogleAccount_SelectBingAccountPlaceholder');\r\n return BingAccountSelectionColTemplate({\r\n enableToggleButton,\r\n selectedBingAccountName,\r\n isDropdownMenuExpanded,\r\n });\r\n },\r\n }]);\r\n\r\n const plugins = {\r\n a11y: { i18n },\r\n filter: {\r\n search: {\r\n container: '.import-grid .grid-filter-container',\r\n property: 'AccountName',\r\n title: i18n.get('Search_AdWordsAccountName'),\r\n },\r\n },\r\n placeholder: {\r\n container: '.import-grid .grid-noresult',\r\n text: i18n.get('GoogleImport_SelectAccount_NoAccounts'),\r\n },\r\n uiBlocker: {\r\n el: $('.import-grid'),\r\n },\r\n };\r\n\r\n return {\r\n el: '.import-grid .grid-table',\r\n dataSource: {\r\n type: 'memory',\r\n data: null,\r\n primaryKey: 'CustomerId',\r\n },\r\n\r\n selection: {\r\n single: false,\r\n bodyClasses: 'text-center',\r\n headClasses: 'text-center',\r\n },\r\n\r\n scrolling: {\r\n virtualized: true,\r\n header: 'fixed',\r\n },\r\n\r\n columns: columnsConfig,\r\n tableClasses: ['table', 'table-bordered'],\r\n plugins,\r\n };\r\n}\r\n","import _ from 'underscore';\r\nimport Promise from 'bluebird';\r\n\r\nimport { BaseImportStep, ImportSource } from '@bingads-webui-campaign/import-components';\r\nimport { CurrencyConversionView } from '@bingads-webui-campaign/google-import-page';\r\nimport { withUiBlock } from '@bingads-webui/uiblocker';\r\n\r\nimport template from './multi-account-google-account-step.pug';\r\nimport { MultiGoogleAccountGridView } from './grid/index';\r\n\r\nexport class MultiAccountGoogleAccountStep extends BaseImportStep {\r\n initialize({\r\n deps,\r\n }) {\r\n super.initialize({\r\n deps,\r\n });\r\n this.isContinueButtonEnabled = false;\r\n }\r\n\r\n get title() {\r\n return this.buildTitle({\r\n activeTitle: this.i18n.get('GoogleImport_MultiAccount_SelectAccount_Title'),\r\n summaryTitle: this.i18n.get('GoogleImport_SelectAccount_Summary'),\r\n });\r\n }\r\n\r\n getSelectedAccountName() {\r\n return this.grid && _.propertyOf(this.grid.getSelectedItem())('AccountName');\r\n }\r\n\r\n willShow() {\r\n if (this.checkIfShouldUpdateAndResetFlagIfTrue()) {\r\n this.deps.logActivities.renderSelectAdWordsAccount.start();\r\n\r\n const state = this.getState();\r\n const {\r\n googleAccount, bingAccount, initialSettings, isEditingScheduledImport,\r\n } = state;\r\n\r\n const hasNoData = _.isEmpty(googleAccount);\r\n\r\n this.$el.html(template({\r\n hasNoData,\r\n i18n: this.i18n,\r\n }));\r\n\r\n const initialAccountMap = [];\r\n if (isEditingScheduledImport && initialSettings) {\r\n initialSettings.ImportTaskItemList.forEach((item) => {\r\n if (_.contains(_.pluck(bingAccount, 'Id'), item.AccountId)) {\r\n initialAccountMap.push({\r\n GoogleCustomerId: item.AdWordsImportContext.CustomerId,\r\n BingAccountId: item.AccountId,\r\n });\r\n }\r\n });\r\n }\r\n\r\n if (!hasNoData) {\r\n this.grid = new MultiGoogleAccountGridView({\r\n parentElement: this.$('.multi-google-account-grid'),\r\n googleAccountData: googleAccount,\r\n bingAccountData: bingAccount,\r\n i18n: this.i18n,\r\n initialAccountMap,\r\n });\r\n\r\n this.currencyConversionView = new CurrencyConversionView({\r\n parentElement: this.$('.currency-conversion-control'),\r\n // wrap i18n to use the shared CurrencyConversionView\r\n i18n: ImportSource.google(this.i18n).i18n,\r\n importSourceAccountCurrency: '',\r\n bingAccountCurrency: '',\r\n isSingleAccountMode: false,\r\n });\r\n this.currencyConversionView.on('change:convert', () => {\r\n this.isEdited = true;\r\n });\r\n this.currencyConversionView.render();\r\n\r\n this.grid.on('change:error', (hasError) => {\r\n this.isContinueButtonEnabled = !hasError;\r\n this.trigger('change:action');\r\n });\r\n this.grid.on('change:select', () => {\r\n this.isEdited = true;\r\n this.currencyConversionView.koModel.importSourceAccountCurrency('');\r\n this.currencyConversionView.koModel.bingAccountCurrency('');\r\n this.grid.koModel.accountMap().forEach((item) => {\r\n const googleCurrency = _.findWhere(\r\n this.grid.googleAccountData,\r\n { CustomerId: item.GoogleCustomerId }\r\n ).Currency;\r\n const bingCurrency = _.findWhere(\r\n this.grid.bingAccountData,\r\n { Id: item.BingAccountId }\r\n ).Currency;\r\n if (googleCurrency !== bingCurrency) {\r\n this.currencyConversionView.koModel.importSourceAccountCurrency(googleCurrency);\r\n this.currencyConversionView.koModel.bingAccountCurrency(bingCurrency);\r\n }\r\n });\r\n });\r\n this.grid.render();\r\n }\r\n this.logTrace('render google account step');\r\n this.deps.logActivities.renderSelectAdWordsAccount.stop();\r\n } else {\r\n this.logTrace('not edited, directly expand google account step');\r\n }\r\n }\r\n\r\n wizardShouldGoNext() {\r\n if (this.grid && this.grid.isValid()) {\r\n const promises = [];\r\n const selectedGoogleAccounts = this.grid.koModel.selectedAccount();\r\n const googleCampaignsForSelectedAccounts = [];\r\n selectedGoogleAccounts.forEach((item) => {\r\n promises.push(this.repository.getGoogleCampaigns(item.CustomerId)\r\n .then((googleCampaigns) => {\r\n googleCampaignsForSelectedAccounts.push({\r\n googleCustomerId: item.CustomerId,\r\n googleCampaigns,\r\n });\r\n }));\r\n });\r\n\r\n if (this.currencyConversionView) {\r\n this.patchState({\r\n autoCurrencyConversionEnabled: this.currencyConversionView.koModel.doConvert(),\r\n });\r\n }\r\n\r\n return Promise.all(promises)\r\n .then(() => {\r\n // validate again if all selected google accounts has campaigns\r\n if (!this.grid.validateSelectedAccountsHasCampaigns(googleCampaignsForSelectedAccounts)) {\r\n return false;\r\n }\r\n this.patchState({\r\n selectedGoogleAccounts,\r\n googleCampaignsForSelectedAccounts,\r\n selectedGoogleAccountToBingAccountMap: this.grid.koModel.accountMap(),\r\n loginCustomerId: selectedGoogleAccounts[0].LoginCustomerId,\r\n });\r\n return true;\r\n })\r\n .catch((err) => {\r\n this.handleErrorInImport(err);\r\n return false;\r\n })\r\n .finally(withUiBlock());\r\n }\r\n return false;\r\n }\r\n\r\n get actions() {\r\n const original = super.actions;\r\n\r\n original[0].enabled = this.isContinueButtonEnabled;\r\n return original;\r\n }\r\n\r\n remove() {\r\n if (this.grid) {\r\n this.grid.remove();\r\n this.grid = null;\r\n }\r\n\r\n if (this.currencyConversionView) {\r\n this.currencyConversionView.remove();\r\n this.currencyConversionView = null;\r\n }\r\n\r\n super.remove();\r\n }\r\n}\r\n","import _ from 'underscore';\r\nimport React from 'react';\r\nimport PropTypes from 'prop-types';\r\nimport { DropdownSelector } from '@bingads-webui-react/dropdown-selector';\r\n\r\nconst PageSize = 10;\r\nconst Mode = 'async';\r\n\r\nexport class GoogleAccountSelector extends React.PureComponent {\r\n static propTypes = {\r\n i18n: PropTypes.shape({\r\n getString: PropTypes.func.isRequired,\r\n }).isRequired,\r\n googleAccountList: PropTypes.arrayOf(PropTypes.shape({\r\n Id: PropTypes.number,\r\n Name: PropTypes.string,\r\n })).isRequired,\r\n switchGoogleAccount: PropTypes.func.isRequired,\r\n };\r\n\r\n constructor(props) {\r\n super(props);\r\n\r\n this.state = {\r\n selectedItem: this.props.googleAccountList[0],\r\n totalCount: this.props.googleAccountList && this.props.googleAccountList.length,\r\n items: this.props.googleAccountList,\r\n };\r\n\r\n this.enableArrowKeysSupport = true;\r\n this.dropdownMenuAriaLabel = this.props.i18n.getString('GoogleImport_MultiAccount_SelectCampaign_SelectedGoogleAdsAccountList');\r\n }\r\n\r\n onSelect = (selectedItem) => {\r\n this.setState({ selectedItem });\r\n this.props.switchGoogleAccount(selectedItem);\r\n };\r\n\r\n onFetch = ({ query = '', pageNumber }) => {\r\n const filterItems = _.filter(this.props.googleAccountList, item => item && item.Name &&\r\n item.Name.toString().toLowerCase().indexOf(query.toLowerCase()) !== -1);\r\n this.setState({\r\n items: filterItems.slice(pageNumber * PageSize, (pageNumber * PageSize) + PageSize),\r\n totalCount: filterItems.length,\r\n });\r\n }\r\n\r\n render() {\r\n return (\r\n (\r\n
\r\n {item.Name}\r\n
\r\n )}\r\n renderSelectedItem={item => {item.Name}}\r\n enableArrowKeysSupport={this.enableArrowKeysSupport}\r\n dropdownMenuAriaLabel={this.dropdownMenuAriaLabel}\r\n />\r\n );\r\n }\r\n}\r\n","import _ from 'underscore';\r\nimport ko from 'knockout';\r\nimport { cloneDeep } from '@bingads-webui/primitive-utilities';\r\n\r\nexport class MultiAccountGoogleCampaignGridViewModel {\r\n constructor(\r\n editGoogleCampaignSelection,\r\n googleAccountList,\r\n googleCampaignList\r\n ) {\r\n this.selectedGoogleCustomerId = ko.observable(googleAccountList[0].Id);\r\n this.selectedGoogleAccountFullCampaignList = ko.computed(() => cloneDeep(_.where(\r\n googleCampaignList,\r\n { googleCustomerId: this.selectedGoogleCustomerId() }\r\n )[0].googleCampaigns));\r\n\r\n\r\n const initCampaignSelection = [];\r\n googleAccountList.forEach((item) => {\r\n let itemCampaignIds = [];\r\n if (_.size(editGoogleCampaignSelection)) {\r\n const editItem = _.findWhere(editGoogleCampaignSelection, { googleCustomerId: item.Id });\r\n if (editItem) {\r\n itemCampaignIds = editItem.selectedCampaignIds;\r\n }\r\n }\r\n initCampaignSelection.push({\r\n googleCustomerId: item.Id,\r\n selectedCampaignIds: itemCampaignIds,\r\n });\r\n });\r\n\r\n this.multiAccountsCampaignSelectionInfo = ko.observableArray(initCampaignSelection);\r\n }\r\n}\r\n","import _ from 'underscore';\r\nimport $ from 'jquery';\r\nimport Backbone from 'backbone';\r\nimport ko from 'knockout';\r\nimport React from 'react';\r\nimport ReactDOM from 'react-dom';\r\n\r\nimport { createGoogleCampaignGridView } from '@bingads-webui-campaign/google-import-page';\r\n\r\nimport { GoogleAccountSelector } from './google-account-selector';\r\nimport template from './multi-account-google-campaign-grid-template.pug';\r\nimport { MultiAccountGoogleCampaignGridViewModel } from './multi-account-google-campaign-grid-viewmodel';\r\n\r\nexport class MultiAccountGoogleCampaignGridView extends Backbone.View {\r\n initialize({\r\n parentElement,\r\n googleAccountList,\r\n googleCampaignList,\r\n i18n,\r\n appConfig,\r\n repo,\r\n editGoogleCampaignSelection,\r\n }) {\r\n this.googleAccountList = googleAccountList;\r\n this.googleCampaignList = googleCampaignList;\r\n this.parentElement = parentElement;\r\n this.i18n = i18n;\r\n this.appConfig = appConfig;\r\n this.repo = repo;\r\n this.editGoogleCampaignSelection = editGoogleCampaignSelection;\r\n this.showPaused = false;\r\n this.koModel = new MultiAccountGoogleCampaignGridViewModel(\r\n editGoogleCampaignSelection,\r\n googleAccountList,\r\n googleCampaignList\r\n );\r\n }\r\n\r\n render() {\r\n this.el.innerHTML = template({\r\n i18n: this.i18n,\r\n });\r\n ko.applyBindings(this.koModel, this.el);\r\n\r\n // this is to ensure grid container element is on DOM tree before rendering grid.\r\n this.parentElement.append(this.el);\r\n\r\n this.renderGoogleAccountSelector();\r\n\r\n this.renderSingleAccountCampaignGridView();\r\n\r\n this.applyInitialSelection(this.koModel.selectedGoogleCustomerId());\r\n }\r\n\r\n renderGoogleAccountSelector() {\r\n const googleAccountSelectorProps = {\r\n i18n: this.i18n,\r\n googleAccountList: this.googleAccountList,\r\n switchGoogleAccount: this.switchGoogleAccount.bind(this),\r\n };\r\n const googleAccountSelectorElement = React.createElement(\r\n GoogleAccountSelector,\r\n googleAccountSelectorProps\r\n );\r\n\r\n ReactDOM.render(googleAccountSelectorElement, $('.google-account-selector')[0]);\r\n }\r\n\r\n renderSingleAccountCampaignGridView() {\r\n this.singleAccountView = createGoogleCampaignGridView({\r\n data: this.koModel.selectedGoogleAccountFullCampaignList(),\r\n showPaused: this.showPaused,\r\n i18n: this.i18n,\r\n appConfig: this.appConfig,\r\n repo: this.repo,\r\n multiAccountMode: true,\r\n isAIMImportEnabled: this.appConfig.get('permissions').IsAIMCampaignEnabled,\r\n });\r\n\r\n // if campaign selection grid for current account has error,\r\n // disable google account dropdown selector\r\n this.singleAccountView.koModel.hasError.subscribe((newValue) => {\r\n this.trigger('change:error', newValue);\r\n if (newValue) {\r\n this.$('.google-account-selector .ba-dropdown-selector button.dropdown-toggle')[0].disabled = true;\r\n } else {\r\n this.$('.google-account-selector .ba-dropdown-selector button.dropdown-toggle')[0].disabled = false;\r\n }\r\n });\r\n\r\n this.$('.google-campaign-grid-for-single-account').html(this.singleAccountView.render().el);\r\n\r\n this.singleAccountView.on('change:select', () => {\r\n this.trigger('change:select');\r\n });\r\n }\r\n\r\n switchGoogleAccount(selectedItem) {\r\n if (selectedItem.Id === this.koModel.selectedGoogleCustomerId()) {\r\n return;\r\n }\r\n\r\n // reserve campaign selection info for the unselected account\r\n this.updateMultiAccountCampaignSelectionInfo();\r\n this.showPaused = this.singleAccountView.getCurrentSetting().showPaused;\r\n\r\n // re-render campaign selection grid according to the newly selected google account\r\n this.koModel.selectedGoogleCustomerId(selectedItem.Id);\r\n\r\n if (this.singleAccountView) {\r\n this.singleAccountView.remove();\r\n this.singleAccountView = null;\r\n }\r\n this.renderSingleAccountCampaignGridView();\r\n\r\n this.applyInitialSelection(selectedItem.Id);\r\n }\r\n\r\n applyInitialSelection(selectedGoogleCustomerId) {\r\n // update if import all and selected campaign according to reserved info\r\n const reservedInfoForSelectedAccount = _.where(\r\n this.koModel.multiAccountsCampaignSelectionInfo(),\r\n { googleCustomerId: selectedGoogleCustomerId }\r\n );\r\n if (_.size(reservedInfoForSelectedAccount)) {\r\n if (!_.size(reservedInfoForSelectedAccount[0].selectedCampaignIds)) {\r\n // if selectedCampaignIds is empty[], it means importAll\r\n this.singleAccountView.koModel.importAll(true);\r\n } else {\r\n // eslint-disable-next-line max-len\r\n this.singleAccountView.selectCampaigns(reservedInfoForSelectedAccount[0].selectedCampaignIds);\r\n }\r\n }\r\n }\r\n\r\n updateMultiAccountCampaignSelectionInfo() {\r\n const selectedCustomerId = this.koModel.selectedGoogleCustomerId();\r\n const updatedMultiAccountsCampaignSelectionInfo = _.reject(\r\n this.koModel.multiAccountsCampaignSelectionInfo(),\r\n item => item.googleCustomerId === selectedCustomerId\r\n );\r\n updatedMultiAccountsCampaignSelectionInfo.push({\r\n googleCustomerId: selectedCustomerId,\r\n selectedCampaignIds: this.singleAccountView.koModel.importAll() ?\r\n [] :\r\n _.pluck(this.singleAccountView.koModel.selectedCampaigns(), 'Id'),\r\n });\r\n this.koModel.multiAccountsCampaignSelectionInfo(updatedMultiAccountsCampaignSelectionInfo);\r\n }\r\n\r\n areAnyPausedCampaignsSelected() {\r\n let result = false;\r\n this.koModel.multiAccountsCampaignSelectionInfo().forEach((item) => {\r\n const allCampaigns = _.where(\r\n this.googleCampaignList,\r\n { googleCustomerId: item.googleCustomerId }\r\n )[0].googleCampaigns;\r\n\r\n if (_.size(item.selectedCampaignId)) {\r\n item.selectedCampaignId.forEach((campaignId) => {\r\n const selectedCampaign = _.where(allCampaigns, { Id: campaignId });\r\n if (_.size(selectedCampaign) && selectedCampaign[0].Status === 'Paused') {\r\n result = true;\r\n }\r\n });\r\n }\r\n });\r\n return result;\r\n }\r\n\r\n\r\n remove() {\r\n if (this.singleAccountView) {\r\n this.singleAccountView.remove();\r\n this.singleAccountView = null;\r\n }\r\n return super.remove();\r\n }\r\n}\r\n\r\n","import _ from 'underscore';\r\nimport { BaseImportStep } from '@bingads-webui-campaign/import-components';\r\nimport { withUiBlock } from '@bingads-webui/uiblocker';\r\n\r\nimport template from './multi-account-google-campaign-step.pug';\r\nimport { MultiAccountGoogleCampaignGridView } from './grid/index';\r\n\r\nexport class MultiAccountGoogleCampaignStep extends BaseImportStep {\r\n initialize({\r\n deps,\r\n }) {\r\n super.initialize({\r\n deps,\r\n });\r\n this.isContinueButtonEnabled = true;\r\n this.generateImportUserPreferencesFromPreviousOptions =\r\n deps.generateImportUserPreferencesFromPreviousOptions;\r\n this.config = deps.config;\r\n this.deps = deps;\r\n this.permissions = this.config.get('Permissions') || {};\r\n }\r\n\r\n render() {\r\n this.$el.html(template({\r\n i18n: this.i18n,\r\n }));\r\n return this;\r\n }\r\n\r\n get title() {\r\n return this.buildTitle({\r\n activeTitle: this.i18n.get('GoogleImport_SelectCampaign_Title'),\r\n summaryTitle: this.i18n.get('GoogleImport_SelectCampaign_Summary'),\r\n });\r\n }\r\n\r\n willShow() {\r\n if (this.checkIfShouldUpdateAndResetFlagIfTrue()) {\r\n this.isContinueButtonEnabled = true;\r\n this.deps.logActivities.renderSelectAdWordsCampaigns.start();\r\n const state = this.getState() || {};\r\n const {\r\n selectedGoogleAccounts, googleCampaignsForSelectedAccounts, initialSettings,\r\n isEditingScheduledImport,\r\n } = state;\r\n this.isEditingScheduledImport = isEditingScheduledImport;\r\n\r\n const editGoogleCampaignSelection = [];\r\n if (isEditingScheduledImport && initialSettings) {\r\n initialSettings.ImportTaskItemList.forEach((item) => {\r\n const itemCustomerId = item.AdWordsImportContext && item.AdWordsImportContext.CustomerId;\r\n if (itemCustomerId && _.contains(_.pluck(selectedGoogleAccounts, 'CustomerId'), itemCustomerId)) {\r\n editGoogleCampaignSelection.push({\r\n googleCustomerId: itemCustomerId,\r\n selectedCampaignIds: item.AdWordsImportContext.CampaignIds,\r\n });\r\n }\r\n });\r\n }\r\n\r\n const googleAccountList = [];\r\n selectedGoogleAccounts.forEach((item) => {\r\n googleAccountList.push({\r\n Id: item.CustomerId,\r\n Name: item.AccountName || item.CustomerId,\r\n });\r\n });\r\n\r\n if (this.view) {\r\n this.view.remove();\r\n this.view = null;\r\n }\r\n\r\n this.view = new MultiAccountGoogleCampaignGridView({\r\n parentElement: this.$('.multi-google-campaign-grid'),\r\n googleAccountList,\r\n googleCampaignList: googleCampaignsForSelectedAccounts,\r\n i18n: this.i18n,\r\n appConfig: this.config,\r\n repo: this.repository,\r\n editGoogleCampaignSelection,\r\n });\r\n\r\n // initialize events\r\n this.view.on('change:error', (hasError) => {\r\n this.isContinueButtonEnabled = !hasError;\r\n this.trigger('change:action');\r\n });\r\n\r\n this.view.on('change:select', () => {\r\n this.isEdited = true;\r\n });\r\n\r\n this.view.render();\r\n\r\n this.logTrace('render google campaign step');\r\n this.deps.logActivities.renderSelectAdWordsCampaigns.stop();\r\n } else {\r\n this.logTrace('not edited, directly expand google campaign step');\r\n }\r\n }\r\n\r\n get actions() {\r\n const original = super.actions;\r\n\r\n original[0].enabled = this.isContinueButtonEnabled;\r\n original[0].htmlAttributes['data-analyticsid'] = 'omniture-google-import-choose-campaigns';\r\n return original;\r\n }\r\n\r\n wizardShouldGoNext() {\r\n this.view.updateMultiAccountCampaignSelectionInfo();\r\n this.patchState({\r\n selectedCampaignIds: this.view.koModel.multiAccountsCampaignSelectionInfo(),\r\n googleCampaignsSummary: this.getSummaryInfo(),\r\n includePausedCampaigns: this.view.areAnyPausedCampaignsSelected()\r\n && !this.isEditingScheduledImport,\r\n });\r\n\r\n // log campaign selection per account\r\n const selection = [];\r\n _.each(this.state.googleCampaignsForSelectedAccounts, (account) => {\r\n const selected = _.find(\r\n this.state.selectedCampaignIds,\r\n campaigns => campaigns.googleCustomerId === account.googleCustomerId\r\n );\r\n if (selected) {\r\n const allSelected = selected.selectedCampaignIds.length === 0;\r\n const userCampaignSelection = {\r\n selection: allSelected ? 'all' : 'selected',\r\n totalCampaigns: account.googleCampaigns.length,\r\n selectedCampaigns: (allSelected && account.googleCampaigns.length)\r\n || selected.selectedCampaignIds.length,\r\n };\r\n selection.push(userCampaignSelection);\r\n }\r\n });\r\n // payload looks like\r\n // [\r\n // {\r\n // selection: all/selectedGoogleAccounts,\r\n // totalCampaigns: x,\r\n // selectedCampaigns: y,\r\n // }\r\n // ]\r\n this.logTrace({ CampaignSelection: selection });\r\n\r\n const state = this.getState() || {};\r\n const { selectedGoogleAccounts } = state;\r\n const googleCustomerList = _.indexBy(selectedGoogleAccounts, 'CustomerId');\r\n\r\n return this.repository.getMultiAccountGoogleImportUserPreferences(googleCustomerList)\r\n .then((preferences) => {\r\n if (preferences) {\r\n this.patchState({\r\n previousImportOptions: preferences,\r\n });\r\n return true;\r\n }\r\n return this.deps.onCredentialsError();\r\n })\r\n .catch((err) => { //eslint-disable-line\r\n this.handleGenericError(err);\r\n return false;\r\n })\r\n .finally(withUiBlock());\r\n }\r\n\r\n getCurrentSetting() {\r\n return this.grid && this.grid.getCurrentSetting();\r\n }\r\n\r\n remove() {\r\n if (this.view) {\r\n this.view.remove();\r\n this.view = null;\r\n }\r\n\r\n super.remove();\r\n }\r\n}\r\n","import Promise from 'bluebird';\r\nimport _ from 'underscore';\r\n\r\nimport { ScheduleImportStep } from '@bingads-webui-campaign/google-import-page';\r\n\r\nexport class MultiAccountScheduleImportStep extends ScheduleImportStep {\r\n initialize({\r\n deps,\r\n }) {\r\n super.initialize({\r\n deps,\r\n });\r\n this.IsMultiAccountImport = true;\r\n }\r\n\r\n createImportRunNowWithScheduledAndGoNextWhenReady(state) {\r\n this.logTrace('multiaccount run now feature used');\r\n\r\n const taskItemBody = this.scheduleFormView.serializeImportSchedulingOptions();\r\n if (taskItemBody) {\r\n taskItemBody.scheduledTaskItemBody = _.extend(taskItemBody.scheduledTaskItemBody, {\r\n importUserPreferences: state.importUserPreferences,\r\n });\r\n\r\n taskItemBody.runNowTaskItemBody = _.extend(taskItemBody.runNowTaskItemBody, {\r\n importUserPreferences: state.importUserPreferences,\r\n });\r\n return this.repository.prepareMultiAccountGoogleImportTaskItem({\r\n importOptions: taskItemBody.scheduledTaskItemBody,\r\n stepState: state,\r\n }).then(scheduleBody => (\r\n this.createScheduledImportAndGoNextWhenReady(scheduleBody, state)\r\n )).then(() => {\r\n this.patchState({\r\n isScheduledImport: false,\r\n });\r\n return this.repository.prepareMultiAccountGoogleImportTaskItem({\r\n importOptions: taskItemBody.runNowTaskItemBody,\r\n stepState: state,\r\n });\r\n }).then(runNowBody => (\r\n this.createRunNowImportAndGoNextWhenReady(runNowBody) // eslint-disable-line\r\n ));\r\n }\r\n return Promise.resolve(false);\r\n }\r\n\r\n createImportAndGoNextWhenReady(state) {\r\n this.logTrace({\r\n ImportUserSettings: {\r\n ScheduleFrequency: this.scheduleFormView.viewModel.chosenFrequency().value,\r\n ImportOptions: state.importUserPreferences,\r\n },\r\n });\r\n let taskItemBody = this.scheduleFormView.serializeImportSchedulingOptions();\r\n\r\n if (taskItemBody) {\r\n taskItemBody = _.extend(taskItemBody, {\r\n importUserPreferences: state.importUserPreferences,\r\n });\r\n\r\n return this.repository.prepareMultiAccountGoogleImportTaskItem({\r\n importOptions: taskItemBody,\r\n stepState: state,\r\n })\r\n .then((finalBody) => {\r\n if (this.scheduleFormView.isScheduledImport()) {\r\n return this.createScheduledImportAndGoNextWhenReady(finalBody, state);\r\n }\r\n\r\n return this.createRunNowImportAndGoNextWhenReady(finalBody);\r\n });\r\n }\r\n\r\n this.logTrace('No taskItemBody returned from scheduleFormView.serializeImportSchedulingOptions');\r\n return Promise.resolve(false);\r\n }\r\n\r\n createScheduledImportAndGoNextWhenReady(taskItemBody, state) {\r\n let taskItemPromise;\r\n this.patchState({\r\n isScheduledImport: true,\r\n scheduledTimeDisplayString: this.scheduleFormView.getDisplayString(),\r\n });\r\n\r\n if (state.isEditingScheduledImport) {\r\n taskItemPromise = this.repository.updateScheduledImportTaskItem(\r\n taskItemBody,\r\n state.initialSettings.taskItemId\r\n );\r\n } else {\r\n taskItemPromise = this.repository.createScheduledImportTaskItem(taskItemBody);\r\n }\r\n return taskItemPromise\r\n .then(() => {\r\n this.importButtonEnabled = false;\r\n this.trigger('change:action');\r\n return true;\r\n });\r\n }\r\n\r\n createRunNowImportAndGoNextWhenReady(taskItemBody) {\r\n const taskItemPromise = this.repository.createRunNowImportTaskItem(taskItemBody);\r\n return taskItemPromise.then(() => {\r\n this.importButtonEnabled = false;\r\n this.trigger('change:action');\r\n return true;\r\n });\r\n }\r\n}\r\n","import _ from 'underscore';\r\nimport { ImportSummaryStep, ImportSource } from '@bingads-webui-campaign/import-components';\r\n\r\nimport template from './multi-account-import-summary-template.pug';\r\n\r\nexport class MultiAccountImportSummaryStep extends ImportSummaryStep {\r\n initialize({ deps }) {\r\n super.initialize({ deps });\r\n this.permissions = deps.config.get('Permissions') || {};\r\n this.repo = deps.repository;\r\n }\r\n\r\n willShow() {\r\n const state = this.getState() || {};\r\n\r\n let summaryText;\r\n if (state.isScheduledImport) {\r\n summaryText = this.i18n.get('Scheduled_Import_Summary_Header').replace('{0}', state.scheduledTimeDisplayString);\r\n } else {\r\n summaryText = this.i18n.get('MultiAccountGoogleImport_RunNow_Import_Summary_Header');\r\n }\r\n\r\n this.$el.html(template({\r\n summaryText,\r\n i18n: ImportSource.google(this.i18n, this.repo).i18n,\r\n showAlert: this.showDisplayCampaignAlert(),\r\n }));\r\n\r\n this.logTrace('render multi account google import summary step');\r\n }\r\n\r\n get actions() {\r\n const state = this.getState() || {};\r\n return [{\r\n name: 'view-schedule-and-history',\r\n displayText: state.isScheduledImport ?\r\n this.i18n.get('Scheduled_Import_View_Schedule_Button') :\r\n this.i18n.get('MultiAccountGoogleImport_RunNow_Import_View_History_Button'),\r\n method: 'viewScheduleAndHistory',\r\n enabled: true,\r\n htmlAttributes: {\r\n class: 'btn btn-default',\r\n },\r\n }];\r\n }\r\n\r\n viewScheduleAndHistory() {\r\n this.repository.redirectToImportScheduleAndHistory();\r\n }\r\n\r\n getSelectedCampaigns() {\r\n const state = this.getState() || {};\r\n\r\n const { googleCampaignsForSelectedAccounts, selectedCampaignIds } = state;\r\n\r\n const tmp = _.indexBy(googleCampaignsForSelectedAccounts, 'googleCustomerId');\r\n\r\n let selectedCampaigns = [];\r\n\r\n _.each(selectedCampaignIds, (campaign) => {\r\n const googleCampaigns = _.result(_.result(tmp, campaign.googleCustomerId), 'googleCampaigns', []);\r\n if (_.size(campaign.selectedCampaignIds) === 0) {\r\n selectedCampaigns = selectedCampaigns.concat(googleCampaigns);\r\n } else {\r\n selectedCampaigns = selectedCampaigns.concat(_.filter(googleCampaigns, cm => _.result(campaign, 'selectedCampaignIds', []).includes(cm.Id)));\r\n }\r\n });\r\n\r\n return selectedCampaigns;\r\n }\r\n\r\n showDisplayCampaignAlert = () => {\r\n if (!this.permissions.IsAIMCampaignEnabled) {\r\n return false;\r\n }\r\n\r\n return this.repo.containDisplayType(this.getSelectedCampaigns());\r\n };\r\n}\r\n","import _ from 'underscore';\r\n\r\nimport {\r\n GoogleLoginStep,\r\n GoogleImportOptionsStep,\r\n} from '@bingads-webui-campaign/google-import-page';\r\n\r\nimport {\r\n MultiAccountGoogleAccountStep,\r\n MultiAccountGoogleCampaignStep,\r\n MultiAccountScheduleImportStep,\r\n MultiAccountImportSummaryStep,\r\n BingAccountTitleStep,\r\n} from '../step/index';\r\n\r\nfunction createBingAccountTitleStep(deps) {\r\n return {\r\n stepName: 'bing-account-title-step',\r\n stepView: new BingAccountTitleStep({\r\n deps: _.defaults({\r\n linkTextForTitle: deps.i18n.get('GoogleImport_MultiAccount_StepSummary_ViewDetails'),\r\n }, deps),\r\n }),\r\n };\r\n}\r\n\r\nfunction createGoogleLoginStep(deps) {\r\n return {\r\n stepName: 'google-login-step',\r\n stepView: new GoogleLoginStep({\r\n deps: _.defaults({\r\n previousStepName: 'bing-account-title-step',\r\n linkTextForTitle: deps.i18n.get('GoogleImport_Logout_Title'),\r\n }, deps),\r\n singleAccountMode: false,\r\n }),\r\n };\r\n}\r\n\r\nfunction createGoogleAccountStep(deps) {\r\n return {\r\n stepName: 'google-account-step',\r\n stepView: new MultiAccountGoogleAccountStep({\r\n deps: _.defaults({\r\n previousStepName: 'google-login-step',\r\n linkTextForTitle: deps.i18n.get('GoogleImport_MultiAccount_StepSummary_ViewDetails'),\r\n }, deps),\r\n }),\r\n };\r\n}\r\n\r\nfunction createGoogleCampaignStep(deps) {\r\n return {\r\n stepName: 'google-campaign-step',\r\n stepView: new MultiAccountGoogleCampaignStep({\r\n deps: _.defaults({\r\n previousStepName: 'google-account-step',\r\n linkTextForTitle: deps.i18n.get('GoogleImport_MultiAccount_StepSummary_ViewDetails'),\r\n }, deps),\r\n }),\r\n };\r\n}\r\n\r\nfunction createImportOptionsStep(deps) {\r\n return {\r\n stepName: 'import-options-step',\r\n stepView: new GoogleImportOptionsStep({\r\n deps: _.defaults({\r\n previousStepName: 'google-campaign-step',\r\n isCustomerLevel: true,\r\n }, deps),\r\n }),\r\n };\r\n}\r\n\r\nfunction createScheduleImportStep(deps) {\r\n return {\r\n stepName: 'schedule-import-step',\r\n stepView: new MultiAccountScheduleImportStep({\r\n deps: _.defaults({ previousStepName: 'import-options-step' }, deps),\r\n }),\r\n };\r\n}\r\n\r\nfunction createImportSummaryStep(deps) {\r\n return {\r\n stepName: 'import-summary-step',\r\n stepView: new MultiAccountImportSummaryStep({ deps }),\r\n };\r\n}\r\n\r\nexport class MultiAccountGoogleImportStepFactory {\r\n static createSteps(deps) {\r\n deps.check();\r\n const steps = [];\r\n\r\n steps.push(createBingAccountTitleStep(deps));\r\n steps.push(createGoogleLoginStep(deps));\r\n steps.push(createGoogleAccountStep(deps));\r\n steps.push(createGoogleCampaignStep(deps));\r\n steps.push(createImportOptionsStep(deps));\r\n steps.push(createScheduleImportStep(deps));\r\n steps.push(createImportSummaryStep(deps));\r\n\r\n return steps;\r\n }\r\n}\r\n","import Backbone from 'backbone';\r\nimport Promise from 'bluebird';\r\nimport _ from 'underscore';\r\nimport $ from 'jquery';\r\n\r\nimport { PopoverView, contents } from '@bingads-webui/popover';\r\nimport { BaseImportView, showPopoverTableView } from '@bingads-webui-campaign/import-components';\r\nimport { MultiAccountGoogleImportRepository } from '../repository/index';\r\nimport { MultiAccountGoogleImportStepFactory } from './multi-account-google-import-step-factory';\r\nimport BingAccountViewDetailsTempalte from '../step/bing-account-title/grid/view-details-pop-up-view.pug';\r\n\r\n// Common dependency checks should happen in base-import-view\r\nfunction checkRequiredDepsForGoogleImport(deps) {\r\n deps.check('edm');\r\n deps.check('jsData');\r\n deps.check('google');\r\n deps.check('timeZoneMapper');\r\n deps.check('uxMode');\r\n deps.check('cookieHelperForEditImport');\r\n deps.check('doubleListBox');\r\n deps.check('accountSelectionLists');\r\n}\r\n\r\nexport class MultiAccountGoogleImportPage extends Backbone.View {\r\n initialize({\r\n deps,\r\n options = {},\r\n }) {\r\n checkRequiredDepsForGoogleImport(deps);\r\n this.deps = deps;\r\n this.perfMarker = this.deps.perfMarker;\r\n this.options = _.extend({\r\n pageTitle: deps.i18n.get('GoogleImport_PageTitle'),\r\n subTitle: deps.i18n.get('GoogleImport_MultiAccount_PageDescription'),\r\n }, options);\r\n this.isGoogleAccountSkipped = false;\r\n this.googleImportRepository = new MultiAccountGoogleImportRepository({ deps });\r\n this.initialState = {};\r\n this.baseImportOptions = this.options;\r\n\r\n this.steps = MultiAccountGoogleImportStepFactory.createSteps(_.extend(deps, {\r\n repository: this.googleImportRepository,\r\n isContinueImport: !!options.importId,\r\n subFieldsBlacklist: options.subFieldsBlacklist,\r\n onCredentialsError: this.onCredentialsError.bind(this),\r\n }));\r\n this.baseImportOptions.showAllStepsInLastStepFunc = () => true;\r\n if (this.options.importId) {\r\n this.initialState.importId = options.importId;\r\n this.baseImportOptions.currentStep = 'schedule-import-step';\r\n }\r\n this.baseImportOptions.enableEdit = true;\r\n\r\n this.onSwitchFinished = () => {\r\n $('[data-step-name=\"google-login-step\"] .edit-step').hide();\r\n const $accountEdit = $('[data-step-name=\"google-account-step\"] .edit-step');\r\n\r\n if (this.isGoogleAccountSkipped) {\r\n $accountEdit.hide();\r\n } else {\r\n $accountEdit.show();\r\n }\r\n };\r\n this.onSwitchFinished.bind(this);\r\n }\r\n\r\n logTrace(...args) {\r\n this.googleImportRepository.logTrace(...args);\r\n }\r\n\r\n render() {\r\n this.perfMarker.willRender();\r\n let initBaseViewPromise = Promise.resolve([]);\r\n\r\n let initialStateFetchPromise = Promise.resolve([]);\r\n\r\n if (this.options.taskItemId) {\r\n this.logTrace('taskItemId is passed');\r\n\r\n initialStateFetchPromise =\r\n this.googleImportRepository.getImportTaskItem(this.options.taskItemId)\r\n .then((taskItem) => {\r\n // in this case, if user has signed in on import schedule page, update session Id\r\n const currentUserId = _.propertyOf(this.deps.config.get('CurrentUser'))('Id');\r\n\r\n if (taskItem.ModifiedBy.Id !== currentUserId) {\r\n this.logTrace('a different user is editing');\r\n const { cookieHelperForEditImport } = this.deps;\r\n const sessionId = cookieHelperForEditImport.getSessionId(this.options.taskItemId);\r\n\r\n cookieHelperForEditImport.deleteCookie();\r\n if (sessionId) {\r\n taskItem.SessionId = sessionId; // eslint-disable-line\r\n }\r\n }\r\n\r\n this.initialState.initialSettings = taskItem;\r\n this.initialState.initialSettings.taskItemId = this.options.taskItemId;\r\n this.initialState.isEditingScheduledImport = true;\r\n });\r\n }\r\n\r\n initBaseViewPromise = initialStateFetchPromise.then(() => {\r\n this.baseImportView = new BaseImportView({\r\n deps: this.deps,\r\n steps: this.steps,\r\n options: this.baseImportOptions,\r\n initialState: this.initialState,\r\n onSwitchFinished: this.onSwitchFinished,\r\n });\r\n });\r\n\r\n return initBaseViewPromise.then(() => (\r\n this.baseImportView.render()\r\n .then((baseImportView) => {\r\n this.$el.html(baseImportView.el);\r\n this.attachPageEventHandlers();\r\n this.perfMarker.done();\r\n return this;\r\n })\r\n ));\r\n }\r\n\r\n attachPageEventHandlers() {\r\n const googleLoginStepView = _.findWhere(this.steps, { stepName: 'google-login-step' }).stepView;\r\n const googleCampaignStepView = {}; // google-campaign-step\r\n\r\n this.baseImportView.on('click:step.header.link', (e) => {\r\n const stepName = $(e.target).closest('.step-header').attr('data-step-name');\r\n\r\n if (stepName === 'google-login-step') {\r\n this.logTrace('signout clicked. start to log out and go to google login step');\r\n googleLoginStepView.logoutGoogle();\r\n // preserve bing account selection data\r\n const previousState = this.baseImportView.currentStepInstance.getState();\r\n const { bingAccount } = previousState;\r\n this.baseImportView.currentStepInstance.setState({\r\n savedSetting: _.result(googleCampaignStepView, 'getCurrentSetting') || {},\r\n isEditEnabledForWizard: true, // !this.isSignUpMode,\r\n bingAccount,\r\n });\r\n\r\n if (!_.isEmpty(this.initialState)) {\r\n this.initialState.initialSettings.ImportTaskItemList = [];\r\n }\r\n this.baseImportView.currentStepInstance.patchState(this.initialState);\r\n this.baseImportView.goToStep(stepName);\r\n }\r\n\r\n if (stepName === 'bing-account-title-step') {\r\n const targetRect = e.target.getBoundingClientRect();\r\n new PopoverView({\r\n target: this.$(e.target),\r\n position: {\r\n isAbsolute: true,\r\n left: targetRect.left,\r\n top: targetRect.bottom,\r\n },\r\n containerClassName: ['BingAccountViewDetailsView'],\r\n }).setContent(new contents.TitledContent()\r\n .setTitle(this.deps.i18n.getString('GoogleImport_MicrosoftAdvertising_ViewDetail'))\r\n .setBody({\r\n html: BingAccountViewDetailsTempalte({\r\n i18n: this.deps.i18n,\r\n selectedAccounts: _.pluck(this.baseImportView.view.state.bingAccount, 'Name'),\r\n }),\r\n }));\r\n }\r\n\r\n if (stepName === 'google-account-step') {\r\n const data = [];\r\n this.baseImportView.view.state.selectedGoogleAccountToBingAccountMap.forEach((item) => {\r\n const tempGoogleCustomerName = _.findWhere(\r\n this.baseImportView.view.state.selectedGoogleAccounts,\r\n { CustomerId: item.GoogleCustomerId }\r\n ).AccountName;\r\n const tempBingAccountName = _.findWhere(\r\n this.baseImportView.view.state.bingAccount,\r\n { Id: item.BingAccountId }\r\n ).Name;\r\n data.push({\r\n AccountName: `${tempGoogleCustomerName} (${item.GoogleCustomerId})`,\r\n customizedContents: `${tempBingAccountName} (${item.BingAccountId})`,\r\n });\r\n });\r\n\r\n showPopoverTableView(\r\n e.target,\r\n ['StepSummaryDetailView'],\r\n this.deps.i18n.getString('GoogleImport_GoogleAdsAccounts_ViewDetail'),\r\n [{\r\n bodyClasses: 'AccountName',\r\n name: 'AccountName',\r\n title: this.deps.i18n.get('GoogleImport_MicrosoftAdvertising_GoogleAccounts'),\r\n }, {\r\n bodyClasses: 'customizedContents',\r\n name: 'customizedContents',\r\n title: this.deps.i18n.getString('GoogleImport_GoogleAdsAccounts_Microsoft_Advertising_Account'),\r\n }],\r\n data,\r\n this.deps.i18n\r\n );\r\n }\r\n\r\n if (stepName === 'google-campaign-step') {\r\n const data = [];\r\n this.baseImportView.view.state.selectedCampaignIds.forEach((item) => {\r\n const tempGoogleCustomerName = _.findWhere(\r\n this.baseImportView.view.state.selectedGoogleAccounts,\r\n { CustomerId: item.googleCustomerId }\r\n ).AccountName;\r\n data.push({\r\n AccountName: `${tempGoogleCustomerName} (${item.googleCustomerId})`,\r\n customizedContents: _.size(item.selectedCampaignIds) ?\r\n this.deps.i18n.getString('GoogleImport_GoogleAdsCampaigns_ViewDetail_SelectSpecific') :\r\n this.deps.i18n.getString('GoogleImport_GoogleAdsCampaigns_ViewDetail_SelectAll'),\r\n });\r\n });\r\n\r\n showPopoverTableView(\r\n e.target,\r\n ['StepSummaryDetailView'],\r\n this.deps.i18n.getString('GoogleImport_GoogleAdsCampaigns_ViewDetail'),\r\n [{\r\n bodyClasses: 'AccountName',\r\n name: 'AccountName',\r\n title: this.deps.i18n.get('GoogleImport_MicrosoftAdvertising_GoogleAccounts'),\r\n }, {\r\n bodyClasses: 'customizedContents',\r\n name: 'customizedContents',\r\n title: this.deps.i18n.getString('GoogleImport_GoogleAdsCampaigns_ViewDetail_ColumnName'),\r\n }],\r\n data,\r\n this.deps.i18n\r\n );\r\n }\r\n });\r\n\r\n googleLoginStepView.on('switch:step', () => {\r\n this.isGoogleAccountSkipped = false;\r\n this.baseImportView.steps[1].stepView.trigger('next');\r\n });\r\n }\r\n\r\n onCredentialsError() {\r\n this.logTrace('call onCredentialsError');\r\n\r\n const googleLoginStepView = _.findWhere(this.steps, { stepName: 'google-login-step' }).stepView;\r\n googleLoginStepView.logoutGoogleWithErrorMessage();\r\n this.baseImportView.currentStepInstance.setState({});\r\n this.baseImportView.goToStep('google-login-step');\r\n }\r\n\r\n // this needs to be called after this view has been attached to dom\r\n // otherwise UI blocker throws exception\r\n startPollingAfterContinueImport() {\r\n if (this.options.taskItemId && !this.baseImportView.onContinueImportView) {\r\n this.logTrace('taskItemId is passed, set cookie');\r\n\r\n const { ImportTaskItemList, SessionId } = this.initialState.initialSettings;\r\n if (_.size(ImportTaskItemList) === 0) {\r\n return;\r\n }\r\n const { AccountName } = ImportTaskItemList[0].AdWordsImportContext;\r\n\r\n this.logTrace(`set adwords context to cookie: AccountName - ${AccountName}, SessionId - ${SessionId} `);\r\n this.googleImportRepository.setGoogleImportAccountInfoInCookie({\r\n loginAccount: AccountName,\r\n sessionId: SessionId,\r\n });\r\n }\r\n }\r\n}\r\n\r\n","/* eslint-disable no-undef */\r\n\r\nexport const StepConstants = {\r\n SignInStep: {\r\n path: 'signInStep',\r\n stepName: _TL_('Sign in to Amazon Ads'),\r\n title: _TL_('Sign in to Amazon Ads'),\r\n },\r\n ChooseAccounts: {\r\n path: 'chooseAccounts',\r\n stepName: _TL_('Choose accounts'),\r\n title: _TL_('Choose accounts'),\r\n },\r\n StartImportSmart: {\r\n path: 'startImport.smart',\r\n stepName: _TL_('Set schedule'),\r\n title: _TL_('You\\'re ready to start your import'),\r\n },\r\n AmazonCampaignStep: {\r\n path: 'amazonCampaignStep',\r\n stepName: _TL_('Choose campaigns'),\r\n title: _TL_('Which campaigns do you want to import?'),\r\n },\r\n ImportSummaryStep: {\r\n path: 'importSummaryStep',\r\n title: _TL_('Import Summary'),\r\n },\r\n ImportOptionStep: {\r\n path: 'importOptionStep',\r\n stepName: _TL_('Choose items and options'),\r\n title: _TL_('Choose which items to import and the options to set for them.'),\r\n },\r\n StartImportAdvanced: {\r\n path: 'startImport.advanced',\r\n stepName: _TL_('Set schedule'),\r\n title: _TL_('Set schedule'),\r\n },\r\n ImportStatusStep: {\r\n path: 'importStatusStep',\r\n title: _TL_('Import Status'),\r\n },\r\n};\r\n","// import Promise from 'bluebird';\r\nimport { CommonImportRepository } from '@bingads-webui-campaign/import-shared-repositories';\r\nimport Promise from 'bluebird';\r\nimport { StringPayload } from '@bingads-webui/azure-upload';\r\nimport _ from 'underscore';\r\nimport { filterAndLocalizeAmazonCampaignsUtil } from './amazon-import-repository-utils';\r\n\r\nconst startAmazonSessionUrlTmpl = '/ImportSession/StartAmazonSession(CustomerId=:customer_id,AccountId=:account_id)?authCode={{AuthCode}}&redirectUri={{redirectUri}}';\r\nconst startAmazonSessionWithTokenUrlTmpl =\r\n 'ImportSession/StartAmazonSession(CustomerId=:customer_id,AccountId=:account_id)?refreshToken={{Token}}';\r\nconst amazonAccountsUrlTmpl =\r\n '/ImportSession/AmazonAccounts(CustomerId=:customer_id,AccountId=:account_id,SessionId={{SessionId}})';\r\nconst amazonCampaignsUrlTmpl =\r\n '/ImportSession/AmazonCampaigns(CustomerId=:customer_id,AccountId=:account_id,SessionId={{SessionId}})';\r\nconst keyNameOfSessionIdInCookie = 'OAuth2_AmazonImportSessionId';\r\nconst keyNameOfLoginAccountInCookie = 'OAuth2_AmazonLoginAccount';\r\nconst amazonEntitiesBulkFileTypeNum = 17;\r\nconst importType = 'AmazonImport';\r\nconst amazonAdsEntityBulkFileType = 'GoogleAdsEntityIdFile';\r\n\r\nexport class AmazonImportRepository extends CommonImportRepository {\r\n constructor({ deps }) {\r\n super({ deps, type: 'AmazonImport', importType });\r\n this.edm = deps.edm;\r\n this.jsData = deps.jsData;\r\n if (this.edm != null) {\r\n this.taskItemOptions = {\r\n adapter: 'odata',\r\n entitySet: this.edm.currentAccount.TaskItems,\r\n };\r\n }\r\n this.ccJsData = deps.ccJsData;\r\n }\r\n\r\n getAmazonSessionIdFromCookie() {\r\n return this.getValueInSubImportCookieByAccountId(keyNameOfSessionIdInCookie)[0];\r\n }\r\n\r\n isUserLoggedIn() {\r\n return !!this.getAmazonSessionIdFromCookie();\r\n }\r\n\r\n setAmazonImportAccountInfoInCookie({ loginAccount, sessionId }) {\r\n this.addSubCookieToImportCookie({\r\n [keyNameOfLoginAccountInCookie]: loginAccount,\r\n [keyNameOfSessionIdInCookie]: sessionId,\r\n });\r\n }\r\n\r\n startAmazonSessionInternal(url, notUpdateCookie = false) {\r\n return this.odata.post(url)\r\n .then(({ AmazonSessionId: sessionId, AmazonLoginEmail: loginAccount }) => {\r\n if (sessionId && !notUpdateCookie) {\r\n this.setAmazonImportAccountInfoInCookie({\r\n sessionId,\r\n loginAccount,\r\n });\r\n return sessionId;\r\n }\r\n return sessionId;\r\n });\r\n }\r\n\r\n startAmazonSession(authCode, notUpdateCookie) {\r\n const url = startAmazonSessionUrlTmpl\r\n .replace('{{AuthCode}}', authCode)\r\n .replace(':account_id', this.aid);\r\n\r\n return this.startAmazonSessionInternal(url, notUpdateCookie);\r\n }\r\n\r\n startAmazonSessionWithToken(token) {\r\n const url = startAmazonSessionWithTokenUrlTmpl\r\n .replace('{{Token}}', token)\r\n .replace(':account_id', this.aid);\r\n\r\n return this.startAmazonSessionInternal(url);\r\n }\r\n\r\n logout() {\r\n this.removeImportCookieValue(keyNameOfSessionIdInCookie, keyNameOfLoginAccountInCookie);\r\n }\r\n\r\n getAmazonLoginAccountFromCookie() {\r\n return this.getValueInSubImportCookieByAccountId(keyNameOfLoginAccountInCookie)[0];\r\n }\r\n\r\n getAmazonAccountName() {\r\n return this.getAmazonLoginAccountFromCookie();\r\n }\r\n\r\n getAmazonAccounts() {\r\n const sessionId = this.getAmazonSessionIdFromCookie();\r\n const url = amazonAccountsUrlTmpl\r\n .replace('{{SessionId}}', sessionId);\r\n\r\n return this.odata.get(url).then(accounts => _.map(accounts, account => ({\r\n ...account,\r\n Currency: String(account.Currency).toUpperCase(),\r\n })));\r\n }\r\n\r\n getSelectionDataFromBlob(blobName) {\r\n return this.getEntitiesBlob(blobName)\r\n .then(blob =>\r\n ({\r\n selectedCampaignIds: blob.CampaignIds,\r\n }));\r\n }\r\n\r\n getEntitiesBlob(blobName) {\r\n return this.getBulkBlob(blobName, amazonEntitiesBulkFileTypeNum);\r\n }\r\n\r\n getAmazonCampaigns(amazonAccountId, marketPlace = 1) {\r\n const sessionId = this.getAmazonSessionIdFromCookie();\r\n let url = amazonCampaignsUrlTmpl.replace('{{SessionId}}', sessionId);\r\n\r\n url = this.formatUrl({\r\n url,\r\n queryParameters: {\r\n ExternalAccountId: amazonAccountId,\r\n AmazonMarketPlace: marketPlace,\r\n },\r\n });\r\n\r\n return this.odata.get(url)\r\n .then(data => filterAndLocalizeAmazonCampaignsUtil(data, this.deps.newI18n, this.logError));\r\n }\r\n\r\n prepareForCampaignSelectionStep(customerId, marketPlace, blobName) {\r\n const promises = {};\r\n promises.amazonCampaigns = this.getAmazonCampaigns(customerId, marketPlace);\r\n\r\n if (blobName) {\r\n promises.selectionData = this.getSelectionDataFromBlob(blobName)\r\n .then((selectionData) => {\r\n const finalState = {};\r\n finalState.selectedCampaignIds = selectionData.selectedCampaignIds;\r\n return finalState;\r\n });\r\n }\r\n\r\n return Promise.props(promises)\r\n .then(({ amazonCampaigns, selectionData }) => {\r\n const finalState = { amazonCampaigns };\r\n if (selectionData) {\r\n const availableIdBoolMap = _.object(_.map(amazonCampaigns, obj => [obj.Id, true]));\r\n const campaignIdFilter = ids => _.filter(ids, id => availableIdBoolMap[id]);\r\n const selectedCampaignIds = campaignIdFilter(selectionData.selectedCampaignIds);\r\n _.extend(finalState, {\r\n selectedCampaignIds: _.isEmpty(selectedCampaignIds) ? null : selectedCampaignIds,\r\n });\r\n }\r\n return finalState;\r\n });\r\n }\r\n\r\n getAmazonImportUserPreferences() {\r\n let preferences = {};\r\n\r\n return this.getImportUserPreferencesWithBMCandMinInfo('AmazonImport')\r\n .then((userPref) => {\r\n preferences = _.extend(preferences, userPref);\r\n\r\n return preferences;\r\n });\r\n }\r\n\r\n getAmazonImportInfoFromCookie() {\r\n const result = this.getValueInSubImportCookieByAccountId(\r\n keyNameOfSessionIdInCookie,\r\n keyNameOfLoginAccountInCookie\r\n );\r\n\r\n return {\r\n sessionId: result[0],\r\n amazonAccountName: result[1],\r\n };\r\n }\r\n\r\n serializeAmazonEntitiesSelectionDataToStringPayload(selectionData) {\r\n return new StringPayload({\r\n content: JSON.stringify({\r\n CampaignIds: selectionData.selectedCampaignIds,\r\n }),\r\n });\r\n }\r\n\r\n prepareAmazonImportContext({\r\n amazonCustomerId,\r\n initialAmazonAccount,\r\n amazonEntitiesSelectionData,\r\n uid,\r\n }) {\r\n let sessionId;\r\n let amazonAccountName;\r\n\r\n if (initialAmazonAccount) {\r\n ({ sessionId } = initialAmazonAccount);\r\n ({ amazonAccountName } = initialAmazonAccount);\r\n } else {\r\n const info = this.getAmazonImportInfoFromCookie();\r\n\r\n ({ sessionId } = info);\r\n ({ amazonAccountName } = info);\r\n\r\n if (!sessionId) {\r\n this.logTrace(`prepareAmazonImportContext: failed to getAmazonImportInfoFromCookie with info ${JSON.stringify(info)}`);\r\n sessionId = this.getAmazonSessionIdFromCookie();\r\n amazonAccountName = this.getAmazonAccountName();\r\n\r\n if (!sessionId) {\r\n this.logTrace(`prepareAmazonImportContext: failed to getAmazonSessionIdFromCookie with sessionId ${sessionId} amazonAccountName ${amazonAccountName}`);\r\n }\r\n }\r\n }\r\n\r\n const amazonImportContext = {\r\n '@odata.type': '#Model.AmazonImportContext',\r\n SessionId: sessionId,\r\n ProfileId: String(amazonCustomerId),\r\n AccountName: amazonAccountName,\r\n AmazonSessionUserId: String(uid),\r\n AmazonMarketPlaceType: 'NorthAmerica', // hard coded here since we only support NA for now\r\n };\r\n\r\n if (amazonEntitiesSelectionData) {\r\n return this.uploadToAzureBlobViaOdata({\r\n bulkFileType: amazonAdsEntityBulkFileType,\r\n payload:\r\n this.serializeAmazonEntitiesSelectionDataToStringPayload(amazonEntitiesSelectionData),\r\n }).then(blob =>\r\n ({\r\n ...amazonImportContext,\r\n AmazonEntitiesBlobName: blob.BlobName,\r\n }));\r\n }\r\n\r\n return Promise.resolve(amazonImportContext);\r\n }\r\n\r\n prepareAmazonImportTaskItem({\r\n importOptions,\r\n stepState,\r\n }) {\r\n const {\r\n importUserPreferences = {},\r\n notificationType,\r\n notificationEmailAddresses,\r\n timeZoneId,\r\n name,\r\n cron,\r\n taskItemState,\r\n } = importOptions;\r\n\r\n const {\r\n amazonCustomerId,\r\n initialAmazonAccount,\r\n amazonEntitiesSelectionData,\r\n } = stepState;\r\n\r\n return this.prepareAmazonImportContext({\r\n amazonCustomerId,\r\n initialAmazonAccount,\r\n amazonEntitiesSelectionData,\r\n uid: this.uid,\r\n })\r\n .then(amazonImportContext =>\r\n (_.extend(\r\n this.prepareCompleteImportTaskItem(importUserPreferences, timeZoneId), {\r\n NotificationType: notificationType,\r\n NotificationEmailAddresses: notificationEmailAddresses,\r\n AmazonImportContext: amazonImportContext,\r\n ImportType: importType,\r\n '@odata.type': '#Model.AmazonImportTaskItem',\r\n Type: `AmazonImport${this.testTypeSuffix}`,\r\n },\r\n // pass IsAutoFrequency and IsSmartImport if the properties exist\r\n _.pick(importOptions, 'IsAutoFrequency', 'IsSmartImport'),\r\n !!name && { Name: name },\r\n !!taskItemState && { State: taskItemState },\r\n !!cron && { Cron: cron }\r\n )));\r\n }\r\n}\r\n","import _ from 'underscore';\r\n\r\nexport const filterAndLocalizeAmazonCampaignsUtil = (campaigns, i18n) => {\r\n const filteredAndLocalized = _.chain(campaigns)\r\n .filter((campaign) => {\r\n const status = campaign.Status;\r\n\r\n return status !== 'Draft' && status !== 'Delete' && status !== 'Deleted';\r\n })\r\n .map(({\r\n Id,\r\n Name,\r\n Status,\r\n }) => ({\r\n Id,\r\n Name,\r\n Status,\r\n Type: i18n.getString(_TL_('Sponsored products')), // default type for Amazon campaign\r\n }))\r\n .value();\r\n\r\n return filteredAndLocalized;\r\n};\r\n","import Promise from 'bluebird';\r\nimport $ from 'jquery';\r\n\r\nexport class AmazonLoginRepository {\r\n static CLIENT_ID = 'amzn1.application-oa2-client.4aaa2dcd38834711973c9ec98eba2e74';\r\n static SCOPE = 'profile cpc_advertising:campaign_management';\r\n static isAmazonLoginReady = false;\r\n\r\n ensureAmazonLoginReady() {\r\n // we need to remove the cached iframe proxy,\r\n // or the login popup cannot be mounted in other pages\r\n // because the discrepancy of different URLs.\r\n $('#amazon-root').empty();\r\n if (!AmazonLoginRepository.isAmazonLoginReady) {\r\n return new Promise((resolve) => {\r\n window.onAmazonLoginReady = () => {\r\n window.amazon.Login.setClientId(AmazonLoginRepository.CLIENT_ID);\r\n window.amazon.Login.setUseCookie(true);\r\n AmazonLoginRepository.isAmazonLoginReady = true;\r\n resolve(window.amazon);\r\n };\r\n window.require(['https://assets.loginwithamazon.com/sdk/na/login1.js']);\r\n });\r\n }\r\n return Promise.resolve(window.amazon);\r\n }\r\n\r\n login() {\r\n return this.ensureAmazonLoginReady()\r\n .then(amazon => new Promise((resolve, reject) => {\r\n amazon.Login.authorize({\r\n interactive: 'always',\r\n popup: true,\r\n scope: AmazonLoginRepository.SCOPE,\r\n response_type: 'code',\r\n code_challenge_method: 'plain',\r\n }, (response) => {\r\n if (response.error) {\r\n reject(response.error);\r\n return;\r\n }\r\n resolve(response.code);\r\n });\r\n }));\r\n }\r\n\r\n logout() {\r\n return this.ensureAmazonLoginReady().then((amazon) => {\r\n amazon.Login.logout();\r\n });\r\n }\r\n}\r\n","import { CommonPermissionFactory } from '@bingads-webui-campaign/import-shared-repositories';\r\n\r\nexport class PermissionFactory extends CommonPermissionFactory {\r\n constructor({\r\n permissions,\r\n }) {\r\n super({\r\n permissions,\r\n });\r\n\r\n this.permissions = permissions;\r\n }\r\n\r\n // TODO: enable the pilots when implementing for Amazon\r\n IsImportSmartScheduleStepImprovementPhaseTwoEnabled = () => false;\r\n IsImportSmartScheduleStepPanelImprovementEnabled = () => false;\r\n IsImportSmartScheduleStepPanelDataRestoreImprovementEnabled = () => false;\r\n}\r\n","import _ from 'underscore';\r\nimport { withAccountSelectionStepPrefetch } from '@bingads-webui-campaign/imports-core';\r\n\r\nconst prefetchConfig = {\r\n handleError: ({\r\n err,\r\n handleGenericError,\r\n }) => {\r\n handleGenericError(err);\r\n },\r\n fetchAccounts: repository =>\r\n repository.getAmazonAccounts(),\r\n getExistingAccounts: context => context.amazonAccounts,\r\n getExistingSelectedAccount: context => context.selectedAccounts,\r\n getSelectedAccounts: (accounts, initialSettings) => {\r\n let selectedAccounts = [];\r\n if (initialSettings.AmazonImportContext && initialSettings.AmazonImportContext.ProfileId) {\r\n const { ProfileId } = initialSettings.AmazonImportContext;\r\n\r\n selectedAccounts = _.filter(accounts, item => +item.Id === +ProfileId);\r\n }\r\n return selectedAccounts;\r\n },\r\n getNewStateAfterAccountsLoaded: (accounts, __, originalState) => ({\r\n ...originalState,\r\n amazonAccounts: accounts,\r\n }),\r\n};\r\n\r\nexport const withAmazonImportAccountSelectionStepPrefetch = Step =>\r\n withAccountSelectionStepPrefetch(Step, prefetchConfig);\r\n","/* eslint-disable jsx-a11y/anchor-is-valid */\r\nimport React from 'react';\r\nimport PropTypes from 'prop-types';\r\nimport classnames from 'classnames';\r\nimport { HelpLink } from '@bingads-webui-react/help-link';\r\nimport { ImportType, LoginDescription, handleAmazonLoginError } from '@bingads-webui-campaign/imports-core';\r\nimport { PrimaryButton, DefaultButton } from '@bingads-webui-react/fabric-with-signal';\r\nimport { withActivityContext } from '@bingads-webui-react/hoc-with-signal';\r\nimport { withDefaultStyles } from '@bingads-webui-react/with-default-styles';\r\n\r\nconst logoutResetData = {\r\n // account seletor page data\r\n selectedAccounts: [],\r\n amazonAccounts: null,\r\n autoConvertCurrencyEnabled: true,\r\n\r\n // option page data\r\n importOptions: null,\r\n previousImportOptions: null,\r\n // campagin selector page data\r\n CampaignIds: null,\r\n amazonEntitiesSelectionData: null,\r\n};\r\n\r\nfunction style() {\r\n return {\r\n descriptionBox: {\r\n fontSize: 14,\r\n lineHeight: '25px',\r\n marginBottom: 80,\r\n },\r\n link: {\r\n color: '#0078D4',\r\n textDecoration: 'underline',\r\n '& a.HelpTopic:focus': {\r\n outline: '1px solid #605e5c',\r\n },\r\n },\r\n errorMessage: {\r\n color: '#d13438',\r\n marginTop: 20,\r\n },\r\n buttonMargin: {\r\n marginTop: '10px',\r\n marginRight: '10px',\r\n },\r\n };\r\n}\r\n\r\nexport class UnstyledLoginContainer extends React.PureComponent {\r\n constructor(props) {\r\n super(props);\r\n this.deps = props.context.deps;\r\n this.repository = props.context.repository;\r\n this.loginRepository = props.context.loginRepository;\r\n this.goToNextStep = props.context.goToNextStep;\r\n this.handleGenericError = props.context.handleGenericError;\r\n this.patchState = props.context.patchState;\r\n this.newI18n = this.deps.newI18n;\r\n this.perfMarker = this.deps.perfMarker;\r\n this.loginPerfMarker = this.deps.loginPerfMarker;\r\n this.state = {\r\n errorMsg: null,\r\n };\r\n }\r\n\r\n componentDidMount() {\r\n if (this.loginPerfMarker) {\r\n this.loginPerfMarker.done();\r\n }\r\n }\r\n\r\n loginToAmazon = () => {\r\n if (this.deps.token) {\r\n return this.repository.startAmazonSessionWithToken(this.deps.token)\r\n .then(() => this.toNextStep())\r\n .catch(this.handleError);\r\n }\r\n return this.loginRepository.login()\r\n .then(authCode => this.repository.startAmazonSession(authCode))\r\n .then(() => this.toNextStep())\r\n .catch(this.handleError);\r\n };\r\n\r\n logout = () => {\r\n this.repository.logout();\r\n this.patchState({\r\n isLoggedIn: false,\r\n ...logoutResetData,\r\n });\r\n };\r\n\r\n handleError = (res) => {\r\n this.setState({\r\n errorMsg: handleAmazonLoginError(res, this.newI18n),\r\n });\r\n };\r\n\r\n toNextStep = () => {\r\n const sessionId = this.repository.getAmazonSessionIdFromCookie();\r\n if (!sessionId) {\r\n this.logout();\r\n this.setState({\r\n errorMsg: handleAmazonLoginError({ error: 'amazon_already_signed_out' }, this.newI18n),\r\n });\r\n return;\r\n }\r\n this.goToNextStep(this.props.nextStepPath);\r\n this.patchState({\r\n isLoggedIn: true,\r\n });\r\n };\r\n\r\n isLoggedIn = () => this.repository.isUserLoggedIn();\r\n\r\n render() {\r\n const { classes } = this.props;\r\n const isInActiveAccount = this.deps.config.get('CurrentAccountInActive');\r\n\r\n return (\r\n
\r\n
\r\n \r\n {this.newI18n.getString(_TL_('Get your campaigns up and running quickly by importing them directly from Amazon Ads into Microsoft Advertising account.'))} \r\n \r\n \r\n {this.newI18n.getString(_TL_('Before you start, make sure you understand')) } \r\n \r\n \r\n { this.newI18n.getString(_TL_('what will be imported')) }.\r\n \r\n \r\n \r\n
\r\n
\r\n {this.isLoggedIn() ? (\r\n
\r\n \r\n \r\n
\r\n ) : (\r\n \r\n )}\r\n
\r\n
\r\n { isInActiveAccount && { this.newI18n.getString(_TL_('Imports can only be ran from active accounts.'))}}\r\n { this.state.errorMsg }\r\n
\r\n
\r\n );\r\n }\r\n}\r\n\r\nUnstyledLoginContainer.propTypes = {\r\n context: PropTypes.shape({\r\n loginRepository: PropTypes.shape({}).isRequired,\r\n deps: PropTypes.shape({\r\n logTrace: PropTypes.func,\r\n newI18n: PropTypes.shape({}),\r\n }).isRequired,\r\n loginErrorMessage: PropTypes.string,\r\n repository: PropTypes.shape({}).isRequired,\r\n patchState: PropTypes.func.isRequired,\r\n goToNextStep: PropTypes.func.isRequired,\r\n handleGenericError: PropTypes.func.isRequired,\r\n }).isRequired,\r\n classes: PropTypes.shape().isRequired,\r\n nextStepPath: PropTypes.string.isRequired, // eslint-disable-line\r\n};\r\n\r\nexport const LoginContainer = withDefaultStyles(\r\n withActivityContext(UnstyledLoginContainer),\r\n style\r\n);\r\n\r\nexport const renderDescription = (i18n, nextStepPath, repository) => {\r\n const signOut = (contextValues) => {\r\n const {\r\n goToNextStep,\r\n patchState,\r\n toggleImportType,\r\n } = contextValues;\r\n\r\n repository.logout();\r\n patchState({\r\n isLoggedIn: false,\r\n logOutButtonClicked: true,\r\n ...logoutResetData,\r\n });\r\n\r\n toggleImportType(ImportType.Smart);\r\n goToNextStep(nextStepPath);\r\n };\r\n\r\n return (\r\n \r\n );\r\n};\r\n","import React from 'react';\r\nimport PropTypes from 'prop-types';\r\nimport { Activity } from '@bingads-webui-react/hoc-with-signal';\r\nimport { ImportCoreContext, StepContainer } from '@bingads-webui-campaign/imports-core';\r\nimport { LoginContainer } from './login-container';\r\nimport { getActionBarItems } from './action-bar-config';\r\nimport { withLoginStepPrefetch } from './prefetch';\r\n\r\nfunction AmazonLoginStepWithoutPrefetch(props) {\r\n const { stepTitle, stepPrefetchHoc } = props;\r\n const WrappedLoginContainer =\r\n stepPrefetchHoc ? stepPrefetchHoc(LoginContainer) : LoginContainer;\r\n\r\n return (\r\n \r\n {\r\n (contextValues) => {\r\n const { deps } = contextValues;\r\n const { getUniqueImportGUID } = deps;\r\n const uniqueImportId = (getUniqueImportGUID && getUniqueImportGUID()) || '';\r\n\r\n return (\r\n \r\n \r\n \r\n \r\n \r\n );\r\n }\r\n }\r\n \r\n );\r\n}\r\n\r\nAmazonLoginStepWithoutPrefetch.propTypes = {\r\n stepTitle: PropTypes.string.isRequired,\r\n nextStepPath: PropTypes.string.isRequired,\r\n stepPrefetchHoc: PropTypes.func,\r\n};\r\n\r\nAmazonLoginStepWithoutPrefetch.defaultProps = {\r\n stepPrefetchHoc: null,\r\n};\r\n\r\nexport const AmazonLoginStep = withLoginStepPrefetch(AmazonLoginStepWithoutPrefetch);\r\n\r\nexport { renderDescription } from './login-container';\r\n","export const getActionBarItems = () => {\r\n const config = [{\r\n type: 'button-cancel',\r\n }];\r\n\r\n return config;\r\n};\r\n","/* eslint-disable react-hooks/rules-of-hooks */\r\nimport React, { useContext, useState } from 'react';\r\nimport PropTypes from 'prop-types';\r\nimport $ from 'jquery';\r\nimport _ from 'underscore';\r\nimport { ImportCoreContext } from '@bingads-webui-campaign/imports-core';\r\nimport { withUiBlock } from '@bingads-webui/uiblocker';\r\n\r\nimport { StepConstants } from '../../page/step-config';\r\n\r\nexport const withLoginStepPrefetch = (PreExecuteStep) => {\r\n const LoginStepPrefetch = React.memo((props) => {\r\n const importCoreContext = useContext(ImportCoreContext);\r\n\r\n const {\r\n rootContainerClassName,\r\n } = props;\r\n\r\n const {\r\n deps,\r\n repository,\r\n patchState,\r\n amazonAccounts: existingAmazonAccount,\r\n logOutButtonClicked = false,\r\n goToNextStep,\r\n } = importCoreContext;\r\n\r\n const {\r\n taskItemId,\r\n config,\r\n newI18n,\r\n scope,\r\n } = deps;\r\n\r\n if (!taskItemId) {\r\n return ;\r\n }\r\n\r\n const [loading, setLoading] = useState(true); // to notify api is loading.\r\n const [dispatchedOdataCall, setDispatchedOdataCall] = useState(false);\r\n\r\n let initialState = {};\r\n\r\n if (loading &&\r\n !dispatchedOdataCall &&\r\n (!logOutButtonClicked && !existingAmazonAccount)\r\n ) {\r\n setDispatchedOdataCall(true);\r\n repository.getImportTaskItem(deps.taskItemId)\r\n .then((taskItem) => {\r\n // in this case, if user has signed in on import schedule page, update session Id\r\n const currentUserId = _.propertyOf(config.get('CurrentUser'))('Id');\r\n\r\n if (taskItem.ModifiedBy.Id !== currentUserId) {\r\n const { cookieHelperForEditImport } = deps;\r\n const sessionId = cookieHelperForEditImport.getSessionId(deps.taskItemId);\r\n\r\n cookieHelperForEditImport.deleteCookie();\r\n if (sessionId) {\r\n taskItem.AmazonImportContext.SessionId = sessionId; // eslint-disable-line\r\n } else {\r\n repository.logTrace(`Edit task met different userid. currentUserId: ${currentUserId} and taskItem.ModifiedBy.Id:${taskItem.ModifiedBy.Id}`);\r\n repository.logout();\r\n taskItem.AmazonImportContext.SessionId = null; // eslint-disable-line\r\n }\r\n }\r\n\r\n initialState.initialSettings = taskItem;\r\n initialState.initialSettings.taskItemId = deps.taskItemId;\r\n // the name is from last import\r\n initialState.isNameEdit = true;\r\n initialState.isEditingScheduledImport = true;\r\n\r\n return taskItem;\r\n })\r\n .then((taskItem) => {\r\n const {\r\n AccountName,\r\n SessionId,\r\n } = taskItem.AmazonImportContext;\r\n\r\n if (SessionId) {\r\n repository.setAmazonImportAccountInfoInCookie({\r\n loginAccount: AccountName,\r\n sessionId: SessionId,\r\n });\r\n }\r\n })\r\n .then(() => {\r\n if (initialState && initialState.isEditingScheduledImport) {\r\n const {\r\n AmazonImportContext: {\r\n CampaignIds,\r\n AmazonEntitiesBlobName,\r\n },\r\n ImportUserPreference,\r\n IsAutoFrequency,\r\n IsSmartImport,\r\n TimeZoneId,\r\n Cron,\r\n NotificationEmailAddresses,\r\n NotificationType,\r\n Name,\r\n } = initialState.initialSettings;\r\n let autoConvertCurrencyEnabled = ImportUserPreference &&\r\n ImportUserPreference.EnableAutoCurrencyConversion;\r\n if (_.isUndefined(autoConvertCurrencyEnabled) ||\r\n _.isNull(autoConvertCurrencyEnabled)) {\r\n autoConvertCurrencyEnabled = true;\r\n }\r\n\r\n initialState = _.extend(initialState, {\r\n IsAutoFrequency: !!IsAutoFrequency,\r\n IsSmartImport: !!IsSmartImport,\r\n ImportUserPreference,\r\n TimeZoneId,\r\n Cron,\r\n NotificationEmailAddresses,\r\n NotificationType,\r\n Name,\r\n CampaignIds,\r\n AmazonEntitiesBlobName,\r\n autoConvertCurrencyEnabled,\r\n });\r\n }\r\n return StepConstants.SignInStep.path;\r\n })\r\n .then(() => {\r\n patchState(initialState);\r\n // Go directly to importStep if passed in.\r\n const { importStep } = scope.values;\r\n\r\n if (importStep) {\r\n goToNextStep(importStep);\r\n }\r\n setLoading(false);\r\n })\r\n .finally(withUiBlock($(`.${rootContainerClassName}`), newI18n.getString(_TL_('Loading'))));\r\n } else if (existingAmazonAccount || logOutButtonClicked) {\r\n return ();\r\n }\r\n\r\n return loading ? null : ;\r\n });\r\n\r\n LoginStepPrefetch.propTypes = {\r\n rootContainerClassName: PropTypes.string.isRequired,\r\n };\r\n\r\n return LoginStepPrefetch;\r\n};\r\n","export const getActionBarItems = ({\r\n shouldGoToNextStep,\r\n prevStepName,\r\n nextStepName,\r\n nextButtonDisabled,\r\n}) => {\r\n const config = [{\r\n type: 'button-back',\r\n prevStepName,\r\n }, {\r\n type: 'button-next',\r\n validateFunction: shouldGoToNextStep,\r\n nextStepName,\r\n disabled: !!nextButtonDisabled,\r\n }, {\r\n type: 'button-cancel',\r\n extraLeftPadding: true,\r\n }];\r\n\r\n return config;\r\n};\r\n","import React from 'react';\r\nimport PropTypes from 'prop-types';\r\nimport {\r\n ADD_COLUMN,\r\n REMOVE_COLUMN,\r\n AccountSelector\r\n} from '@bingads-webui-campaign/imports-core';\r\n\r\nexport function AmazonImportAccountSelector(props) {\r\n const getSelectedListColumns = i18n => ([{\r\n key: 'account-name',\r\n name: i18n.getString(_TL_('Account name')),\r\n fieldName: 'Name',\r\n }, {\r\n key: REMOVE_COLUMN,\r\n name: '',\r\n fieldName: REMOVE_COLUMN,\r\n }]);\r\n\r\n const getAccountListColumns = i18n => ([{\r\n key: 'account-name',\r\n name: i18n.getString(_TL_('Amazon Ads account name')),\r\n fieldName: 'Name',\r\n minWidth: 100,\r\n maxWidth: 600,\r\n isResizable: true,\r\n }, {\r\n key: 'profile-id',\r\n name: i18n.getString(_TL_('Amazon Ads account ID')),\r\n fieldName: 'Id',\r\n minWidth: 170,\r\n maxWidth: 170,\r\n isResizable: false,\r\n }, {\r\n key: 'currency',\r\n name: i18n.getString(_TL_('Amazon Ads currency')),\r\n fieldName: 'Currency',\r\n minWidth: 155,\r\n maxWidth: 155,\r\n isResizable: false,\r\n }, {\r\n key: ADD_COLUMN,\r\n name: i18n.getString(_TL_('Add Button')),\r\n headerClassName: 'account-selector-add-column-header',\r\n fieldName: ADD_COLUMN,\r\n minWidth: 50,\r\n maxWidth: 50,\r\n }]);\r\n\r\n const { amazonAccounts } = props.context;\r\n\r\n // will remove this condition later once we want to enable multi-single conversion scenarios.\r\n const maxSelectedItems = 1;\r\n\r\n return (\r\n \r\n );\r\n}\r\n\r\nAmazonImportAccountSelector.propTypes = {\r\n context: PropTypes.shape({}).isRequired,\r\n};\r\n","import React from 'react';\r\nimport PropTypes from 'prop-types';\r\nimport _ from 'underscore';\r\nimport Promise from 'bluebird';\r\n\r\nimport { Activity } from '@bingads-webui-react/hoc-with-signal';\r\nimport { StepContainer, ImportCoreContext, ErrorContainer } from '@bingads-webui-campaign/imports-core';\r\n\r\nimport { getActionBarItems } from './action-bar-config';\r\nimport { AmazonImportAccountSelector as AccountSelector } from './account-selector';\r\n\r\nclass AmazonAccountStepInternal extends React.PureComponent {\r\n constructor(props) {\r\n super(props);\r\n this.state = {\r\n error: false,\r\n errorMsg: '',\r\n };\r\n this.WrappedAccountSelector =\r\n props.stepPrefetchHoc ? props.stepPrefetchHoc(AccountSelector) : AccountSelector;\r\n }\r\n\r\n componentDidUpdate() {\r\n const {\r\n contextValues,\r\n } = this.props;\r\n\r\n const {\r\n accountsPageError,\r\n } = contextValues;\r\n\r\n if (accountsPageError) {\r\n this.setError(accountsPageError);\r\n }\r\n }\r\n\r\n setError = msg => (\r\n this.setState({\r\n error: true,\r\n errorMsg: msg,\r\n })\r\n );\r\n\r\n clearError = () => (\r\n this.setState({\r\n error: false,\r\n })\r\n );\r\n\r\n validate = () => {\r\n const {\r\n contextValues,\r\n } = this.props;\r\n\r\n const {\r\n deps,\r\n selectedAccounts,\r\n } = contextValues;\r\n\r\n const i18n = deps.newI18n;\r\n\r\n if (_.isEmpty(selectedAccounts) || selectedAccounts.length === 0) {\r\n this.setError(i18n.getString(_TL_('Please choose an Amazon Ads account')));\r\n return new Promise(resolve => resolve(false));\r\n }\r\n\r\n return new Promise(resolve => resolve(true));\r\n };\r\n\r\n render() {\r\n const {\r\n contextValues,\r\n stepTitle,\r\n prevStepName,\r\n nextStepName,\r\n prevStepNameIfPrefetchFail,\r\n nextStepNameIfPrefetchOnlyOneAccount,\r\n rootContainerClassName,\r\n isCurrencyConvertorDisabled,\r\n } = this.props;\r\n\r\n const { WrappedAccountSelector } = this;\r\n const { deps, accountsPageError, selectedAccounts } = contextValues;\r\n\r\n const { getUniqueImportGUID } = deps;\r\n\r\n const uniqueImportId = (getUniqueImportGUID && getUniqueImportGUID()) || '';\r\n\r\n const nextButtonDisabled = _.isEmpty(selectedAccounts);\r\n\r\n return (\r\n \r\n \r\n {/* the StepContainer asks for a single child */}\r\n \r\n \r\n {(this.state.error || accountsPageError)\r\n ? ()\r\n : null\r\n }\r\n \r\n \r\n \r\n );\r\n }\r\n}\r\n\r\nAmazonAccountStepInternal.propTypes = {\r\n contextValues: PropTypes.shape({}).isRequired,\r\n stepTitle: PropTypes.string.isRequired,\r\n prevStepName: PropTypes.string.isRequired,\r\n nextStepName: PropTypes.string.isRequired,\r\n stepPrefetchHoc: PropTypes.func,\r\n prevStepNameIfPrefetchFail: PropTypes.string.isRequired,\r\n nextStepNameIfPrefetchOnlyOneAccount: PropTypes.string.isRequired,\r\n rootContainerClassName: PropTypes.string,\r\n isCurrencyConvertorDisabled: PropTypes.bool,\r\n};\r\n\r\nAmazonAccountStepInternal.defaultProps = {\r\n stepPrefetchHoc: null,\r\n isCurrencyConvertorDisabled: false,\r\n rootContainerClassName: 'amazon-import-root',\r\n};\r\n\r\nexport const AmazonAccountStep = React.memo(props => (\r\n \r\n {\r\n contextValues => (\r\n \r\n )\r\n }\r\n \r\n));\r\n","import _ from 'underscore';\r\n\r\nexport const getActionBarItems = ({\r\n i18n,\r\n startImporting,\r\n isReadOnly,\r\n scheduleOnly,\r\n onSwitchCustomizeMode,\r\n getPrevStepName,\r\n permissionFactory,\r\n}) => {\r\n const config = _.compact([{\r\n type: 'button-back',\r\n prevStepName: getPrevStepName(),\r\n }, {\r\n type: 'button',\r\n primary: true,\r\n className: 'start-import',\r\n text: scheduleOnly ? i18n.getString(_TL_('Set schedule')) : i18n.getString(_TL_('Start import')),\r\n onClick: startImporting,\r\n disabled: isReadOnly,\r\n },\r\n !(permissionFactory && permissionFactory.IsImportSmartScheduleStepImprovementEnabled && permissionFactory.IsImportSmartScheduleStepImprovementEnabled())\r\n && onSwitchCustomizeMode ? {\r\n type: 'button-link',\r\n className: 'customize-import-button',\r\n text: i18n.getString(_TL_('Advanced import')),\r\n onClick: onSwitchCustomizeMode,\r\n } : null,\r\n ]);\r\n\r\n return config;\r\n};\r\n","/* eslint-disable max-len */\r\nimport React, { useContext, useState } from 'react';\r\nimport PropTypes from 'prop-types';\r\nimport _ from 'underscore';\r\nimport $ from 'jquery';\r\nimport Promise from 'bluebird';\r\nimport { ImportCoreContext } from '@bingads-webui-campaign/imports-core';\r\nimport { withUiBlock } from '@bingads-webui/uiblocker';\r\n\r\nexport const withSmartImportStepPrefetch = (PreExecuteComponent) => {\r\n const SmartImportStepPrefetch = React.memo((props) => {\r\n const importCoreContext = useContext(ImportCoreContext);\r\n\r\n const {\r\n rootContainerClassName,\r\n } = props;\r\n\r\n const {\r\n deps,\r\n repository,\r\n patchState,\r\n selectedAccounts,\r\n previousImportOptions,\r\n AmazonEntitiesBlobName,\r\n isEditingScheduledImport,\r\n CampaignIds,\r\n accountToCampaignsOptionsMapping = {},\r\n ImportUserPreference,\r\n IsSmartImport,\r\n } = importCoreContext;\r\n\r\n const {\r\n i18n,\r\n toggleCampaignsSelectionStep,\r\n } = deps;\r\n\r\n const doAllAccountsHaveCampaign = ({\r\n accountsToCampaign,\r\n }) => {\r\n const accountIdsWithNoCampaign = [];\r\n\r\n _.each(accountsToCampaign, (campaigns, customerId) => {\r\n // for single account we get data as: { profileId: { amazonCampaigns: [] }}\r\n // eslint-disable-next-line no-param-reassign\r\n campaigns = campaigns.amazonCampaigns;\r\n\r\n if ((campaigns && campaigns.length === 0) || _.isEmpty(campaigns)) {\r\n accountIdsWithNoCampaign.push(customerId);\r\n }\r\n });\r\n\r\n const accountWithNoCampaigns = [];\r\n\r\n if (accountIdsWithNoCampaign.length > 0) {\r\n _.each(accountIdsWithNoCampaign, (accountId) => {\r\n const accountMatchingCustomerId = _.filter(selectedAccounts, account => (account.Id === parseInt(accountId, 10)));\r\n\r\n if (accountMatchingCustomerId.length > 0) {\r\n accountWithNoCampaigns.push(accountMatchingCustomerId[0].Name);\r\n }\r\n });\r\n }\r\n\r\n // check if all the accounts have no campaings.\r\n // for single account this will always be 1.\r\n // for multiaccount all the accounts shouldn't have campaigns for us to hide the campaigns step.\r\n if (accountWithNoCampaigns.length === selectedAccounts.length) {\r\n return false;\r\n }\r\n\r\n return true;\r\n };\r\n\r\n const [loading, setLoading] = useState(true); // to notify api is loading.\r\n const [dispatchedOdataCall, setDispatchedOdataCall] = useState(false);\r\n\r\n const accountIdsToFetch = _.filter(selectedAccounts, account => !_.has(accountToCampaignsOptionsMapping, account.Id));\r\n\r\n if (loading &&\r\n !dispatchedOdataCall &&\r\n accountIdsToFetch.length !== 0\r\n ) {\r\n setDispatchedOdataCall(true);\r\n\r\n // promise object holding each\r\n // customerId : promise to getCampaigns\r\n // userPreference: promise to get options for the cid or aid.\r\n const promiseObject = {};\r\n\r\n const customerId = selectedAccounts[0].Id;\r\n const marketPlace = selectedAccounts[0].MarketPlace;\r\n\r\n promiseObject[customerId] = repository.prepareForCampaignSelectionStep(customerId, marketPlace, AmazonEntitiesBlobName);\r\n\r\n\r\n // if account change, previousImportOptions is null, we will call api to get it\r\n if (!previousImportOptions) {\r\n promiseObject.getUserPreferences = repository.getAmazonImportUserPreferences(selectedAccounts[0].Id);\r\n }\r\n\r\n Promise.props(promiseObject)\r\n // campaignState if it's editing schedule import:\r\n .then((result) => {\r\n const preferences = result.getUserPreferences;\r\n\r\n // remove the preference from promise result object\r\n // eslint-disable-next-line\r\n delete result.getUserPreferences;\r\n // already selected accounts\r\n const alreadySelectedAmazonAccounts = {};\r\n\r\n _.each(accountToCampaignsOptionsMapping, (mapping, cid) => {\r\n alreadySelectedAmazonAccounts[cid] = mapping.campaignsData;\r\n });\r\n\r\n // check if any of the accounts dont have campaigns.\r\n // if we have any accounts with no campaigns we skip the campaign selection step.\r\n const hasAccountsWithNoCampaigns = !doAllAccountsHaveCampaign({\r\n accountsToCampaign: { ...result, ...alreadySelectedAmazonAccounts },\r\n });\r\n\r\n // patch campaign selection data for editing scheduled import scenario\r\n const amazonEntitiesSelectionData = {};\r\n const { amazonCampaigns } = result[selectedAccounts[0].Id];\r\n\r\n // for single account mode we need additional data from getCampaigns call.\r\n const {\r\n selectedCampaignIds,\r\n } = result[selectedAccounts[0].Id];\r\n\r\n if (isEditingScheduledImport) {\r\n if (!selectedCampaignIds && CampaignIds) {\r\n amazonEntitiesSelectionData.selectedCampaignIds = CampaignIds;\r\n }\r\n _.extend(\r\n amazonEntitiesSelectionData,\r\n !!selectedCampaignIds && { selectedCampaignIds }\r\n );\r\n }\r\n\r\n // map each customer's customerId to their campaigns.\r\n _.each(result, (amazonCampaingsForCustomerId, cid) => {\r\n accountToCampaignsOptionsMapping[cid] = {\r\n campaignsData: {\r\n ...amazonCampaingsForCustomerId,\r\n },\r\n preference: {\r\n ...preferences,\r\n },\r\n };\r\n });\r\n\r\n let importOptions = preferences;\r\n if (isEditingScheduledImport && ImportUserPreference && !IsSmartImport) {\r\n importOptions = ImportUserPreference;\r\n }\r\n\r\n patchState({\r\n amazonCampaigns,\r\n ...previousImportOptions ? {} : {\r\n previousImportOptions: preferences,\r\n importOptions,\r\n },\r\n amazonEntitiesSelectionData,\r\n selectedAccounts,\r\n accountToCampaignsOptionsMapping,\r\n accountsPageError: null,\r\n hasAccountsWithNoCampaigns,\r\n CampaignIds: selectedCampaignIds,\r\n });\r\n\r\n if (hasAccountsWithNoCampaigns) {\r\n toggleCampaignsSelectionStep(false);\r\n } else {\r\n toggleCampaignsSelectionStep(true);\r\n }\r\n\r\n setLoading(false);\r\n })\r\n .finally(withUiBlock($(`.${rootContainerClassName}`), i18n.getString(_TL_('Loading'))));\r\n } else if (accountIdsToFetch.length === 0 && !dispatchedOdataCall) {\r\n const filteredAccountsToCampaign = {};\r\n\r\n _.each(accountToCampaignsOptionsMapping, (mapping, customerId) => {\r\n filteredAccountsToCampaign[customerId] = mapping.campaignsData;\r\n });\r\n\r\n const hasAccountsWithNoCampaigns = !doAllAccountsHaveCampaign({\r\n accountsToCampaign: filteredAccountsToCampaign,\r\n });\r\n\r\n const customerId = selectedAccounts[0].Id;\r\n\r\n const { amazonCampaigns } = accountToCampaignsOptionsMapping[customerId].campaignsData;\r\n\r\n const { preference } = accountToCampaignsOptionsMapping[customerId];\r\n\r\n let importOptions = preference;\r\n if (isEditingScheduledImport && ImportUserPreference && !IsSmartImport) {\r\n importOptions = ImportUserPreference;\r\n }\r\n\r\n patchState({\r\n accountsPageError: null,\r\n amazonCampaigns,\r\n hasAccountsWithNoCampaigns,\r\n ...previousImportOptions ? {} : {\r\n previousImportOptions: preference,\r\n importOptions,\r\n },\r\n });\r\n\r\n if (hasAccountsWithNoCampaigns) {\r\n toggleCampaignsSelectionStep(false);\r\n } else {\r\n toggleCampaignsSelectionStep(true);\r\n }\r\n\r\n return ();\r\n }\r\n\r\n return (\r\n
\r\n {\r\n loading ?
: \r\n }\r\n
\r\n );\r\n });\r\n\r\n SmartImportStepPrefetch.propTypes = {\r\n rootContainerClassName: PropTypes.string.isRequired,\r\n };\r\n\r\n return SmartImportStepPrefetch;\r\n};\r\n\r\n","\r\nimport $ from 'jquery';\r\nimport Promise from 'bluebird';\r\nimport { first, chain } from 'underscore';\r\nimport { withUiBlock } from '@bingads-webui/uiblocker';\r\n\r\nexport const createScheduledImportAndGoNextWhenReady = (\r\n taskItemBody,\r\n state\r\n) => {\r\n const { repository } = state;\r\n let taskItemPromise;\r\n\r\n if (state.isEditingScheduledImport) {\r\n taskItemPromise = repository.updateScheduledImportTaskItem(\r\n taskItemBody,\r\n state.initialSettings.taskItemId\r\n );\r\n } else {\r\n taskItemPromise = repository.createScheduledImportTaskItem(taskItemBody);\r\n }\r\n\r\n return taskItemPromise;\r\n};\r\n\r\nconst StartImportErrorCodes = {\r\n TaskSchedulingInvalid: _TL_('An error occured while saving the import. Time chosen to schedule the import is invalid.'),\r\n AmazonSyncApiInternalError: _TL_('Amazon Advertising encountered an unexpected error. Please try restarting your import or contact Support.'),\r\n AmazonSyncThrottlingLimitReached: _TL_('Amazon Advertising is currently limiting the number of import requests that can be made. Please try your import again later.'),\r\n AmazonSyncAccessDenied: _TL_('Amazon Advertising has denied permission to import from the linked account. Please log out of Amazon and try importing again, or contact Support.'),\r\n GenericImportError: _TL_('Microsoft Ads has encountered an error. Please try again later or contact support.'),\r\n};\r\n\r\nexport const createRunNowImportAndGoNextWhenReady = (\r\n taskItemBody,\r\n state,\r\n setImportStatus,\r\n getNextStepName\r\n) => {\r\n const {\r\n repository,\r\n deps,\r\n goToNextStep,\r\n patchState,\r\n } = state;\r\n\r\n return repository.createRunNowImportTaskItem(taskItemBody)\r\n .then((response) => {\r\n deps.toggleShowImportStatusStep(true);\r\n\r\n setImportStatus({\r\n taskItemExecutionId: first(response.TaskItemExecutions).Id,\r\n });\r\n patchState({\r\n hideProgressList: true,\r\n });\r\n\r\n goToNextStep(getNextStepName({ isRunNowImport: true }));\r\n });\r\n};\r\n\r\nexport const formatTaskData = (contextValues, taskData) => {\r\n const {\r\n selectedAccounts,\r\n amazonEntitiesSelectionData,\r\n CampaignIds,\r\n } = contextValues;\r\n const scheduleStepState = {\r\n amazonCustomerId: selectedAccounts[0].Id,\r\n campaignIds: CampaignIds,\r\n amazonEntitiesSelectionData,\r\n };\r\n return {\r\n ...taskData,\r\n scheduleStepState,\r\n };\r\n};\r\n\r\nexport const createImportAndGoNextWhenReady = ({\r\n state,\r\n generateTaskData,\r\n setImportStatus,\r\n activity,\r\n getNextStepName,\r\n rootContainerClassName,\r\n showErrorMessage,\r\n}) => {\r\n const {\r\n repository,\r\n patchState,\r\n goToNextStep,\r\n deps,\r\n } = state;\r\n\r\n const {\r\n isRunNowWithScheduledImport,\r\n isRunNowImport,\r\n isScheduledImport,\r\n scheduleStepState,\r\n importOptions,\r\n importOptionsRunnow,\r\n } = generateTaskData();\r\n\r\n return Promise.resolve()\r\n .then(() => {\r\n if (isRunNowWithScheduledImport || isScheduledImport) {\r\n return repository.prepareAmazonImportTaskItem({\r\n importOptions,\r\n stepState: scheduleStepState,\r\n }).then(scheduleBody => createScheduledImportAndGoNextWhenReady(\r\n scheduleBody,\r\n state\r\n ));\r\n }\r\n\r\n return Promise.resolve(true);\r\n })\r\n .then(() => {\r\n if (isRunNowImport || isRunNowWithScheduledImport) {\r\n return repository.prepareAmazonImportTaskItem({\r\n importOptions: importOptionsRunnow,\r\n stepState: scheduleStepState,\r\n }).then(runNowBody => (\r\n createRunNowImportAndGoNextWhenReady(runNowBody, state, setImportStatus, getNextStepName) // eslint-disable-line\r\n ));\r\n }\r\n patchState({\r\n hideProgressList: true,\r\n });\r\n deps.toggleShowImportSummary(true);\r\n\r\n goToNextStep(getNextStepName({ isRunNowImport: false }));\r\n return Promise.resolve(false);\r\n })\r\n .catch((errors) => {\r\n const ODataError = chain(errors)\r\n .result('responseJSON')\r\n .result('value')\r\n .result('0')\r\n .result('Code')\r\n .value();\r\n const errorMessage = StartImportErrorCodes[ODataError] ||\r\n StartImportErrorCodes.GenericImportError;\r\n\r\n showErrorMessage(deps.newI18n.getString(errorMessage));\r\n\r\n if (activity) {\r\n activity.signal(`step wizard encountered an error while importing - ${JSON.stringify(errors)}`);\r\n }\r\n })\r\n .finally(withUiBlock($(`.${rootContainerClassName}`), deps.newI18n.getString(_TL_('Loading'))));\r\n};\r\n","import React from 'react';\r\n\r\nimport { StartImportSmartStep as GeneralStartImportStep } from '@bingads-webui-campaign/imports-core';\r\n\r\nimport { StepConstants } from '../../page/step-config';\r\nimport { getActionBarItems } from './action-bar-config';\r\nimport { withSmartImportStepPrefetch } from './smart-import-step-prefetch';\r\nimport { createImportAndGoNextWhenReady } from '../helpers/create-schedule-runnow-job';\r\n\r\nconst getAdvancedCustomizingStepName = (hasAccountsWithNoCampaigns) => {\r\n if (hasAccountsWithNoCampaigns) {\r\n return StepConstants.ImportOptionStep.path;\r\n }\r\n return StepConstants.AmazonCampaignStep.path;\r\n};\r\n\r\nconst getPrevStepName = () => StepConstants.ChooseAccounts.path;\r\n\r\nconst getNextStepName = ({ isRunNowImport }) => {\r\n if (isRunNowImport) {\r\n return StepConstants.ImportStatusStep.path;\r\n }\r\n return StepConstants.ImportSummaryStep.path;\r\n};\r\n\r\nconst formatTaskData = (contextValues, taskData) => {\r\n const {\r\n selectedAccounts,\r\n } = contextValues;\r\n const scheduleStepState = {\r\n amazonCustomerId: selectedAccounts[0].Id,\r\n campaignIds: [],\r\n amazonEntitiesSelectionData: null,\r\n };\r\n return {\r\n ...taskData,\r\n scheduleStepState,\r\n };\r\n};\r\n\r\nexport const StartImportSmartStep = props => (\r\n \r\n);\r\n","import { StepConstants } from '../../page/step-config';\r\n\r\nexport const getActionBarItems = (\r\n shouldGoToNextStep,\r\n shouldGoToPreviousStep,\r\n hasAccountsWithNoCampaigns\r\n) => {\r\n const config = [{\r\n type: 'button-back',\r\n validateFunction: shouldGoToPreviousStep,\r\n prevStepName: hasAccountsWithNoCampaigns ?\r\n StepConstants.StartImportSmart.path :\r\n StepConstants.AmazonCampaignStep.path,\r\n }, {\r\n type: 'button-next',\r\n validateFunction: shouldGoToNextStep,\r\n nextStepName: StepConstants.StartImportAdvanced.path,\r\n }, {\r\n type: 'button-cancel',\r\n extraLeftPadding: true,\r\n }];\r\n\r\n return config;\r\n};\r\n","import { getBlackList, getDefaultImportOptionFields } from '@bingads-webui-campaign/import-components';\r\n\r\nexport const getSubFieldsBlackList = (permissions) => {\r\n const subFieldsBlacklist = getBlackList(permissions);\r\n\r\n // filter out some options for P0 requirement\r\n subFieldsBlacklist.push('ImportAccountUrlOptions');\r\n subFieldsBlacklist.push('ImportDeletedEntities');\r\n subFieldsBlacklist.push('ImportUET');\r\n subFieldsBlacklist.push('AssociatedUETTagId');\r\n subFieldsBlacklist.push('ImportUpdateEntityPreference_UpdateAdGroupAndKeywordBids');\r\n subFieldsBlacklist.push('ImportUpdateEntityPreference_UpdateAdGroupAndKeywordBidStrategies');\r\n subFieldsBlacklist.push('ImportUpdateEntityPreference_UpdateCampaignBudget');\r\n subFieldsBlacklist.push('RaiseLowBidsToMinServingBidsForBsc');\r\n subFieldsBlacklist.push('AutoDeviceBidOptimization');\r\n // other options\r\n subFieldsBlacklist.push('ImportAppendDestUrlPreference_UseAppendString');\r\n subFieldsBlacklist.push('ImportAppendDestUrlPreference_AppendStringForDestinationUrl');\r\n subFieldsBlacklist.push('ImportSearchAndReplaceDestUrlPreference_UseSearchAndReplaceString');\r\n subFieldsBlacklist.push('ImportSearchAndReplaceDestUrlPreference_SearchStringForDestinationUrl');\r\n subFieldsBlacklist.push('ImportSearchAndReplaceDestUrlPreference_ReplaceStringForDestinationUrl');\r\n subFieldsBlacklist.push('AppendPreferencesForTrackingTemplate_UseAppendString');\r\n subFieldsBlacklist.push('AppendPreferencesForTrackingTemplate_AppendStringForTrackingTemplate');\r\n subFieldsBlacklist.push('SearchAndReplacePreferencesForTrackingTemplate_UseSearchAndReplaceString');\r\n subFieldsBlacklist.push('SearchAndReplacePreferencesForTrackingTemplate_SearchStringForTrackingTemplate');\r\n subFieldsBlacklist.push('SearchAndReplacePreferencesForTrackingTemplate_ReplaceStringForTrackingTemplate');\r\n subFieldsBlacklist.push('SearchAndReplaceForCustomParameters_EnableSearchAndReplace');\r\n subFieldsBlacklist.push('SearchAndReplaceForCustomParameters_SearchString');\r\n subFieldsBlacklist.push('SearchAndReplaceForCustomParameters_ReplaceString');\r\n subFieldsBlacklist.push('SearchAndReplaceForFinalURLSuffix_EnableSearchAndReplace');\r\n subFieldsBlacklist.push('SearchAndReplaceForFinalURLSuffix_SearchString');\r\n subFieldsBlacklist.push('SearchAndReplaceForFinalURLSuffix_ReplaceString');\r\n subFieldsBlacklist.push('ImportUpdateEntityPreference_UpdateNameForExistingCampaigns');\r\n subFieldsBlacklist.push('ImportNewOption_ImportNewCampaignsAndMarkAsPaused');\r\n subFieldsBlacklist.push('ImportSearchAndDsaMixedCampaignAsSearchCampaign');\r\n subFieldsBlacklist.push('ImportPrefixAndSuffixForStringProperty_EnablePrefixAndSuffix');\r\n subFieldsBlacklist.push('ImportPrefixAndSuffixForStringProperty_SuffixString');\r\n subFieldsBlacklist.push('ImportSearchAndReplaceForStringProperty_EnableSearchAndReplace');\r\n subFieldsBlacklist.push('ImportSearchAndReplaceForStringProperty_SearchString');\r\n subFieldsBlacklist.push('ImportSearchAndReplaceForStringProperty_ReplaceString');\r\n subFieldsBlacklist.push('PauseParentIfNoLocationSupported');\r\n subFieldsBlacklist.push('EnableParentLocationMapping');\r\n subFieldsBlacklist.push('StoreIdForImportedProductAdExtensionsFlag');\r\n subFieldsBlacklist.push('StoreIdForImportedProductAdExtensions');\r\n subFieldsBlacklist.push('StoreIdForImportedProductAdExtensions');\r\n subFieldsBlacklist.push('PauseAIMAdGroupIfAllAudienceCriterionNotImported');\r\n subFieldsBlacklist.push('ImportNewOption_ImportNewImageAdExtensions');\r\n subFieldsBlacklist.push('ImportUpdateEntityPreference_UpdateImageAdExtensions');\r\n subFieldsBlacklist.push('RenameCampaignNameWithSuffix');\r\n\r\n return subFieldsBlacklist;\r\n};\r\n\r\nexport const importOptionFieldHelpIds = {\r\n ImportNewEntities: 'Pop_BA_Import_FB_ItemsNotPreviouslyImported',\r\n UpdateEntityPreferences: 'Pop_BA_Import_FB_UpdateExistingItems',\r\n DefaultBidsBelowMinToAdCenterMinBid: 'pop_BA_Import_FB_SetUnknownBid',\r\n DefaultCampaignBudgetBelowMinToAdCenterMinBudget: 'pop_BA_Import_FB_IncreaseCampBudget',\r\n AdjustmentForBids_EnableAdjustment: 'Pop_BA_Import_FB_AdjustBidValue',\r\n AdjustmentForCampaignBudgets_EnableAdjustment: 'Pop_BA_Import_FB_AdjustBudgValue',\r\n ImportNewOption_ImportNewActiveEntitiesOnly: 'pop_BA_Import_FB_PauseCampaigns',\r\n};\r\n\r\nexport const getImportOptionFields = (params) => {\r\n const optionFields = getDefaultImportOptionFields({\r\n ...params,\r\n hideEntityAdvancedOptions: true,\r\n helpIds: importOptionFieldHelpIds,\r\n });\r\n optionFields.forEach((opt) => {\r\n const { fields } = opt;\r\n\r\n fields.forEach((field) => {\r\n const newField = field;\r\n if (field.property === 'ImportNewOption_ImportNewActiveEntitiesOnly') {\r\n newField.label = params.i18n.getString('Import_ImportOptions_CampaignOptionsHeader');\r\n newField.showLabel = true;\r\n }\r\n });\r\n });\r\n return optionFields;\r\n};\r\n","import React from 'react';\r\nimport PropTypes from 'prop-types';\r\nimport { ImportOptionsStep } from '@bingads-webui-campaign/imports-core';\r\nimport { getActionBarItems } from './action-bar-config';\r\nimport { withSmartImportStepPrefetch } from '../start-smart-import-step/smart-import-step-prefetch';\r\nimport { withAmazonImportAccountSelectionStepPrefetch } from '../amazon-account-step/prefetch';\r\nimport { StepConstants } from '../../page/step-config';\r\nimport { getImportOptionFields, getSubFieldsBlackList } from './amazon-import-option-config';\r\n\r\nconst AmazonImportOptionsStepWithoutHOCs = props => (\r\n \r\n);\r\n\r\nAmazonImportOptionsStepWithoutHOCs.propTypes = {\r\n permissions: PropTypes.shape({}).isRequired,\r\n};\r\n\r\nexport const AmazonImportOptionsStep =\r\n // eslint-disable-next-line\r\n withAmazonImportAccountSelectionStepPrefetch(withSmartImportStepPrefetch(AmazonImportOptionsStepWithoutHOCs));\r\n","import { StepConstants } from '../../page/step-config';\r\n\r\nexport const getActionBarItems = (\r\n i18n,\r\n startImporting,\r\n isReadOnly,\r\n scheduleOnly\r\n) => {\r\n const config = [{\r\n type: 'button-back',\r\n prevStepName: StepConstants.ImportOptionStep.path,\r\n }, {\r\n type: 'button',\r\n primary: true,\r\n className: 'start-import',\r\n text: scheduleOnly ? i18n.getString(_TL_('Set schedule')) : i18n.getString(_TL_('Start import')),\r\n onClick: startImporting,\r\n disabled: isReadOnly,\r\n }, {\r\n type: 'button-cancel',\r\n extraLeftPadding: true,\r\n }];\r\n\r\n return config;\r\n};\r\n","import React from 'react';\r\nimport {\r\n StartImportAdvancedStep as GeneralStartImportAdvancedStep,\r\n} from '@bingads-webui-campaign/imports-core';\r\nimport { getActionBarItems } from './action-bar-config';\r\nimport { StepConstants } from '../../page/step-config';\r\nimport { formatTaskData, createImportAndGoNextWhenReady } from '../helpers/create-schedule-runnow-job';\r\n\r\nexport const getNextStepName = ({ isRunNowImport }) => (isRunNowImport\r\n ? StepConstants.ImportStatusStep.path\r\n : StepConstants.ImportSummaryStep.path);\r\n\r\nexport const StartImportAdvancedStep = props => (\r\n \r\n);\r\n","import $ from 'jquery';\r\nimport _ from 'underscore';\r\nimport { withUiBlock } from '@bingads-webui/uiblocker';\r\nimport { notificationApi, NotificationLevel } from '@bingads-webui-react/notification-center';\r\n\r\nexport const onSaveAmazonImportScheduleInfo = ({\r\n contextValues,\r\n tasks,\r\n displaystring,\r\n onEditScheduleClose,\r\n}) => {\r\n const { scheduledTaskItemBody } = tasks;\r\n const {\r\n Name,\r\n isNameEdit,\r\n getStateValue,\r\n patchState,\r\n repository,\r\n deps,\r\n IsSmartImport,\r\n importOptions: importUserPreferences,\r\n amazonEntitiesSelectionData,\r\n } = contextValues;\r\n\r\n const { i18n } = deps;\r\n\r\n const scheduleStepState = {\r\n amazonCustomerId: getStateValue('selectedAccounts')[0].Id,\r\n amazonEntitiesSelectionData: IsSmartImport ? null : amazonEntitiesSelectionData,\r\n };\r\n\r\n const importOptions = {\r\n notificationType: scheduledTaskItemBody.NotificationType,\r\n notificationEmailAddresses: scheduledTaskItemBody.NotificationEmailAddresses,\r\n timeZoneId: scheduledTaskItemBody.TimeZoneId,\r\n name: isNameEdit ? Name : scheduledTaskItemBody.defaultName,\r\n cron: scheduledTaskItemBody.Cron,\r\n IsAutoFrequency: scheduledTaskItemBody.IsAutoFrequency,\r\n IsSmartImport,\r\n importUserPreferences: IsSmartImport ? null : importUserPreferences,\r\n };\r\n\r\n if (scheduledTaskItemBody) {\r\n repository.prepareAmazonImportTaskItem({\r\n importOptions,\r\n stepState: scheduleStepState,\r\n })\r\n .then(finalBody => (\r\n repository.createScheduledImportTaskItem(finalBody)\r\n ))\r\n .then(() => {\r\n notificationApi.add({\r\n severity: NotificationLevel.Confirmation,\r\n title: '',\r\n message: i18n.get('Scheduled_Import_Summary_Header').replace('{0}', displaystring),\r\n target: 'FloatingBanner',\r\n });\r\n patchState({\r\n isRunNowImport: false,\r\n isRunNowWithScheduledImport: true,\r\n Name: isNameEdit ? Name : scheduledTaskItemBody.defaultName,\r\n scheduleSummaryString: displaystring,\r\n });\r\n onEditScheduleClose();\r\n })\r\n .finally(withUiBlock(\r\n /* target */ $('.schedule-setting-editor-panel .panel-content'),\r\n /* loadingText */ i18n.getString('Loading'),\r\n /* shouldFocus */ _,\r\n /* delayedLoading */ _,\r\n /* overlayZIndex */ '1010'\r\n ));\r\n }\r\n};\r\n","import {\r\n parseCronToDisplayString,\r\n ImportSchedulingOptions,\r\n} from '@bingads-webui-campaign/imports-core';\r\n\r\nexport const getAmazonImportDetailsView = (contextValues) => {\r\n const {\r\n deps,\r\n getStateValue,\r\n IsAutoFrequency,\r\n TimeZoneId,\r\n Cron,\r\n repository,\r\n isScheduledImport,\r\n isRunNowWithScheduledImport,\r\n selectedAccounts,\r\n } = contextValues;\r\n\r\n const importSchedulingOptions = new ImportSchedulingOptions(deps.i18n);\r\n\r\n\r\n const { config, newI18n } = deps;\r\n const scheduleSummaryString = getStateValue('scheduleSummaryString') || parseCronToDisplayString(\r\n deps.newI18n,\r\n IsAutoFrequency,\r\n Cron,\r\n TimeZoneId,\r\n importSchedulingOptions,\r\n false,\r\n deps.timeZoneMapper\r\n );\r\n\r\n const frequencyStat = scheduleSummaryString;\r\n\r\n const importDetails = [{\r\n label: newI18n.getString(_TL_('Import name')),\r\n value: getStateValue('Name'),\r\n labelClassName: 'import-name',\r\n }, {\r\n label: newI18n.getString(_TL_('Amazon account')),\r\n value: repository.getAmazonAccountName(),\r\n labelClassName: 'import-amazon-email import-email',\r\n }, {\r\n label: newI18n.getString(_TL_('Amazon Ads account')),\r\n value: selectedAccounts[0].Name,\r\n labelClassName: 'import-amazon-account-name import-account-name',\r\n }, {\r\n label: newI18n.getString(_TL_('Microsoft Advertising account')),\r\n value: config.get('CurrentAccount').Title,\r\n labelClassName: 'import-microsoft-account-name',\r\n }, (isScheduledImport || isRunNowWithScheduledImport) && {\r\n label: newI18n.getString(_TL_('Schedule and frequency')),\r\n value: frequencyStat,\r\n labelClassName: 'import-schedule-and-frequency',\r\n }];\r\n\r\n return importDetails;\r\n};\r\n","import React from 'react';\r\nimport { ImportSummaryPage as GenericImportSummaryPage } from '@bingads-webui-campaign/imports-core';\r\nimport { onSaveAmazonImportScheduleInfo } from './save-schedule-info';\r\nimport { getAmazonImportDetailsView } from './get-import-details-view';\r\n\r\nconst errorMessage = _TL_('Note: Some of your data might have been skipped or modified during import because of differences between Microsoft Advertising and Amazon Ads.');\r\nconst learnMoreText = _TL_('Learn more about importing campaigns from Amazon Ads.');\r\nconst noCampaignAlert = _TL_('We were unable to import any campaigns from this account. Going forward, we\\'ll keep your Amazon Ads account in sync with this Microsoft Advertising account.');\r\nconst cardPanelTitles = {\r\n Additions: _TL_('New items imported from Amazon Ads'),\r\n};\r\n\r\nexport const AmazonImportSummaryStep = props => (\r\n \r\n);\r\n","import React from 'react';\r\n\r\nimport {\r\n ImportStatusStep as GeneralImportStatusStep,\r\n} from '@bingads-webui-campaign/imports-core';\r\n\r\nimport { StepConstants } from '../../page/step-config';\r\n\r\nexport const ImportStatusStep = props => (\r\n \r\n);\r\n","import React from 'react';\r\nimport PropTypes from 'prop-types';\r\nimport { VerticalSeparatedLayout } from '@bingads-webui-react/steps';\r\nimport { ImportType, CampaignSelectionStep } from '@bingads-webui-campaign/imports-core';\r\n\r\nimport { withAmazonImportAccountSelectionStepPrefetch } from '../steps/amazon-account-step/prefetch';\r\nimport { StepConstants } from './step-config';\r\nimport { AmazonLoginStep, renderDescription } from '../steps/amazon-login-step';\r\nimport { AmazonAccountStep } from '../steps/amazon-account-step';\r\nimport { StartImportSmartStep } from '../steps/start-smart-import-step';\r\nimport { AmazonImportOptionsStep } from '../steps/amazon-import-option-step';\r\nimport { StartImportAdvancedStep } from '../steps/start-import-advanced-step';\r\nimport { AmazonImportSummaryStep } from '../steps/amazon-import-summary-step';\r\nimport { ImportStatusStep } from '../steps/import-status-step';\r\n\r\nconst {\r\n Step,\r\n} = VerticalSeparatedLayout;\r\n\r\nexport const getAmazonLoginStep = ({\r\n i18n,\r\n repository,\r\n rootContainerClassName,\r\n}) => {\r\n const title = i18n.getString(StepConstants.SignInStep.stepName);\r\n const { path } = StepConstants.SignInStep;\r\n return (\r\n renderDescription(i18n, StepConstants.SignInStep.path, repository)}\r\n >\r\n \r\n \r\n );\r\n};\r\n\r\ngetAmazonLoginStep.propTypes = {\r\n i18n: PropTypes.shape({}).isRequired,\r\n repository: PropTypes.shape({}).isRequired,\r\n rootContainerClassName: PropTypes.string.isRequired,\r\n};\r\n\r\nexport const getAmazonAccountStep = ({\r\n i18n,\r\n rootContainerClassName,\r\n}) => {\r\n const title = i18n.getString(StepConstants.ChooseAccounts.stepName);\r\n const { path } = StepConstants.ChooseAccounts;\r\n const prevStepName = StepConstants.SignInStep.path;\r\n const nextStepName = StepConstants.StartImportSmart.path;\r\n return (\r\n \r\n \r\n \r\n );\r\n};\r\n\r\ngetAmazonAccountStep.propTypes = {\r\n i18n: PropTypes.shape({}).isRequired,\r\n rootContainerClassName: PropTypes.string.isRequired,\r\n};\r\n\r\nexport const getStartImportSmartStep = ({\r\n i18n,\r\n getImportType,\r\n setImportStatus,\r\n rootContainerClassName,\r\n}) => {\r\n const title = i18n.getString(StepConstants.StartImportSmart.stepName);\r\n const { path } = StepConstants.StartImportSmart;\r\n const isEnabled = getImportType() === ImportType.Smart;\r\n return (\r\n \r\n \r\n \r\n );\r\n};\r\ngetStartImportSmartStep.propTypes = {\r\n i18n: PropTypes.shape({}).isRequired,\r\n getImportType: PropTypes.func.isRequired,\r\n setImportStatus: PropTypes.func.isRequired,\r\n rootContainerClassName: PropTypes.string.isRequired,\r\n};\r\n\r\nexport const getAmazonCampaignStep = ({\r\n i18n,\r\n getImportType,\r\n showCampaignSelectionStep,\r\n rootContainerClassName,\r\n repository,\r\n}) => {\r\n const title = i18n.getString(StepConstants.AmazonCampaignStep.stepName);\r\n const { path } = StepConstants.AmazonCampaignStep;\r\n const isEnabled = getImportType() === ImportType.Advanced && showCampaignSelectionStep;\r\n\r\n return (\r\n \r\n \r\n repository.getAmazonCampaigns(selectedAccount.Id, selectedAccount.MarketPlace)}\r\n entitiesSelectionDataName=\"amazonEntitiesSelectionData\"\r\n />\r\n \r\n );\r\n};\r\n\r\ngetAmazonCampaignStep.propTypes = {\r\n i18n: PropTypes.shape({}).isRequired,\r\n getImportType: PropTypes.func.isRequired,\r\n showCampaignSelectionStep: PropTypes.bool.isRequired,\r\n rootContainerClassName: PropTypes.string.isRequired,\r\n repository: PropTypes.shape({}).isRequired,\r\n};\r\n\r\nexport const getAmazonImportOptionsStep = ({\r\n i18n,\r\n deps,\r\n getImportType,\r\n permissions,\r\n rootContainerClassName,\r\n}) => {\r\n const title = i18n.getString(StepConstants.ImportOptionStep.stepName);\r\n const { path } = StepConstants.ImportOptionStep;\r\n const isEnabled = getImportType() === ImportType.Advanced;\r\n const importAccountCurrencyTitle = i18n.getString(_TL_('Amazon Ads:'));\r\n\r\n return (\r\n \r\n \r\n \r\n );\r\n};\r\n\r\ngetAmazonImportOptionsStep.propTypes = {\r\n i18n: PropTypes.shape({}).isRequired,\r\n deps: PropTypes.shape({}).isRequired,\r\n getImportType: PropTypes.func.isRequired,\r\n permissions: PropTypes.shape({}).isRequired,\r\n rootContainerClassName: PropTypes.string.isRequired,\r\n};\r\n\r\nexport const getStartImportAdvancedStep = ({\r\n i18n,\r\n getImportType,\r\n setImportStatus,\r\n rootContainerClassName,\r\n}) => {\r\n const title = i18n.getString(StepConstants.StartImportAdvanced.stepName);\r\n const { path } = StepConstants.StartImportAdvanced;\r\n const isEnabled = getImportType() === ImportType.Advanced;\r\n return (\r\n \r\n \r\n \r\n );\r\n};\r\n\r\ngetStartImportAdvancedStep.propTypes = {\r\n i18n: PropTypes.shape({}).isRequired,\r\n getImportType: PropTypes.func.isRequired,\r\n setImportStatus: PropTypes.func.isRequired,\r\n rootContainerClassName: PropTypes.string.isRequired,\r\n};\r\n\r\nexport const getImportSummaryStep = ({\r\n i18n,\r\n showImportSummary,\r\n}) => {\r\n const title = i18n.getString(StepConstants.ImportSummaryStep.title);\r\n const { path } = StepConstants.ImportSummaryStep;\r\n return (\r\n \r\n \r\n \r\n );\r\n};\r\n\r\ngetImportSummaryStep.propTypes = {\r\n i18n: PropTypes.shape({}).isRequired,\r\n showImportSummary: PropTypes.bool.isRequired,\r\n};\r\n\r\nexport const getImportStatusStep = ({\r\n i18n,\r\n getImportStatus,\r\n showImportStatusStep,\r\n rootContainerClassName,\r\n}) => {\r\n const title = i18n.getString(StepConstants.ImportStatusStep.title);\r\n const { path } = StepConstants.ImportStatusStep;\r\n\r\n return (\r\n \r\n \r\n \r\n );\r\n};\r\n\r\ngetImportStatusStep.propTypes = {\r\n i18n: PropTypes.shape({}).isRequired,\r\n getImportStatus: PropTypes.func.isRequired,\r\n showImportStatusStep: PropTypes.bool.isRequired,\r\n rootContainerClassName: PropTypes.string.isRequired,\r\n};\r\n","import React from 'react';\r\nimport PropTypes from 'prop-types';\r\nimport Promise from 'bluebird';\r\n// import $ from 'jquery';\r\nimport { BaseImportCore, checkRequiredDeps, ImportType, ImportMode } from '@bingads-webui-campaign/imports-core';\r\nimport { perfMarkerPropTypes } from '@bingads-webui/performance-marker';\r\n// import { Constants as CCUIConstants } from '@bingads-webui-clientcenter/entity-utils';\r\n// import { withUiBlock } from '@bingads-webui/uiblocker';\r\nimport { Scenario } from '@bingads-webui-react/hoc-with-signal';\r\nimport { generateGuid } from '@bingads-webui-universal/primitive-utilities';\r\n\r\nimport { StepConstants } from './step-config';\r\nimport { AmazonImportRepository, AmazonLoginRepository, PermissionFactory } from '../repository';\r\n\r\nimport {\r\n getAmazonLoginStep,\r\n getAmazonAccountStep,\r\n getStartImportSmartStep,\r\n getAmazonCampaignStep,\r\n getAmazonImportOptionsStep,\r\n getStartImportAdvancedStep,\r\n getImportSummaryStep,\r\n getImportStatusStep,\r\n} from './step-factory';\r\n\r\nfunction checkRequiredDepsForAmazonImport(deps) {\r\n checkRequiredDeps(deps);\r\n deps.check('edm');\r\n deps.check('jsData');\r\n deps.check('cookieHelperForEditImport');\r\n}\r\n\r\nconst rootContainerClassName = 'amazon-import-root';\r\n\r\nexport class AmazonImportPage extends React.PureComponent {\r\n constructor(props) {\r\n super(props);\r\n this.perfMarker = props.perfMarker;\r\n this.steps = [];\r\n this.state = {\r\n isInit: false,\r\n importType: ImportType.Smart,\r\n importMode: ImportMode.Single,\r\n showImportSummary: false, // eslint-disable-line\r\n showImportStatusStep: false, // eslint-disable-line\r\n importStatus: null,\r\n startStep: StepConstants.SignInStep, // google-login-step\r\n hideProgressList: false,\r\n showCampaignSelectionStep: true, // eslint-disable-line\r\n uniqueImportGUID: generateGuid(),\r\n };\r\n this.initialize(props);\r\n }\r\n\r\n componentDidUpdate = (prevProps) => {\r\n if (prevProps.location.key !== this.props.location.key) {\r\n // eslint-disable-next-line\r\n this.setState({\r\n isInit: false,\r\n importType: ImportType.Smart,\r\n importMode: ImportMode.Single,\r\n showImportSummary: false, // eslint-disable-line\r\n showImportStatusStep: false, // eslint-disable-line\r\n importStatus: null,\r\n startStep: StepConstants.SignInStep,\r\n hideProgressList: false,\r\n showCampaignSelectionStep: true, // eslint-disable-line\r\n uniqueImportGUID: generateGuid(),\r\n });\r\n this.initialState = {};\r\n this.initialize(prevProps);\r\n }\r\n }\r\n\r\n getUniqueImportGUID = () => this.state.uniqueImportGUID;\r\n\r\n getImportType = () => this.state.importType;\r\n\r\n setImportStatus = (status) => {\r\n this.setState({\r\n importStatus: status,\r\n });\r\n }\r\n\r\n getImportStatus = () => this.state.importStatus;\r\n\r\n getImportMode = () => this.state.importMode;\r\n\r\n getImportScope = () => this.state.ImportScope;\r\n\r\n logTrace(...args) {\r\n this.repository.logTrace(...args);\r\n }\r\n\r\n initialize = (props) => {\r\n this.perfMarker.willFetchData();\r\n\r\n // don't take reject param, if coupon call fails, we will just not show the offer\r\n Promise.resolve().then(() => {\r\n checkRequiredDepsForAmazonImport(props.deps);\r\n this.deps = props.deps;\r\n\r\n // Deps.\r\n this.deps.newI18n = this.props.i18n;\r\n this.deps.importStatus = this.state.importStatus;\r\n this.deps.perfMarker = this.props.perfMarker;\r\n this.deps.scope = props.scope;\r\n this.deps.serverContext = props.serverContext;\r\n this.i18n = this.deps.i18n;\r\n this.deps.loginPerfMarker = this.props.perfMarker.createChild('Smart_Import_Login_Step');\r\n this.deps.loginPerfMarker.willInit();\r\n\r\n // Unique Import ID for substrate.\r\n this.deps.getUniqueImportGUID = this.getUniqueImportGUID;\r\n\r\n // Toggle functions.\r\n this.deps.toggleShowImportSummary = this.toggleShowImportSummary;\r\n this.deps.toggleShowImportStatusStep = this.toggleShowImportStatusStep;\r\n this.deps.toggleCampaignsSelectionStep = this.toggleCampaignsSelectionStep;\r\n\r\n // Repository init.\r\n this.repository = new AmazonImportRepository({\r\n deps: this.deps,\r\n });\r\n\r\n this.amazonLoginRepository = new AmazonLoginRepository();\r\n\r\n this.permissionFactory = this.deps.permissionFactory\r\n ? this.deps.permissionFactory\r\n : new PermissionFactory({\r\n permissions: props.permissions,\r\n importMode: props.scope.values.aid ? ImportMode.Single : ImportMode.Multi,\r\n });\r\n\r\n const initialStateFetchPromise = Promise.resolve([]);\r\n\r\n return initialStateFetchPromise.then(() => {\r\n this.setState({\r\n isInit: true,\r\n });\r\n });\r\n });\r\n }\r\n\r\n toggleShowImportSummary = (state) => {\r\n this.setState({\r\n showImportSummary: state, // eslint-disable-line\r\n });\r\n }\r\n\r\n toggleShowImportStatusStep = (state) => {\r\n this.setState({\r\n showImportStatusStep: state, // eslint-disable-line\r\n });\r\n }\r\n\r\n toggleImportType = (type) => {\r\n this.setState({\r\n importType: type,\r\n });\r\n }\r\n\r\n toggleImportMode = (mode) => {\r\n this.setState({\r\n importMode: mode,\r\n });\r\n this.permissionFactory.toggleImportMode(mode);\r\n }\r\n\r\n toggleCampaignsSelectionStep = (state) => {\r\n this.setState({\r\n showCampaignSelectionStep: state, // eslint-disable-line\r\n });\r\n }\r\n\r\n constructSteps = (i18n) => {\r\n this.steps = [];\r\n // construct base step\r\n this.steps.push(getAmazonLoginStep({\r\n i18n,\r\n repository: this.repository,\r\n rootContainerClassName,\r\n }));\r\n this.steps.push(getAmazonAccountStep({\r\n i18n,\r\n rootContainerClassName,\r\n }));\r\n this.steps.push(getStartImportSmartStep({\r\n i18n,\r\n getImportType: this.getImportType,\r\n setImportStatus: this.setImportStatus,\r\n rootContainerClassName,\r\n }));\r\n this.steps.push(getAmazonCampaignStep({\r\n i18n,\r\n getImportType: this.getImportType,\r\n showCampaignSelectionStep: this.state.showCampaignSelectionStep,\r\n rootContainerClassName,\r\n repository: this.repository,\r\n }));\r\n this.steps.push(getAmazonImportOptionsStep({\r\n i18n,\r\n deps: this.deps,\r\n getImportType: this.getImportType,\r\n permissions: this.props.permissions,\r\n rootContainerClassName,\r\n }));\r\n this.steps.push(getStartImportAdvancedStep({\r\n i18n,\r\n getImportType: this.getImportType,\r\n setImportStatus: this.setImportStatus,\r\n rootContainerClassName,\r\n }));\r\n this.steps.push(getImportSummaryStep({\r\n i18n,\r\n showImportSummary: this.state.showImportSummary,\r\n }));\r\n this.steps.push(getImportStatusStep({\r\n i18n,\r\n getImportStatus: this.getImportStatus,\r\n showImportStatusStep: this.state.showImportStatusStep,\r\n rootContainerClassName,\r\n }));\r\n }\r\n\r\n render() {\r\n const {\r\n rootClassName,\r\n i18n,\r\n } = this.props;\r\n\r\n if (this.state.isInit) {\r\n this.steps = [];\r\n this.constructSteps(i18n);\r\n } else {\r\n return null;\r\n }\r\n\r\n const handleCancelButtonClick = () => this.repository.redirectToCampaigns();\r\n\r\n return (\r\n \r\n \r\n \r\n \r\n
\r\n );\r\n }\r\n}\r\n\r\nAmazonImportPage.propTypes = {\r\n rootClassName: PropTypes.string.isRequired,\r\n perfMarker: perfMarkerPropTypes.isRequired,\r\n i18n: PropTypes.shape({}).isRequired,\r\n ccJsData: PropTypes.shape({\r\n FeatureAdoptionCoupon: PropTypes.shape({\r\n findAll: PropTypes.func,\r\n }),\r\n }),\r\n deps: PropTypes.shape({}).isRequired,\r\n location: PropTypes.shape({\r\n key: PropTypes.string,\r\n }).isRequired,\r\n permissions: PropTypes.shape({}).isRequired,\r\n};\r\n\r\nAmazonImportPage.defaultProps = {\r\n ccJsData: null,\r\n};\r\n","import _ from 'underscore';\r\n\r\nimport { AccountTitleStep } from '@bingads-webui-campaign/import-components';\r\n\r\nimport {\r\n AccountSelectionStep,\r\n CampaignSelectionStep,\r\n getDefaultCampaignGridConfig,\r\n ImportOptionsStep,\r\n BaseScheduleImportStep,\r\n ImportSummaryStep,\r\n} from '@bingads-webui-campaign/google-import-page';\r\n\r\nimport {\r\n FacebookLoginStep,\r\n} from '../index';\r\n\r\nfunction createAccountTitleStep(deps) {\r\n return {\r\n stepName: 'account-title-step',\r\n stepView: new AccountTitleStep({\r\n deps,\r\n }),\r\n };\r\n}\r\n\r\nfunction createFacebookLoginStep(deps) {\r\n return {\r\n stepName: 'facebook-login-step',\r\n stepView: new FacebookLoginStep({\r\n deps: _.defaults({ linkTextForTitle: deps.i18n.get('GoogleImport_Logout_Title') }, deps),\r\n }),\r\n };\r\n}\r\n\r\nfunction createFacebookAccountStep(deps) {\r\n return {\r\n stepName: 'facebook-account-step',\r\n stepView: new AccountSelectionStep({\r\n importSourceName: deps.importSource.name, // 'facebook'\r\n getStateAdapter: deps.importSource.getStateAdapter,\r\n deps: _.defaults({ previousStepName: 'facebook-login-step', i18n: deps.importSource.i18n }, deps),\r\n }),\r\n };\r\n}\r\n\r\nfunction createFacebookCampaignStep(deps) {\r\n // add one more columns for facebook campaign grid\r\n const getFacebookCampaignGridConfig = (params) => {\r\n const defaultConfig = getDefaultCampaignGridConfig(params);\r\n const columns = _.filter(defaultConfig.columns, c => c.name !== 'Type'); // don't show Type column\r\n columns.splice(1, 0, { // add 'Facebook Campaign Id' column,\r\n name: 'Id',\r\n title: deps.importSource.i18n.get('Import_SelectCampaign_Facebook_Id'),\r\n sortable: item => item.Id.toString().toLowerCase(),\r\n });\r\n // always enable \"show paused campaigns\" checkbox\r\n const { plugins } = defaultConfig;\r\n if (plugins && plugins.filter && plugins.filter.pausedFilter) {\r\n plugins.filter.pausedFilter.alwaysEnable = true;\r\n }\r\n return { ...defaultConfig, columns, plugins };\r\n };\r\n\r\n return {\r\n stepName: 'facebook-campaign-step',\r\n stepView: new CampaignSelectionStep({\r\n importSourceName: deps.importSource.name,\r\n getStateAdapter: deps.importSource.getStateAdapter,\r\n isAIMImportEnabled: false,\r\n isAdGroupLevelImportEnabled: false,\r\n getCampaignGridConfig: getFacebookCampaignGridConfig,\r\n deps: _.defaults({\r\n previousStepName: 'facebook-account-step',\r\n i18n: deps.importSource.i18n,\r\n repository: deps.importSource.repository,\r\n }, deps),\r\n }),\r\n };\r\n}\r\n\r\nfunction createImportOptionsStep(deps) {\r\n return {\r\n stepName: 'import-options-step',\r\n stepView: new ImportOptionsStep({\r\n importSourceName: 'facebook',\r\n deps: _.defaults({\r\n previousStepName: 'facebook-campaign-step',\r\n i18n: deps.importSource.i18n,\r\n isPauseAdGroupIfNoLocationSupportedEnabled: true,\r\n }, deps),\r\n }),\r\n };\r\n}\r\n\r\nfunction createScheduleImportStep(deps) {\r\n return {\r\n stepName: 'schedule-import-step',\r\n stepView: new BaseScheduleImportStep({\r\n importSourceName: deps.importSource.name,\r\n deps: _.defaults({\r\n previousStepName: 'import-options-step',\r\n i18n: deps.importSource.i18n,\r\n repository: deps.importSource.repository,\r\n }, deps),\r\n }),\r\n };\r\n}\r\n\r\nfunction createImportSummaryStep(deps) {\r\n return {\r\n stepName: 'import-summary-step',\r\n stepView: new ImportSummaryStep({\r\n importSourceName: deps.importSource.name,\r\n isAdGroupLevelImportEnabled: false,\r\n labels: {\r\n summaryDisclaimerKey: 'FacebookImport_SummaryPage_Disclaimer',\r\n summaryDisclaimerHelpLinkKey: 'FacebookImport_SummaryPage_Disclaimer_HelpLink',\r\n loginSummary: 'FacebookImport_ImportSummary_LoginSummary',\r\n accountSummary: 'FacebookImport_ImportSummary_AccountSummary',\r\n campaignsAndAdGroupsSummary: 'FacebookImport_ImportSummary_CampaignsAndAdGroupsSummary',\r\n campaignSummary: 'FacebookImport_ImportSummary_CampaignSummary',\r\n },\r\n getStateAdapter: deps.importSource.getStateAdapter,\r\n deps: _.defaults({\r\n i18n: deps.importSource.i18n,\r\n repository: deps.importSource.repository,\r\n summaryHelpTopic: 'app54769',\r\n }, deps),\r\n }),\r\n };\r\n}\r\n\r\nexport class FacebookImportStepFactory {\r\n static createSteps(deps) {\r\n deps.check();\r\n const steps = [];\r\n steps.push(createAccountTitleStep(deps));\r\n steps.push(createFacebookLoginStep(deps));\r\n steps.push(createFacebookAccountStep(deps));\r\n steps.push(createFacebookCampaignStep(deps));\r\n steps.push(createImportOptionsStep(deps));\r\n steps.push(createScheduleImportStep(deps));\r\n steps.push(createImportSummaryStep(deps));\r\n\r\n return steps;\r\n }\r\n\r\n static createStepsForSignup(deps) {\r\n const steps = [];\r\n\r\n steps.push(createFacebookLoginStep(deps));\r\n steps.push(createFacebookAccountStep(deps));\r\n steps.push(createFacebookCampaignStep(deps));\r\n steps.push(createImportSummaryStep(deps));\r\n return steps;\r\n }\r\n}\r\n","import Backbone from 'backbone';\r\nimport Promise from 'bluebird';\r\nimport _ from 'underscore';\r\nimport $ from 'jquery';\r\nimport { BaseImportView, ImportSource, getFacebookImportOptionBlackList as getSubFieldsBlackList,\r\n getFacebookImportOptionFields as getImportOptionFields,\r\n facebookImportOptionFieldHelpIds as importOptionFieldHelpIds } from '@bingads-webui-campaign/import-components';\r\nimport { PerfMarkerFactory } from '@bingads-webui/performance-marker';\r\nimport { FacebookImportRepository } from '@bingads-webui-campaign/import-shared-repositories';\r\nimport { FacebookImportStepFactory } from './facebook-import-step-factory';\r\n// Common dependency checks should happen in base-import-view\r\nfunction checkRequiredDepsForFacebookImport(deps) {\r\n deps.check('edm');\r\n deps.check('FB');\r\n deps.check('jsData');\r\n deps.check('timeZoneMapper');\r\n deps.check('uxMode');\r\n deps.check('cookieHelperForEditImport');\r\n}\r\n\r\nexport class FacebookImportPage extends Backbone.View {\r\n initialize({ deps, options = {} }) {\r\n checkRequiredDepsForFacebookImport(deps);\r\n this.deps = deps;\r\n this.perfMarker = this.deps.perfMarker || PerfMarkerFactory.createMarker('FacebookImport', { autoEnd: false });\r\n\r\n this.options = _.extend({\r\n pageTitle: `${deps.i18n.get('FacebookImport_PageTitle')}`,\r\n subTitle: deps.i18n.get('FacebookImport_PageDescription').replace('app51001', 'app54769'), // replace the help id for facebook import\r\n }, options);\r\n\r\n this.isFacebookAccountSkipped = false;\r\n this.facebookImportRepository = new FacebookImportRepository({ deps });\r\n this.initialState = {};\r\n this.baseImportOptions = this.options;\r\n\r\n this.importSource = ImportSource.facebook(deps.i18n, this.facebookImportRepository);\r\n\r\n const permissions = deps && deps.config && deps.config.get('Permissions');\r\n this.steps = FacebookImportStepFactory.createSteps(_.extend(deps, {\r\n repository: this.facebookImportRepository,\r\n isContinueImport: !!options.importId,\r\n subFieldsBlacklist: getSubFieldsBlackList(permissions || {}),\r\n getImportOptionFields,\r\n importOptionFieldHelpIds,\r\n onCredentialsError: this.onCredentialsError.bind(this),\r\n importSource: this.importSource,\r\n }));\r\n this.baseImportOptions.showAllStepsInLastStepFunc =\r\n wizard => wizard.currentStepInstance.isScheduledImport;\r\n if (this.options.importId) {\r\n this.initialState.importId = options.importId;\r\n this.baseImportOptions.currentStep = 'schedule-import-step';\r\n }\r\n this.baseImportOptions.enableEdit = true;\r\n\r\n this.onSwitchFinished = () => {\r\n $('[data-step-name=\"facebook-login-step\"] .edit-step').hide();\r\n $('[data-step-name=\"account-title-step\"] .edit-step').hide();\r\n const $accountEdit = $('[data-step-name=\"facebook-account-step\"] .edit-step');\r\n\r\n if (this.isFacebookAccountSkipped) {\r\n $accountEdit.hide();\r\n } else {\r\n $accountEdit.show();\r\n }\r\n };\r\n this.onSwitchFinished.bind(this);\r\n }\r\n\r\n logTrace(...args) {\r\n this.facebookImportRepository.logTrace(...args);\r\n }\r\n\r\n logError(...args) {\r\n this.facebookImportRepository.logError(...args);\r\n }\r\n\r\n render() {\r\n this.perfMarker.willRender();\r\n let initBaseViewPromise = Promise.resolve([]);\r\n let initialStateFetchPromise = Promise.resolve([]);\r\n\r\n if (this.options.taskItemId) {\r\n this.logTrace('taskItemId is passed');\r\n\r\n initialStateFetchPromise =\r\n this.facebookImportRepository.getImportTaskItem(this.options.taskItemId)\r\n .then((taskItem) => {\r\n // in this case, if user has signed in on import schedule page, update session Id\r\n const currentUserId = _.propertyOf(this.deps.config.get('CurrentUser'))('Id');\r\n\r\n if (taskItem.ModifiedBy.Id !== currentUserId) {\r\n this.logTrace('a different user is editing');\r\n const { cookieHelperForEditImport } = this.deps;\r\n const sessionId = cookieHelperForEditImport.getSessionId(this.options.taskItemId);\r\n\r\n cookieHelperForEditImport.deleteCookie();\r\n if (sessionId) {\r\n taskItem.FacebookImportContext.SessionId = sessionId; // eslint-disable-line\r\n }\r\n }\r\n\r\n this.initialState.initialSettings = taskItem;\r\n this.initialState.initialSettings.taskItemId = this.options.taskItemId;\r\n this.initialState.isEditingScheduledImport = true;\r\n });\r\n }\r\n\r\n initBaseViewPromise = initialStateFetchPromise.then(() => {\r\n this.baseImportView = new BaseImportView({\r\n deps: this.deps,\r\n steps: this.steps,\r\n options: this.baseImportOptions,\r\n initialState: this.initialState,\r\n onSwitchFinished: this.onSwitchFinished,\r\n });\r\n });\r\n\r\n const isLoadingFBScriptFailed = !(this.deps && this.deps.FB);\r\n return initBaseViewPromise.then(() => (\r\n this.baseImportView.render()\r\n .then((baseImportView) => {\r\n if (isLoadingFBScriptFailed) {\r\n // show general error page\r\n throw new Error('Facebook import: failed to load facebook script.');\r\n }\r\n this.$el.html(baseImportView.el);\r\n this.$('[data-step-name=\"account-title-step\"] .edit-step').hide();\r\n this.attachPageEventHandlers();\r\n this.perfMarker.done();\r\n return this;\r\n })\r\n ));\r\n }\r\n\r\n remove() {\r\n if (this.baseImportView) {\r\n this.baseImportView.remove();\r\n }\r\n super.remove();\r\n }\r\n\r\n attachPageEventHandlers() {\r\n const facebookLoginStepView = _.findWhere(this.steps, { stepName: 'facebook-login-step' }).stepView;\r\n const facebookAccountStepView = _.findWhere(this.steps, { stepName: 'facebook-account-step' }).stepView;\r\n const facebookCampaignStepView = _.findWhere(this.steps, { stepName: 'facebook-campaign-step' }).stepView;\r\n\r\n this.baseImportView.on('click:step.header.link', (e) => {\r\n const stepName = $(e.target).closest('.step-header').attr('data-step-name');\r\n\r\n if (stepName === 'facebook-login-step') {\r\n this.logTrace('signout clicked. start to log out and go to facebook login step');\r\n facebookLoginStepView.logoutFacebook();\r\n this.baseImportView.currentStepInstance.setState({\r\n savedSetting: _.result(facebookCampaignStepView, 'getCurrentSetting') || {},\r\n isEditEnabledForWizard: !this.isSignUpMode,\r\n });\r\n\r\n if (!_.isEmpty(this.initialState)) {\r\n this.initialState.initialSettings.FacebookImportContext = null;\r\n }\r\n this.baseImportView.currentStepInstance.patchState(this.initialState);\r\n this.baseImportView.goToStep(stepName);\r\n }\r\n });\r\n\r\n facebookLoginStepView.on('switch:step', (obj) => {\r\n if (obj) {\r\n this.logTrace('directly go to facebook campaign step');\r\n facebookAccountStepView.patchState(obj);\r\n facebookLoginStepView.patchState({\r\n 'facebook-account-step.isEdited': true,\r\n });\r\n this.isFacebookAccountSkipped = true;\r\n this.baseImportView.goToStep('facebook-campaign-step');\r\n } else {\r\n this.isFacebookAccountSkipped = false;\r\n this.baseImportView.goToStep('facebook-account-step');\r\n }\r\n });\r\n }\r\n\r\n onCredentialsError() {\r\n this.logTrace('call onCredentialsError');\r\n\r\n const facebookLoginStepView = _.findWhere(this.steps, { stepName: 'facebook-login-step' }).stepView;\r\n facebookLoginStepView.logoutFacebookWithErrorMessage();\r\n this.baseImportView.currentStepInstance.setState({});\r\n this.baseImportView.goToStep('facebook-login-step');\r\n }\r\n\r\n // this needs to be called after this view has been attached to dom\r\n // otherwise UI blocker throws exception\r\n startPollingAfterContinueImport() {\r\n if (this.options.importId) {\r\n this.logTrace('importId is passed, go to next step');\r\n\r\n this.baseImportView.goToNextStep();\r\n } else if (this.options.taskItemId && !this.baseImportView.onContinueImportView) {\r\n this.logTrace('taskItemId is passed, set cookie');\r\n\r\n const facebookLoginStepView = _.findWhere(this.steps, { stepName: 'facebook-login-step' }).stepView;\r\n const { AccountName, SessionId } = this.initialState.initialSettings.FacebookImportContext;\r\n\r\n this.logTrace(`set adwords context to cookie: AccountName - ${AccountName}, SessionId - ${SessionId} `);\r\n this.facebookImportRepository.setFacebookImportAccountInfoInCookie({\r\n loginAccount: AccountName,\r\n sessionId: SessionId,\r\n });\r\n\r\n facebookLoginStepView.continue();\r\n }\r\n }\r\n}\r\n","import _ from 'underscore';\r\nimport ko from 'knockout';\r\nimport { BaseImportStep } from '@bingads-webui-campaign/import-components';\r\nimport { validateSelectedAccountCampaigns } from '@bingads-webui-campaign/google-import-page';\r\nimport { withUiBlock } from '@bingads-webui/uiblocker';\r\n\r\nimport FacebookLoginTemplate from './facebook-login-template.pug';\r\n\r\nexport class FacebookLoginStep extends BaseImportStep {\r\n initialize({ deps, singleAccountMode = true }) {\r\n super.initialize({ deps });\r\n\r\n this.signupMode = deps.uxMode === 'signup';\r\n this.singleAccountMode = singleAccountMode;\r\n this.permissionsDeclined = false; // permission request to Facebook APIs are declined by users\r\n }\r\n\r\n get actions() {\r\n const actions = [];\r\n\r\n if (this.repository.isUserLoggedIn()) {\r\n actions.push({\r\n name: 'continue',\r\n displayText: this.i18n.get('CampaignImport_ButtonContinue'),\r\n method: 'continue',\r\n htmlAttributes: {\r\n class: 'btn btn-primary',\r\n },\r\n enabled: true,\r\n }, {\r\n name: 'signout',\r\n displayText: this.i18n.get('GoogleImport_Logout_Title'),\r\n method: 'logoutFacebook',\r\n htmlAttributes: {\r\n class: 'btn btn-default',\r\n },\r\n enabled: true,\r\n });\r\n } else {\r\n actions.push({\r\n name: 'sign-in',\r\n displayText: this.i18n.get('FacebookImport_CampaignImport_ButtonAuthorize'),\r\n method: 'signIn',\r\n htmlAttributes: {\r\n class: 'btn btn-primary',\r\n 'data-analyticsid': 'omniture-facebook-import-sign-in',\r\n },\r\n enabled: true,\r\n });\r\n if (!this.signupMode) {\r\n actions.push({\r\n name: 'cancel',\r\n displayText: this.i18n.get('CampaignImport_ButtonCancel'),\r\n });\r\n }\r\n }\r\n\r\n return actions;\r\n }\r\n\r\n get title() {\r\n return this.buildTitle({\r\n activeTitle: this.i18n.get('FacebookImport_Login_Title'),\r\n summaryTitle: this.i18n.get('FacebookImport_Login_Summary'),\r\n });\r\n }\r\n\r\n getSummaryInfo() {\r\n return this.repository.getFacebookAccountName();\r\n }\r\n\r\n render() {\r\n this.koModel = {\r\n errorMsg: ko.observable(''),\r\n isLoggedIn: ko.observable(this.repository.isUserLoggedIn()),\r\n };\r\n this.koModel.errorMsgRole = ko.computed(() => (this.koModel.errorMsg() === '' ? 'none' : 'alert'), this.koModel);\r\n this.$el.html(FacebookLoginTemplate({\r\n i18n: this.i18n,\r\n currentFacebookAccount: this.repository.getFacebookAccountName(),\r\n currentAccount: this.deps.config.get('CurrentAccount').Title,\r\n singleAccountMode: this.singleAccountMode,\r\n }));\r\n ko.applyBindings(this.koModel, this.el);\r\n this.logTrace('render facebook login step');\r\n this.deps.logActivities.logInAccount.startSignal();\r\n return this;\r\n }\r\n\r\n signIn() {\r\n this.deps.logScenario.clickOnSignInButton.create().signal();\r\n\r\n // don't support dev token for Facebook currently\r\n // // for debug mode\r\n // if (this.deps.token) {\r\n // this.signIntoFacebookInDevEnvWithToken();\r\n // return;\r\n // }\r\n\r\n // clear error message\r\n this.koModel.errorMsg('');\r\n\r\n this.repository.login({\r\n rerequest: this.permissionsDeclined,\r\n onSuccess: ({ accessToken }) => {\r\n const startSessionPromise = this.repository.startFacebookSession(accessToken);\r\n return this.processSignIn(startSessionPromise);\r\n },\r\n onPermissionsDeclined: ({ declinedScopes }) => {\r\n const permissionsDescription = declinedScopes.map(ds => ds.description).join(', ');\r\n this.logTrace(`User denied facebook permissions: ${permissionsDescription}`);\r\n this.koModel.errorMsg(this.i18n.get('FacebookImport_Permission_Denied_Error'));\r\n this.permissionsDeclined = true;\r\n },\r\n onFail: (error) => {\r\n if (error && error.authErrors === 'popup_blocked_by_browser') {\r\n this.koModel.errorMsg(this.i18n.get('GoogleImport_AuthorizationError_Popup_Blocked'));\r\n } else if (error && error.authErrors === 'idpiframe_initialization_failed') {\r\n this.koModel.errorMsg(this.i18n.get('GoogleImport_AuthorizationError_Cookies_Disabled'));\r\n } else if (error === 'unknown') {\r\n // general error message\r\n this.koModel.errorMsg(this.i18n.get('FacebookImport_Error_Signin_Required'));\r\n } else { // todo: more errors from facebook\r\n this.koModel.errorMsg(this.i18n.get('FacebookImport_AuthorizationError'));\r\n }\r\n this.logTrace(`failed to login to facebook import spa, err: ${JSON.stringify(error)}`);\r\n },\r\n });\r\n }\r\n\r\n continue() {\r\n this.deps.logActivities.logInAccount.stopSignal();\r\n\r\n const sessionId = this.repository.getFacebookImportInfoFromCookie().facebookSessionId;\r\n if (!sessionId) {\r\n this.logoutFacebook();\r\n this.koModel.errorMsg(this.i18n.get('FacebookImport_AlreadySignedOut_Error'));\r\n return;\r\n }\r\n\r\n const state = this.getState();\r\n const finalState = {};\r\n this.repository.getFacebookAccounts(sessionId)\r\n .then((accountData) => {\r\n const facebookAccount = _.map(accountData, ({\r\n Currency,\r\n ExtensionData,\r\n Id,\r\n Name,\r\n Status,\r\n }) => ({\r\n AccountName: Name,\r\n Currency,\r\n CustomerId: Id,\r\n ExtensionData,\r\n Status,\r\n }));\r\n\r\n finalState.facebookAccount = facebookAccount;\r\n finalState.facebookLoginSummary = this.getSummaryInfo();\r\n\r\n // should not skip facebook account step if currency conversion is required\r\n let shouldConvertCurrency = false;\r\n if (facebookAccount.length === 1) {\r\n const bingCurrency = this.deps.config.get('AccountCurrencyCode');\r\n const facebookCurrency = facebookAccount[0].Currency;\r\n if (facebookCurrency !== bingCurrency) {\r\n shouldConvertCurrency = true;\r\n }\r\n }\r\n\r\n // skip facebook account step\r\n if (this.singleAccountMode && facebookAccount.length === 1 && !shouldConvertCurrency) {\r\n this.logTrace('prepare for facebook campaign step');\r\n const blobName = state && state.initialSettings\r\n && state.initialSettings.FacebookImportContext\r\n && state.initialSettings.FacebookImportContext.FacebookEntitiesBlobName;\r\n return this.repository\r\n .prepareForCampaignSelectionStep(facebookAccount[0].CustomerId, blobName);\r\n }\r\n\r\n return null;\r\n })\r\n .then((extraState) => {\r\n let facebookAccountSummary = null;\r\n if (extraState\r\n && validateSelectedAccountCampaigns(extraState.facebookCampaigns, this.signupMode)) {\r\n this.logTrace('only one facebook account, go directly to facebook campaigns');\r\n this.deps.logScenario.accountSelectionSkipped.create().signal();\r\n const soleFacebookAccount = finalState.facebookAccount[0];\r\n // in scenarios when accountname is blank (e.g. bingadstest1),\r\n // use login name and customer id for summary info\r\n facebookAccountSummary = _.size(soleFacebookAccount.AccountName) > 0 ?\r\n soleFacebookAccount.AccountName :\r\n `${this.repository.getFacebookAccountName()}, ${soleFacebookAccount.CustomerId}`;\r\n\r\n _.extend(finalState, extraState, {\r\n facebookAccountSummary,\r\n facebookCustomerId: soleFacebookAccount.CustomerId,\r\n });\r\n }\r\n this.patchState(finalState);\r\n return this.trigger('switch:step', facebookAccountSummary ? { facebookAccountSummary } : undefined);\r\n })\r\n .catch(err => this.handleError(err))\r\n .finally(withUiBlock());\r\n }\r\n\r\n signIntoFacebookInDevEnvWithToken() {\r\n return this.processSignIn(this.repository.startFacebookSessionWithToken(this.deps.token));\r\n }\r\n\r\n processSignIn(startSessionPromise) {\r\n return startSessionPromise.then(({ sessionId }) => {\r\n if (sessionId) {\r\n return this.continue();\r\n }\r\n\r\n this.koModel.errorMsg(this.i18n.get('FacebookImport_Signin_General_Error'));\r\n // logout if failed to get sessionId from MT\r\n this.logError('Failed to get sessionID from MT, will log out user from Facebook.');\r\n return this.logoutFacebook();\r\n })\r\n .catch(err => this.handleError(err))\r\n .finally(withUiBlock());\r\n }\r\n\r\n handleError(err) {\r\n let code;\r\n let msg;\r\n\r\n if (err.body) {\r\n code = _.propertyOf(err.body[0])('Code');\r\n }\r\n\r\n switch (code) {\r\n case 'FacebookSyncTokenExpired':\r\n case 'FacebookSyncPermissionDenied':\r\n case 'FacebookSyncThrottlingLimitReached':\r\n case 'FacebookSyncApiInternalError':\r\n msg = this.deps.i18nErrors.getString(`Error_Campaign_API_${code}`);\r\n break;\r\n default:\r\n break;\r\n }\r\n if (msg) {\r\n // this error will be shown in facebook sign in step\r\n this.koModel.errorMsg(msg);\r\n this.logoutFacebook();\r\n } else {\r\n // this error will be shown on top of page\r\n this.handleGenericError(err);\r\n }\r\n }\r\n\r\n logoutFacebook() {\r\n this.isEdited = true;\r\n const postLogout = (error) => {\r\n this.koModel.isLoggedIn(this.repository.isUserLoggedIn());\r\n const errMsg = error ? `Error: ${JSON.stringify(error)}` : '';\r\n this.logTrace(`User logging out of Facebook account. ${errMsg}`);\r\n this.trigger('change:action');\r\n };\r\n this.repository.logout({ onSuccess: postLogout, onFail: postLogout });\r\n }\r\n}\r\n","import _ from 'underscore';\r\n\r\nimport { CommonImportRepository } from '@bingads-webui-campaign/import-shared-repositories';\r\n\r\nconst getColumnMappingUrlTmp =\r\n '/ImportSession/ColumnMapping(CustomerId=:customer_id,AccountId=:account_id)';\r\nconst getImportPreviewUrlTmpl =\r\n '/ImportSession/ImportPreview(CustomerId=:customer_id,AccountId=:account_id)';\r\nconst importType = 'FileBasedImport';\r\n\r\n// Format sample data extracted from file into grid data format\r\n// Sample input: row ['a', 'b']\r\n// Sample output: { '0': 'a', '1': 'b' }\r\nfunction formatSampleData(data) {\r\n return _.map(data.SampleRows, (row) => {\r\n const result = {};\r\n\r\n _.each(row, (cell, index) => {\r\n result[index.toString()] = cell;\r\n });\r\n return result;\r\n });\r\n}\r\n\r\nexport class FileImportRepository extends CommonImportRepository {\r\n constructor({\r\n deps,\r\n }) {\r\n super({\r\n deps,\r\n importType,\r\n });\r\n this.azureUploader = deps.azureUploader;\r\n const permissions = deps.config.get('Permissions');\r\n this.isBaiduFileImportEnabled = permissions && permissions.dynamic && permissions.dynamic.BaiduFileImport && permissions.dynamic.CNMarketExpansion;\r\n\r\n this.typeFieldWhenCreatingTaskExecution = `FileImport${this.testTypeSuffix}`;\r\n }\r\n\r\n uploadFile(importFile) {\r\n return this.azureUploader({ file: importFile });\r\n }\r\n\r\n getColumnMapping(blobUrl, fileFormat) {\r\n const url = this.formatUrl({\r\n url: getColumnMappingUrlTmp,\r\n queryParameters: {\r\n filePath: blobUrl,\r\n lcId: 1033,\r\n ImportFormat: fileFormat,\r\n },\r\n });\r\n\r\n return this.odata.get(url)\r\n .then((data) => {\r\n const formattedData = formatSampleData(data);\r\n\r\n return _.extend({}, data, {\r\n formattedData,\r\n });\r\n });\r\n }\r\n\r\n hasImportPreviewBeenApplied(status) {\r\n return this.isImportStatusValid(status) && (\r\n status.CurrentImportStatus === 'SubmitInProgress' || status.CurrentImportStatus === 'Complete'\r\n );\r\n }\r\n\r\n hasImportPreviewBeenCreated(status) {\r\n return this.isImportStatusValid(status) && !(\r\n status.CurrentImportStatus === 'ValidationInProgress' ||\r\n status.CurrentImportStatus === 'UploadInProgress' ||\r\n status.CurrentImportStatus === 'NotStarted'\r\n );\r\n }\r\n\r\n getImportPreview(importId) {\r\n const url = this.formatUrl({\r\n url: getImportPreviewUrlTmpl,\r\n queryParameters: {\r\n importId,\r\n },\r\n });\r\n\r\n return this.odata.get(url)\r\n .then(data => this.filterLocalizedEntities(data));\r\n }\r\n\r\n prepareBaseImportTaskItem() {\r\n return _.defaults({\r\n Type: this.typeFieldWhenCreatingTaskExecution,\r\n }, super.prepareBaseImportTaskItem());\r\n }\r\n\r\n createPreviewTaskExecution(fileName, filePath, columnMapping, importUserPreferences, fileFormat) {\r\n const model = _.extend(this.prepareCompleteImportTaskItem(importUserPreferences), {\r\n ImportType: importType,\r\n ImportAction: 'Preview',\r\n ...this.isBaiduFileImportEnabled ? { ImportFormat: fileFormat } : {},\r\n ImportColToAdCenterMapField: columnMapping,\r\n FileImportContext: {\r\n '@odata.type': '#Model.FileImportContext',\r\n UploadedFileName: fileName,\r\n FilePath: filePath,\r\n },\r\n AdWordsImportContext: {\r\n '@odata.type': '#Model.AdWordsImportContext',\r\n CampaignIds: [],\r\n },\r\n NotificationType: 'None',\r\n Cron: '',\r\n });\r\n\r\n return this.createImportTaskItemExecution(model);\r\n }\r\n\r\n createFullTaskExecution(fileName, filePath, columnMapping, importUserPreferences, fileFormat) {\r\n const model = _.extend(this.prepareCompleteImportTaskItem(importUserPreferences), {\r\n ImportType: importType,\r\n ImportAction: 'Full',\r\n ...this.isBaiduFileImportEnabled ? { ImportFormat: fileFormat } : {},\r\n ImportColToAdCenterMapField: columnMapping,\r\n FileImportContext: {\r\n '@odata.type': '#Model.FileImportContext',\r\n UploadedFileName: fileName,\r\n FilePath: filePath,\r\n },\r\n AdWordsImportContext: {\r\n '@odata.type': '#Model.AdWordsImportContext',\r\n CampaignIds: [],\r\n },\r\n NotificationType: 'None',\r\n Cron: '',\r\n });\r\n\r\n return this.createImportTaskItemExecution(model);\r\n }\r\n\r\n createCommitTaskExecution(importId) {\r\n const model = _.extend(this.prepareBaseImportTaskItem(), {\r\n ImportType: importType,\r\n ImportId: importId,\r\n ImportAction: 'Commit',\r\n });\r\n\r\n return this.createImportTaskItemExecution(model);\r\n }\r\n\r\n shouldStopPolling(data) {\r\n return super.shouldStopPolling(data) ||\r\n (data.Status !== 'PendingExecution' && data.ImportStatus === 'ValidationCompleted');\r\n }\r\n\r\n setInProcessImportCookie({ importId }) {\r\n super.setInProcessImportCookie({\r\n importId,\r\n importType,\r\n });\r\n }\r\n\r\n getFileImportUserPreferences() {\r\n return this.getImportUserPreferencesWithBMCandMinInfo(importType);\r\n }\r\n}\r\n","import { View } from 'backbone';\r\nimport ko from 'knockout';\r\n\r\nimport fileFormatTemplate from './file-format-template.pug';\r\n\r\nclass FileFormatViewModel {\r\n constructor() {\r\n this.selectedFormatValue = ko.observable('');\r\n this.showErrorMessage = ko.observable(false);\r\n }\r\n}\r\n\r\nexport class FileFormatView extends View {\r\n initialize({ i18n, values, valueMessages }) {\r\n this.i18n = i18n;\r\n this.viewModel = new FileFormatViewModel();\r\n this.values = values;\r\n this.valueMessages = valueMessages;\r\n }\r\n\r\n events() {\r\n return {\r\n 'click input': 'formatChange',\r\n };\r\n }\r\n\r\n formatChange(e) {\r\n this.trigger('changed', e.target.id);\r\n }\r\n\r\n render() {\r\n this.$el.html(fileFormatTemplate({\r\n values: this.values,\r\n valueMessages: this.valueMessages,\r\n validationErrorMessage: this.i18n.getString('Validation_UploadFileFormatRequired'),\r\n }));\r\n ko.applyBindings(this.viewModel, this.el);\r\n\r\n return this;\r\n }\r\n\r\n validate() {\r\n if (this.viewModel.selectedFormatValue() === '') {\r\n this.viewModel.showErrorMessage(true);\r\n return false;\r\n }\r\n this.viewModel.showErrorMessage(false);\r\n return true;\r\n }\r\n\r\n getSelectedValue() {\r\n return this.viewModel.selectedFormatValue();\r\n }\r\n}\r\n","import _ from 'underscore';\r\n\r\nimport { BaseImportStep } from '@bingads-webui-campaign/import-components';\r\nimport { FilePicker } from '@bingads-webui/file-picker';\r\nimport { withUiBlock } from '@bingads-webui/uiblocker';\r\n\r\nimport template from './file-upload-step-template.pug';\r\nimport { FileFormatView } from './file-format/file-format-view';\r\n\r\nconst FILE_FORMATS = ['Microsoft', 'Google'];\r\nconst FILE_FORMATS_STRINGS = i18n => [\r\n i18n.getString('FileImport_BingAds_Format'),\r\n i18n.getString('FileImport_AdWords_Format'),\r\n];\r\n\r\nexport class FileUploadStep extends BaseImportStep {\r\n initialize({\r\n deps,\r\n }) {\r\n super.initialize({\r\n deps,\r\n });\r\n\r\n this.permissions = this.deps.config.get('Permissions');\r\n this.isFileFormatEnabled = this.permissions.IsImportFileFormatEnabled;\r\n this.isBaiduFileImportEnabled = this.permissions.dynamic.BaiduFileImport && this.permissions.dynamic.CNMarketExpansion;\r\n\r\n this.hasNoFileSelected = true;\r\n this.filePickerView = new FilePicker({\r\n theme: 'default',\r\n allowedFileExtensions: ['.csv', '.tsv', '.xlsx', '.zip'],\r\n validateFileExtensionsFailedMessage: this.i18n.get('FileImport_Upload_InvalidFileExtension'),\r\n validator: (file) => {\r\n if (file.size === 0) {\r\n return this.i18n.get('FileImport_Upload_InvalidFile');\r\n }\r\n return null;\r\n },\r\n i18n: this.i18n,\r\n isNative: !deps.isForVNext,\r\n displayFilePath: 'filename',\r\n });\r\n\r\n if (this.isFileFormatEnabled) {\r\n this.fileFormatView = new FileFormatView({\r\n i18n: this.i18n,\r\n values: this.isBaiduFileImportEnabled ? FILE_FORMATS.concat(['Baidu']) : FILE_FORMATS,\r\n valueMessages: this.isBaiduFileImportEnabled ? FILE_FORMATS_STRINGS(this.i18n).concat([this.i18n.getString('FileImport_Baidu_Format')]) : FILE_FORMATS_STRINGS(this.i18n),\r\n });\r\n }\r\n\r\n this.logTrace(`isBaiduFileImportEnabled:${this.isBaiduFileImportEnabled}`);\r\n }\r\n\r\n render() {\r\n this.$el.html(template({\r\n i18n: this.i18n,\r\n importTemplateUrl: this.deps.importTemplateUrl,\r\n isBaiduFileImportEnabled: this.isBaiduFileImportEnabled,\r\n }));\r\n\r\n this.$('.file-picker').html(this.filePickerView.render().el);\r\n if (this.isFileFormatEnabled) {\r\n this.$('.file-format').html(this.fileFormatView.render().el);\r\n }\r\n\r\n this.filePickerView.on('changed', (filePath) => {\r\n this.hasNoFileSelected = _.isEmpty(filePath);\r\n this.isEdited = true;\r\n });\r\n\r\n this.fileFormatView.on('changed', (id) => {\r\n this.logTrace(`file format option changed to ${id}`);\r\n\r\n // clear error for file picker view when selected format changes\r\n this.filePickerView.viewModel.resetStatus();\r\n\r\n this.isEdited = true;\r\n\r\n if (this.isBaiduFileImportEnabled) {\r\n if (id === 'Baidu') {\r\n this.$('.baidu-file-import-more-info').html(this.i18n.get('FileImport_TemplateText_Baidu_MoreInfo', { entityNames: '推广计划、推广单元、创意、关键词和账户' }));\r\n } else {\r\n this.$('.baidu-file-import-more-info').html('');\r\n }\r\n }\r\n });\r\n\r\n this.logTrace('render file upload step');\r\n return this;\r\n }\r\n\r\n get title() {\r\n return this.buildTitle({\r\n activeTitle: this.i18n.get('FileImport_UploadFile_Title'),\r\n summaryTitle: this.i18n.get('FileImport_UploadFile_Summary'),\r\n });\r\n }\r\n\r\n getSummaryInfo() {\r\n return _.propertyOf(this.filePickerView.fileObject)('name');\r\n }\r\n\r\n wizardShouldGoNext() {\r\n if (this.hasNoFileSelected && !this.filePickerView.hasErrors()) {\r\n this.filePickerView.addExternalValidationErrors(this.i18n.get('Validation_UploadFileRequired'));\r\n }\r\n\r\n // Only zip format is supported for Baidu file import\r\n if (this.isBaiduFileImportEnabled\r\n && this.fileFormatView.getSelectedValue() === 'Baidu'\r\n && this.filePickerView.fileObject\r\n && this.filePickerView.fileObject.type !== 'application/x-zip-compressed'\r\n && !this.filePickerView.hasErrors()\r\n ) {\r\n this.filePickerView.addExternalValidationErrors(this.i18n.get('Validation_UploadFileFormatInvalid_Baidu'));\r\n }\r\n\r\n if (this.filePickerView.hasErrors()) {\r\n return false;\r\n }\r\n if (this.isFileFormatEnabled && !this.fileFormatView.validate()) {\r\n return false;\r\n }\r\n\r\n return this.repository.uploadFile(this.filePickerView.fileObject)\r\n .then((blobUrl) => {\r\n const fileFormat = this.isFileFormatEnabled ? this.fileFormatView.getSelectedValue() : '';\r\n\r\n this.patchState({\r\n fileUploadSummary: this.getSummaryInfo(),\r\n filePath: blobUrl,\r\n fileName: this.filePickerView.fileObject && this.filePickerView.fileObject.name,\r\n fileFormat,\r\n });\r\n return this.repository.getColumnMapping(blobUrl, fileFormat);\r\n })\r\n .then((columnMappingData) => {\r\n this.patchState({\r\n columnMappingData,\r\n });\r\n return true;\r\n })\r\n .catch((error) => {\r\n const err = error || {};\r\n\r\n if (!err.localizedError && err.body) {\r\n const code = _.propertyOf(err.body[0])('Code');\r\n\r\n if (code) {\r\n // customize error message for ImportInvalidFileFormat with Baidu Ads format\r\n if (this.state.fileFormat === 'Baidu' && code === 'ImportInvalidFileFormat') {\r\n err.localizedError = this.i18n.get('Error_Campaign_API_ImportInvalidFileFormat_Baidu');\r\n } else {\r\n err.localizedError = this.repository.getLocalizedErrorMessage(code);\r\n }\r\n }\r\n }\r\n if (err.localizedError) {\r\n this.filePickerView.addExternalValidationErrors(err.localizedError);\r\n } else {\r\n this.handleGenericError(error);\r\n }\r\n return false;\r\n })\r\n .finally(withUiBlock());\r\n }\r\n}\r\n","import Backbone from 'backbone';\r\nimport $ from 'jquery';\r\nimport { a11yPlugin } from '@bingads-webui/projection-grid-a11y';\r\nimport projectionGrid from 'projection-grid';\r\n\r\nimport { generateConfig } from './column-matching-grid-config';\r\n\r\nfunction onSelectChanged(e) {\r\n const $target = $(e.target);\r\n\r\n if ($target.val() === this.notMappedValueStr) {\r\n $target.addClass('error');\r\n } else {\r\n $target.removeClass('error');\r\n }\r\n this.trigger('change:select');\r\n}\r\n\r\nexport class ColumnMatchingGridView extends Backbone.View {\r\n initialize({\r\n data,\r\n defaultColumns,\r\n notMappedValue,\r\n i18n,\r\n }) {\r\n // todo: get notmapped fom import schema instead of arguments.\r\n this.notMappedValueStr = notMappedValue.toString();\r\n this.defaultColumns = defaultColumns;\r\n this.grid = projectionGrid\r\n .factory({\r\n vnext: true,\r\n })\r\n .use(a11yPlugin)\r\n .create(generateConfig({\r\n data,\r\n defaultColumns,\r\n notMappedValue: this.notMappedValueStr,\r\n i18n,\r\n }));\r\n }\r\n\r\n get events() {\r\n return {\r\n 'change select': onSelectChanged.bind(this),\r\n };\r\n }\r\n\r\n render() {\r\n this.$el.html(this.grid.gridView.render().el);\r\n return this;\r\n }\r\n\r\n getMappingState() {\r\n let allMapped = true;\r\n const columnMapping = [];\r\n let allNotMapped = true;\r\n\r\n this.$('th select').each((index, elem) => {\r\n const val = $(elem).val();\r\n\r\n if (allMapped && val === this.notMappedValueStr) {\r\n allMapped = false;\r\n }\r\n if (allNotMapped && val !== this.notMappedValueStr) {\r\n allNotMapped = false;\r\n }\r\n columnMapping.push(this.defaultColumns[val].EnumName);\r\n });\r\n\r\n return {\r\n columnMapping,\r\n allMapped,\r\n allNotMapped,\r\n };\r\n }\r\n\r\n remove() {\r\n if (this.grid) {\r\n this.grid.gridView.remove();\r\n this.grid = null;\r\n }\r\n\r\n super.remove();\r\n }\r\n}\r\n","import _ from 'underscore';\r\nimport headerCellDropDownTmpl from './column-matching-grid-header.pug';\r\n\r\nexport function generateConfig({\r\n data,\r\n defaultColumns,\r\n notMappedValue,\r\n i18n,\r\n}) {\r\n const columns = _.map(data.ImportHeader, (header, index) => ({\r\n name: index.toString(),\r\n title: header,\r\n bodyClasses: ['truncated'],\r\n }));\r\n\r\n const customizedHeaderCells = _.map(data.ImportHeader, (header, index) => {\r\n const cell = { attributes: {} };\r\n let selectedColumnKey = notMappedValue;\r\n\r\n _.any(defaultColumns, (val, key) => {\r\n const found = val.EnumName === data.ColumnMappingStrings[index];\r\n\r\n if (found) {\r\n selectedColumnKey = key;\r\n }\r\n return found;\r\n });\r\n\r\n cell.html = headerCellDropDownTmpl({\r\n defaultColumns,\r\n cellIndex: index,\r\n selectedOption: selectedColumnKey,\r\n showError: selectedColumnKey === notMappedValue,\r\n });\r\n return cell;\r\n });\r\n\r\n const plugins = {\r\n a11y: { i18n },\r\n };\r\n\r\n return {\r\n dataSource: {\r\n type: 'memory',\r\n data: data.formattedData,\r\n },\r\n columns,\r\n rows: {\r\n headRows: [{\r\n cells: customizedHeaderCells,\r\n },\r\n 'column-header-rows',\r\n ],\r\n },\r\n tableClasses: ['table', 'table-bordered'],\r\n tableAttributes: { 'aria-label': i18n.getString('Import_ImportSummary_ColumnMatchingSummary') },\r\n plugins,\r\n };\r\n}\r\n","import ko from 'knockout';\r\n\r\nimport { BaseImportStep } from '@bingads-webui-campaign/import-components';\r\nimport { withUiBlock } from '@bingads-webui/uiblocker';\r\n\r\nimport { ColumnMatchingGridView } from './grid/index';\r\nimport template from './column-matching-step.pug';\r\n\r\nexport class ColumnMatchingStep extends BaseImportStep {\r\n initialize({\r\n deps,\r\n }) {\r\n super.initialize({\r\n deps,\r\n });\r\n this.isContinueButtonEnabled = true;\r\n this.koModel = {\r\n showAllNotMappedError: ko.observable(false),\r\n };\r\n this.koModel.showAllNotMappedError.subscribe((newValue) => {\r\n this.isContinueButtonEnabled = !newValue;\r\n this.trigger('change:action');\r\n });\r\n }\r\n\r\n render() {\r\n this.$el.html(template({\r\n i18n: this.i18n,\r\n }));\r\n ko.applyBindings(this.koModel, this.el);\r\n return this;\r\n }\r\n\r\n get title() {\r\n return this.buildTitle({\r\n activeTitle: this.i18n.get('FileImport_ColumnMatching_Title'),\r\n summaryTitle: this.i18n.get('FileImport_ColumnMatching_Summary'),\r\n });\r\n }\r\n\r\n getSummaryInfo() {\r\n return this.grid && this.grid.getMappingState().allMapped ?\r\n this.i18n.get('FileImport_ColumnMatching_AllColumnsMappedSummary') :\r\n this.i18n.get('FileImport_ColumnMatching_ColumnsUnMappedSummary');\r\n }\r\n\r\n willShow() {\r\n if (this.checkIfShouldUpdateAndResetFlagIfTrue()) {\r\n this.deps.logActivities.renderImportColumnMatching.start();\r\n const state = this.getState();\r\n const data = state.columnMappingData;\r\n\r\n this.grid = new ColumnMatchingGridView({\r\n data,\r\n defaultColumns: this.deps.defaultColumns,\r\n notMappedValue: this.deps.notMappedValue,\r\n i18n: this.i18n,\r\n });\r\n this.$('.column-matching-grid').html(this.grid.render().el);\r\n this.grid.on('change:select', () => {\r\n this.isEdited = true;\r\n this.koModel.showAllNotMappedError(false);\r\n });\r\n this.logTrace('render column matching step');\r\n this.deps.logActivities.renderImportColumnMatching.stop();\r\n } else {\r\n this.logTrace('not edited, directly expand column matching step');\r\n }\r\n }\r\n\r\n wizardShouldGoNext() {\r\n if (this.grid && this.grid.getMappingState().allNotMapped) {\r\n this.koModel.showAllNotMappedError(true);\r\n return false;\r\n }\r\n\r\n this.patchState({\r\n columnMapping: this.grid.getMappingState().columnMapping,\r\n columnMatchingSummary: this.getSummaryInfo(),\r\n });\r\n\r\n return this.repository.getFileImportUserPreferences()\r\n .then((preferences) => {\r\n this.patchState({\r\n previousImportOptions: preferences,\r\n });\r\n\r\n return true;\r\n })\r\n .catch((err) => { //eslint-disable-line\r\n this.handleGenericError(err);\r\n return false;\r\n })\r\n .finally(withUiBlock());\r\n }\r\n\r\n get actions() {\r\n const original = super.actions;\r\n\r\n original[0].enabled = this.isContinueButtonEnabled;\r\n return original;\r\n }\r\n\r\n remove() {\r\n if (this.grid) {\r\n this.grid.remove();\r\n this.grid = null;\r\n }\r\n\r\n super.remove();\r\n }\r\n}\r\n","import Promise from 'bluebird';\r\nimport $ from 'jquery';\r\n\r\nimport { withUiBlock } from '@bingads-webui/uiblocker';\r\nimport { ImportOptionsStep } from '@bingads-webui-campaign/import-components';\r\nimport template from './file-import-options-step.pug';\r\n\r\nexport class FileImportOptionsStep extends ImportOptionsStep {\r\n initialize({\r\n deps,\r\n }) {\r\n super.initialize({\r\n deps,\r\n });\r\n this.importButtonEnabled = true;\r\n this.stepRemoved = false;\r\n }\r\n\r\n render() {\r\n this.$el.html(template());\r\n return this;\r\n }\r\n\r\n willShow() {\r\n if (this.checkIfShouldUpdateAndResetFlagIfTrue()) {\r\n const state = this.getState();\r\n\r\n if (state && state.previousImportOptions) {\r\n this.fileName = state.fileName;\r\n this.filePath = state.filePath;\r\n this.columnMapping = state.columnMapping;\r\n this.fileFormat = state.fileFormat;\r\n\r\n const permissions = this.deps.config.get('Permissions');\r\n if (permissions && permissions.dynamic && permissions.dynamic.BaiduFileImport && permissions.dynamic.CNMarketExpansion) {\r\n if (this.fileFormat === 'Baidu') {\r\n this.deps.subFieldsBlacklist = this.deps.subFieldsBlacklistForBaidu;\r\n state.previousImportOptions.PauseNewCampaigns = true;\r\n state.previousImportOptions.ImportActiveOnlyNewCampaigns = false;\r\n } else {\r\n this.deps.subFieldsBlacklist = this.deps.subFieldsBlacklistForDefault;\r\n }\r\n }\r\n\r\n this.renderForm();\r\n }\r\n } else {\r\n this.logTrace('not edited, directly expand file import options step');\r\n }\r\n }\r\n\r\n wizardShouldGoNext() {\r\n const state = this.getState() || {};\r\n const closeBlock = withUiBlock();\r\n let preparePreviewPromise;\r\n\r\n if (state.importId) {\r\n if (state.isEditEnabledForWizard && this.isEditedOrFirstSubmit) {\r\n preparePreviewPromise = this.repository.cancelCurrentImport(state.importId)\r\n .then(() => (\r\n this.createPreviewTaskExecutionAndStartPolling(closeBlock)\r\n ));\r\n } else {\r\n preparePreviewPromise = this.repository.pollGetImportStatus(state.importId, closeBlock);\r\n }\r\n } else if (this.importOptionsForm && this.importOptionsForm.validate()) {\r\n preparePreviewPromise = this.createPreviewTaskExecutionAndStartPolling(closeBlock);\r\n } else {\r\n closeBlock();\r\n return Promise.resolve(false);\r\n }\r\n\r\n const permissions = this.deps.config.get('Permissions');\r\n\r\n if ((permissions.IsSkipFileImportPreviewStepEnabled && !this.deps.isContinueImport)) {\r\n return preparePreviewPromise\r\n .then(({ importId }) => {\r\n if (this.stepRemoved) {\r\n return false;\r\n }\r\n this.patchState({\r\n importId,\r\n });\r\n return this.repository.getImportSummary(importId);\r\n })\r\n .then((data) => {\r\n if (this.stepRemoved) {\r\n return false;\r\n }\r\n this.patchState({\r\n summary: data,\r\n });\r\n return true;\r\n })\r\n .catch((err) => {\r\n this.applyButtonEnabled = true;\r\n this.trigger('change:action');\r\n this.handleErrorInImport(err);\r\n return false;\r\n })\r\n .finally(closeBlock);\r\n }\r\n return preparePreviewPromise\r\n .then(({ importId }) => {\r\n this.patchState({\r\n importId,\r\n });\r\n return this.repository.getImportPreview(importId);\r\n })\r\n .then((data) => {\r\n this.patchState({\r\n preview: data,\r\n });\r\n this.importButtonEnabled = true; // re-enable button in case user jumps back a step\r\n this.trigger('change:action');\r\n return true;\r\n })\r\n .catch((err) => {\r\n this.importButtonEnabled = true;\r\n this.trigger('change:action');\r\n\r\n const customized = err.customized || {};\r\n const { errorCode } = customized;\r\n if (errorCode === 17033) {\r\n // allow edits by not triggering typical error workflow\r\n this.showErrorMessage(customized.message);\r\n $('.btn-primary').attr('disabled', 'disabled');\r\n } else {\r\n this.handleErrorInImport(err);\r\n }\r\n return false;\r\n })\r\n .finally(closeBlock);\r\n }\r\n\r\n createPreviewTaskExecutionAndStartPolling(closeBlock) {\r\n const importPref = this.getImportOptions();\r\n\r\n this.updateStateWithFormInfo();\r\n const permissions = this.deps.config.get('Permissions');\r\n\r\n if (permissions.IsSkipFileImportPreviewStepEnabled && !this.deps.isContinueImport) {\r\n return this.repository.createFullTaskExecution(\r\n this.fileName, this.filePath,\r\n this.columnMapping, importPref, this.fileFormat\r\n )\r\n .then((taskExecutionId) => {\r\n this.importButtonEnabled = false;\r\n this.trigger('change:action');\r\n return this.repository.pollTaskItemExecutionStatus(taskExecutionId, closeBlock);\r\n });\r\n }\r\n return this.repository.createPreviewTaskExecution(\r\n this.fileName, this.filePath,\r\n this.columnMapping, importPref, this.fileFormat\r\n )\r\n .then((taskExecutionId) => {\r\n this.importButtonEnabled = false;\r\n this.trigger('change:action');\r\n return this.repository.pollTaskItemExecutionStatus(taskExecutionId, closeBlock);\r\n });\r\n }\r\n\r\n get actions() {\r\n const actions = super.actions;\r\n\r\n actions[0].displayText = this.i18n.get('CampaignImport_GSyncConnect');\r\n actions[0].enabled = this.importButtonEnabled;\r\n return actions;\r\n }\r\n}\r\n","import projectionGrid from 'projection-grid';\r\nimport _ from 'underscore';\r\nimport { a11yPlugin } from '@bingads-webui/projection-grid-a11y';\r\nimport { withUiBlock } from '@bingads-webui/uiblocker';\r\nimport { BaseImportStep } from '@bingads-webui-campaign/import-components';\r\nimport template from './import-preview-step.pug';\r\n\r\nexport class ImportPreviewStep extends BaseImportStep {\r\n initialize({\r\n deps,\r\n }) {\r\n super.initialize({\r\n deps,\r\n });\r\n this.applyButtonEnabled = true;\r\n }\r\n\r\n render() {\r\n return this;\r\n }\r\n\r\n get title() {\r\n return this.buildTitle(this.i18n.get('Import_ImportPreview_Title'));\r\n }\r\n\r\n get actions() {\r\n return [\r\n {\r\n name: 'next',\r\n displayText: this.i18n.get('Import_ApplyChanges'),\r\n enabled: this.applyButtonEnabled,\r\n },\r\n {\r\n name: 'cancel',\r\n displayText: this.i18n.get('CampaignImport_ButtonCancel'),\r\n },\r\n ];\r\n }\r\n\r\n willShow() {\r\n if (this.checkIfShouldUpdateAndResetFlagIfTrue()) {\r\n this.deps.logActivities.renderImportPreview.start();\r\n const state = this.getState();\r\n\r\n this.importId = state.importId;\r\n\r\n if (state.preview) {\r\n const data = state.preview;\r\n const hasStats = !_.isEmpty(data);\r\n\r\n this.$el.html(template({\r\n i18n: this.i18n,\r\n hasStats,\r\n }));\r\n\r\n if (hasStats) {\r\n const columns = [{\r\n property: 'Name',\r\n title: '',\r\n }, {\r\n name: 'Additions',\r\n title: this.i18n.get('Import_ColumnHeader_Additions'),\r\n }, {\r\n name: 'Changes',\r\n title: this.i18n.get('Import_ColumnHeader_Synced'),\r\n }, {\r\n name: 'Deletions',\r\n title: this.i18n.get('Import_ColumnHeader_Deletions'),\r\n }, {\r\n name: 'Errors',\r\n title: this.i18n.get('Import_ColumnHeader_Errors'),\r\n }];\r\n const config = {\r\n dataSource: {\r\n type: 'memory',\r\n data,\r\n },\r\n columns,\r\n tableClasses: ['table', 'table-bordered', 'grid'],\r\n tableAttributes: { 'aria-label': this.i18n.getString('Import_ImportPreview_Title') },\r\n plugins: {\r\n a11y: { i18n: this.i18n },\r\n },\r\n };\r\n\r\n this.grid = projectionGrid\r\n .factory({\r\n vnext: true,\r\n })\r\n .use(a11yPlugin)\r\n .create(config);\r\n this.$('.import-preview-grid').html(this.grid.gridView.render().el);\r\n\r\n this.logTrace('render import preview step');\r\n } else {\r\n this.handleGenericError({ message: 'unexpected: don\\'t have preview data' });\r\n }\r\n }\r\n this.deps.logActivities.renderImportPreview.stop();\r\n } else {\r\n this.logTrace('not edited, directly expand import preview step');\r\n }\r\n }\r\n\r\n wizardShouldGoNext() {\r\n const state = this.getState() || {};\r\n const closeBlock = withUiBlock();\r\n let prepareSummaryPromise;\r\n\r\n if (this.repository.hasImportPreviewBeenApplied(state.importStatus)) {\r\n this.importId = state.importStatus.ImportId;\r\n prepareSummaryPromise = this.repository.pollGetImportStatus(this.importId, closeBlock);\r\n } else {\r\n prepareSummaryPromise = this.repository.createCommitTaskExecution(this.importId)\r\n .then((taskExecutionId) => {\r\n this.applyButtonEnabled = false;\r\n this.trigger('change:action');\r\n return this.repository.pollTaskItemExecutionStatus(taskExecutionId, closeBlock);\r\n });\r\n }\r\n return prepareSummaryPromise\r\n .then(() => this.repository.getImportSummary(this.importId))\r\n .then((data) => {\r\n this.patchState({\r\n summary: data,\r\n });\r\n return true;\r\n })\r\n .catch((err) => {\r\n this.applyButtonEnabled = true;\r\n this.trigger('change:action');\r\n this.handleErrorInImport(err);\r\n return false;\r\n })\r\n .finally(closeBlock);\r\n }\r\n}\r\n","import { ImportSummaryStep } from '@bingads-webui-campaign/import-components';\r\n\r\nexport class FileImportSummaryStep extends ImportSummaryStep {\r\n initialize({ deps }) {\r\n super.initialize({ deps });\r\n }\r\n\r\n willShow() {\r\n const state = this.getState();\r\n\r\n this.permissions = this.deps.config.get('Permissions');\r\n\r\n if (this.permissions && this.permissions.dynamic && this.permissions.dynamic.BaiduFileImport && this.permissions.dynamic.CNMarketExpansion && state.fileFormat === 'Baidu') {\r\n this.summaryDisclaimerKey = 'Import_SummaryPage_Disclaimer_Baidu';\r\n this.summaryDisclaimerHelpLinkKey = ''; // TODO: add later after the help doc is ready\r\n this.summaryHelpTopic = ''; // TODO: update real help id later\r\n }\r\n\r\n this.summaryInfos = [{\r\n label: 'Import_ImportSummary_FileUploadSummary',\r\n text: state.fileUploadSummary,\r\n }, {\r\n label: 'Import_ImportSummary_ColumnMatchingSummary',\r\n text: state.columnMatchingSummary,\r\n }, {\r\n label: 'Import_ImportSummary_OptionsSummary',\r\n text: state.importOptionsSummary,\r\n }];\r\n\r\n super.willShow();\r\n this.logTrace('render import summary step');\r\n }\r\n}\r\n","import _ from 'underscore';\r\n\r\nimport { AccountTitleStep } from '@bingads-webui-campaign/import-components';\r\nimport { getBlackList } from '@bingads-webui-campaign/import-shared-repositories';\r\n\r\nimport {\r\n FileUploadStep,\r\n ColumnMatchingStep,\r\n FileImportOptionsStep,\r\n ImportPreviewStep,\r\n FileImportSummaryStep,\r\n} from '../step/index';\r\n\r\nfunction createAccountTitleStep(deps) {\r\n return {\r\n stepName: 'account-title-step',\r\n stepView: new AccountTitleStep({ deps }),\r\n };\r\n}\r\n\r\nfunction createFileUploadStep(deps) {\r\n return {\r\n stepName: 'file-upload-step',\r\n stepView: new FileUploadStep({ deps }),\r\n };\r\n}\r\n\r\nfunction createColumnMatchingStep(deps) {\r\n return {\r\n stepName: 'column-matching-step',\r\n stepView: new ColumnMatchingStep({\r\n deps: _.defaults({ previousStepName: 'file-upload-step' }, deps),\r\n }),\r\n };\r\n}\r\n\r\nexport const getSubFieldsBlackList = (permissions, fileFormat) => {\r\n const subFieldsBlacklist = getBlackList(permissions);\r\n\r\n subFieldsBlacklist.push('ImportAccountUrlOptions');\r\n subFieldsBlacklist.push('ImportDeletedEntities');\r\n subFieldsBlacklist.push('ImportNewOption_ImportNewAudienceTargets');\r\n subFieldsBlacklist.push('ImportUpdateEntityPreference_UpdateAudienceTargets');\r\n subFieldsBlacklist.push('ImportNewOption_ImportNewPageFeeds');\r\n subFieldsBlacklist.push('ImportUpdateEntityPreference_UpdatePageFeeds');\r\n subFieldsBlacklist.push('ImportNewOption_ImportNewAdCustomizerFeeds');\r\n subFieldsBlacklist.push('ImportUpdateEntityPreference_UpdateAdCustomizerFeeds');\r\n subFieldsBlacklist.push('ImportUET');\r\n subFieldsBlacklist.push('AssociatedUETTagId');\r\n subFieldsBlacklist.push('AutoDeviceBidOptimization');\r\n subFieldsBlacklist.push('ImportUpdateEntityPreference_UpdateAdUrls');\r\n subFieldsBlacklist.push('ImportUpdateEntityPreference_UpdateSitelinkUrls');\r\n\r\n if (permissions && permissions.dynamic && permissions.dynamic.BaiduFileImport && permissions.dynamic.CNMarketExpansion && fileFormat === 'Baidu') {\r\n // new options\r\n subFieldsBlacklist.push('ImportNewOption_ImportNewNegativeKeywordList');\r\n // subFieldsBlacklist.push('ImportNewOption_ImportNewTrackingTemplateAndCustomParams');\r\n subFieldsBlacklist.push('ImportNewOption_ImportNewNegativeSites');\r\n subFieldsBlacklist.push('ImportNewCustomFiltersForShoppingCampaigns');\r\n subFieldsBlacklist.push('ImportNewOption_ImportNewDemographicTargets');\r\n\r\n // new extensions\r\n subFieldsBlacklist.push('ImportNewOption_ImportNewAppAdExtensions');\r\n subFieldsBlacklist.push('ImportNewOption_ImportNewCallAdExtensions');\r\n subFieldsBlacklist.push('ImportNewOption_ImportNewCalloutAdExtensions');\r\n subFieldsBlacklist.push('ImportNewOption_ImportNewLocationAdExtensions');\r\n subFieldsBlacklist.push('ImportNewOption_ImportNewPriceAdExtensions');\r\n subFieldsBlacklist.push('ImportNewOption_ImportNewPromotionAdExtensions');\r\n subFieldsBlacklist.push('ImportNewOption_ImportNewReviewAdExtensions');\r\n subFieldsBlacklist.push('ImportNewOption_ImportNewSitelinkAdExtensions');\r\n subFieldsBlacklist.push('ImportNewOption_ImportNewStructuredSnippetAdExtensions');\r\n subFieldsBlacklist.push('ImportNewOption_ImportNewImageAdExtensions');\r\n\r\n // update options\r\n subFieldsBlacklist.push('ImportUpdateEntityPreference_UpdateAppAdExtensions');\r\n subFieldsBlacklist.push('ImportUpdateEntityPreference_UpdateExistingNegativeKeywordList');\r\n subFieldsBlacklist.push('ImportUpdateEntityPreference_UpdateNegativeSites');\r\n // subFieldsBlacklist.push('ImportUpdateEntityPreference_UpdateTrackingTemplateAndCustomParams');\r\n subFieldsBlacklist.push('ImportUpdateEntityPreference_UpdateAdGroupNetworkSetting');\r\n subFieldsBlacklist.push('UpdateCustomFiltersForShoppingCampaigns');\r\n subFieldsBlacklist.push('ImportUpdateEntityPreference_UpdateDemographicTargets');\r\n\r\n // update extensions\r\n subFieldsBlacklist.push('ImportUpdateEntityPreference_UpdateCallAdExtensions');\r\n subFieldsBlacklist.push('ImportUpdateEntityPreference_UpdateCalloutAdExtensions');\r\n subFieldsBlacklist.push('ImportUpdateEntityPreference_UpdateLocationAdExtensions');\r\n subFieldsBlacklist.push('ImportUpdateEntityPreference_UpdatePriceAdExtensions');\r\n subFieldsBlacklist.push('ImportUpdateEntityPreference_UpdatePromotionAdExtensions');\r\n subFieldsBlacklist.push('ImportUpdateEntityPreference_UpdateReviewAdExtensions');\r\n subFieldsBlacklist.push('ImportUpdateEntityPreference_UpdateSitelinkAdExtensions');\r\n subFieldsBlacklist.push('ImportUpdateEntityPreference_UpdateStructuredSnippetAdExtensions');\r\n subFieldsBlacklist.push('ImportUpdateEntityPreference_UpdateImageAdExtensions');\r\n\r\n // bid and budget\r\n subFieldsBlacklist.push('RaiseLowBidsToMinServingBidsForBsc');\r\n\r\n // tracking template\r\n subFieldsBlacklist.push('AppendPreferencesForTrackingTemplate_UseAppendString');\r\n subFieldsBlacklist.push('AppendPreferencesForTrackingTemplate_AppendStringForTrackingTemplate');\r\n\r\n subFieldsBlacklist.push('SearchAndReplacePreferencesForTrackingTemplate_UseSearchAndReplaceString');\r\n subFieldsBlacklist.push('SearchAndReplacePreferencesForTrackingTemplate_SearchStringForTrackingTemplate');\r\n subFieldsBlacklist.push('SearchAndReplacePreferencesForTrackingTemplate_ReplaceStringForTrackingTemplate');\r\n\r\n subFieldsBlacklist.push('SearchAndReplaceForCustomParameters_EnableSearchAndReplace');\r\n subFieldsBlacklist.push('SearchAndReplaceForCustomParameters_SearchString');\r\n subFieldsBlacklist.push('SearchAndReplaceForCustomParameters_ReplaceString');\r\n }\r\n return subFieldsBlacklist;\r\n};\r\n\r\nfunction createImportOptionsStep(deps) {\r\n const permissions = deps.config.get('Permissions');\r\n\r\n // eslint-disable-next-line no-param-reassign\r\n deps.subFieldsBlacklist = getSubFieldsBlackList(permissions);\r\n if (permissions && permissions.dynamic && permissions.dynamic.BaiduFileImport && permissions.dynamic.CNMarketExpansion) {\r\n // eslint-disable-next-line no-param-reassign\r\n deps.subFieldsBlacklistForBaidu = getSubFieldsBlackList(permissions, 'Baidu');\r\n // eslint-disable-next-line no-param-reassign\r\n deps.subFieldsBlacklistForDefault = deps.subFieldsBlacklist;\r\n }\r\n\r\n return {\r\n stepName: 'import-options-step',\r\n stepView: new FileImportOptionsStep({\r\n deps: _.defaults({ previousStepName: 'column-matching-step' }, deps),\r\n }),\r\n };\r\n}\r\n\r\nfunction createImportPreviewStep(deps) {\r\n return {\r\n stepName: 'import-preview-step',\r\n stepView: new ImportPreviewStep({\r\n deps: _.defaults({ previousStepName: 'import-options-step' }, deps),\r\n }),\r\n };\r\n}\r\n\r\nfunction createImportSummaryStep(deps) {\r\n return {\r\n stepName: 'import-summary-step',\r\n stepView: new FileImportSummaryStep({ deps }),\r\n };\r\n}\r\n\r\nexport class FileImportStepFactory {\r\n static createSteps(deps) {\r\n deps.check();\r\n const permissions = deps.config.get('Permissions');\r\n const steps = [];\r\n\r\n steps.push(createAccountTitleStep(deps));\r\n steps.push(createFileUploadStep(deps));\r\n steps.push(createColumnMatchingStep(deps));\r\n steps.push(createImportOptionsStep(deps));\r\n if ((!permissions.IsSkipFileImportPreviewStepEnabled || deps.isContinueImport)) {\r\n steps.push(createImportPreviewStep(deps));\r\n }\r\n steps.push(createImportSummaryStep(deps));\r\n\r\n return steps;\r\n }\r\n}\r\n","import Backbone from 'backbone';\r\nimport Promise from 'bluebird';\r\nimport $ from 'jquery';\r\nimport _ from 'underscore';\r\n\r\nimport { BaseImportView } from '@bingads-webui-campaign/import-components';\r\n\r\nimport { FileImportRepository } from '../repository/index';\r\nimport { FileImportStepFactory } from './file-import-step-factory';\r\n\r\n// Common dependency checks should happen in base-import-view\r\nfunction checkRequiredDepsForFileImport(deps) {\r\n deps.check('azureUploader');\r\n deps.check('defaultColumns');\r\n deps.check('notMappedValue');\r\n deps.check('importTemplateUrl');\r\n}\r\n\r\nexport class FileImportPage extends Backbone.View {\r\n initialize({\r\n deps,\r\n options = {},\r\n }) {\r\n checkRequiredDepsForFileImport(deps);\r\n this.perfMarker = deps.perfMarker;\r\n\r\n this.repository = new FileImportRepository({\r\n deps,\r\n });\r\n this.options = _.extend({\r\n pageTitle: deps.i18n.get('FileImport_PageTitle'),\r\n }, options);\r\n this.deps = deps;\r\n this.steps = FileImportStepFactory.createSteps(_.extend({\r\n repository: this.repository,\r\n isContinueImport: !!options.importId,\r\n subFieldsBlacklist: options.subFieldsBlacklist,\r\n }, deps));\r\n }\r\n\r\n logTrace(...args) {\r\n this.repository.logTrace(...args);\r\n }\r\n\r\n render() {\r\n this.perfMarker.willRender();\r\n let renderPromise = Promise.resolve(true);\r\n const initialState = {};\r\n const baseImportOptions = this.options;\r\n\r\n baseImportOptions.enableEdit = true;\r\n if (this.options.importId) {\r\n initialState.importId = this.options.importId;\r\n initialState.isPreviewImportFromLogGrid = true;\r\n renderPromise = this.repository.getImportStatus()\r\n .then((response) => {\r\n this.startPollingAfterContinueImport =\r\n _.partial(this.startPollingAfterContinueImport, response).bind(this);\r\n if (this.repository.hasImportPreviewBeenApplied(response)) {\r\n this.logTrace('pending import has been submitted');\r\n\r\n baseImportOptions.currentStep = 'import-preview-step';\r\n } else {\r\n this.logTrace('pending import is not submitted');\r\n\r\n baseImportOptions.currentStep = 'import-options-step';\r\n }\r\n return Promise.resolve(true);\r\n });\r\n }\r\n\r\n return renderPromise\r\n .then(() => {\r\n this.baseImportView = new BaseImportView({\r\n deps: this.deps,\r\n steps: this.steps,\r\n options: baseImportOptions,\r\n initialState,\r\n onSwitchFinished() {\r\n $('[data-step-name=\"account-title-step\"] .edit-step').hide();\r\n },\r\n });\r\n\r\n return this.baseImportView.render()\r\n .then((baseImportView) => {\r\n this.$el.html(baseImportView.el);\r\n this.$('[data-step-name=\"account-title-step\"] .edit-step').hide();\r\n this.perfMarker.done();\r\n return this;\r\n });\r\n });\r\n }\r\n\r\n remove() {\r\n if (this.baseImportView) {\r\n this.baseImportView.remove();\r\n }\r\n super.remove();\r\n }\r\n\r\n // this needs to be called after this view has been attached to dom\r\n // otherwise UI blocker throws exception\r\n startPollingAfterContinueImport(importStatus) {\r\n if (importStatus) {\r\n this.baseImportView.goToNextStep(importStatus);\r\n }\r\n }\r\n}\r\n","import ko from 'knockout';\r\n\r\nexport class InstantSearchViewModel {\r\n constructor({\r\n placeholder,\r\n }) {\r\n this.placeholder = ko.observable(placeholder);\r\n this.searchString = ko.observable('');\r\n this.inEditMode = ko.observable(false);\r\n }\r\n}\r\n","import ko from 'knockout';\r\nimport Backbone from 'backbone';\r\n\r\nimport template from './instant-search.pug';\r\nimport { InstantSearchViewModel } from './instant-search-viewmodel';\r\n\r\nexport class InstantSearch extends Backbone.View {\r\n initialize({\r\n placeholder = '',\r\n i18n,\r\n }) {\r\n this.koModel = new InstantSearchViewModel({\r\n placeholder,\r\n });\r\n this.i18n = i18n;\r\n }\r\n\r\n get events() {\r\n return {\r\n 'input input': '_onInputChanged',\r\n 'keypress input': '_onKeyPressedInTextInput',\r\n 'click .filtercloseimage': '_clearSearch',\r\n };\r\n }\r\n\r\n _onInputChanged(event) {\r\n const trimmedVal = this.koModel.searchString().replace(/^\\s+/, '');// trim white space from left, note trimLeft is not supported on IE\r\n\r\n /*\r\n workaround for IE.\r\n In IE, tab into with or tab out from will trigger this event.\r\n If value is not empty, this event wont' be triggered.\r\n And preventDefault() will cancel the default action.\r\n so focus will get lost, elements are inaccessible by keyboard.\r\n if edit mode is not changed and no search string, do nothing\r\n */\r\n if ((this.koModel.inEditMode() === !!trimmedVal) && !trimmedVal) {\r\n return;\r\n }\r\n\r\n event.preventDefault();\r\n this.koModel.inEditMode(!!trimmedVal);\r\n this.trigger('input', trimmedVal);\r\n }\r\n\r\n _onKeyPressedInTextInput(event) {\r\n const RETURN_CODE = 13;\r\n\r\n if (event.which === RETURN_CODE) {\r\n event.preventDefault();\r\n }\r\n }\r\n\r\n _clearSearch(event) {\r\n event.preventDefault();\r\n this.koModel.searchString('');\r\n this.koModel.inEditMode(false);\r\n this.trigger('input', '');\r\n }\r\n\r\n render() {\r\n this.$el.html(template({\r\n i18n: this.i18n,\r\n }));\r\n ko.applyBindings(this.koModel, this.el);\r\n\r\n return this;\r\n }\r\n}\r\n","import ko from 'knockout';\r\n\r\nexport class ShowPausedFilterViewModel {\r\n constructor(options) {\r\n this.disableShowPause = ko.observable(options.disable);\r\n this.showPaused = ko.observable('');\r\n }\r\n}\r\n","import _ from 'underscore';\r\nimport ko from 'knockout';\r\nimport Backbone from 'backbone';\r\n\r\nimport template from './show-paused-filter.pug';\r\nimport { ShowPausedFilterViewModel } from './show-paused-filter-viewmodel';\r\n\r\nexport class ShowPausedFilter extends Backbone.View {\r\n initialize(options) {\r\n this.options = options || {};\r\n\r\n this.koModel = new ShowPausedFilterViewModel(_.defaults({\r\n disable: this.options.shouldDisableThisFilter,\r\n }, {\r\n disable: false,\r\n }));\r\n }\r\n\r\n render() {\r\n this.el.innerHTML = template({\r\n i18n: this.options.i18n,\r\n });\r\n ko.applyBindings(this.koModel, this.el);\r\n\r\n if (!this.options.shouldDisableThisFilter) {\r\n this.koModel.showPaused.subscribe((newValue) => {\r\n this.trigger('change', newValue);\r\n }, this);\r\n }\r\n\r\n if (this.options.showPaused) {\r\n this.koModel.showPaused(true);\r\n } else {\r\n this.koModel.showPaused(false); // default is to show active campaigns\r\n }\r\n\r\n return this;\r\n }\r\n}\r\n","import _ from 'underscore';\r\n\r\nexport default (gridView, func) => {\r\n gridView.set({\r\n dataSource: _.defaults({\r\n filter: func,\r\n }, gridView.get('dataSource')),\r\n });\r\n};\r\n","import _ from 'underscore';\r\nimport $ from 'jquery';\r\n\r\nimport { InstantSearch } from './instant-search';\r\nimport { ShowPausedFilter } from './show-paused-filter';\r\nimport setFilter from './set-memory-filter';\r\n\r\nexport function generateFilterPlugin({\r\n i18n,\r\n logTrace = () => {},\r\n}) {\r\n return definePlugin => definePlugin('memoryFilter', ['config', 'gridView'], (config, gridView) => {\r\n const filterConfig = config.plugins.filter || {};\r\n const searchConfig = filterConfig.search;\r\n const searchProperty = searchConfig && searchConfig.property;\r\n let searchBoxView;\r\n let searchValue;\r\n\r\n const pausedConfig = filterConfig.pausedFilter;\r\n const showPausedFilterProperty = pausedConfig && pausedConfig.property;\r\n let showPausedView;\r\n let showPausedChecked;\r\n let activeData;\r\n\r\n function searchFilter(val, item) {\r\n if (item[searchProperty]) {\r\n return item[searchProperty].toLowerCase().indexOf(val.toLowerCase()) !== -1;\r\n }\r\n return !val; // return Accounts with null name if search val is empty\r\n }\r\n\r\n function isActive(item) {\r\n return item[showPausedFilterProperty] === i18n.get('CampaignImport_EntityStatusActive');\r\n }\r\n\r\n function generateFilterFunction() {\r\n const filterConditions = [];\r\n\r\n if (!_.isUndefined(searchValue)) {\r\n filterConditions.push(_.partial(searchFilter, searchValue));\r\n }\r\n\r\n if (showPausedChecked === false) {\r\n filterConditions.push(isActive);\r\n }\r\n\r\n return item => _.every(filterConditions, filter => filter(item));\r\n }\r\n\r\n if (searchConfig) {\r\n searchBoxView = new InstantSearch({\r\n placeholder: searchConfig.title,\r\n i18n,\r\n });\r\n\r\n $(searchConfig.container).html(searchBoxView.el);\r\n\r\n searchBoxView.on('input', _.debounce((val) => {\r\n searchValue = val;\r\n setFilter(gridView, generateFilterFunction());\r\n logTrace(`GoogleAccountSearch:${val}`);\r\n }, 200)); // check input after some time instead of check very input\r\n }\r\n\r\n if (pausedConfig) {\r\n const { data } = config.dataSource;\r\n activeData = _.filter(data, isActive);\r\n\r\n if (pausedConfig.forceHide) {\r\n showPausedChecked = false;\r\n setFilter(gridView, generateFilterFunction());\r\n } else {\r\n const hasNoActiveData = _.isEmpty(activeData);\r\n const shouldDisableThisFilter = (activeData.length === data.length) || hasNoActiveData;\r\n\r\n showPausedView = new ShowPausedFilter({\r\n showPaused: pausedConfig.showPaused || hasNoActiveData,\r\n shouldDisableThisFilter: !pausedConfig.alwaysEnable && shouldDisableThisFilter,\r\n i18n,\r\n });\r\n showPausedView.filteredData = activeData;\r\n\r\n $(pausedConfig.container).html(showPausedView.el);\r\n\r\n showPausedView.on('change', (checked) => {\r\n showPausedChecked = checked;\r\n setFilter(gridView, generateFilterFunction());\r\n });\r\n }\r\n }\r\n\r\n return {\r\n render: () => {\r\n if (searchBoxView) {\r\n searchBoxView.render();\r\n }\r\n\r\n if (showPausedView) {\r\n showPausedView.render();\r\n }\r\n },\r\n remove: () => {\r\n if (searchBoxView) {\r\n searchBoxView.remove();\r\n }\r\n\r\n if (showPausedView) {\r\n showPausedView.remove();\r\n }\r\n },\r\n searchBoxView,\r\n totalDataWithActiveFilter: activeData,\r\n enableShowPaused: () => {\r\n if (showPausedView) {\r\n showPausedView.koModel.showPaused(true);\r\n }\r\n },\r\n getShowPausedValue: () => showPausedChecked,\r\n };\r\n });\r\n}\r\n","import ko from 'knockout';\r\nimport _ from 'underscore';\r\n\r\nexport class CampaignGridViewModel {\r\n constructor({\r\n data,\r\n repo,\r\n isAIMImportEnabled = false,\r\n }) {\r\n const hasDiplayCampaign = repo.containDisplayType(data);\r\n\r\n this.importAll = ko.observable(true);\r\n this.importAll.Editing = ko.computed({\r\n read() {\r\n return this.importAll() ? 'true' : 'false';\r\n },\r\n write(newValue) {\r\n this.importAll(newValue === 'true');\r\n },\r\n }, this);\r\n\r\n this.showPaused = ko.observable(false);\r\n\r\n this.selectedCampaigns = ko.observable('');\r\n this.showValidationError = ko.computed(() => _.isEmpty(this.selectedCampaigns()));\r\n this.hasError = ko.computed(() => !this.importAll() && this.showValidationError());\r\n\r\n this.showDisplayCampaignAlert = ko.computed(() => {\r\n if (!isAIMImportEnabled) {\r\n return false;\r\n }\r\n if (this.importAll()) {\r\n return hasDiplayCampaign;\r\n }\r\n return repo.containDisplayType(this.selectedCampaigns());\r\n });\r\n }\r\n}\r\n","import _ from 'underscore';\r\n\r\nexport function generateConfig({\r\n i18n,\r\n data,\r\n showPaused,\r\n signupMode,\r\n}) {\r\n const columnsConfig = _.compact([{\r\n name: 'Name',\r\n title: i18n.get('Import_SelectCampaign_CampaignName'),\r\n sortable: item => item.Name.toString().toLowerCase(),\r\n bodyClasses: 'truncated',\r\n }, {\r\n name: 'Type',\r\n title: i18n.get('Import_SelectCampaign_Type'),\r\n sortable: item => item.Type.toString().toLowerCase(),\r\n }, {\r\n name: 'Status',\r\n title: i18n.get('Import_SelectCampaign_Status'),\r\n sortable: item => item.Status.toString().toLowerCase(),\r\n }]);\r\n\r\n const plugins = {\r\n a11y: { i18n },\r\n filter: {\r\n search: {\r\n container: '.importCampaignsGrid .grid-filter-container',\r\n property: 'Name',\r\n title: i18n.getString('Campaigns_SearchCampaign'),\r\n },\r\n pausedFilter: {\r\n container: '.importCampaignsGrid .show-paused-filter',\r\n property: 'Status',\r\n showPaused,\r\n forceHide: signupMode,\r\n },\r\n },\r\n toolbar: {\r\n container: '.importCampaignsGrid .grid-toolbar',\r\n },\r\n };\r\n\r\n const tableName = i18n.getString('Import_Campaigns_ViewDetail_ColumnName');\r\n\r\n return {\r\n el: '.importCampaignsGrid .grid-table',\r\n dataSource: {\r\n type: 'memory',\r\n data,\r\n },\r\n\r\n scrolling: {\r\n virtualized: true,\r\n header: {\r\n type: 'fixed',\r\n attributes: { 'aria-label': i18n.getString('{{tableName}} table header').replace('{{tableName}}', tableName) },\r\n },\r\n },\r\n\r\n selection: {\r\n bodyClasses: 'text-center',\r\n headClasses: 'text-center',\r\n },\r\n columns: columnsConfig,\r\n tableClasses: ['table', 'table-bordered'],\r\n tableAttributes: { 'aria-label': tableName },\r\n plugins,\r\n };\r\n}\r\n\r\n","import _ from 'underscore';\r\nimport $ from 'jquery';\r\nimport Backbone from 'backbone';\r\nimport ko from 'knockout';\r\n\r\nimport projectionGrid from 'projection-grid';\r\nimport { a11yPlugin } from '@bingads-webui/projection-grid-a11y';\r\nimport { assistedSelectionPlugin } from '@bingads-webui/projection-grid-assisted-selection';\r\n\r\nimport { generateFilterPlugin } from '../../../plugin/index';\r\nimport template from './campaign-selection-grid-template.pug';\r\nimport { CampaignGridViewModel } from './campaign-selection-grid-viewmodel';\r\n\r\nimport { generateConfig } from './campaign-selection-grid-config';\r\n\r\nexport class CampaignGridView extends Backbone.View {\r\n initialize({\r\n data = [],\r\n showPaused = false,\r\n signupMode,\r\n i18n,\r\n repo,\r\n multiAccountMode = false,\r\n isAIMImportEnabled,\r\n getGridConfig,\r\n }) {\r\n const localizedData = _.map(data, obj => _.extend(obj, { Status: i18n.get(`CampaignImport_EntityStatus${obj.Status}`) }));\r\n const sortedData = _.sortBy(localizedData, obj => obj.Name.toString().toLowerCase());\r\n\r\n const getConfig = getGridConfig || generateConfig;\r\n this.config = getConfig({\r\n i18n,\r\n data: sortedData,\r\n showPaused,\r\n signupMode,\r\n });\r\n this.i18n = i18n;\r\n this.toolbarList = ['search'];\r\n this.koModel = new CampaignGridViewModel({\r\n data: localizedData,\r\n repo,\r\n isAIMImportEnabled,\r\n });\r\n this.dataForImportAll = localizedData;\r\n this.signupMode = signupMode;\r\n this.multiAccountMode = multiAccountMode;\r\n this.maxLen = 96; // max length for summary info\r\n }\r\n\r\n render() {\r\n this.el.innerHTML = template({\r\n i18n: this.i18n,\r\n signupMode: this.signupMode,\r\n singleAccountMode: !this.multiAccountMode,\r\n });\r\n ko.applyBindings(this.koModel, this.el);\r\n\r\n const ensureRenderImportSpecific = _.once(this.renderImportSpecific).bind(this);\r\n\r\n this.koModel.importAll.subscribe((newValue) => {\r\n if (!newValue) {\r\n ensureRenderImportSpecific();\r\n }\r\n this.trigger('change:select');\r\n }, this);\r\n\r\n this.koModel.hasError.subscribe((value) => {\r\n this.trigger('change:error', value);\r\n });\r\n\r\n return this;\r\n }\r\n\r\n renderImportSpecific() {\r\n this.grid = projectionGrid\r\n .factory({ vnext: true })\r\n .use(a11yPlugin)\r\n .use(generateFilterPlugin({\r\n i18n: this.i18n,\r\n }))\r\n .use(assistedSelectionPlugin)\r\n .create(this.config);\r\n\r\n this.gridView = this.grid.gridView;\r\n this.gridView.render();\r\n this.grid.memoryFilter.render();\r\n\r\n this.gridView.on('willUpdate', () => {\r\n $(this.config.el).addClass('fixed-height');\r\n }, this);\r\n\r\n this.gridView.on('didUpdate', () => {\r\n $(this.config.el).removeClass('fixed-height');\r\n this.koModel.selectedCampaigns(this.gridView.selectedItems());\r\n this.trigger('change:select');\r\n }, this);\r\n\r\n return this;\r\n }\r\n\r\n getCurrentSetting() {\r\n return {\r\n showPaused: !this.koModel.importAll() &&\r\n this.grid.memoryFilter.getShowPausedValue(),\r\n };\r\n }\r\n\r\n getSelectedCampaigns() {\r\n if (this.koModel.importAll()) {\r\n return [];\r\n }\r\n\r\n return _.map(this.gridView.selectedItems(), item => item.Id);\r\n }\r\n\r\n areAnyPausedCampaignsSelected() {\r\n return !this.koModel.importAll() &&\r\n _.reduce(\r\n this.gridView.selectedItems(),\r\n (memo, item) => (memo || item.Status === this.i18n.getString('CampaignImport_EntityStatusPaused')), false\r\n );\r\n }\r\n\r\n selectCampaigns(campaignIds) {\r\n if (_.size(campaignIds) > 0) {\r\n // select import specific campaigns and show paused\r\n this.koModel.importAll(false);\r\n this.grid.memoryFilter.enableShowPaused();\r\n\r\n const wrappedSetCampaigns = _.once(this.setSelectedCampaignsInGrid).bind(this);\r\n\r\n // select campaigns in grid after grid renders\r\n this.gridView.on('didUpdate', () => {\r\n if (this.gridView._isRendered) { // eslint-disable-line no-underscore-dangle\r\n wrappedSetCampaigns(campaignIds);\r\n }\r\n });\r\n }\r\n }\r\n\r\n setSelectedCampaignsInGrid(campaignIds) {\r\n const data = this.gridView.itemArray;\r\n const selectedCampaigns = _.map(_.filter(data, obj => (\r\n _.contains(campaignIds, obj.Id)\r\n )), obj => (\r\n obj[this.gridView.primaryKey]\r\n ));\r\n\r\n _.each(selectedCampaigns, (obj) => {\r\n this.gridView.selectRow(obj);\r\n });\r\n this.koModel.selectedCampaigns(campaignIds);\r\n }\r\n\r\n getSummaryInfo() {\r\n if (this.koModel.importAll()) {\r\n return this.i18n.get('Import_SelectCampaign_AllCampaigns');\r\n }\r\n\r\n let summaryText = '';\r\n const totalCampaignsNumber = this.dataForImportAll.length;\r\n const selectedCampaignsNumber = this.gridView.selectedItems().length;\r\n const totalActiveCampaignsNumber = _.size(this.grid.memoryFilter.totalDataWithActiveFilter);\r\n\r\n if (selectedCampaignsNumber === totalCampaignsNumber ||\r\n selectedCampaignsNumber === totalActiveCampaignsNumber) {\r\n // check if there any active campaigns\r\n if (totalActiveCampaignsNumber === 0) {\r\n summaryText = this.i18n.get('Import_SelectCampaign_AllPaused');\r\n } else if (selectedCampaignsNumber === totalActiveCampaignsNumber) {\r\n summaryText = this.i18n.get('Import_SelectCampaign_AllActive');\r\n } else {\r\n summaryText = this.i18n.get('Import_SelectCampaign_AllCampaigns');\r\n }\r\n } else {\r\n _.every(this.gridView.selectedItems(), (campaign) => {\r\n if (summaryText.length + campaign.Name.length < this.maxLen) {\r\n summaryText += `${campaign.Name}, `;\r\n return true;\r\n }\r\n\r\n summaryText += '...';\r\n return false;\r\n });\r\n\r\n // summaryText may ends with \", \", we need to remove it.\r\n const trimPattern = /, $/;\r\n\r\n summaryText = summaryText.replace(trimPattern, '');\r\n }\r\n\r\n return summaryText;\r\n }\r\n\r\n showSpecificCampaigns() {\r\n this.koModel.importAll(false);\r\n }\r\n\r\n remove() {\r\n if (this.grid) {\r\n this.grid.memoryFilter.remove();\r\n this.gridView.remove();\r\n }\r\n return super.remove();\r\n }\r\n}\r\n","import PropTypes, { func, shape, number, bool, string, arrayOf } from 'prop-types';\r\n\r\nexport const CampaignDataArrayProps = arrayOf(shape({\r\n Id: number.isRequired,\r\n Name: string.isRequired,\r\n Status: string.isRequired,\r\n Type: string.isRequired,\r\n}));\r\nexport const RepositoryProps = shape({\r\n containDisplayType: func.isRequired,\r\n getGoogleAdGroupsByCampaignId: func.isRequired,\r\n});\r\nexport const AnnotatedDataProps = arrayOf(shape({\r\n id: number.isRequired,\r\n name: string.isRequired,\r\n status: string.isRequired,\r\n type: string.isRequired,\r\n availableWithFilter: bool.isRequired,\r\n}));\r\nexport const I18nProps = shape({\r\n getString: func.isRequired,\r\n get: func.isRequired,\r\n});\r\nexport const I18nAmdLoaderProps = shape({\r\n parseDecimal: func.isRequired,\r\n});\r\nexport const SelectionDataProps = shape({\r\n selectedCampaignIds: arrayOf(number),\r\n selectedWithActiveOnly: arrayOf(number),\r\n selectedAdGroupMap: PropTypes.objectOf(arrayOf(number)),\r\n});\r\nexport const StateGetterProps = shape({\r\n setSelectedDataGetter: func.isRequired,\r\n setImportAllGetter: func.isRequired,\r\n});\r\n","import React from 'react';\r\nimport PropTypes from 'prop-types';\r\nimport { Checkbox } from '@bingads-webui-react/checkbox';\r\nimport { keyCode } from '@bingads-webui/keycode';\r\n\r\nimport { I18nProps } from './shapes';\r\n\r\nexport class GoogleCampaignAndAdGroupHeader extends React.PureComponent {\r\n static propTypes = {\r\n i18n: I18nProps.isRequired,\r\n ariaLabel: PropTypes.string.isRequired,\r\n selectAllChecked: PropTypes.bool.isRequired,\r\n onSelectAllCheckboxChange: PropTypes.func.isRequired,\r\n onSortChange: PropTypes.func.isRequired,\r\n sortInDescendingOrder: PropTypes.bool.isRequired,\r\n sortedProperty: PropTypes.string.isRequired,\r\n };\r\n\r\n handleSelectAllFilterChange = e => this.props.onSelectAllCheckboxChange(e.target.checked);\r\n\r\n render() {\r\n const sortString = this.props.sortInDescendingOrder ? 'descending' : 'ascending';\r\n const sortIcon = ;\r\n\r\n return (\r\n
\r\n \r\n \r\n \r\n \r\n \r\n \r\n this.props.onSortChange('name')}\r\n tabIndex=\"0\"\r\n onKeyDown={(event) => {\r\n if ((event.keyCode === keyCode.Enter) || (event.keyCode === keyCode.Space)) {\r\n this.props.onSortChange('name');\r\n }\r\n }}\r\n >\r\n {this.props.sortedProperty === 'name' && sortIcon}\r\n {this.props.i18n.get('GoogleImport_SelectCampaign_CampaignName')}\r\n \r\n this.props.onSortChange('type')}\r\n tabIndex=\"0\"\r\n onKeyDown={(event) => {\r\n if ((event.keyCode === keyCode.Enter) || (event.keyCode === keyCode.Space)) {\r\n this.props.onSortChange('type');\r\n }\r\n }}\r\n >\r\n {this.props.sortedProperty === 'type' && sortIcon}\r\n {this.props.i18n.get('GoogleImport_SelectCampaign_Type')}\r\n \r\n \r\n {this.props.i18n.get('GoogleImport_SelectCampaign_AdGroupStatus')}\r\n \r\n \r\n \r\n
\r\n
\r\n );\r\n }\r\n}\r\n","export const ACTIVE_STATUS = 'Active';\r\nexport const PAUSED_STATUS = 'Paused';\r\nexport const SELECTALL_CHECKBOX_STATUS = {\r\n CHECKED: 0,\r\n UNCHECKED: 1,\r\n UNDEFINED: 2,\r\n};\r\nexport const MaxSelectedCampaignsWithSpecificAdGroups = 10;\r\n","import React from 'react';\r\nimport PropTypes from 'prop-types';\r\nimport { FlattenedNode } from '@bingads-webui-react/tree-view';\r\nimport { TooltipHost, TooltipOverflowMode } from '@bingads-webui-react/fabric-control';\r\n\r\nimport { PAUSED_STATUS } from './constants';\r\n\r\nexport const ListNode = node => (\r\n \r\n \r\n \r\n \r\n {node.name}\r\n \r\n \r\n \r\n {node.isExpandable ? node.type : ''}\r\n \r\n \r\n {node.isExpandable ? node.selectionStatus : ''}\r\n \r\n \r\n);\r\n\r\nListNode.propTypes = PropTypes.shape(FlattenedNode);\r\n","import _ from 'underscore';\r\nimport React from 'react';\r\nimport PropTypes from 'prop-types';\r\n\r\nimport { TreeView, CheckBoxNode, NodeOperations } from '@bingads-webui-react/tree-view';\r\nimport { ListNode } from './list-node-renderer';\r\nimport { RepositoryProps, AnnotatedDataProps, StateGetterProps, I18nProps, SelectionDataProps } from './shapes';\r\nimport { ACTIVE_STATUS, SELECTALL_CHECKBOX_STATUS, MaxSelectedCampaignsWithSpecificAdGroups } from './constants';\r\n\r\nconst PAGE_SIZE = 20;\r\n\r\nexport class CampaignAdGroupTree extends React.PureComponent {\r\n static propTypes = {\r\n googleCustomerId: PropTypes.number.isRequired,\r\n i18n: I18nProps.isRequired,\r\n onErrorOrWarning: PropTypes.func.isRequired,\r\n onSelectionChange: PropTypes.func.isRequired,\r\n annotatedData: AnnotatedDataProps.isRequired,\r\n pageNumber: PropTypes.number.isRequired,\r\n repository: RepositoryProps.isRequired,\r\n selectionData: SelectionDataProps.isRequired,\r\n showPausedAdGroups: PropTypes.bool.isRequired,\r\n selectAllCheckboxStatus: PropTypes.number.isRequired,\r\n toggleSelectAllCheckboxOnGridUpdate: PropTypes.func.isRequired,\r\n stateGetter: StateGetterProps.isRequired,\r\n setUiBlocker: PropTypes.func.isRequired,\r\n };\r\n\r\n constructor(props) {\r\n super(props);\r\n\r\n this.campaignSelectedStatus = {\r\n NONE: this.props.i18n.get('GoogleImport_SelectEntities_None'),\r\n SPECIFIC_SELECTED: this.props.i18n.get('GoogleImport_SelectEntities_Specific'),\r\n ALL_EXISTING_AND_NEW_ENABLED: this.props.i18n.get('GoogleImport_SelectEntities_ExistingAndNewEnabled'),\r\n ALL_EXISTING_AND_NEW: this.props.i18n.get('GoogleImport_SelectEntities_ExistingAndNew'),\r\n };\r\n\r\n this.expandIconAriaLabel = this.props.i18n.get('GoogleImport_ExpandableNode');\r\n\r\n const initialDataState = this.initializeSelectionAndExpansionData();\r\n const initialNodeState = this.buildNodes(this.props, initialDataState);\r\n this.state = _.extend(initialDataState, initialNodeState);\r\n\r\n this.props.stateGetter.setSelectedDataGetter(() =>\r\n _.pick(this.state, 'selectedCampaignIds', 'selectedWithActiveOnly', 'selectedAdGroupMap'));\r\n\r\n this.checkAndPropogateEmptyError(this.state);\r\n this.updateSelectAllFilter(this.props, this.state);\r\n }\r\n\r\n componentDidUpdate(prevProps) {\r\n const state = prevProps.selectionData !== this.props.selectionData ?\r\n this.initializeSelectionAndExpansionData(newState => this.setState(newState))\r\n : this.state;\r\n\r\n if (\r\n prevProps.annotatedData !== this.props.annotatedData\r\n || prevProps.showPausedAdGroups !== this.props.showPausedAdGroups\r\n || prevProps.pageNumber !== this.props.pageNumber) {\r\n this.updateNodes(this.props, state, newState => this.setState(newState));\r\n this.updateSelectAllFilter(this.props, state);\r\n } else if ((prevProps.selectAllCheckboxStatus !== this.props.selectAllCheckboxStatus) &&\r\n (this.props.selectAllCheckboxStatus !== SELECTALL_CHECKBOX_STATUS.UNDEFINED)) {\r\n this.selectAllFiltered();\r\n }\r\n\r\n if (prevProps.stateGetter !== this.props.stateGetter) {\r\n this.props.stateGetter.setSelectedDataGetter(() =>\r\n _.pick(this.state, 'selectedCampaignIds', 'selectedWithActiveOnly', 'selectedAdGroupMap'));\r\n }\r\n\r\n this.checkAndPropogateEmptyError(state);\r\n this.checkAndRemoveThrotllingAlert();\r\n }\r\n\r\n /* Event handlers */\r\n\r\n onNodeExpanded = (unused, node) => {\r\n if (!this.isThrottlingRequired(node)) {\r\n this.props.setUiBlocker(true);\r\n this.props.repository.getGoogleAdGroupsByCampaignId(this.props.googleCustomerId, node.id)\r\n .then((expandedAdGroupData) => {\r\n this.setState((prevState, prevProps) => {\r\n const { nodes } = prevState;\r\n const newState = { expandedAdGroupData };\r\n const newNodes = _.map(nodes, (n) => {\r\n if (n.id === node.id) {\r\n return this.expandNode(_.extend({}, prevState, newState), node, prevProps);\r\n }\r\n if (n.state.expanded) {\r\n return this.collapseNode(n);\r\n }\r\n return n;\r\n });\r\n return { nodes: newNodes, expandedAdGroupData };\r\n });\r\n })\r\n .finally(() => this.props.setUiBlocker(false));\r\n } else {\r\n this.props.onErrorOrWarning(this.props.i18n.get('Maximum_Selected_Specific_Campaign_Reached'), true);\r\n }\r\n }\r\n\r\n onNodeCollapsed = (unused, node) => {\r\n this.setState((prevState) => {\r\n const { nodes } = prevState;\r\n const newNodes = this.rebuildWithReplaceAction(nodes, node.id, this.collapseNode);\r\n return { nodes: newNodes, expandedAdGroupData: [] };\r\n });\r\n }\r\n\r\n onNodeSelected = (unused, node) => {\r\n const isDisplayType = this.props.repository.containDisplayType([node]);\r\n if (node.isExpandable) {\r\n this.setState((prevState, prevProps) => {\r\n const {\r\n nodes, selectedCampaignIds, selectedWithActiveOnly,\r\n } = prevState;\r\n const { id, state: { checked } } = node;\r\n const newState = {};\r\n if (checked) {\r\n if (prevProps.showPausedAdGroups) {\r\n newState.selectedCampaignIds = _.uniq(_.union(selectedCampaignIds, [id]));\r\n } else {\r\n newState.selectedWithActiveOnly = _.uniq(_.union(selectedWithActiveOnly, [id]));\r\n }\r\n } else {\r\n _.extend(newState, this.removeCampaignSelection(prevState, id));\r\n }\r\n newState.nodes = this.rebuildWithReplaceAction(\r\n nodes, id,\r\n _.partial(this.selectCampaignNode, _.extend({}, prevState, newState))\r\n );\r\n this.props.onSelectionChange(id, checked, isDisplayType);\r\n return newState;\r\n }, () => this.updateSelectAllFilter(this.props, this.state));\r\n } else {\r\n this.setState((prevState) => {\r\n const { nodes, expandedAdGroupData, selectedAdGroupMap } = prevState;\r\n const parentId = node.campaignId;\r\n const parentNode = _.where(nodes, { id: parentId })[0];\r\n const parentSelectionStatus = this.determineSelectionStatus(prevState, parentNode);\r\n\r\n // build list based on status\r\n let initialSelection;\r\n switch (parentSelectionStatus) {\r\n case this.campaignSelectedStatus.ALL_EXISTING_AND_NEW:\r\n initialSelection = _.pluck(expandedAdGroupData, 'Id');\r\n break;\r\n case this.campaignSelectedStatus.ALL_EXISTING_AND_NEW_ENABLED:\r\n initialSelection = _.pluck(_.filter(expandedAdGroupData, n => n.Status === ACTIVE_STATUS), 'Id');\r\n break;\r\n case this.campaignSelectedStatus.SPECIFIC_SELECTED:\r\n initialSelection = selectedAdGroupMap[parentId];\r\n break;\r\n default:\r\n initialSelection = [];\r\n break;\r\n }\r\n\r\n // replace previous selection with new selection\r\n const newState = {};\r\n _.extend(newState, this.removeCampaignSelection(prevState, parentId));\r\n const newSelection = _.uniq(node.state.checked ?\r\n _.union(initialSelection, [node.id])\r\n : _.without(initialSelection, node.id));\r\n const parentChecked = !_.isEmpty(newSelection);\r\n if (parentChecked) {\r\n newState.selectedAdGroupMap = _.clone(selectedAdGroupMap);\r\n newState.selectedAdGroupMap[parentId] = newSelection;\r\n }\r\n\r\n newState.nodes = this.rebuildWithReplaceAction(\r\n nodes, parentId,\r\n _.partial(this.selectAdGroupNode, newState, node)\r\n );\r\n this.props.onSelectionChange(parentId, parentChecked, isDisplayType);\r\n return newState;\r\n }, () => this.updateSelectAllFilter(this.props, this.state));\r\n }\r\n }\r\n\r\n /* Helper/Misc functions */\r\n\r\n getClassNames = node => [`checkbox-node-${node.id}`, {\r\n 'expanded-node': node.isExpandable && node.state && node.state.expanded,\r\n 'collapsed-node': node.isExpandable && !(node.state && node.state.expanded),\r\n 'leaf-node': !node.isExpandable,\r\n }];\r\n\r\n getFilteredCampaignIds = (annotatedData) => {\r\n const filteredNodes = _.filter(annotatedData, node => node.availableWithFilter);\r\n return _.map(filteredNodes, node => node.id);\r\n }\r\n\r\n isMaxSelectedSpecificCampaignReached = () =>\r\n _.keys(this.state.selectedAdGroupMap).length >= MaxSelectedCampaignsWithSpecificAdGroups;\r\n\r\n isThrottlingRequired = node =>\r\n this.isMaxSelectedSpecificCampaignReached() && !(node.id in this.state.selectedAdGroupMap);\r\n\r\n initializeSelectionAndExpansionData = (callback) => {\r\n const newState = {\r\n selectedCampaignIds: this.props.selectionData.selectedCampaignIds || [],\r\n selectedWithActiveOnly: this.props.selectionData.selectedWithActiveOnly || [],\r\n selectedAdGroupMap: this.props.selectionData.selectedAdGroupMap || {},\r\n expandedAdGroupData: [],\r\n };\r\n if (callback) callback(newState);\r\n return newState;\r\n }\r\n\r\n combineOrDiff = (combine, arr1, arr2) => {\r\n const result = combine ?\r\n _.uniq(_.union(arr1, arr2)) : _.difference(arr1, arr2);\r\n return result;\r\n }\r\n\r\n rebuildWithReplaceAction = (arr, id, action) =>\r\n _.map(arr, (val) => {\r\n if (val.id === id) {\r\n return action(val);\r\n }\r\n return val;\r\n });\r\n\r\n checkAndPropogateEmptyError = (state) => {\r\n if (_.isEmpty(state.selectedCampaignIds)\r\n && _.isEmpty(state.selectedWithActiveOnly)\r\n && _.isEmpty(state.selectedAdGroupMap)) {\r\n this.props.onErrorOrWarning(this.props.i18n.get('Validation_CampaignSelectionRequired'));\r\n } else {\r\n this.props.onErrorOrWarning('');\r\n }\r\n }\r\n\r\n checkAndRemoveThrotllingAlert = () => {\r\n if (!this.isMaxSelectedSpecificCampaignReached()) {\r\n this.props.onErrorOrWarning('', true);\r\n }\r\n }\r\n\r\n /* Node transformers */\r\n\r\n selectAllFiltered = () => {\r\n this.setState((prevState, props) => {\r\n const { selectAllCheckboxStatus, annotatedData } = props;\r\n const {\r\n selectedCampaignIds, selectedWithActiveOnly, selectedAdGroupMap,\r\n } = prevState;\r\n const newState = {};\r\n const filteredCampaignIds = this.getFilteredCampaignIds(annotatedData);\r\n newState.selectedCampaignIds = this.combineOrDiff(\r\n selectAllCheckboxStatus === SELECTALL_CHECKBOX_STATUS.CHECKED && props.showPausedAdGroups,\r\n selectedCampaignIds,\r\n filteredCampaignIds\r\n );\r\n newState.selectedWithActiveOnly = this.getFilteredCampaignIds(annotatedData);\r\n newState.selectedWithActiveOnly = this.combineOrDiff(\r\n selectAllCheckboxStatus === SELECTALL_CHECKBOX_STATUS.CHECKED && !props.showPausedAdGroups,\r\n selectedWithActiveOnly,\r\n filteredCampaignIds\r\n );\r\n newState.selectedAdGroupMap = _.omit(selectedAdGroupMap, filteredCampaignIds);\r\n return newState;\r\n }, () => this.updateNodes(this.props, this.state, newState => this.setState(newState)));\r\n }\r\n\r\n expandNode = (state, campaignNode) =>\r\n _.extend({}, campaignNode, {\r\n state: _.extend({}, campaignNode.state, { expanded: true }),\r\n children: this.buildAdGroupNodes(state, campaignNode, this.props.showPausedAdGroups),\r\n });\r\n\r\n collapseNode = campaignNode =>\r\n _.extend({}, campaignNode, {\r\n state: _.extend({}, campaignNode.state, { expanded: false }),\r\n children: [],\r\n });\r\n\r\n selectCampaignNode = (selectedData, campaignNode) => {\r\n const checked = !campaignNode.state.checked;\r\n return _.extend({}, campaignNode, {\r\n selectionStatus: this.determineSelectionStatus(selectedData, campaignNode),\r\n state: _.extend({}, campaignNode.state, { checked, indeterminate: false }),\r\n children: _.map(campaignNode.children, n =>\r\n _.extend(n, {\r\n state: _.extend({}, n.state, { checked }),\r\n })),\r\n });\r\n }\r\n\r\n selectAdGroupNode = (selectedData, adGroupNode, campaignNode) => {\r\n const resultNode = _.extend({}, campaignNode);\r\n const resultSelectionStatus = this.determineSelectionStatus(selectedData, campaignNode);\r\n const newChildren = _.map(campaignNode.children, (n) => {\r\n if (n.id === adGroupNode.id) {\r\n return adGroupNode;\r\n }\r\n return n;\r\n });\r\n return _.extend(resultNode, {\r\n state: _.extend({}, resultNode.state, {\r\n checked: resultSelectionStatus !== this.campaignSelectedStatus.NONE,\r\n indeterminate: resultSelectionStatus === this.campaignSelectedStatus.SPECIFIC_SELECTED,\r\n }),\r\n selectionStatus: resultSelectionStatus,\r\n children: newChildren,\r\n });\r\n }\r\n\r\n /* Selection helpers */\r\n\r\n determineSelectionStatus = (selectedData, node) => {\r\n const { id } = node;\r\n const { selectedCampaignIds, selectedWithActiveOnly, selectedAdGroupMap } = selectedData;\r\n if (_.contains(selectedCampaignIds, id)) {\r\n return this.campaignSelectedStatus.ALL_EXISTING_AND_NEW;\r\n }\r\n if (_.contains(selectedWithActiveOnly, id)) {\r\n return this.campaignSelectedStatus.ALL_EXISTING_AND_NEW_ENABLED;\r\n }\r\n if (_.has(selectedAdGroupMap, id)) {\r\n if (_.size(selectedAdGroupMap[id]) === _.size(node.children)) {\r\n return this.campaignSelectedStatus.ALL_EXISTING_AND_NEW;\r\n }\r\n return this.campaignSelectedStatus.SPECIFIC_SELECTED;\r\n }\r\n return this.campaignSelectedStatus.NONE;\r\n }\r\n\r\n removeCampaignSelection = (state, id) => {\r\n const { selectedCampaignIds, selectedWithActiveOnly, selectedAdGroupMap } = state;\r\n const changes = {};\r\n\r\n if (_.contains(selectedCampaignIds, id)) {\r\n changes.selectedCampaignIds = _.without(selectedCampaignIds, id);\r\n }\r\n if (_.contains(selectedWithActiveOnly, id)) {\r\n changes.selectedWithActiveOnly = _.without(selectedWithActiveOnly, id);\r\n }\r\n if (_.has(selectedAdGroupMap, id)) {\r\n changes.selectedAdGroupMap = _.omit(selectedAdGroupMap, id);\r\n }\r\n return changes;\r\n }\r\n\r\n /* Build functions */\r\n\r\n updateNodes = (newProps, state, callback) => callback(this.buildNodes(newProps, state));\r\n\r\n updateSelectAllFilter = (prevProps, newState) => {\r\n const { selectedCampaignIds, selectedAdGroupMap, selectedWithActiveOnly } = newState;\r\n const { annotatedData } = prevProps;\r\n const allSelectedIds = _.union(\r\n selectedCampaignIds,\r\n selectedWithActiveOnly,\r\n _.map(_.keys(selectedAdGroupMap), id => parseInt(id, 10))\r\n );\r\n const filteredCampaignIds = this.getFilteredCampaignIds(annotatedData);\r\n const remainingUnselectedCampaigns = _.difference(filteredCampaignIds, allSelectedIds);\r\n this.props.toggleSelectAllCheckboxOnGridUpdate(remainingUnselectedCampaigns.length < 1\r\n && filteredCampaignIds.length > 0);\r\n }\r\n\r\n buildNodes = (newProps, state) => {\r\n const { annotatedData, pageNumber, showPausedAdGroups } = newProps;\r\n const { expandedAdGroupData } = state;\r\n const expandedId = expandedAdGroupData && expandedAdGroupData[0]\r\n && expandedAdGroupData[0].campaignId;\r\n\r\n let visCount = 0;\r\n const newState = {};\r\n newState.nodes = _.compact(_.map(annotatedData, (op) => {\r\n const isExpanded = op.id === expandedId;\r\n const resultSelectionStatus = this.determineSelectionStatus(state, op);\r\n if (op.availableWithFilter) {\r\n visCount += 1;\r\n if (visCount > pageNumber * PAGE_SIZE && visCount <= (pageNumber + 1) * PAGE_SIZE) {\r\n return _.extend(_.pick(op, 'id', 'name', 'status', 'type'), {\r\n isExpandable: true,\r\n selectionStatus: resultSelectionStatus,\r\n state: {\r\n checked: resultSelectionStatus !== this.campaignSelectedStatus.NONE,\r\n expanded: isExpanded,\r\n indeterminate:\r\n resultSelectionStatus === this.campaignSelectedStatus.SPECIFIC_SELECTED,\r\n },\r\n children: isExpanded ?\r\n this.buildAdGroupNodes(this.state, op, showPausedAdGroups)\r\n : [],\r\n });\r\n }\r\n }\r\n\r\n if (isExpanded) newState.expandedAdGroupData = [];\r\n return undefined;\r\n }));\r\n return newState;\r\n }\r\n\r\n buildAdGroupNodes = (state, campaignNode, showPausedAdGroups) => {\r\n const campaignId = campaignNode.id;\r\n const { expandedAdGroupData, selectedAdGroupMap } = state;\r\n const selectionStatus = this.determineSelectionStatus(state, campaignNode);\r\n return _.compact(_.map(expandedAdGroupData, (obj) => {\r\n const isActive = obj.Status === ACTIVE_STATUS;\r\n if (showPausedAdGroups || isActive) {\r\n const checked =\r\n selectionStatus === this.campaignSelectedStatus.ALL_EXISTING_AND_NEW\r\n || (selectionStatus === this.campaignSelectedStatus.ALL_EXISTING_AND_NEW_ENABLED\r\n && isActive)\r\n || (selectionStatus === this.campaignSelectedStatus.SPECIFIC_SELECTED\r\n && _.contains(selectedAdGroupMap[campaignId], obj.Id));\r\n return {\r\n id: obj.Id,\r\n name: obj.Name,\r\n status: obj.Status,\r\n type: obj.Type,\r\n campaignId: obj.campaignId,\r\n state: {\r\n checked,\r\n },\r\n };\r\n }\r\n\r\n return undefined;\r\n }));\r\n }\r\n\r\n updateTypeHandlers = () => ({\r\n [NodeOperations.SELECTED]: this.onNodeSelected,\r\n [NodeOperations.EXPANDED]: this.onNodeExpanded,\r\n [NodeOperations.COLLAPSED]: this.onNodeCollapsed,\r\n })\r\n\r\n render = () => (\r\n \r\n );\r\n}\r\n","/*\r\n Combines search box, filter, uiblocker and TreeView\r\n*/\r\nimport _ from 'underscore';\r\nimport React, { Component } from 'react';\r\nimport PropTypes from 'prop-types';\r\n\r\nimport { UiBlocker } from '@bingads-webui-react/ui-blocker';\r\nimport { SearchBox, SearchResultLiveRegion } from '@bingads-webui-react/search-box';\r\nimport { Pagination } from '@bingads-webui-react/pagination';\r\nimport { Checkbox } from '@bingads-webui-react/checkbox';\r\nimport { Alert } from '@bingads-webui-react/alert';\r\nimport { getShowNoActiveCampaignCouponAlert } from '@bingads-webui-campaign/import-components';\r\n\r\nimport { GoogleCampaignAndAdGroupHeader } from './header';\r\nimport { RepositoryProps, CampaignDataArrayProps, I18nProps, StateGetterProps, SelectionDataProps, I18nAmdLoaderProps } from './shapes';\r\nimport { CampaignAdGroupTree } from './tree-view';\r\nimport { ACTIVE_STATUS, PAUSED_STATUS, SELECTALL_CHECKBOX_STATUS } from './constants';\r\n\r\nconst PAGE_SIZE = 20;\r\nconst INITIAL_PAGE_NUMBER = 0;\r\n\r\nexport class GoogleCampaignAndAdGroupSelector extends Component {\r\n static propTypes = {\r\n data: CampaignDataArrayProps.isRequired,\r\n googleCustomerId: PropTypes.number.isRequired,\r\n i18n: I18nProps.isRequired,\r\n i18nAmdLoader: I18nAmdLoaderProps.isRequired,\r\n onErrorOrWarning: PropTypes.func.isRequired,\r\n onSelectionChange: PropTypes.func.isRequired,\r\n repository: RepositoryProps.isRequired,\r\n selectionData: SelectionDataProps,\r\n stateGetter: StateGetterProps,\r\n // eslint-disable-next-line react/forbid-prop-types\r\n logScenario: PropTypes.object,\r\n // eslint-disable-next-line react/forbid-prop-types\r\n coupon: PropTypes.object,\r\n };\r\n\r\n static defaultProps = {\r\n selectionData: {},\r\n stateGetter: {\r\n setSelectedDataGetter: _.noop,\r\n setImportAllGetter: _.noop,\r\n },\r\n logScenario: undefined,\r\n coupon: null,\r\n };\r\n\r\n constructor(props) {\r\n super(props);\r\n\r\n this.state = this.initializeState();\r\n }\r\n\r\n componentDidUpdate(prevProps, prevState) {\r\n if (this.props.logScenario) {\r\n if (prevState.selectAllCheckboxChecked !== this.state.selectAllCheckboxChecked) {\r\n this.props.logScenario.selectAllCampaigns.create()\r\n .signal(this.state.selectAllCheckboxChecked);\r\n }\r\n if (prevState.showPausedCampaigns !== this.state.showPausedCampaigns) {\r\n this.props.logScenario.showPausedCampaigns.create().signal(this.state.showPausedCampaigns);\r\n }\r\n if (prevState.showPausedAdGroups !== this.state.showPausedAdGroups) {\r\n this.props.logScenario.showPausedAdGroups.create().signal(this.state.showPausedAdGroups);\r\n }\r\n if (prevState.query !== this.state.query) {\r\n this.props.logScenario.searchInCampaign.create().signal(this.state.query);\r\n }\r\n }\r\n\r\n if (prevProps.data !== this.props.data\r\n || prevProps.selectionData !== this.props.selectionData) {\r\n this.initializeState(newState => this.setState(newState));\r\n } else {\r\n getShowNoActiveCampaignCouponAlert(\r\n this.props.coupon,\r\n this.props.data,\r\n this.props.stateGetter.getSelectedData(),\r\n (showNoActiveCampaignCouponAlert) => {\r\n if (this.state.showNoActiveCampaignCouponAlert !== showNoActiveCampaignCouponAlert) {\r\n this.setState({ showNoActiveCampaignCouponAlert });\r\n }\r\n }\r\n );\r\n }\r\n }\r\n\r\n onSelectionChange = (id, checked, isDisplayType) => {\r\n this.props.onSelectionChange(id, checked, isDisplayType);\r\n\r\n // need to log this with a timeout, otherwise the new item\r\n // that gets selected is not reflected in getSelectedData\r\n if (this.props.logScenario) {\r\n setTimeout(() => {\r\n const selectionData = this.props.stateGetter.getSelectedData();\r\n const selectionToLog = {};\r\n selectionToLog.campaigns = _.map(\r\n selectionData.selectedCampaignIds,\r\n campaignId => _.find(this.props.data, campaign => campaign.Id === campaignId)\r\n );\r\n selectionToLog.adGroups = selectionData.selectedAdGroupMap;\r\n this.props.logScenario.campaignSelectionChanged.create().signal(selectionToLog);\r\n }, 500);\r\n }\r\n };\r\n\r\n /*\r\n Event handlers\r\n */\r\n onCampaignFilterChange = (updates) => {\r\n this.setState((prevState) => {\r\n const newState = _.defaults({}, updates, prevState);\r\n const { annotatedData, availableCount } = this.buildAnnotatedData(newState);\r\n\r\n const pageNumber = prevState.pageNumber * PAGE_SIZE < availableCount ?\r\n prevState.pageNumber : Math.floor(availableCount / PAGE_SIZE);\r\n return {\r\n ...updates, annotatedData, availableCount, pageNumber,\r\n };\r\n });\r\n };\r\n\r\n onPageNumberChanged = (pageNumber) => {\r\n // log pageNumberChange here instead of in componentDidUpdate because on filter change\r\n // it would also trigger page number change which should not be logged\r\n if (this.props.logScenario) {\r\n this.props.logScenario.pageNumberChange.create().signal(pageNumber);\r\n }\r\n this.setState({ pageNumber });\r\n };\r\n\r\n onQuery = query => this.onCampaignFilterChange({ query });\r\n\r\n onCampaignFilter = e => this.onCampaignFilterChange({ showPausedCampaigns: e.target.checked });\r\n\r\n onAdGroupFilter = e => this.setState({ showPausedAdGroups: e.target.checked });\r\n\r\n onSelectAllCheckboxChange = (selectAllCheckboxChecked) => {\r\n this.setState({\r\n selectAllCheckboxChecked,\r\n selectAllCheckboxStatus: selectAllCheckboxChecked ?\r\n SELECTALL_CHECKBOX_STATUS.CHECKED : SELECTALL_CHECKBOX_STATUS.UNCHECKED,\r\n });\r\n };\r\n\r\n setUiBlocker = blocking => this.setState({ blocking });\r\n\r\n initializeState(callback) {\r\n const sortedData = _.sortBy(this.props.data, obj => obj.Name.toString().toLowerCase());\r\n const pausedCampaigns = _.where(sortedData, { Status: PAUSED_STATUS });\r\n\r\n const showNoActiveCampaignCouponAlert = getShowNoActiveCampaignCouponAlert(\r\n this.props.coupon,\r\n this.props.data,\r\n this.props.selectionData\r\n );\r\n\r\n const initialState = {\r\n query: '',\r\n showPausedCampaignsDisabled: _.isEmpty(pausedCampaigns),\r\n showPausedCampaigns: !_.isEmpty(this.props.selectionData)\r\n || pausedCampaigns.length === sortedData.length,\r\n showPausedAdGroups: true,\r\n selectAllCheckboxStatus: SELECTALL_CHECKBOX_STATUS.UNCHECKED,\r\n selectAllCheckboxChecked: false,\r\n blocking: false,\r\n pageNumber: INITIAL_PAGE_NUMBER,\r\n annotatedData: sortedData,\r\n sortInDescendingOrder: false,\r\n sortedProperty: '',\r\n showNoActiveCampaignCouponAlert,\r\n };\r\n const initialAnnotatedState = this.buildAnnotatedData(initialState);\r\n const newState = _.extend(initialState, initialAnnotatedState);\r\n\r\n if (callback) callback(newState);\r\n return newState;\r\n }\r\n\r\n toggleSelectAllCheckboxOnGridUpdate = (selectAllCheckboxChecked) => {\r\n this.setState({\r\n selectAllCheckboxChecked,\r\n selectAllCheckboxStatus: SELECTALL_CHECKBOX_STATUS.UNDEFINED,\r\n });\r\n };\r\n\r\n sortAnnotatedData = (property) => {\r\n this.setState((prevState) => {\r\n const { annotatedData, sortedProperty, sortInDescendingOrder } = prevState;\r\n if (sortedProperty === property || (_.isEmpty(sortedProperty) && property === 'name')) {\r\n return {\r\n annotatedData: _.clone(annotatedData).reverse(),\r\n sortedProperty: property,\r\n sortInDescendingOrder: !sortInDescendingOrder,\r\n };\r\n }\r\n\r\n const newAnnotatedData = _.sortBy(\r\n annotatedData,\r\n obj => obj[property].toString().toLowerCase()\r\n );\r\n return {\r\n annotatedData: newAnnotatedData, sortedProperty: property, sortInDescendingOrder: false,\r\n };\r\n });\r\n };\r\n\r\n buildAnnotatedData = (state) => {\r\n const { query, showPausedCampaigns } = state;\r\n let availableCount = 0;\r\n const annotatedData = _.map(state.annotatedData, (op) => {\r\n const status = op.status || op.Status;\r\n const name = op.name || op.Name;\r\n const availableWithFilter =\r\n (!query || name.toLowerCase().indexOf(query.toLowerCase()) !== -1)\r\n && (showPausedCampaigns || status === ACTIVE_STATUS);\r\n availableCount += availableWithFilter;\r\n return {\r\n id: op.id || op.Id,\r\n name,\r\n status,\r\n type: op.type || op.Type,\r\n availableWithFilter,\r\n };\r\n });\r\n return { annotatedData, availableCount };\r\n };\r\n\r\n render() {\r\n const { i18n, data } = this.props;\r\n const tableName = i18n.get('GoogleImport_GoogleAdsCampaigns_ViewDetail_ColumnName');\r\n const headerAriaLabel = i18n.getString('{{tableName}} table header').replace('{{tableName}}', tableName);\r\n\r\n const containPmaxCampaign = _.find(data, campaign => campaign.TypeId === 7);\r\n const showPausedAdGroupMessage = containPmaxCampaign ?\r\n this.props.i18n.get('GoogleImport_SelectAdGroupsAndAssetGroups_ShowPaused') :\r\n this.props.i18n.get('GoogleImport_SelectAdGroups_ShowPaused');\r\n\r\n return (\r\n
\r\n \r\n \r\n
\r\n \r\n \r\n
\r\n \r\n \r\n {this.state.showNoActiveCampaignCouponAlert && (\r\n
\r\n }\r\n dismissible={false}\r\n message={i18n.get('FAC_GImport_Inline_MustHave1ActiveAccount')}\r\n />\r\n
\r\n )}\r\n \r\n {this.props.i18n.get('GoogleImport_SelectCampaign_ShowPaused')}\r\n \r\n \r\n {showPausedAdGroupMessage}\r\n \r\n \r\n
\r\n );\r\n }\r\n}\r\n","import _ from 'underscore';\r\nimport React from 'react';\r\nimport PropTypes from 'prop-types';\r\n\r\nimport { RadioGroup } from '@bingads-webui-react/primitive';\r\n\r\nimport { I18nProps, I18nAmdLoaderProps, RepositoryProps, CampaignDataArrayProps, SelectionDataProps, StateGetterProps } from './shapes';\r\nimport { GoogleCampaignAndAdGroupSelector } from './list-box';\r\n\r\nexport class GoogleCampaignAndAdGroupStep extends React.PureComponent {\r\n static propTypes = {\r\n data: CampaignDataArrayProps.isRequired,\r\n googleCustomerId: PropTypes.number.isRequired,\r\n i18n: I18nProps.isRequired,\r\n i18nAmdLoader: I18nAmdLoaderProps.isRequired,\r\n onError: PropTypes.func.isRequired,\r\n onSelectionChange: PropTypes.func.isRequired,\r\n repository: RepositoryProps.isRequired,\r\n selectionData: SelectionDataProps.isRequired,\r\n stateGetter: StateGetterProps.isRequired,\r\n // eslint-disable-next-line react/no-unused-prop-types\r\n renderDisplayCampaignAlert: PropTypes.func,\r\n // eslint-disable-next-line react/forbid-prop-types\r\n logScenario: PropTypes.object,\r\n importAllCampaignsSelected: PropTypes.func,\r\n importSpecificCampaignSelectedLog: PropTypes.func,\r\n // eslint-disable-next-line react/forbid-prop-types\r\n coupon: PropTypes.object,\r\n };\r\n\r\n static defaultProps = {\r\n renderDisplayCampaignAlert: undefined,\r\n logScenario: undefined,\r\n importSpecificCampaignSelectedLog: () => {},\r\n importAllCampaignsSelected: () => {},\r\n coupon: null,\r\n }\r\n\r\n constructor(props) {\r\n super(props);\r\n\r\n this.state = this.initializeState();\r\n this.props.stateGetter.setImportAllGetter((() => this.state.importAll));\r\n }\r\n\r\n componentDidUpdate(prevProps) {\r\n if (prevProps.data !== this.props.data\r\n || prevProps.selectionData !== this.props.selectionData) {\r\n this.initializeState(newState => this.setState(newState));\r\n }\r\n if (prevProps.stateGetter !== this.props.stateGetter) {\r\n this.props.stateGetter.setImportAllGetter((() => this.state.importAll));\r\n }\r\n }\r\n\r\n initializeState(callback) {\r\n const dataHasDisplayType = this.props.repository.containDisplayType(this.props.data);\r\n const availableIdBoolMap = _.object(_.map(this.props.data, obj => [obj.Id, true]));\r\n const selectedIds = _.union(\r\n this.props.selectionData.selectedCampaignIds,\r\n this.props.selectionData.selectedWithActiveOnly,\r\n _.map(_.keys(this.props.selectionData.selectedAdGroupMap), id => parseInt(id, 10))\r\n );\r\n this.props.onError('');\r\n const newState = {\r\n error: '',\r\n warning: '',\r\n importAll: _.isEmpty(this.props.selectionData)\r\n || _.every(this.props.selectionData, _.isEmpty),\r\n dataHasDisplayType,\r\n selectedDisplayIds: _.filter(selectedIds, id => availableIdBoolMap[id]),\r\n };\r\n\r\n if (callback) callback(newState);\r\n return newState;\r\n }\r\n\r\n handleRadioChange = (item) => {\r\n const importAll = item.val;\r\n if (importAll) {\r\n this.props.importAllCampaignsSelected();\r\n } else {\r\n this.props.importSpecificCampaignSelectedLog();\r\n }\r\n const newState = {\r\n importAll,\r\n };\r\n if (importAll) {\r\n this.handleErrorOrWarning('');\r\n newState.selectedDisplayIds = [];\r\n }\r\n this.setState(newState, this.props.onSelectionChange);\r\n }\r\n\r\n handleErrorOrWarning = (error, isWarning = false) => {\r\n if (isWarning) {\r\n this.setState({ warning: error });\r\n } else {\r\n this.props.onError(!_.isEmpty(error));\r\n this.setState({ error });\r\n }\r\n };\r\n\r\n handleSelectionChange = (id, checked, isDisplayType) => {\r\n this.props.onSelectionChange();\r\n if (isDisplayType) {\r\n this.setState((prevState) => {\r\n const { selectedDisplayIds } = prevState;\r\n const newState = {};\r\n newState.selectedDisplayIds = _.uniq(checked ?\r\n _.union(selectedDisplayIds, [id])\r\n : _.without(selectedDisplayIds, id));\r\n return newState;\r\n });\r\n }\r\n }\r\n\r\n render = () => {\r\n const { i18n } = this.props;\r\n const radioItems = [\r\n {\r\n val: true,\r\n name: i18n.get('GoogleImport_SelectCampaign_ImportAll'),\r\n },\r\n {\r\n val: false,\r\n name: i18n.get('GoogleImport_SelectEntities_ImportSpecific'),\r\n },\r\n ];\r\n\r\n return (\r\n
\r\n
\r\n \r\n {i18n.get('GoogleImport_SelectEntities_Description')}\r\n \r\n
\r\n item.name}\r\n />\r\n {!this.state.importAll &&\r\n \r\n }\r\n
\r\n {this.state.error}\r\n
\r\n {this.state.warning &&\r\n
\r\n {this.state.warning}\r\n
\r\n }\r\n
\r\n );\r\n };\r\n}\r\n","import Backbone from 'backbone';\r\nimport React from 'react';\r\nimport ReactDOM from 'react-dom';\r\nimport { GoogleCampaignAndAdGroupStep } from './step';\r\n\r\nexport class GoogleCampaignAndAdGroupView extends Backbone.View {\r\n initialize({\r\n appConfig,\r\n data,\r\n googleCustomerId,\r\n i18n,\r\n i18nAmdLoader,\r\n repository,\r\n selectionData,\r\n renderDisplayCampaignAlert,\r\n logScenario,\r\n coupon,\r\n }) {\r\n this.appConfig = appConfig;\r\n this.data = data;\r\n this.googleCustomerId = googleCustomerId;\r\n this.i18n = i18n;\r\n this.i18nAmdLoader = i18nAmdLoader;\r\n this.repository = repository;\r\n this.selectionData = selectionData;\r\n this.renderDisplayCampaignAlert = renderDisplayCampaignAlert;\r\n this.logScenario = logScenario;\r\n this.coupon = coupon;\r\n\r\n this.stateGetter = {\r\n setSelectedDataGetter: (getter) => {\r\n this.selectedDataGetter = getter;\r\n },\r\n setImportAllGetter: (getter) => {\r\n this.importAllGetter = getter;\r\n },\r\n getSelectedData: () => this.selectedDataGetter(),\r\n getImportAll: () => this.importAllGetter(),\r\n };\r\n\r\n this.triggerError = hasError => this.trigger('change:error', hasError).bind(this);\r\n this.triggerEdit = () => this.trigger('change:select').bind(this);\r\n }\r\n\r\n render(parentEl) {\r\n ReactDOM.render(, parentEl);\r\n }\r\n\r\n getStateData() {\r\n const stateData = {};\r\n\r\n if (this.stateGetter.getImportAll()) {\r\n stateData.selectionData = {};\r\n stateData.areAnyPausedCampaignsSelected = false;\r\n } else {\r\n stateData.selectionData = this.stateGetter.getSelectedData();\r\n stateData.areAnyPausedCampaignsSelected = true;\r\n }\r\n stateData.googleCampaignsSummary = this.getSummaryInfo();\r\n return stateData;\r\n }\r\n\r\n // required by step wizard\r\n getSummaryInfo() {\r\n if (this.stateGetter.getImportAll) {\r\n return this.i18n.get(this.stateGetter.getImportAll() ?\r\n 'GoogleImport_SelectCampaign_AllCampaigns' : 'GoogleImport_SelectCampaignsAndAdGroups_SpecificCampaignsAndAdGroups');\r\n }\r\n return '';\r\n }\r\n}\r\n","import React from 'react';\r\nimport ReactDOM from 'react-dom';\r\nimport _ from 'underscore';\r\nimport Promise from 'bluebird';\r\n\r\nimport { BaseImportStep, getShowNoActiveCampaignCouponAlert } from '@bingads-webui-campaign/import-components';\r\nimport { withUiBlock } from '@bingads-webui/uiblocker';\r\nimport { ByPassConfirmationModal } from '@bingads-webui-react/feature-adoption-coupon';\r\n\r\nimport template from './campaign-selection-step.pug';\r\nimport { CampaignGridView } from './grid/index';\r\n\r\n// facebook doesn't support adgroup level currently\r\nimport { GoogleCampaignAndAdGroupView } from './ad-group-level-view/backbone-pipe-view';\r\n\r\nexport class CampaignSelectionStep extends BaseImportStep {\r\n initialize({\r\n importSourceName,\r\n getStateAdapter,\r\n isAIMImportEnabled,\r\n isAdGroupLevelImportEnabled,\r\n deps,\r\n getCampaignGridConfig,\r\n }) {\r\n super.initialize({\r\n deps,\r\n });\r\n this.isContinueButtonEnabled = true;\r\n this.signupMode = deps.uxMode === 'signup';\r\n this.generateImportUserPreferencesFromPreviousOptions =\r\n deps.generateImportUserPreferencesFromPreviousOptions;\r\n this.config = deps.config;\r\n this.deps = deps;\r\n this.permissions = this.config.get('Permissions') || {};\r\n this.isAdGroupLevelImportEnabled = isAdGroupLevelImportEnabled;\r\n\r\n this.isAIMImportEnabled = isAIMImportEnabled;\r\n this.importSourceName = importSourceName;\r\n this.stateAdapter = getStateAdapter(this.getState.bind(this), this.patchState.bind(this));\r\n this.getState = this.stateAdapter.getState;\r\n this.patchState = this.stateAdapter.patchState;\r\n this.getCampaignGridConfig = getCampaignGridConfig;\r\n this.coupon = deps.coupon;\r\n }\r\n\r\n render() {\r\n this.$el.html(template({\r\n i18n: this.i18n,\r\n }));\r\n return this;\r\n }\r\n\r\n get title() {\r\n return this.buildTitle({\r\n activeTitle: this.isAdGroupLevelImportEnabled ?\r\n this.i18n.get('Import_SelectCampaignsAndAdGroups_Title')\r\n : this.i18n.get('Import_SelectCampaign_Title'),\r\n summaryTitle: this.isAdGroupLevelImportEnabled ?\r\n this.i18n.get('Import_SelectCampaignsAndAdGroups_Summary')\r\n : this.i18n.get('Import_SelectCampaign_Summary'),\r\n });\r\n }\r\n\r\n getSummaryInfo() {\r\n return this.view && this.view.getSummaryInfo();\r\n }\r\n\r\n willShow() {\r\n if (this.checkIfShouldUpdateAndResetFlagIfTrue()) {\r\n this.isContinueButtonEnabled = true;\r\n this.deps.logActivities.renderSelectAdWordsCampaigns.start();\r\n const state = this.getState() || {};\r\n const {\r\n importSourceCustomerId, importSourceCampaigns,\r\n selectedAdGroupMap, selectedCampaignIds, selectedWithActiveOnly,\r\n importContext, isEditingScheduledImport,\r\n } = state;\r\n this.isEditingScheduledImport = isEditingScheduledImport;\r\n\r\n // initialize views\r\n if (this.isAdGroupLevelImportEnabled) {\r\n const selectionData = {};\r\n if (this.isEditingScheduledImport) {\r\n if (\r\n !selectedCampaignIds && !selectedAdGroupMap\r\n && importContext\r\n && importContext.CampaignIds\r\n ) {\r\n selectionData.selectedCampaignIds = importContext.CampaignIds;\r\n }\r\n\r\n _.extend(\r\n selectionData,\r\n !!selectedAdGroupMap && { selectedAdGroupMap },\r\n !!selectedWithActiveOnly && { selectedWithActiveOnly },\r\n !!selectedCampaignIds && { selectedCampaignIds }\r\n );\r\n }\r\n // facebook don't support adgroup level currently\r\n this.view = new GoogleCampaignAndAdGroupView({\r\n appConfig: this.config,\r\n data: importSourceCampaigns,\r\n googleCustomerId: importSourceCustomerId,\r\n i18n: this.i18n,\r\n i18nAmdLoader: this.deps.i18nAmdLoader,\r\n repository: this.repository,\r\n selectionData,\r\n logScenario: this.deps.logScenario,\r\n coupon: this.coupon,\r\n });\r\n } else {\r\n this.view = new CampaignGridView({\r\n data: importSourceCampaigns,\r\n signupMode: this.signupMode,\r\n i18n: this.i18n,\r\n appConfig: this.config,\r\n repo: this.repository,\r\n isAIMImportEnabled: this.isAIMImportEnabled,\r\n getGridConfig: this.getCampaignGridConfig,\r\n });\r\n }\r\n\r\n // initialize events\r\n this.view.on('change:error', (hasError) => {\r\n this.isContinueButtonEnabled = !hasError;\r\n this.trigger('change:action');\r\n });\r\n this.view.on('change:select', () => {\r\n this.isEdited = true;\r\n });\r\n\r\n // render\r\n if (this.isAdGroupLevelImportEnabled) {\r\n this.view.render(this.$('.importsource-campaign-grid')[0]);\r\n } else {\r\n this.$('.importsource-campaign-grid').html(this.view.render().el);\r\n\r\n if (importContext) {\r\n let campaignIds;\r\n if (importContext.CampaignIds) {\r\n campaignIds = importContext.CampaignIds;\r\n } else if (selectedAdGroupMap || selectedWithActiveOnly || selectedCampaignIds) {\r\n campaignIds = _.union(\r\n selectedCampaignIds, selectedWithActiveOnly,\r\n _.map(_.keys(selectedAdGroupMap), id => parseInt(id, 10))\r\n );\r\n }\r\n this.view.selectCampaigns(campaignIds);\r\n }\r\n }\r\n this.logTrace(`render ${this.importSourceName} campaign step`);\r\n this.deps.logActivities.renderSelectAdWordsCampaigns.stop();\r\n this.deps.logActivities.selectCampaign.startSignal();\r\n } else {\r\n this.logTrace(`not edited, directly expand ${this.importSourceName} campaign step`);\r\n }\r\n }\r\n\r\n get actions() {\r\n if (this.signupMode) {\r\n return [{\r\n name: 'next',\r\n displayText: this.i18n.get('CampaignImport_GSyncConnect'),\r\n htmlAttributes: {\r\n id: `omniture-${this.importSourceName}-import-signup-import`,\r\n class: 'btn btn-primary',\r\n },\r\n enabled: this.isContinueButtonEnabled,\r\n }];\r\n }\r\n\r\n const original = super.actions;\r\n\r\n original[0].enabled = this.isContinueButtonEnabled;\r\n original[0].htmlAttributes['data-analyticsid'] = `omniture-${this.importSourceName}-import-choose-campaigns`;\r\n return original;\r\n }\r\n\r\n wizardShouldGoNext() {\r\n const finishStep = () => {\r\n this.deps.logActivities.selectCampaign.stopSignal(this.state.campaignIds);\r\n\r\n const { importSourceCustomerId } = this.getState() || {};\r\n\r\n return this.repository.getUserPreferences(importSourceCustomerId)\r\n .then((preferences) => {\r\n if (preferences) {\r\n this.patchState({\r\n previousImportOptions: preferences,\r\n });\r\n\r\n if (this.signupMode) {\r\n this.deps.logActivities.completeSchedule.startSignal();\r\n return this.startImportForSignup();\r\n }\r\n return true;\r\n }\r\n return this.deps.onCredentialsError();\r\n })\r\n .catch((err) => { //eslint-disable-line\r\n this.handleGenericError(err);\r\n return false;\r\n })\r\n .finally(withUiBlock());\r\n };\r\n\r\n if (this.isAdGroupLevelImportEnabled) {\r\n const stateData = this.stateAdapter.getState(this.view.getStateData());\r\n const importAll = this.view.stateGetter.getImportAll();\r\n\r\n const updateState = () => {\r\n this.patchState({\r\n campaignIds: _.union(\r\n stateData.selectionData.selectedCampaignIds,\r\n stateData.selectionData.selectedWithActiveOnly,\r\n _.map(_.keys(stateData.selectionData.selectedAdGroupMap), id => parseInt(id, 10))\r\n ),\r\n importSourceEntitiesSelectionData: stateData.selectionData,\r\n importSourceCampaignsSummary: stateData.importSourceCampaignsSummary,\r\n includePausedCampaigns: stateData.areAnyPausedCampaignsSelected\r\n && !this.isEditingScheduledImport,\r\n });\r\n return finishStep();\r\n };\r\n\r\n if (this.coupon) {\r\n if (!importAll && getShowNoActiveCampaignCouponAlert(\r\n this.coupon,\r\n this.getState().importSourceCampaigns,\r\n stateData.selectionData\r\n )) {\r\n return new Promise((resolve) => {\r\n const element = document.createElement('div');\r\n element.style.display = 'none';\r\n this.$el.append(element);\r\n\r\n const detachModal = () => {\r\n ReactDOM.unmountComponentAtNode(element);\r\n element.remove();\r\n };\r\n\r\n ReactDOM.render( {\r\n detachModal();\r\n resolve(false);\r\n }}\r\n onConfirm={() => {\r\n detachModal();\r\n this.trigger('enableFacOnScheduleStep', false);\r\n resolve(updateState());\r\n }}\r\n />, element);\r\n });\r\n }\r\n\r\n // if not import all, or not showing \"no active campaign\" alert,\r\n // notify that coupon is enabled (in case it was disabled) then the user\r\n // returned and fixed it\r\n this.trigger('enableFacOnScheduleStep', true);\r\n }\r\n\r\n return updateState();\r\n }\r\n\r\n this.patchState({\r\n campaignIds: this.view.getSelectedCampaigns(),\r\n importSourceCampaignsSummary: this.getSummaryInfo(),\r\n includePausedCampaigns: this.view.areAnyPausedCampaignsSelected()\r\n && !this.isEditingScheduledImport,\r\n });\r\n return finishStep();\r\n }\r\n\r\n startImportForSignup() {\r\n this.deps.logActivities.completeSchedule.stopSignal();\r\n const state = this.getState() || {};\r\n const taskItemBody = {\r\n state: 'Active',\r\n notificationType: 'None',\r\n timeZoneId: this.config.get('AccountTimeZone'),\r\n importUserPreferences:\r\n this.generateImportUserPreferencesFromPreviousOptions(\r\n this.deps,\r\n state.previousImportOptions\r\n ),\r\n };\r\n\r\n return this.repository.prepareImportTaskItem({\r\n importOptions: taskItemBody,\r\n stepState: state,\r\n })\r\n .then(finalBody => this.repository.createScheduledImportTaskItem(finalBody))\r\n .then(() => true);\r\n }\r\n\r\n getCurrentSetting() {\r\n return this.grid && this.grid.getCurrentSetting();\r\n }\r\n\r\n remove() {\r\n if (this.view) {\r\n this.view.remove();\r\n this.view = null;\r\n }\r\n\r\n super.remove();\r\n }\r\n}\r\n","import _ from 'underscore';\r\n\r\nexport function validateSelectedAccountCampaigns(selectedAccountCampaigns, signupMode) {\r\n if (_.isEmpty(selectedAccountCampaigns)) return false;\r\n\r\n if (signupMode && _.isArray(selectedAccountCampaigns)) {\r\n // in signup mode, check active campaigns only\r\n return _.some(selectedAccountCampaigns, ({ Status }) => (Status === 'Active'));\r\n }\r\n return true;\r\n}\r\n","import ko from 'knockout';\r\nimport _ from 'underscore';\r\n\r\nimport { validateSelectedAccountCampaigns } from '../validate-selected-account-campaigns';\r\n\r\n// initial dummy value for campaigns which will not cause the validation error to show up\r\n// before the user attempts to move to the next step\r\nconst INITIAL_ACCOUNT_CAMPAIGNS = [{\r\n Name: 'DefaultCampaign',\r\n Status: 'Active',\r\n}];\r\n\r\nexport class AccountGridViewModel {\r\n constructor({\r\n signupMode = false,\r\n i18n,\r\n }) {\r\n this.selectedAccount = ko.observable('');\r\n this.selectedAccountCampaigns = ko.observable(INITIAL_ACCOUNT_CAMPAIGNS);\r\n this.showValidationError = ko.computed(() => _.isEmpty(this.selectedAccount()));\r\n\r\n this.noCampaignsErrorMessage = ko.observable(signupMode\r\n ? i18n.get('GoogleImport_SelectAccount_NoActiveCampaigns')\r\n : i18n.get('GoogleImport_SelectAccount_NoCampaigns'));\r\n this.showNoCampaignsError = ko.computed(() => {\r\n if (this.showValidationError()) {\r\n return false;\r\n }\r\n\r\n return !validateSelectedAccountCampaigns(this.selectedAccountCampaigns(), signupMode);\r\n });\r\n this.hasError = ko.computed(() => this.showValidationError() || this.showNoCampaignsError());\r\n }\r\n\r\n clearNoCampaignError() {\r\n this.selectedAccountCampaigns(INITIAL_ACCOUNT_CAMPAIGNS);\r\n }\r\n}\r\n","import _ from 'underscore';\r\nimport $ from 'jquery';\r\nimport Backbone from 'backbone';\r\nimport ko from 'knockout';\r\n\r\nimport projectionGrid from 'projection-grid';\r\nimport { a11yPlugin } from '@bingads-webui/projection-grid-a11y';\r\nimport { placeholderPlugin } from '@bingads-webui/projection-grid-placeholder';\r\nimport { assistedSelectionPlugin } from '@bingads-webui/projection-grid-assisted-selection';\r\n\r\nimport template from './account-grid-template.pug';\r\nimport { AccountGridViewModel } from './account-grid-viewmodel';\r\n\r\nimport { generateConfig } from './account-grid-config';\r\nimport { generateFilterPlugin } from '../../../plugin/index';\r\n\r\nexport class AccountGridView extends Backbone.View {\r\n initialize({\r\n parentElement,\r\n accountData = [],\r\n firstAccountCampaigns,\r\n i18n,\r\n signupMode,\r\n logScenario,\r\n logTrace = () => {},\r\n }) {\r\n this.accountData = accountData;\r\n this.parentElement = parentElement;\r\n this.firstAccountCampaigns = firstAccountCampaigns;\r\n this.i18n = i18n;\r\n this.signupMode = signupMode;\r\n this.logScenario = logScenario;\r\n this.logTrace = logTrace;\r\n }\r\n\r\n render() {\r\n this.koModel = new AccountGridViewModel({\r\n signupMode: this.signupMode,\r\n i18n: this.i18n,\r\n });\r\n\r\n this.el.innerHTML = template({\r\n i18n: this.i18n,\r\n });\r\n ko.applyBindings(this.koModel, this.el);\r\n this.koModel.hasError.subscribe((value) => {\r\n this.trigger('change:error', value);\r\n });\r\n\r\n // this is to ensure grid container element is on DOM tree before rendering grid.\r\n this.parentElement.append(this.el);\r\n\r\n const config = generateConfig({\r\n i18n: this.i18n,\r\n });\r\n\r\n config.dataSource.data = _.sortBy(\r\n this.accountData,\r\n obj => (obj.AccountName ? obj.AccountName.toString().toLowerCase() : '')\r\n );\r\n this.grid = projectionGrid\r\n .factory({ vnext: true })\r\n .use(a11yPlugin)\r\n .use(placeholderPlugin)\r\n .use(generateFilterPlugin({\r\n i18n: this.i18n,\r\n logTrace: this.logTrace.bind(this),\r\n }))\r\n .use(assistedSelectionPlugin)\r\n .create(config);\r\n\r\n this.gridView = this.grid.gridView;\r\n this.gridView.render();\r\n this.grid.memoryFilter.render();\r\n\r\n this.gridView.on('willUpdate', () => {\r\n $(config.el).addClass('fixed-height');\r\n }, this);\r\n\r\n this.gridView.on('didUpdate', () => {\r\n $(config.el).removeClass('fixed-height');\r\n\r\n if (this.accountData.length > 1) {\r\n this.koModel.selectedAccount(_.first(this.gridView.selectedItems()));\r\n this.koModel.clearNoCampaignError(); // clear up the error message\r\n }\r\n this.trigger('change:select');\r\n }, this);\r\n\r\n this.gridView.once('didUpdate', () => {\r\n if (this.accountData.length === 1) {\r\n this.gridView.selectRow(this.accountData[0].CustomerId);\r\n this.koModel.selectedAccount(this.accountData[0]);\r\n this.koModel.selectedAccountCampaigns(this.firstAccountCampaigns);\r\n }\r\n }, this);\r\n\r\n return this;\r\n }\r\n\r\n isValid() {\r\n return !this.koModel.hasError();\r\n }\r\n\r\n getSelectedItem() {\r\n return this.koModel.selectedAccount();\r\n }\r\n\r\n setSelectedAccountCampaigns(campaigns) {\r\n this.koModel.selectedAccountCampaigns(campaigns);\r\n setTimeout(() => {\r\n if (this.logScenario && campaigns && campaigns.length === 0) {\r\n this.logScenario.accountWithoutCampaignSelected.create().signal();\r\n }\r\n }, 500);\r\n }\r\n\r\n clearNoCampaignError() {\r\n this.koModel.clearNoCampaignError();\r\n }\r\n\r\n selectAccountById(id) {\r\n this.gridView.selectRow(id);\r\n }\r\n\r\n remove() {\r\n if (this.grid) {\r\n this.grid.memoryFilter.remove();\r\n this.gridView.remove();\r\n }\r\n\r\n return super.remove();\r\n }\r\n}\r\n","\r\nimport _ from 'underscore';\r\n\r\nexport function generateConfig({\r\n i18n,\r\n}) {\r\n const columnsConfig = _.compact([{\r\n name: 'AccountName',\r\n title: i18n.get('Import_SelectAccount_AccountName'),\r\n sortable: (item) => {\r\n const accountName = item.AccountName;\r\n\r\n return accountName ? accountName.toString().toLowerCase() : '';\r\n },\r\n bodyClasses: 'truncated',\r\n }, {\r\n name: 'Currency',\r\n title: i18n.get('Import_SelectAccount_CurrencyName'),\r\n bodyClasses: 'truncated',\r\n }, {\r\n name: 'CustomerId',\r\n title: i18n.get('Import_SelectAccount_CustomerId'),\r\n }]);\r\n\r\n const plugins = {\r\n a11y: { i18n },\r\n filter: {\r\n search: {\r\n container: '.import-grid .grid-filter-container',\r\n property: 'AccountName',\r\n title: i18n.get('Search_AccountName'),\r\n },\r\n },\r\n placeholder: {\r\n container: '.import-grid .grid-noresult',\r\n text: i18n.get('Import_SelectAccount_NoAccounts'),\r\n },\r\n };\r\n\r\n const tableName = i18n.getString('Import_ImportSummary_AccountSummary');\r\n\r\n return {\r\n el: '.import-grid .grid-table',\r\n dataSource: {\r\n type: 'memory',\r\n data: null,\r\n primaryKey: 'CustomerId',\r\n },\r\n\r\n scrolling: {\r\n virtualized: true,\r\n header: {\r\n type: 'fixed',\r\n attributes: { 'aria-label': i18n.getString('{{tableName}} table header').replace('{{tableName}}', tableName) },\r\n },\r\n },\r\n\r\n selection: {\r\n single: true,\r\n bodyClasses: 'text-center',\r\n },\r\n\r\n columns: columnsConfig,\r\n tableClasses: ['table', 'table-bordered'],\r\n tableAttributes: { 'aria-label': tableName },\r\n plugins,\r\n };\r\n}\r\n","import ko from 'knockout';\r\n\r\nexport class CurrencyConversionViewModel {\r\n constructor(importSourceAccountCurrency, bingAccountCurrency) {\r\n this.doConvert = ko.observable(true);\r\n this.doConvert.Editing = ko.computed({\r\n read() {\r\n return this.doConvert() ? 'true' : 'false';\r\n },\r\n write(newValue) {\r\n this.doConvert(newValue === 'true');\r\n },\r\n }, this);\r\n\r\n this.importSourceAccountCurrency = ko.observable(importSourceAccountCurrency);\r\n this.bingAccountCurrency = ko.observable(bingAccountCurrency);\r\n\r\n this.shouldShow = ko.computed(() => (this.importSourceAccountCurrency() !==\r\n this.bingAccountCurrency()));\r\n }\r\n}\r\n","\r\nimport Backbone from 'backbone';\r\nimport ko from 'knockout';\r\n\r\nimport template from './currency-conversion-view-template.pug';\r\nimport { CurrencyConversionViewModel } from './currency-conversion-view-model';\r\n\r\nexport class CurrencyConversionView extends Backbone.View {\r\n initialize({\r\n parentElement,\r\n i18n,\r\n importSourceAccountCurrency,\r\n bingAccountCurrency,\r\n isSingleAccountMode,\r\n }) {\r\n this.parentElement = parentElement;\r\n this.i18n = i18n;\r\n this.importSourceAccountCurrency = importSourceAccountCurrency;\r\n this.bingAccountCurrency = bingAccountCurrency;\r\n this.isSingleAccountMode = isSingleAccountMode;\r\n }\r\n\r\n render() {\r\n this.koModel = new CurrencyConversionViewModel(\r\n this.importSourceAccountCurrency,\r\n this.bingAccountCurrency\r\n );\r\n\r\n this.el.innerHTML = template({\r\n i18n: this.i18n,\r\n singleAccountMode: this.isSingleAccountMode,\r\n });\r\n ko.applyBindings(this.koModel, this.el);\r\n\r\n this.koModel.doConvert.subscribe(() => {\r\n this.trigger('change:convert');\r\n }, this);\r\n\r\n this.parentElement.append(this.el);\r\n }\r\n}\r\n","/* eslint-disable max-len */\r\nimport _ from 'underscore';\r\nimport { withUiBlock } from '@bingads-webui/uiblocker';\r\nimport { BaseImportStep } from '@bingads-webui-campaign/import-components';\r\nimport template from './account-selection-step.pug';\r\nimport { AccountGridView } from './grid/index';\r\nimport { CurrencyConversionView } from './currency-conversion-control/currency-conversion-view';\r\n\r\nexport class AccountSelectionStep extends BaseImportStep {\r\n initialize({\r\n importSourceName,\r\n getStateAdapter,\r\n deps,\r\n }) {\r\n super.initialize({\r\n deps,\r\n });\r\n this.importSourceName = importSourceName;\r\n this.isContinueButtonEnabled = false;\r\n this.signupMode = deps.uxMode === 'signup';\r\n this.withCurrencyConversionText = this.i18n.get('GoogleImport_AccountCurrencyConversion_WithCurrencyConversion');\r\n this.withoutCurrencyConversionText = this.i18n.get('GoogleImport_AccountCurrencyConversion_WithoutCurrencyConversion');\r\n\r\n this.stateAdapter = getStateAdapter(this.getState.bind(this), this.patchState.bind(this));\r\n this.getState = this.stateAdapter.getState;\r\n this.patchState = this.stateAdapter.patchState;\r\n }\r\n\r\n get title() {\r\n return this.buildTitle({\r\n activeTitle: this.i18n.get('Import_SelectAccount_Title'),\r\n summaryTitle: this.i18n.get('Import_SelectAccount_Summary'),\r\n });\r\n }\r\n\r\n getSummaryInfo() {\r\n // importSourceAccountSummary may be set in sign in step when only one account.\r\n let summaryInfo = _.propertyOf(this.getState())('importSourceAccountSummary');\r\n\r\n // extend summary text with currency conversion info\r\n if (summaryInfo &&\r\n this.currencyConversionView && this.currencyConversionView.koModel.shouldShow()) {\r\n const autoCurrencyConversionEnabled = this.getState() && this.getState().autoCurrencyConversionEnabled;\r\n if (!_.isUndefined(autoCurrencyConversionEnabled)) {\r\n summaryInfo = `${summaryInfo} ${autoCurrencyConversionEnabled ? this.withCurrencyConversionText : this.withoutCurrencyConversionText}`;\r\n this.deps.logScenario.currencyConversionDisplayed.create().signal();\r\n }\r\n }\r\n return summaryInfo;\r\n }\r\n\r\n getSelectedAccountName() {\r\n return this.grid && _.propertyOf(this.grid.getSelectedItem())('AccountName');\r\n }\r\n\r\n willShow() {\r\n if (this.checkIfShouldUpdateAndResetFlagIfTrue()) {\r\n this.deps.logActivities.renderSelectAdWordsAccount.start();\r\n\r\n const state = this.getState();\r\n const { importSourceAccount, importSourceCampaigns } = state;\r\n this.deps.logScenario.accountList.create().signal({ count: importSourceAccount.length });\r\n\r\n const hasNoData = _.isEmpty(importSourceAccount);\r\n\r\n this.logTrace(`render ${this.importSourceName} account step start`);\r\n this.$el.html(template({\r\n hasNoData,\r\n i18n: this.i18n,\r\n }));\r\n\r\n if (!hasNoData) {\r\n this.grid = new AccountGridView({\r\n i18n: this.i18n,\r\n parentElement: this.$('.import-account-grid'),\r\n accountData: importSourceAccount,\r\n firstAccountCampaigns: importSourceCampaigns,\r\n signupMode: this.signupMode,\r\n logger: this.deps.logScenario,\r\n logTrace: this.logTrace.bind(this),\r\n });\r\n\r\n this.currencyConversionView = new CurrencyConversionView({\r\n parentElement: this.$('.currency-conversion-control'),\r\n i18n: this.i18n,\r\n importSourceAccountCurrency: this.deps.config.get('AccountCurrencyCode'),\r\n bingAccountCurrency: this.deps.config.get('AccountCurrencyCode'),\r\n isSingleAccountMode: true,\r\n });\r\n this.currencyConversionView.on('change:convert', () => {\r\n this.isEdited = true;\r\n this.deps.logScenario.currencyConversionChanged.create().signal();\r\n });\r\n this.currencyConversionView.render();\r\n this.logTrace('render currency conversion view');\r\n\r\n this.grid.on('change:error', (hasError) => {\r\n this.isContinueButtonEnabled = !hasError;\r\n this.trigger('change:action');\r\n });\r\n this.grid.on('change:select', () => {\r\n this.isEdited = true;\r\n const tempSelectedItem = this.grid.getSelectedItem();\r\n if (tempSelectedItem) {\r\n this.currencyConversionView.koModel.importSourceAccountCurrency(tempSelectedItem.Currency);\r\n if (this.currencyConversionView.koModel.shouldShow()) {\r\n this.grid.clearNoCampaignError(); // clear up the error message\r\n }\r\n }\r\n if (this.deps.logScenario && tempSelectedItem) {\r\n this.deps.logScenario.tempSelectedAccount.create().signal({\r\n selectedAccount: tempSelectedItem,\r\n importSourceAccountCurrency: this.currencyConversionView.koModel.importSourceAccountCurrency(),\r\n bingAccountCurrency: this.currencyConversionView.koModel.bingAccountCurrency(),\r\n });\r\n }\r\n });\r\n this.grid.render();\r\n\r\n if (state && state.importSourceCustomerId) {\r\n this.grid.gridView.once('didUpdate', () => {\r\n this.grid.selectAccountById(state.importSourceCustomerId);\r\n });\r\n }\r\n }\r\n this.logTrace(`render ${this.importSourceName} account step`);\r\n this.deps.logActivities.renderSelectAdWordsAccount.stop();\r\n this.deps.logActivities.selectAccount.startSignal();\r\n } else {\r\n this.logTrace(`not edited, directly expand ${this.importSourceName} account step`);\r\n }\r\n }\r\n\r\n wizardShouldGoNext() {\r\n this.deps.logActivities.selectAccount.stopSignal();\r\n this.logTrace('GoogleAccountStepContinueButtonClicked');\r\n if (this.grid && this.grid.isValid()) {\r\n const selectedItem = this.grid.getSelectedItem();\r\n const customerId = selectedItem.CustomerId;\r\n const loginId = selectedItem.LoginCustomerId; // todo: remove it for facebook? google only?\r\n const state = this.getState();\r\n\r\n if (this.currencyConversionView) {\r\n this.patchState({\r\n autoCurrencyConversionEnabled: this.currencyConversionView.koModel.doConvert(),\r\n });\r\n }\r\n\r\n const blobName = state && state.entitiesBlobName;\r\n\r\n return this.repository.prepareForCampaignSelectionStep(customerId, blobName)\r\n .then((extraState) => {\r\n if (this.grid) {\r\n this.grid.setSelectedAccountCampaigns(this.stateAdapter.getState(extraState).importSourceCampaigns);\r\n if (this.grid.isValid()) { // check again to validate campaigns\r\n this.patchState({\r\n importSourceAccountSummary: this.getSelectedAccountName(),\r\n importSourceCustomerId: customerId,\r\n loginCustomerId: loginId, // todo: for facebook, remove it???\r\n ...extraState,\r\n });\r\n return true;\r\n }\r\n } else {\r\n this.logTrace(`grid in ${this.importSourceName} account grid is cleared`);\r\n }\r\n return false;\r\n })\r\n .catch((err) => {\r\n this.handleErrorInImport(err);\r\n return false;\r\n })\r\n .finally(withUiBlock());\r\n }\r\n\r\n return false;\r\n }\r\n\r\n get actions() {\r\n if (this.signupMode) {\r\n return [{\r\n name: 'next',\r\n displayText: this.i18n.get('CampaignImport_ButtonContinue'),\r\n enabled: this.isContinueButtonEnabled,\r\n }];\r\n }\r\n\r\n const original = super.actions;\r\n\r\n original[0].enabled = this.isContinueButtonEnabled;\r\n return original;\r\n }\r\n\r\n remove() {\r\n if (this.grid) {\r\n this.grid.remove();\r\n this.grid = null;\r\n this.logTrace(`remove grid in ${this.importSourceName}-account-step`);\r\n }\r\n\r\n if (this.currencyConversionView) {\r\n this.currencyConversionView.remove();\r\n this.currencyConversionView = null;\r\n }\r\n\r\n super.remove();\r\n }\r\n}\r\n","import { ImportOptionsSummaryBuilder as BaseImportOptionsSummaryBuilder } from '@bingads-webui-campaign/import-components';\r\n\r\nexport class ImportOptionsSummaryBuilder extends BaseImportOptionsSummaryBuilder {\r\n generateEntityOptionsSummary(options) {\r\n const newExistingSummary = super.generateEntityOptionsSummary(options);\r\n const summaryText = [];\r\n\r\n if (options.AdWordsAccountTrackingTemplate) {\r\n summaryText.push(this.i18n.get('Import_ImportOptions_AccountUrlOptions'));\r\n }\r\n\r\n if (newExistingSummary.length > 0) {\r\n summaryText.push(newExistingSummary);\r\n }\r\n\r\n if (options.ImportDeletedEntities) {\r\n summaryText.push(this.i18n.get('Import_ImportOptions_DeleteItemsSummary'));\r\n }\r\n\r\n return summaryText.join(', ');\r\n }\r\n}\r\n","import { ImportOptionsStep as BaseImportOptionsStep } from '@bingads-webui-campaign/import-components';\r\n\r\nimport { ImportOptionsSummaryBuilder } from './import-options-summary-builder';\r\n\r\nexport class ImportOptionsStep extends BaseImportOptionsStep {\r\n initialize({\r\n importSourceName,\r\n deps,\r\n }) {\r\n super.initialize({\r\n deps,\r\n });\r\n\r\n this.importSourceName = importSourceName || 'google';\r\n this.summaryBuilder = new ImportOptionsSummaryBuilder({ i18n: this.i18n });\r\n }\r\n\r\n get actions() {\r\n const original = super.actions;\r\n\r\n original[0].htmlAttributes['data-analyticsid'] = `omniture-${this.importSourceName}-import-options`;\r\n return original;\r\n }\r\n}\r\n","import ko from 'knockout';\r\nimport _ from 'underscore';\r\n\r\n// TODO [901215]: move this to shared components\r\n\r\nfunction failedValidators(validators, value) {\r\n return _.filter(validators, v => !v.isValid(value));\r\n}\r\n\r\nfunction errorMessages(validators, value) {\r\n let errors = [];\r\n\r\n _.each(validators, (failed) => {\r\n const messages = _.isFunction(failed.message) ? failed.message(value) : failed.message;\r\n\r\n if (_.isArray(messages)) {\r\n errors = errors.concat(messages);\r\n } else {\r\n errors.push(messages);\r\n }\r\n });\r\n\r\n return errors;\r\n}\r\n\r\nko.extenders.validate = (observable, validators) => {\r\n const observableWrapper = ko.computed({\r\n read() {\r\n return observable();\r\n },\r\n write(rawValue) {\r\n let value = rawValue;\r\n let errors = [];\r\n\r\n _.each(validators, (validator) => {\r\n if (_.isFunction(validator.process) && !validator.blockInput) {\r\n value = validator.process(value);\r\n }\r\n });\r\n\r\n const failedValidations = failedValidators(validators, value);\r\n\r\n if (_.isEmpty(failedValidations)) {\r\n observableWrapper.hasBeenValid(true);\r\n }\r\n\r\n // if user input is blocked, do not pass this value to internal object\r\n if (_.some(failedValidations, _.property('blockInput'))) {\r\n observable.notifySubscribers();\r\n } else {\r\n // only show errors after observable has been valid\r\n // friendly to user who need to input several times to get a valid value from beginning\r\n // for example, an array with at least 3 elements, or a number > 10\r\n if (observableWrapper.hasBeenValid()) {\r\n errors = errorMessages(failedValidations, value);\r\n }\r\n\r\n if (_.isEqual(observable(), value)) {\r\n observable.notifySubscribers();\r\n } else {\r\n observable(value);\r\n }\r\n }\r\n\r\n observableWrapper.errors(errors);\r\n },\r\n }).extend({ notify: 'always' });\r\n\r\n observableWrapper.hasBeenValid =\r\n ko.observable(_.isEmpty(failedValidators(validators, observable())));\r\n observableWrapper.errors = ko.observableArray();\r\n observableWrapper.validators = validators;\r\n observableWrapper.isValid = ko.computed(() => observableWrapper.errors().length === 0);\r\n observableWrapper.hasError = ko.computed(() => !observableWrapper.isValid());\r\n\r\n // force validation even if value not changed\r\n observableWrapper.validate = () => {\r\n observableWrapper.hasBeenValid(true);\r\n\r\n const value = observable();\r\n\r\n observableWrapper.errors(errorMessages(failedValidators(validators, value), value));\r\n\r\n return observableWrapper.isValid();\r\n };\r\n\r\n return observableWrapper;\r\n};\r\n\r\nexport { ko };\r\n","const getDateFromCron = function (cron) {\r\n const splitCron = cron.split(' ');\r\n\r\n if (splitCron[2] && splitCron[3] && splitCron[5]) {\r\n const date = new Date(`${splitCron[3]}/${splitCron[2]}/${splitCron[5]}`);\r\n const today = new Date();\r\n\r\n return date.getTime() >= today.getTime() ? date : today;\r\n }\r\n return null;\r\n};\r\n\r\nconst mapCronToFrequency = function (cron) {\r\n const onceCron = /^0 [0-9]{1,2} [1-3]{0,1}[0-9] [1]{0,1}[0-9]{1} \\* [0-9]{4}$/;\r\n const monthCron = /^0 [0-9]{1,2} [1-3]{0,1}[0-9] \\* \\* \\*$/;\r\n const dailyCron = /^0 [0-9]{1,2} \\* \\* \\* \\*$/;\r\n const weeklyCron = /^0 [0-9]{1,2} \\* \\* [0-6] \\*$/;\r\n\r\n if (onceCron.test(cron)) {\r\n return 'Once';\r\n }\r\n\r\n if (monthCron.test(cron)) {\r\n return 'Monthly';\r\n }\r\n if (dailyCron.test(cron)) {\r\n return 'Daily';\r\n }\r\n if (weeklyCron.test(cron)) {\r\n return 'Weekly';\r\n }\r\n\r\n return null;\r\n};\r\n\r\nconst prepareCron =\r\nfunction (chosenFrequency, chosenTime, chosenDate, chosenDay, chosenDayOfTheMonth) {\r\n switch (chosenFrequency) {\r\n case 'Once': {\r\n if (!chosenDate) {\r\n this.viewModel.timeError(true);\r\n return 'invalid';\r\n }\r\n\r\n return `0 ${chosenTime} ${chosenDate.getDate()} ${chosenDate.getMonth() + 1} * ${chosenDate.getFullYear()}`;\r\n }\r\n case 'Daily':\r\n return `0 ${chosenTime} * * * *`;\r\n case 'Weekly':\r\n return `0 ${chosenTime} * * ${chosenDay} *`;\r\n case 'Monthly':\r\n return `0 ${chosenTime} ${chosenDayOfTheMonth} * * *`;\r\n default:\r\n return '';\r\n }\r\n};\r\n\r\nconst cronToDisplayString = function (\r\n i18n, datePickerValue,\r\n {\r\n chosenDay, chosenDayOfTheMonth, chosenFrequency, chosenTime, chosenTimeZone,\r\n }\r\n) {\r\n const hour = `${chosenTime().twelveHourDisplay} ${chosenTimeZone()}`;\r\n let displayString = '';\r\n\r\n switch (chosenFrequency().value) {\r\n case 'Auto':\r\n displayString = i18n.getString('ImportSchedule_Auto_Frequency');\r\n break;\r\n case 'Once':\r\n displayString = i18n.getString('Scheduled_Import_OnceTemplate')\r\n .replace('{0}', chosenFrequency().text)\r\n .replace('{1}', datePickerValue)\r\n .replace('{2}', hour);\r\n break;\r\n case 'Daily':\r\n displayString = i18n.getString('AutomatedRules_Frequency_DailyTemplate')\r\n .replace('{0}', chosenFrequency().text)\r\n .replace('{1}', hour);\r\n break;\r\n case 'Weekly':\r\n displayString = i18n.getString('AutomatedRules_Frequency_WeeklyTemplate')\r\n .replace('{0}', chosenFrequency().text)\r\n .replace('{1}', chosenDay().text)\r\n .replace('{2}', hour);\r\n break;\r\n case 'Monthly':\r\n displayString = i18n.getString('AutomatedRules_Frequency_MonthlyTemplate')\r\n .replace('{0}', chosenFrequency().text)\r\n .replace('{1}', chosenDayOfTheMonth())\r\n .replace('{2}', hour);\r\n break;\r\n default:\r\n break;\r\n }\r\n\r\n return displayString;\r\n};\r\n\r\nexport {\r\n cronToDisplayString,\r\n getDateFromCron,\r\n mapCronToFrequency,\r\n prepareCron\r\n};\r\n","import _ from 'underscore';\r\n\r\nexport class ImportSchedulingOptions {\r\n constructor({ deps }) {\r\n this.i18n = deps.i18n;\r\n }\r\n\r\n getHours() {\r\n return [\r\n { val: 0, twentyFourHourDisplay: '00', twelveHourDisplay: this.i18n.get('AdExtensions_Scheduling_Time_12AM_Start_Of_Day') },\r\n { val: 1, twentyFourHourDisplay: '01', twelveHourDisplay: this.i18n.get('AdExtensions_Scheduling_Time_1AM') },\r\n { val: 2, twentyFourHourDisplay: '02', twelveHourDisplay: this.i18n.get('AdExtensions_Scheduling_Time_2AM') },\r\n { val: 3, twentyFourHourDisplay: '03', twelveHourDisplay: this.i18n.get('AdExtensions_Scheduling_Time_3AM') },\r\n { val: 4, twentyFourHourDisplay: '04', twelveHourDisplay: this.i18n.get('AdExtensions_Scheduling_Time_4AM') },\r\n { val: 5, twentyFourHourDisplay: '05', twelveHourDisplay: this.i18n.get('AdExtensions_Scheduling_Time_5AM') },\r\n { val: 6, twentyFourHourDisplay: '06', twelveHourDisplay: this.i18n.get('AdExtensions_Scheduling_Time_6AM') },\r\n { val: 7, twentyFourHourDisplay: '07', twelveHourDisplay: this.i18n.get('AdExtensions_Scheduling_Time_7AM') },\r\n { val: 8, twentyFourHourDisplay: '08', twelveHourDisplay: this.i18n.get('AdExtensions_Scheduling_Time_8AM') },\r\n { val: 9, twentyFourHourDisplay: '09', twelveHourDisplay: this.i18n.get('AdExtensions_Scheduling_Time_9AM') },\r\n { val: 10, twentyFourHourDisplay: '10', twelveHourDisplay: this.i18n.get('AdExtensions_Scheduling_Time_10AM') },\r\n { val: 11, twentyFourHourDisplay: '11', twelveHourDisplay: this.i18n.get('AdExtensions_Scheduling_Time_11AM') },\r\n { val: 12, twentyFourHourDisplay: '12', twelveHourDisplay: this.i18n.get('AdExtensions_Scheduling_Time_12PM') },\r\n { val: 13, twentyFourHourDisplay: '13', twelveHourDisplay: this.i18n.get('AdExtensions_Scheduling_Time_1PM') },\r\n { val: 14, twentyFourHourDisplay: '14', twelveHourDisplay: this.i18n.get('AdExtensions_Scheduling_Time_2PM') },\r\n { val: 15, twentyFourHourDisplay: '15', twelveHourDisplay: this.i18n.get('AdExtensions_Scheduling_Time_3PM') },\r\n { val: 16, twentyFourHourDisplay: '16', twelveHourDisplay: this.i18n.get('AdExtensions_Scheduling_Time_4PM') },\r\n { val: 17, twentyFourHourDisplay: '17', twelveHourDisplay: this.i18n.get('AdExtensions_Scheduling_Time_5PM') },\r\n { val: 18, twentyFourHourDisplay: '18', twelveHourDisplay: this.i18n.get('AdExtensions_Scheduling_Time_6PM') },\r\n { val: 19, twentyFourHourDisplay: '19', twelveHourDisplay: this.i18n.get('AdExtensions_Scheduling_Time_7PM') },\r\n { val: 20, twentyFourHourDisplay: '20', twelveHourDisplay: this.i18n.get('AdExtensions_Scheduling_Time_8PM') },\r\n { val: 21, twentyFourHourDisplay: '21', twelveHourDisplay: this.i18n.get('AdExtensions_Scheduling_Time_9PM') },\r\n { val: 22, twentyFourHourDisplay: '22', twelveHourDisplay: this.i18n.get('AdExtensions_Scheduling_Time_10PM') },\r\n { val: 23, twentyFourHourDisplay: '23', twelveHourDisplay: this.i18n.get('AdExtensions_Scheduling_Time_11PM') },\r\n ];\r\n }\r\n\r\n getFrequencies(withAutoOption = false) {\r\n const options = [\r\n { value: 'Now', text: this.i18n.get('Bulk_Download_Edit_Schedule_Now') },\r\n { value: 'Once', text: this.i18n.get('AutomatedRules_FrequencyGrain_Once') },\r\n { value: 'Daily', text: this.i18n.get('AutomatedRules_FrequencyGrain_Daily') },\r\n { value: 'Weekly', text: this.i18n.get('AutomatedRules_FrequencyGrain_Weekly') },\r\n { value: 'Monthly', text: this.i18n.get('AutomatedRules_FrequencyGrain_Monthly') },\r\n ];\r\n if (withAutoOption) {\r\n return [\r\n { value: 'Auto', text: this.i18n.get('AutomatedRules_FrequencyGrain_Auto') },\r\n ...options,\r\n ];\r\n }\r\n return options;\r\n }\r\n\r\n getFrequenciesForRunNowScheduling(withAutoOption = false) {\r\n const options = [\r\n { value: 'Once', text: this.i18n.get('AutomatedRules_FrequencyGrain_Once') },\r\n { value: 'Daily', text: this.i18n.get('AutomatedRules_FrequencyGrain_Daily') },\r\n { value: 'Weekly', text: this.i18n.get('AutomatedRules_FrequencyGrain_Weekly') },\r\n { value: 'Monthly', text: this.i18n.get('AutomatedRules_FrequencyGrain_Monthly') },\r\n ];\r\n if (withAutoOption) {\r\n return [\r\n { value: 'Auto', text: this.i18n.get('AutomatedRules_FrequencyGrain_Auto') },\r\n ...options,\r\n ];\r\n }\r\n return options;\r\n }\r\n\r\n getEmailOptions() {\r\n return [\r\n { value: 'None', text: this.i18n.get('AutomatedRules_NotificationType_None') },\r\n { value: 'OnChange, OnError', text: this.i18n.get('AutomatedRules_NotificationType_OnChangeOrError') },\r\n { value: 'OnError', text: this.i18n.get('AutomatedRules_NotificationType_OnError'), title: this.i18n.get('AutomatedRules_NotificationType_OnError') },\r\n { value: 'Always', text: this.i18n.get('Scheduled_Import_NotificationType_Always') },\r\n ];\r\n }\r\n\r\n getDaysOfWeek() {\r\n return [\r\n { value: 0, text: this.i18n.getString('DayOfWeek_Sunday') },\r\n { value: 1, text: this.i18n.getString('DayOfWeek_Monday') },\r\n { value: 2, text: this.i18n.getString('DayOfWeek_Tuesday') },\r\n { value: 3, text: this.i18n.getString('DayOfWeek_Wednesday') },\r\n { value: 4, text: this.i18n.getString('DayOfWeek_Thursday') },\r\n { value: 5, text: this.i18n.getString('DayOfWeek_Friday') },\r\n { value: 6, text: this.i18n.getString('DayOfWeek_Saturday') },\r\n ];\r\n }\r\n\r\n getDaysOfMonth() {\r\n return _.map(_.range(1, 29), num => num.toString());\r\n }\r\n}\r\n","import _ from 'underscore';\r\n\r\nconst BASE_10_RADIX = 10;\r\n\r\nconst getTimeZoneIdByText = function (timeZoneText, timeZoneMapper) {\r\n const timeZoneObject =\r\n _.find(timeZoneMapper.getTimeZoneOptions(), obj => obj.text === timeZoneText);\r\n return timeZoneObject && parseInt(timeZoneObject.index, BASE_10_RADIX);\r\n};\r\n\r\nconst getTimeZoneTextById = function (timeZoneId, timeZoneMapper) {\r\n const timeZoneObject = _.find(\r\n timeZoneMapper.getTimeZoneOptions(),\r\n obj => parseInt(obj.index, BASE_10_RADIX) === parseInt(timeZoneId, BASE_10_RADIX)\r\n );\r\n return timeZoneObject && timeZoneObject.text;\r\n};\r\n\r\nconst getAllTimeZoneText = function (timeZoneMapper) {\r\n return _.pluck(timeZoneMapper.getTimeZoneOptions(), 'text');\r\n};\r\n\r\nexport {\r\n getAllTimeZoneText,\r\n getTimeZoneTextById,\r\n getTimeZoneIdByText,\r\n};\r\n","import _ from 'underscore';\r\nimport moment from 'moment';\r\nimport { Validation } from '@bingads-webui/validation';\r\n\r\nimport { ko } from './ko-extension';\r\nimport { ImportSchedulingOptions } from '../util/index';\r\n\r\nexport function ScheduleFormViewModel({\r\n deps, options, enableAutoFrequency, facCoupon,\r\n}) {\r\n this.i18n = deps.i18n;\r\n\r\n const BASE_10_RADIX = 10;\r\n const importSchedulingOptions = new ImportSchedulingOptions({ deps });\r\n const currentUser = deps.config.get('CurrentUser');\r\n this.scheduleFromImportSummary = options.scheduleFromImportSummary;\r\n this.toggleImportButtonStatus = options.toggleImportButtonStatus;\r\n this.isMultiAccountImport = options.isMultiAccountImport;\r\n if (this.scheduleFromImportSummary) {\r\n // eslint-disable-next-line max-len\r\n this.availableFrequencies = ko.observableArray(importSchedulingOptions.getFrequenciesForRunNowScheduling(enableAutoFrequency));\r\n } else {\r\n // eslint-disable-next-line max-len\r\n this.availableFrequencies = ko.observableArray(importSchedulingOptions.getFrequencies(enableAutoFrequency));\r\n }\r\n this.emailOptions = ko.observableArray(importSchedulingOptions.getEmailOptions());\r\n this.availableTimes = ko.observableArray(importSchedulingOptions.getHours());\r\n this.availableDays = ko.observableArray(importSchedulingOptions.getDaysOfWeek());\r\n this.availableDaysOfTheMonth = ko.observableArray(importSchedulingOptions.getDaysOfMonth());\r\n this.timeZones = ko.observableArray(options.availableTimeZones);\r\n this.showUnSupportedDayOfMonth = ko.observable(false);\r\n this.runNowWithScheduled = ko.observable(false);\r\n this.isScheduledFromImportSummaryDone = ko.observable(false);\r\n\r\n if (options.frequency) {\r\n this.chosenFrequency = ko.observable(_.find(\r\n this.availableFrequencies(),\r\n item => item.value === options.frequency\r\n ));\r\n } else {\r\n this.chosenFrequency = ko.observable(_.find(\r\n this.availableFrequencies(),\r\n item => item.value === 'Weekly'\r\n ));\r\n }\r\n\r\n if (options.isEditingScheduledImport && options.initialSettings.Cron) {\r\n this.chosenDay = ko.observable(_.find(\r\n this.availableDays(),\r\n item => item.value === parseInt(options.initialSettings.Cron.split(' ')[4], BASE_10_RADIX)\r\n ));\r\n\r\n this.chosenEmailOption = ko.observable(_.find(\r\n this.emailOptions(),\r\n item => item.value === options.initialSettings.NotificationType\r\n ));\r\n\r\n this.chosenTime = ko.observable(_.find(\r\n this.availableTimes(),\r\n item => item.val.toString() === options.initialSettings.Cron.split(' ')[1]\r\n ));\r\n\r\n let initialDayOfTheMonth = options.initialSettings.Cron.split(' ')[2];\r\n\r\n if (this.chosenFrequency().value === 'Monthly' && !_.contains(this.availableDaysOfTheMonth(), initialDayOfTheMonth)) {\r\n this.showUnSupportedDayOfMonth(true);\r\n initialDayOfTheMonth = _.last(this.availableDaysOfTheMonth());\r\n }\r\n this.chosenDayOfTheMonth = ko.observable(initialDayOfTheMonth);\r\n this.emailAddresses = options.initialSettings.NotificationEmailAddresses\r\n ? ko.observable(options.initialSettings.NotificationEmailAddresses.split(';').join(','))\r\n : ko.observable('');\r\n } else {\r\n // tells if the current date is in daylight savings time.\r\n const isDayLightSavingTime = moment().isDST();\r\n\r\n let time = moment().utc();\r\n time = time.minutes(-options.timeZoneOffsetValue);\r\n\r\n if (isDayLightSavingTime) {\r\n // add 1 hour to the time since moment().utc() returns GMT - 7.\r\n // timeZoneOffsetValue return GMT - 8 always.\r\n // to compensate for daylight saving time add 60 minutes to the time.\r\n time = time.minutes(60);\r\n }\r\n\r\n const hours = time.hours();\r\n const day = time.day();\r\n\r\n this.chosenTime = ko.observable(_.find(\r\n this.availableTimes(),\r\n item => item.val === ((hours + 1) % 24)\r\n ));\r\n\r\n this.chosenDay = ko.observable(this.availableDays()[day]);\r\n this.chosenDayOfTheMonth = ko.observable('');\r\n this.chosenEmailOption = ko.observable(this.emailOptions()[0]);\r\n this.emailAddresses = currentUser.Email ? ko.observable(currentUser.Email) : ko.observable('');\r\n }\r\n\r\n this.timeFormat = ko.observable('12hour');\r\n this.chosenTimeZone = ko.observable(options.defaultTimeZone);\r\n\r\n this.defaultimportName = ko.computed(() => (deps.isMultiAccountImport ?\r\n `${this.chosenFrequency().value} Import - ${deps.dateUtil.format(new Date(), 'yyyy-MM-dd')}` :\r\n `${this.chosenFrequency().value} Import - ${deps.config.get('CurrentAccount').AccountNumber} - ${deps.dateUtil.format(new Date(), 'yyyy-MM-dd')}`));\r\n\r\n this.importName = ko.observable(options.initialSettings.Name || this.defaultimportName()).extend({\r\n validate: [\r\n Validation.required(false, this.i18n).set({\r\n message: this.i18n.get('Scheduled_Import_View_Name_Error'),\r\n }),\r\n ],\r\n });\r\n\r\n if (this.toggleImportButtonStatus) {\r\n this.importName.subscribe((input) => {\r\n if (input.length === 0) {\r\n this.toggleImportButtonStatus(false);\r\n } else {\r\n this.toggleImportButtonStatus(true);\r\n }\r\n });\r\n this.emailAddresses.subscribe(() => {\r\n this.toggleImportButtonStatus(true);\r\n });\r\n this.chosenDay.subscribe(() => {\r\n this.toggleImportButtonStatus(true);\r\n });\r\n this.chosenTime.subscribe(() => {\r\n this.toggleImportButtonStatus(true);\r\n });\r\n }\r\n\r\n this.summaryMessage = ko.observable('');\r\n this.isTitleActive = ko.observable(false);\r\n this.isTitleDisabled = ko.observable(false);\r\n this.isSummaryVisible = ko.observable(false);\r\n this.isFormBodyVisible = ko.observable(false);\r\n this.timeError = ko.observable(false);\r\n this.scheduleImportText = ko.observable(this.i18n.get('Scheduled_Import_Title'));\r\n this.emailAddressError = ko.observable(false);\r\n this.maxLength = ko.observable(255);\r\n this.emailAddressErrorMessage = ko.observable('');\r\n\r\n const remainingCharacters = ko.computed(() =>\r\n this.i18n.get('RemainingCharactersText_New', { count: this.maxLength() - this.importName().length }));\r\n\r\n this.importName = _.extend(this.importName, {\r\n char_rem: remainingCharacters, //eslint-disable-line\r\n });\r\n\r\n this.is12Hour = () => this.timeFormat() === '12hour';\r\n this.isAutoFrequency = () => this.chosenFrequency().value === 'Auto';\r\n this.scheduledImport = () => this.chosenFrequency().value !== 'Now';\r\n this.nonAutoScheduledImport = () => this.chosenFrequency().value !== 'Now' && this.chosenFrequency().value !== 'Auto';\r\n this.showRunNow = () => !this.scheduleFromImportSummary;\r\n\r\n this.showMultiEmail = () => (\r\n this.chosenEmailOption() !== this.emailOptions()[0]\r\n );\r\n this.facCoupon = facCoupon;\r\n}\r\n","import Backbone from 'backbone';\r\nimport ko from 'knockout';\r\nimport moment from 'moment';\r\nimport _ from 'underscore';\r\n\r\nimport { DatePicker } from '@bingads-webui/date-picker';\r\nimport { withUiBlock } from '@bingads-webui/uiblocker';\r\n\r\nimport ScheduleFormTemplate from './schedule-form-template.pug';\r\nimport { ScheduleFormViewModel } from './schedule-form-view-model';\r\nimport ScheduleFromDoneTemplate from './schedule-form-done-template.pug';\r\n\r\nimport {\r\n cronToDisplayString,\r\n getAllTimeZoneText,\r\n getDateFromCron,\r\n getTimeZoneTextById,\r\n getTimeZoneIdByText,\r\n mapCronToFrequency,\r\n prepareCron\r\n} from '../util/index';\r\n\r\nexport class ScheduleFormView extends Backbone.View {\r\n initialize({\r\n importSourceName, deps, options, facCoupon,\r\n }) {\r\n this.deps = deps;\r\n this.i18n = deps.i18n;\r\n this.config = deps.config;\r\n this.showError = options.showError;\r\n this.timeZoneMapper = deps.timeZoneMapper;\r\n this.onCredentialsError = deps.onCredentialsError;\r\n this.repository = deps.repository;\r\n this.options = options;\r\n this.options.initialSettings = this.options.initialSettings || {};\r\n this.options.availableTimeZones = getAllTimeZoneText(this.timeZoneMapper);\r\n this.logTrace = this.options.logTraceFunction;\r\n this.state = options.state;\r\n const initialTimeZoneId = this.options.initialSettings.TimeZoneId || this.config.get('AccountTimeZone');\r\n this.options.defaultTimeZone = getTimeZoneTextById(initialTimeZoneId, this.timeZoneMapper);\r\n\r\n this.options.timeZoneOffsetValue = this.timeZoneMapper.getTimeZoneOffset(initialTimeZoneId);\r\n\r\n const datePickerAriaLabel = this.i18n.get('Scheduled_Import_Available_Date');\r\n\r\n if (this.options.initialSettings.Cron) {\r\n this.options = _.extend(this.options, {\r\n frequency: mapCronToFrequency(this.options.initialSettings.Cron),\r\n });\r\n }\r\n let time = moment().utc();\r\n time = time.minutes(-this.options.timeZoneOffsetValue);\r\n\r\n const minDate =\r\n new Date(time.year(), time.month(), time.date(), time.hour(), time.minute(), time.second());\r\n const maxDate = new Date(minDate);\r\n maxDate.setYear(maxDate.getFullYear() + 1);\r\n\r\n this.datePicker = new DatePicker({\r\n minDate,\r\n maxDate,\r\n selectedDate: this.getInitialDatePickerDate(minDate),\r\n ariaLabel: datePickerAriaLabel,\r\n });\r\n\r\n this.importSourceName = importSourceName || 'google';\r\n\r\n this.viewModel = new ScheduleFormViewModel({\r\n deps,\r\n enableAutoFrequency: importSourceName === 'facebook',\r\n options: this.options,\r\n facCoupon,\r\n });\r\n }\r\n\r\n remove(...args) {\r\n this.datePicker.remove(...args);\r\n super.remove(...args);\r\n }\r\n\r\n render() {\r\n this.$el.html(ScheduleFormTemplate({\r\n importSourceName: this.importSourceName,\r\n i18n: this.i18n,\r\n }));\r\n this.viewModel.defaultimportName.subscribe(() => {\r\n this.viewModel.importName(this.viewModel.defaultimportName());\r\n });\r\n this.viewModel.importName.subscribe((value) => {\r\n if (this.deps.logScenario && this.isScheduledImport() && value && !this.importNameChanged) {\r\n // when switch from others to Now, import name is also changed, do not log it\r\n // log if import name is ever changed for only once, no need to log the changed value\r\n this.deps.logScenario.importNameChanged.create().signal();\r\n this.importNameChanged = true;\r\n }\r\n });\r\n ko.applyBindings(this.viewModel, this.el);\r\n\r\n this.$('.date-picker').append(this.datePicker.render().$el);\r\n\r\n return this;\r\n }\r\n events() {\r\n return {\r\n 'click .schedule-from-import-summary-button': 'scheduleFromImportSummary',\r\n 'click .view-import-history-log-grid': 'redirctToImportHistory',\r\n };\r\n }\r\n\r\n redirctToImportHistory() {\r\n this.repository.redirectToImportScheduleAndHistory();\r\n }\r\n\r\n scheduleFromImportSummary() {\r\n this.logTrace('Scheduling import from import summary');\r\n const { state } = this;\r\n let taskItemBody = this.serializeImportSchedulingOptions();\r\n if (taskItemBody) {\r\n const scheduleOption = taskItemBody.cron ? mapCronToFrequency(taskItemBody.cron) : 'Now';\r\n this.repository.applyOpportunityIfApplicable({ scheduleOption });\r\n\r\n taskItemBody = _.extend(taskItemBody, {\r\n importUserPreferences: state.importUserPreferences,\r\n });\r\n\r\n this.repository.prepareImportTaskItem({\r\n importOptions: taskItemBody,\r\n stepState: state,\r\n })\r\n .then(finalBody => (\r\n this.repository.createScheduledImportTaskItem(finalBody)\r\n ))\r\n .tap((taskItem) => {\r\n this.repository.logApplyOpportunityInfoIfIfApplicable(taskItem && taskItem.Id);\r\n })\r\n .then(() => {\r\n const summaryText = this.i18n.get('Scheduled_Import_Summary_Header').replace('{0}', this.getDisplayString());\r\n this.$el.html(ScheduleFromDoneTemplate({\r\n doneText: summaryText,\r\n navigateToButtonText: this.i18n.get('Scheduled_Import_View_Schedule_Button'),\r\n }));\r\n this.viewModel.isScheduledFromImportSummaryDone = true;\r\n })\r\n .catch((errors) => {\r\n this.importButtonEnabled = true;\r\n this.trigger('change:action');\r\n this.handleErrors(errors);\r\n return false;\r\n })\r\n .finally(withUiBlock(this.$el));\r\n }\r\n }\r\n\r\n getInitialDatePickerDate(currentDate) {\r\n let date = new Date(currentDate);\r\n\r\n // set date in datepicker to existing setting for edit workflow\r\n if (this.options.initialSettings.Cron && this.options.frequency === 'Once') {\r\n date = getDateFromCron(this.options.initialSettings.Cron);\r\n } else if (date.getHours() + 1 === 24) {\r\n // We use the next hour as the default hour setting in the form,\r\n // so, at 11 PM, we need to also advance the day for RunOnce form.\r\n date.setDate(date.getDate() + 1);\r\n }\r\n\r\n return date;\r\n }\r\n\r\n serializeEmailAddresses() {\r\n const emailAddresses = this.viewModel.emailAddresses();\r\n let serializedEmails = '';\r\n const emailAddressArray = emailAddresses ? emailAddresses.split(',') : [];\r\n _.each(emailAddressArray, (email, index) => {\r\n serializedEmails += email.trim();\r\n if (index !== emailAddressArray.length - 1) {\r\n serializedEmails += ';';\r\n }\r\n });\r\n return serializedEmails;\r\n }\r\n\r\n validateEmailAddresses() {\r\n if (this.viewModel.chosenEmailOption() === this.viewModel.emailOptions()[0]) {\r\n return true;\r\n }\r\n\r\n const emailAddresses = this.viewModel.emailAddresses();\r\n if (_.isEmpty(emailAddresses.trim())) {\r\n this.viewModel.emailAddressError(true);\r\n this.viewModel.emailAddressErrorMessage(this.i18n.getString('Scheduled_Import_MultiEmail_Invalid_Email_RequiredError'));\r\n return false;\r\n }\r\n const emailAddressArray = emailAddresses ? emailAddresses.split(',') : [];\r\n if (emailAddressArray.length > 10) {\r\n this.viewModel.emailAddressError(true);\r\n this.viewModel.emailAddressErrorMessage(this.i18n.getString('Scheduled_Import_MultiEmail_Max_Email_Error'));\r\n return false;\r\n }\r\n let areAllEmailsValid = true;\r\n if (emailAddresses === '') {\r\n return true;\r\n }\r\n _.each(emailAddressArray, (email) => {\r\n if (!this.validateEmailAddress(email.trim())) {\r\n this.viewModel.emailAddressError(true);\r\n this.viewModel.emailAddressErrorMessage(this.i18n.getString('Scheduled_Import_MultiEmail_Invalid_Email_Error'));\r\n areAllEmailsValid = false;\r\n }\r\n });\r\n return areAllEmailsValid;\r\n }\r\n\r\n validateEmailAddress(email) {\r\n const re = /^(([^<>()[\\]\\\\.,;:\\s@\"]+(\\.[^<>()[\\]\\\\.,;:\\s@\"]+)*)|(\".+\"))@((\\[[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\])|(([a-zA-Z\\-0-9]+\\.)+[a-zA-Z]{2,}))$/;\r\n return re.test(email);\r\n }\r\n\r\n validateScheduleTime() {\r\n let time = moment().utc();\r\n time = time.minutes(-this.options.timeZoneOffsetValue);\r\n\r\n const hour = this.viewModel.chosenTime().val;\r\n const day = this.datePicker.datePicker.value().getDate();\r\n const minTime = time.hours();\r\n const minDate = time.date();\r\n\r\n if (this.viewModel.chosenFrequency().value === 'Once'\r\n && hour < minTime\r\n && day === minDate) {\r\n this.viewModel.timeError(true);\r\n return false;\r\n }\r\n return true;\r\n }\r\n\r\n\r\n serializeImportSchedulingOptions() {\r\n if (!this.isScheduledImport()\r\n ||\r\n (this.viewModel.importName.validate()\r\n && this.validateEmailAddresses()\r\n && this.validateScheduleTime())\r\n ) {\r\n let body = {\r\n timeZoneId: getTimeZoneIdByText(this.viewModel.chosenTimeZone(), this.timeZoneMapper),\r\n };\r\n\r\n if (this.runNowWithScheduled()) {\r\n this.logTrace(`GoogleEmailNotificationSetting:${JSON.stringify(this.viewModel.chosenEmailOption())}`);\r\n return {\r\n scheduledTaskItemBody: {\r\n timeZoneId: getTimeZoneIdByText(this.viewModel.chosenTimeZone(), this.timeZoneMapper),\r\n name: this.viewModel.importName(),\r\n cron: prepareCron(\r\n this.viewModel.chosenFrequency().value,\r\n this.viewModel.chosenTime().val,\r\n this.datePicker.datePicker.value(),\r\n this.viewModel.chosenDay().value,\r\n this.viewModel.chosenDayOfTheMonth()\r\n ),\r\n notificationType: this.viewModel.chosenEmailOption().value,\r\n notificationEmailAddresses:\r\n this.viewModel.chosenEmailOption() !== this.viewModel.emailOptions()[0]\r\n ? this.serializeEmailAddresses()\r\n : null,\r\n },\r\n runNowTaskItemBody: {\r\n timeZoneId: getTimeZoneIdByText(this.viewModel.chosenTimeZone(), this.timeZoneMapper),\r\n taskItemState: 'Active',\r\n notificationType: 'None',\r\n notificationEmailAddresses: null,\r\n },\r\n };\r\n } else if (this.isAutoFrequency()) {\r\n this.logTrace('Auto Frequency');\r\n body = _.extend(body, {\r\n name: this.viewModel.importName(),\r\n notificationType: this.viewModel.chosenEmailOption().value,\r\n notificationEmailAddresses:\r\n this.viewModel.chosenEmailOption() !== this.viewModel.emailOptions()[0]\r\n ? this.serializeEmailAddresses()\r\n : null,\r\n IsAutoFrequency: true,\r\n });\r\n } else if (this.isScheduledImport()) {\r\n this.logTrace(`GoogleEmailNotificationSetting:${JSON.stringify(this.viewModel.chosenEmailOption())}`);\r\n body = _.extend(body, {\r\n name: this.viewModel.importName(),\r\n cron: prepareCron(\r\n this.viewModel.chosenFrequency().value,\r\n this.viewModel.chosenTime().val,\r\n this.datePicker.datePicker.value(),\r\n this.viewModel.chosenDay().value,\r\n this.viewModel.chosenDayOfTheMonth()\r\n ),\r\n notificationType: this.viewModel.chosenEmailOption().value,\r\n notificationEmailAddresses:\r\n this.viewModel.chosenEmailOption() !== this.viewModel.emailOptions()[0]\r\n ? this.serializeEmailAddresses()\r\n : null,\r\n });\r\n } else {\r\n body = _.extend(body, {\r\n taskItemState: 'Active',\r\n notificationType: 'None',\r\n notificationEmailAddresses: null,\r\n });\r\n }\r\n\r\n return body;\r\n }\r\n return null;\r\n }\r\n\r\n isScheduledImport() {\r\n return this.viewModel.scheduledImport();\r\n }\r\n\r\n runNowWithScheduled() {\r\n return this.viewModel.runNowWithScheduled();\r\n }\r\n\r\n isAutoFrequency() {\r\n return this.viewModel.isAutoFrequency();\r\n }\r\n\r\n handleErrors(errors, logTraceFunc) {\r\n if (errors && errors.errors && _.first(errors.errors)) {\r\n const errorCode = _.first(errors.errors).Code;\r\n\r\n if (logTraceFunc) logTraceFunc(`Handling error in schedule form view. Error code: ${errorCode}`);\r\n switch (errorCode) {\r\n case 'TaskSchedulingInvalid':\r\n this.viewModel.timeError(true);\r\n break;\r\n case 'InvalidAdWordsImportContext': // todo: InvalidFacebookImportContext? error code for facebook??\r\n this.onCredentialsError();\r\n break;\r\n case 'TaskThrottlingLimitReached':\r\n this.showError(this.i18n.getString('Import_Scheduled_Import_Throttling_Error', `${this.i18n.get('ImportScheduleAndHistoryActionText')}`));\r\n break;\r\n default:\r\n this.showError(this.i18n.get('GenericErrorMessage'));\r\n break;\r\n }\r\n } else {\r\n this.showError(this.i18n.get('GenericErrorMessage'));\r\n }\r\n }\r\n\r\n attachFrequencyListener(listener) {\r\n this.viewModel.chosenFrequency.subscribe(listener);\r\n }\r\n\r\n getDisplayString() {\r\n return cronToDisplayString(\r\n this.i18n,\r\n this.datePicker.datePicker.value().toLocaleDateString(),\r\n this.viewModel\r\n );\r\n }\r\n}\r\n","import Promise from 'bluebird';\r\nimport React from 'react';\r\nimport ReactDOM from 'react-dom';\r\nimport _ from 'underscore';\r\n\r\nimport { BaseImportStep } from '@bingads-webui-campaign/import-components';\r\nimport { withUiBlock } from '@bingads-webui/uiblocker';\r\nimport { Constants as CCUIConstants } from '@bingads-webui-clientcenter/entity-utils';\r\nimport { ByPassConfirmationModal } from '@bingads-webui-react/feature-adoption-coupon';\r\n\r\nimport { ScheduleFormView } from './form/index';\r\nimport template from './schedule-import-step.pug';\r\nimport { mapCronToFrequency } from './util';\r\n\r\nconst FAC_STATUS_ADOPTED = CCUIConstants.RecommendationAdoptionStatus.Adopted;\r\n\r\nexport class ScheduleImportStep extends BaseImportStep {\r\n initialize({\r\n importSourceName,\r\n deps,\r\n }) {\r\n super.initialize({\r\n deps,\r\n });\r\n\r\n this.deps = deps;\r\n this.nextActionText = this.i18n.get('UserCtrl_ImportCampaignImportFile');\r\n this.importOmnitureTrackingId = `omniture-${importSourceName}-import-runnow-import`;\r\n this.importButtonEnabled = true;\r\n\r\n this.coupon = deps.coupon;\r\n\r\n this.importSourceName = importSourceName;\r\n\r\n this.stepRemoved = false;\r\n }\r\n\r\n render() {\r\n this.$el.html(template());\r\n return this;\r\n }\r\n\r\n willShow() {\r\n this.logTrace('will show schedule import step');\r\n\r\n if (this.checkIfShouldUpdateAndResetFlagIfTrue()) {\r\n const state = this.getState() || {};\r\n\r\n this.scheduleFormView = new ScheduleFormView({\r\n importSourceName: this.importSourceName,\r\n deps: this.deps,\r\n options: {\r\n isEditingScheduledImport: state.isEditingScheduledImport,\r\n initialSettings: state.initialSettings,\r\n showError: this.showErrorMessage,\r\n isMultiAccountImport: this.IsMultiAccountImport,\r\n scheduleFromImportSummary: false,\r\n state: this.getState(),\r\n logTraceFunction: this.logTrace,\r\n toggleImportButtonStatus: this.toggleImportButtonStatus,\r\n },\r\n facCoupon: this.coupon,\r\n });\r\n\r\n this.$('.schedule-import-container').html(this.scheduleFormView.render().$el);\r\n\r\n this.scheduleFormView\r\n .attachFrequencyListener(this.changeActionTextOnFrequencyChange.bind(this));\r\n this.changeActionTextOnFrequencyChange();\r\n this.logTrace('render schedule import step');\r\n this.deps.logActivities.completeSchedule.startSignal();\r\n } else {\r\n this.logTrace('not edited, directly expand schedule import step');\r\n }\r\n }\r\n\r\n toggleImportButtonStatus = (enable) => {\r\n if (enable) {\r\n this.importButtonEnabled = true;\r\n super.updateAction();\r\n } else {\r\n this.importButtonEnabled = false;\r\n super.updateAction();\r\n }\r\n }\r\n get title() {\r\n return this.buildTitle({\r\n activeTitle: this.i18n.get('Scheduled_Import_Title'),\r\n summaryTitle: this.i18n.get('Scheduled_Import_Title_Summary'),\r\n });\r\n }\r\n\r\n getSummaryInfo() {\r\n return this.scheduleFormView && this.scheduleFormView.getDisplayString();\r\n }\r\n\r\n get actions() {\r\n return [\r\n {\r\n name: 'next',\r\n displayText: this.nextActionText,\r\n htmlAttributes: {\r\n id: this.importOmnitureTrackingId,\r\n class: 'btn btn-primary',\r\n 'data-analyticsid': `omniture-${this.importSourceName}-import-schedule-button`,\r\n },\r\n enabled: this.importButtonEnabled,\r\n },\r\n {\r\n name: 'cancel',\r\n displayText: this.i18n.get('CampaignImport_ButtonCancel'),\r\n },\r\n ];\r\n }\r\n\r\n get isScheduledImport() {\r\n return this.scheduleFormView.isScheduledImport();\r\n }\r\n\r\n changeActionTextOnFrequencyChange() {\r\n this.deps.logScenario.frequencyChanged.create()\r\n .signal(this.scheduleFormView.viewModel.chosenFrequency().value);\r\n\r\n if (this.scheduleFormView.isScheduledImport() && this.nextActionText !== this.i18n.get('Scheduled_Import_Schedule_Button')) {\r\n this.nextActionText = this.i18n.get('Scheduled_Import_Schedule_Button');\r\n this.importOmnitureTrackingId = `omniture-${this.importSourceName}-import-schedule-import`;\r\n this.updateAction();\r\n } else if (!this.scheduleFormView.isScheduledImport() && this.nextActionText !== this.i18n.get('UserCtrl_ImportCampaignImportFile')) {\r\n this.nextActionText = this.i18n.get('UserCtrl_ImportCampaignImportFile');\r\n this.importOmnitureTrackingId = `omniture-${this.importSourceName}-import-runnow-import`;\r\n this.updateAction();\r\n }\r\n }\r\n\r\n setNextActionText(i18nKey) {\r\n this.replaceActionText('next', this.i18n.get(i18nKey));\r\n }\r\n\r\n wizardShouldGoNext() {\r\n let facCouponValidate;\r\n\r\n // check if coupon is visible\r\n if (this.coupon\r\n && (this.scheduleFormView.viewModel.chosenFrequency().value === 'Now'\r\n || this.scheduleFormView.viewModel.chosenFrequency().value === 'Once')) {\r\n const element = document.createElement('div');\r\n element.style.display = 'none';\r\n this.$el.append(element);\r\n\r\n const unmount = () => {\r\n ReactDOM.unmountComponentAtNode(element);\r\n element.remove();\r\n };\r\n\r\n facCouponValidate = new Promise((resolve, reject) => {\r\n ReactDOM.render( {\r\n unmount();\r\n reject(new Error('Cancelled'));\r\n }}\r\n onConfirm={() => {\r\n unmount();\r\n this.trigger('changeCouponBannerVisibility', false);\r\n resolve();\r\n }}\r\n />, element);\r\n });\r\n } else {\r\n facCouponValidate = Promise.resolve(this.coupon);\r\n }\r\n\r\n return facCouponValidate.then((facCoupon) => {\r\n if (this.scheduleFormView) {\r\n this.deps.logActivities.completeSchedule\r\n .stopSignal(this.scheduleFormView.viewModel.chosenFrequency().value);\r\n }\r\n const state = this.getState() || {};\r\n const closeBlock = withUiBlock();\r\n let prepareSummaryPromise;\r\n\r\n if (state.importId) {\r\n this.patchState({\r\n isContinueImport: true,\r\n });\r\n prepareSummaryPromise = this.pollRunningImportStatusAndGoNextWhenReady(state, closeBlock);\r\n } else if (this.scheduleFormView.runNowWithScheduled() === true) {\r\n prepareSummaryPromise = this.createImportRunNowWithScheduledAndGoNextWhenReady(state, closeBlock, facCoupon); // eslint-disable-line\r\n } else {\r\n prepareSummaryPromise = this.createImportAndGoNextWhenReady(state, closeBlock, facCoupon);\r\n }\r\n\r\n return prepareSummaryPromise\r\n .catch((errors) => {\r\n this.importButtonEnabled = true;\r\n this.trigger('change:action');\r\n if (errors && errors.customized) {\r\n this.handleErrorInImport(errors);\r\n } else {\r\n this.scheduleFormView.handleErrors(errors);\r\n }\r\n return false;\r\n })\r\n .finally(closeBlock);\r\n })\r\n .catch(() => false);\r\n }\r\n\r\n pollRunningImportStatusAndGoNextWhenReady(state, closeBlock) {\r\n return this.repository.pollGetImportStatus(state.importId, closeBlock)\r\n .then(() => (\r\n this.repository.getImportSummary(state.importId)\r\n .then((importSummaryData) => {\r\n this.patchState({\r\n summary: importSummaryData,\r\n });\r\n return true;\r\n })\r\n ));\r\n }\r\n\r\n createScheduledImportAndGoNextWhenReady(taskItemBody, state, facCoupon) {\r\n let taskItemPromise;\r\n this.patchState({\r\n isScheduledImport: true,\r\n scheduledTimeDisplayString: this.scheduleFormView.getDisplayString(),\r\n });\r\n\r\n if (state.isEditingScheduledImport) {\r\n taskItemPromise = this.repository.updateScheduledImportTaskItem(\r\n taskItemBody,\r\n state.initialSettings.taskItemId\r\n );\r\n } else {\r\n taskItemPromise = this.repository.createScheduledImportTaskItem(taskItemBody)\r\n .tap((taskItem) => {\r\n const { Id } = taskItem || {};\r\n this.repository.logApplyOpportunityInfoIfIfApplicable(Id);\r\n });\r\n }\r\n\r\n // if there is a coupon, mark as adopted and show a success/alert banner\r\n if (facCoupon) {\r\n taskItemPromise = taskItemPromise\r\n .tap(() => this.repository.updateFACCoupon(FAC_STATUS_ADOPTED)\r\n .then(() => {\r\n if (this.deps.showAlertHandler) {\r\n let action = null;\r\n if (this.deps.isBillToCustomer) {\r\n action = {\r\n message: this.deps.i18nAmdLoader.getString('Notification_Action_ViewPromotionalOffers'),\r\n href: this.deps.couponDetailsUrl,\r\n };\r\n }\r\n\r\n this.deps.showAlertHandler({\r\n title: this.deps.i18nAmdLoader.getString('FACAdoptionFinishSuccessMessage_Title'),\r\n message: this.deps.i18nAmdLoader.getString('FACAdoptionFinishSuccessMessage'),\r\n level: 'Confirmation',\r\n action,\r\n });\r\n }\r\n })\r\n .catch(() => {\r\n if (this.deps.showAlertHandler) {\r\n this.deps.showAlertHandler({\r\n message: this.deps.i18nAmdLoader.getString('GenericFACAdoptionFinishErrorMessage'),\r\n level: 'Error',\r\n });\r\n }\r\n }));\r\n }\r\n\r\n return taskItemPromise\r\n .then(() => {\r\n this.importButtonEnabled = false;\r\n this.trigger('change:action');\r\n return true;\r\n });\r\n }\r\n\r\n createRunNowImportAndGoNextWhenReady(taskItemBody, closeBlock, logOpportunity) {\r\n return this.repository.createRunNowImportTaskItem(taskItemBody)\r\n .tap((taskItem) => {\r\n if (logOpportunity) {\r\n const { Id } = taskItem || {};\r\n this.repository.logApplyOpportunityInfoIfIfApplicable(Id);\r\n }\r\n })\r\n .then((response) => {\r\n this.importButtonEnabled = false;\r\n this.trigger('change:action');\r\n return this.repository\r\n .pollTaskItemExecutionStatus(_.first(response.TaskItemExecutions).Id, closeBlock);\r\n })\r\n .then(({ importId, isBatch }) => {\r\n if (this.stepRemoved) {\r\n return false;\r\n }\r\n this.patchState({\r\n importId,\r\n isBatch,\r\n });\r\n return this.repository.getImportSummary(importId);\r\n })\r\n .then((importSummaryData) => {\r\n if (this.stepRemoved) {\r\n return false;\r\n }\r\n this.patchState({\r\n summary: importSummaryData,\r\n isScheduledImport: false,\r\n });\r\n return true;\r\n });\r\n }\r\n\r\n createImportAndGoNextWhenReady(state, closeBlock, facCoupon) {\r\n let taskItemBody = this.scheduleFormView.serializeImportSchedulingOptions();\r\n this.patchState({\r\n isRunNowWithScheduledImport: false,\r\n });\r\n\r\n if (taskItemBody) {\r\n const scheduleOption = taskItemBody.cron ? mapCronToFrequency(taskItemBody.cron) : 'Now';\r\n this.repository.applyOpportunityIfApplicable({ scheduleOption });\r\n taskItemBody = _.extend(taskItemBody, {\r\n importUserPreferences: state.importUserPreferences,\r\n });\r\n\r\n return this.repository.prepareImportTaskItem({\r\n importOptions: taskItemBody,\r\n stepState: state,\r\n })\r\n .then((finalBody) => {\r\n if (this.scheduleFormView.isScheduledImport()) {\r\n return this.createScheduledImportAndGoNextWhenReady(finalBody, state, facCoupon);\r\n }\r\n return this.createRunNowImportAndGoNextWhenReady(finalBody, closeBlock, true);\r\n });\r\n }\r\n this.importButtonEnabled = false;\r\n this.trigger('change:action');\r\n this.logTrace('No taskItemBody returned from scheduleFormView.serializeImportSchedulingOptions');\r\n return Promise.resolve(false);\r\n }\r\n\r\n createImportRunNowWithScheduledAndGoNextWhenReady(state, closeBlock, facCoupon) {\r\n this.logTrace('run now feature used');\r\n this.patchState({\r\n isRunNowWithScheduledImport: true,\r\n });\r\n\r\n const taskItemBody = this.scheduleFormView.serializeImportSchedulingOptions();\r\n if (taskItemBody) {\r\n const scheduleOption = taskItemBody.scheduledTaskItemBody.cron ? mapCronToFrequency(taskItemBody.scheduledTaskItemBody.cron) : 'Now';\r\n this.repository.applyOpportunityIfApplicable({ scheduleOption });\r\n\r\n taskItemBody.scheduledTaskItemBody = _.extend(taskItemBody.scheduledTaskItemBody, {\r\n importUserPreferences: state.importUserPreferences,\r\n });\r\n\r\n taskItemBody.runNowTaskItemBody = _.extend(taskItemBody.runNowTaskItemBody, {\r\n importUserPreferences: state.importUserPreferences,\r\n });\r\n return this.repository.prepareImportTaskItem({\r\n importOptions: taskItemBody.scheduledTaskItemBody,\r\n stepState: state,\r\n }).then(scheduleBody => (\r\n this.createScheduledImportAndGoNextWhenReady(scheduleBody, state, facCoupon)\r\n )).then(() => (\r\n this.repository.prepareImportTaskItem({\r\n importOptions: taskItemBody.runNowTaskItemBody,\r\n stepState: state,\r\n })\r\n )).then(runNowBody => (\r\n this.createRunNowImportAndGoNextWhenReady(runNowBody, closeBlock)\r\n ));\r\n }\r\n return Promise.resolve(false);\r\n }\r\n}\r\n","import _ from 'underscore';\r\nimport { ImportSummaryStep as BaseImportSummaryStep, ImportSource } from '@bingads-webui-campaign/import-components';\r\n\r\nimport ScheduledImportSummaryTemplate from './scheduled-import-summary-template.pug';\r\nimport { ScheduleFormView } from '../import-schedule-step/form/index';\r\n\r\nexport class ImportSummaryStep extends BaseImportSummaryStep {\r\n initialize({\r\n importSourceName,\r\n isAdGroupLevelImportEnabled,\r\n labels = {},\r\n getStateAdapter,\r\n deps,\r\n }) {\r\n super.initialize({ deps });\r\n this.signupMode = deps.uxMode === 'signup';\r\n this.permissions = deps.config.get('Permissions') || {};\r\n this.isAdGroupLevelImportEnabled = isAdGroupLevelImportEnabled; // !this.signupMode;\r\n this.permissions = deps.config.get('Permissions');\r\n if (labels.summaryDisclaimerKey) {\r\n this.summaryDisclaimerKey = labels.summaryDisclaimerKey;\r\n }\r\n if (labels.summaryDisclaimerHelpLinkKey) {\r\n this.summaryDisclaimerHelpLinkKey = labels.summaryDisclaimerHelpLinkKey;\r\n }\r\n\r\n this.importSourceName = importSourceName;\r\n this.labels = labels;\r\n this.stateAdapter = getStateAdapter(this.getState.bind(this), this.patchState.bind(this));\r\n this.getState = this.stateAdapter.getState;\r\n this.patchState = this.stateAdapter.patchState;\r\n this.config = deps.config;\r\n this.initialTimeZoneId = this.config.get('AccountTimeZone');\r\n this.timeZoneMapper = deps.timeZoneMapper;\r\n\r\n this.summaryDataContextManager = deps.dataContextManager && deps.dataContextManager.default;\r\n }\r\n\r\n willShow() {\r\n const state = this.getState() || {};\r\n if (!this.state.isContinueImport\r\n && !this.state.isRunNowWithScheduledImport) {\r\n this.scheduleFormView = new ScheduleFormView({\r\n importSourceName: this.importSourceName,\r\n deps: this.deps,\r\n options: {\r\n isEditingScheduledImport: state.isEditingScheduledImport,\r\n initialSettings: state.initialSettings,\r\n showError: this.showErrorMessage,\r\n scheduleFromImportSummary: true,\r\n state: this.getState(),\r\n logTraceFunction: this.logTrace,\r\n timeZoneOffsetValue: this.timeZoneMapper.getTimeZoneOffset(this.initialTimeZoneId),\r\n },\r\n });\r\n }\r\n\r\n this.showAlert = this.showDisplayCampaignAlert();\r\n\r\n if (!state.isScheduledImport && !this.signupMode) {\r\n this.summaryInfos = [{\r\n label: this.labels.loginSummary || 'Import_ImportSummary_LoginSummary',\r\n text: state.importSourceLoginSummary,\r\n }, {\r\n label: this.labels.accountSummary || 'Import_ImportSummary_AccountSummary',\r\n text: state.importSourceAccountSummary,\r\n }, {\r\n label: this.isAdGroupLevelImportEnabled ?\r\n (this.labels.campaignsAndAdGroupsSummary || 'Import_ImportSummary_CampaignsAndAdGroupsSummary')\r\n : (this.labels.campaignSummary || 'Import_ImportSummary_CampaignSummary'),\r\n text: state.importSourceCampaignsSummary,\r\n }, {\r\n label: 'Import_ImportSummary_DestinationSummary',\r\n text: this.deps.config.get('CurrentAccount').Title,\r\n }, {\r\n label: 'Import_ImportSummary_OptionsSummary',\r\n text: state.importOptionsSummary,\r\n }];\r\n super.willShow();\r\n this.logTrace('render run now import summary step');\r\n } else {\r\n let summaryText;\r\n let merchantCenterPlaceholderStoreNote;\r\n\r\n if (this.signupMode) {\r\n summaryText = this.i18n.get('Import_SummaryText_ForSignUp');\r\n merchantCenterPlaceholderStoreNote = this.i18n.get('Import_Summary_PlaceholderStore_Note');\r\n this.deps.onSignupComplete();\r\n } else {\r\n summaryText = this.i18n.get('Scheduled_Import_Summary_Header').replace('{0}', state.scheduledTimeDisplayString);\r\n }\r\n\r\n this.$el.html(ScheduledImportSummaryTemplate({\r\n summaryText,\r\n i18n: ImportSource.google(this.i18n, this.deps.repository).i18n,\r\n merchantCenterPlaceholderStoreNote,\r\n showAlert: this.showAlert,\r\n }));\r\n this.logTrace('render schedule import summary step');\r\n }\r\n\r\n // update grid cache\r\n if (this.summaryDataContextManager) {\r\n this.summaryDataContextManager.successEmitter.trigger('invalidate', 'AdGroup');\r\n this.summaryDataContextManager.successEmitter.trigger('invalidate', 'AssetGroup');\r\n }\r\n }\r\n\r\n get actions() {\r\n const state = this.getState() || {};\r\n\r\n if (state.isScheduledImport) {\r\n return [{\r\n name: 'view-schedule',\r\n displayText: this.i18n.get('Scheduled_Import_View_Schedule_Button'),\r\n method: 'viewSchedule',\r\n enabled: true,\r\n htmlAttributes: {\r\n class: 'btn btn-default',\r\n },\r\n }];\r\n } else if (this.signupMode) {\r\n return [{\r\n name: 'add-payment',\r\n displayText: this.i18n.get('CampaignImport_ButtonContinue'),\r\n method: 'addPayment',\r\n enabled: true,\r\n htmlAttributes: {\r\n class: 'btn btn-primary',\r\n },\r\n }];\r\n }\r\n\r\n return super.actions;\r\n }\r\n\r\n viewSchedule() {\r\n this.repository.redirectToImportScheduleAndHistory();\r\n }\r\n\r\n addPayment() {\r\n this.repository.redirectToAddPayment();\r\n }\r\n\r\n showDisplayCampaignAlert() {\r\n const state = this.getState() || {};\r\n\r\n const { campaignIds, googleCampaigns } = state;\r\n\r\n let selectedCampaigns = [];\r\n\r\n if (_.size(campaignIds) === 0) {\r\n selectedCampaigns = googleCampaigns;\r\n } else {\r\n selectedCampaigns =\r\n _.filter(googleCampaigns, campaign => _.contains(campaignIds, campaign.Id));\r\n }\r\n\r\n return this.deps.repository.containDisplayType(selectedCampaigns);\r\n }\r\n}\r\n","import _ from 'underscore';\r\nimport ko from 'knockout';\r\nimport Promise from 'bluebird';\r\nimport { BaseImportStep } from '@bingads-webui-campaign/import-components';\r\nimport { withUiBlock } from '@bingads-webui/uiblocker';\r\nimport { GoogleLoginRepository } from '@bingads-webui-campaign/import-shared-repositories';\r\n\r\nimport { validateSelectedAccountCampaigns } from '../../shared/step/index';\r\nimport GoogleLoginTemplate from './google-login-template.pug';\r\n\r\nexport class GoogleLoginStep extends BaseImportStep {\r\n initialize({\r\n deps,\r\n singleAccountMode = true,\r\n }) {\r\n super.initialize({\r\n deps,\r\n });\r\n const { google, config } = deps;\r\n const permissions = config.get('Permissions') || {};\r\n if (deps.repository) {\r\n this.logTrace(`GSILocal: ${permissions.dynamic.GSILocal}`);\r\n }\r\n this.googleLoginRepository = new GoogleLoginRepository({\r\n deps: { google, GSILocal: permissions.dynamic.GSILocal },\r\n });\r\n this.signupMode = deps.uxMode === 'signup';\r\n this.singleAccountMode = singleAccountMode;\r\n }\r\n\r\n // TODO: Change button text if user is already logged in\r\n get actions() {\r\n const actions = [];\r\n\r\n if (this.repository.isUserLoggedIn()) {\r\n actions.push({\r\n name: 'continue',\r\n displayText: this.i18n.get('CampaignImport_ButtonContinue'),\r\n method: 'continue',\r\n htmlAttributes: {\r\n class: 'btn btn-primary',\r\n },\r\n enabled: true,\r\n }, {\r\n name: 'signout',\r\n displayText: this.i18n.get('GoogleImport_Logout_Title'),\r\n method: 'logoutGoogle',\r\n htmlAttributes: {\r\n class: 'btn btn-default',\r\n },\r\n enabled: true,\r\n });\r\n } else {\r\n actions.push({\r\n name: 'sign-in',\r\n displayText: this.i18n.get('CampaignImport_ButtonAuthorize'),\r\n method: 'signIn',\r\n htmlAttributes: {\r\n class: 'btn btn-primary',\r\n 'data-analyticsid': 'omniture-google-import-sign-in',\r\n },\r\n enabled: true,\r\n });\r\n if (!this.signupMode) {\r\n actions.push({\r\n name: 'cancel',\r\n displayText: this.i18n.get('CampaignImport_ButtonCancel'),\r\n });\r\n }\r\n }\r\n\r\n return actions;\r\n }\r\n\r\n get title() {\r\n return this.buildTitle({\r\n activeTitle: this.i18n.get('GoogleImport_Login_Title'),\r\n summaryTitle: this.i18n.get('GoogleImport_Login_Summary'),\r\n });\r\n }\r\n\r\n getSummaryInfo() {\r\n return this.repository.getGoogleAccountName();\r\n }\r\n\r\n render() {\r\n this.koModel = {\r\n errorMsg: ko.observable(''),\r\n isLoggedIn: ko.observable(this.repository.isUserLoggedIn()),\r\n signInFailedEmptySessionId: ko.observable(false),\r\n };\r\n this.koModel.errorMsgRole = ko.computed(() => (this.koModel.errorMsg() === '' ? 'none' : 'alert'), this.koModel);\r\n this.$el.html(GoogleLoginTemplate({\r\n i18n: this.i18n,\r\n currentGoogleAccount: this.repository.getGoogleAccountName(),\r\n currentAccount: this.deps.config.get('CurrentAccount').Title,\r\n singleAccountMode: this.singleAccountMode,\r\n }));\r\n ko.applyBindings(this.koModel, this.el);\r\n this.logTrace('render google login step');\r\n this.deps.logActivities.logInAccount.startSignal();\r\n return this;\r\n }\r\n\r\n signIn() {\r\n this.deps.logScenario.clickOnSignInButton.create().signal();\r\n if (this.deps.token) {\r\n return this.signIntoGoogleInDevEnvWithToken();\r\n }\r\n this.logTrace(`use offline-access consent: ${this.koModel.signInFailedEmptySessionId()}`);\r\n return new Promise((resolve, reject) => {\r\n this.googleLoginRepository.googleSignIn({\r\n onSuccess: resolve,\r\n onFail: reject,\r\n useConsentPrompt: this.koModel.signInFailedEmptySessionId(),\r\n });\r\n }).then(response => this.onGoogleAuthSuccess(response))\r\n .catch((error) => {\r\n if (error.authErrors === 'popup_failed_to_open') {\r\n this.koModel.errorMsg(this.i18n.get('GoogleImport_AuthorizationError_Popup_Blocked'));\r\n } else if (error.authErrors === 'idpiframe_initialization_failed') {\r\n this.koModel.errorMsg(this.i18n.get('GoogleImport_AuthorizationError_Cookies_Disabled'));\r\n } else if (error.authErrors === 'popup_closed') {\r\n this.koModel.errorMsg(this.i18n.get('GoogleImport_AuthorizationError_Closed_By_User'));\r\n } else {\r\n this.koModel.errorMsg(this.i18n.get('GoogleImport_AuthorizationError'));\r\n }\r\n this.logTrace(`failed to login to google import spa, err: ${error && error.authErrors}`);\r\n })\r\n .finally(withUiBlock());\r\n }\r\n\r\n continue() {\r\n this.deps.logActivities.logInAccount.stopSignal();\r\n\r\n const sessionId = this.repository.getGoogleImportInfoFromCookie().googleSessionId;\r\n\r\n if (!sessionId) {\r\n this.logoutGoogleWithErrorMessage();\r\n return;\r\n }\r\n\r\n const state = this.getState();\r\n const finalState = {};\r\n this.repository.getGoogleAccounts(sessionId)\r\n .then((googleAccount) => {\r\n finalState.googleAccount = googleAccount;\r\n finalState.googleLoginSummary = this.getSummaryInfo();\r\n\r\n // should not skip google account step if currency conversion is required\r\n let shouldConvertCurrency = false;\r\n if (googleAccount.length === 1) {\r\n const bingCurrency = this.deps.config.get('AccountCurrencyCode');\r\n const googleCurrency = googleAccount[0].Currency;\r\n if (googleCurrency !== bingCurrency) {\r\n shouldConvertCurrency = true;\r\n }\r\n }\r\n\r\n if (this.singleAccountMode && googleAccount.length === 1 && !shouldConvertCurrency) {\r\n this.logTrace('prepare for google campaign step');\r\n const blobName = state && state.initialSettings\r\n && state.initialSettings.AdWordsImportContext\r\n && state.initialSettings.AdWordsImportContext.GoogleEntitiesBlobName;\r\n return this.repository\r\n .prepareForCampaignSelectionStep(googleAccount[0].CustomerId, blobName);\r\n }\r\n\r\n return null;\r\n })\r\n .then((extraState) => {\r\n let googleAccountSummary = null;\r\n if (extraState\r\n && validateSelectedAccountCampaigns(extraState.googleCampaigns, this.signupMode)) {\r\n this.logTrace('only one google account, go directly to google campaigns');\r\n this.deps.logScenario.accountSelectionSkipped.create().signal();\r\n const soleGoogleAccount = finalState.googleAccount[0];\r\n // in scenarios when accountname is blank (e.g. bingadstest1),\r\n // use login name and customer id for summary info\r\n googleAccountSummary = _.size(soleGoogleAccount.AccountName) > 0 ?\r\n soleGoogleAccount.AccountName :\r\n `${this.repository.getGoogleAccountName()}, ${soleGoogleAccount.CustomerId}`;\r\n\r\n _.extend(finalState, extraState, {\r\n googleAccountSummary,\r\n googleCustomerId: soleGoogleAccount.CustomerId,\r\n loginCustomerId: soleGoogleAccount.LoginCustomerId,\r\n });\r\n }\r\n this.patchState(finalState);\r\n this.trigger('switch:step', googleAccountSummary ? { googleAccountSummary } : undefined);\r\n })\r\n .catch(err => this.handleError(err))\r\n .finally(withUiBlock());\r\n }\r\n\r\n processSignIn(startSessionPromise) {\r\n return startSessionPromise.then((sessionId) => {\r\n if (sessionId) {\r\n this.continue();\r\n this.koModel.signInFailedEmptySessionId(false);\r\n } else {\r\n this.koModel.signInFailedEmptySessionId(true);\r\n this.koModel.errorMsg(this.i18n.get('GoogleImport_SignInErrorOfflineAccess'));\r\n this.logTrace('No refresh token on file for account. Showing offline access prompt');\r\n }\r\n })\r\n .catch(err => this.handleError(err))\r\n .finally(withUiBlock());\r\n }\r\n\r\n onGoogleAuthSuccess(response) {\r\n return this.processSignIn(this.repository.startGoogleSession(response.code));\r\n }\r\n\r\n signIntoGoogleInDevEnvWithToken() {\r\n return this.processSignIn(this.repository.startGoogleSessionWithToken(this.deps.token));\r\n }\r\n\r\n handleError(err) {\r\n let code;\r\n let msg;\r\n const { i18n } = this;\r\n const email = this.getSummaryInfo();\r\n\r\n if (err.body) {\r\n code = _.propertyOf(err.body[0])('Code');\r\n }\r\n\r\n switch (code) {\r\n case 'GoogleSyncNotAdWordsUser':\r\n msg = i18n.get('CampaignImport_GSyncNotAdsUser').replace('{0}', email);\r\n break;\r\n case 'GoogleSyncInvalidCustomerId':\r\n msg = i18n.get('CampaignImport_GSyncInvalidCustomerId');\r\n break;\r\n case 'GoogleSyncOAuthTokenRevoked':\r\n msg = i18n.get('CampaignImport_GSyncOAuthTokenRevoked');\r\n break;\r\n case 'GoogleSyncWebExceptionTimeout':\r\n msg = i18n.get('CampaignImport_GSyncOperationTimeout');\r\n break;\r\n case 'GoogleSyncAccountNotSetUp':\r\n msg = i18n.get('CampaignImport_GSyncAccountNotSetUp').replace('{0}', email);\r\n break;\r\n case 'GoogleSyncUserIsNotAuthorized':\r\n msg = i18n.get('CampaignImport_GSyncAuthorizationError');\r\n break;\r\n case 'GoogleSyncUserPermissionDenied':\r\n msg = i18n.get('Scheduled_Import_Permission_Error');\r\n break;\r\n case 'GoogleSyncTwoStepVerificationNotEnrolled':\r\n msg = this.deps.i18nErrors.getString(`Error_Campaign_API_${code}`);\r\n break;\r\n default:\r\n break;\r\n }\r\n if (msg) {\r\n // this error will be shown in google sign in step\r\n this.koModel.errorMsg(msg);\r\n this.logoutGoogle();\r\n } else {\r\n // this error will be shown on top of page\r\n this.handleGenericError(err);\r\n }\r\n }\r\n\r\n logoutGoogle() {\r\n this.isEdited = true;\r\n this.repository.logout();\r\n this.koModel.isLoggedIn(this.repository.isUserLoggedIn());\r\n this.logTrace('User logging out of Google account');\r\n this.trigger('change:action');\r\n }\r\n\r\n logoutGoogleWithErrorMessage() {\r\n this.logoutGoogle();\r\n this.koModel.errorMsg(this.i18n.get('Import_Google_AlreadySignedOut_Error'));\r\n }\r\n}\r\n","import _ from 'underscore';\r\nimport { ImportSource } from '@bingads-webui-campaign/import-components';\r\nimport { ImportOptionsStep } from '../../shared/step/index';\r\n\r\nexport { ImportOptionsSummaryBuilder as GoogleImportOptionsSummaryBuilder } from '../../shared/step/index';\r\n\r\nexport class GoogleImportOptionsStep extends ImportOptionsStep {\r\n initialize({ deps }) {\r\n const importSource = ImportSource.google(deps.i18n, deps.repository);\r\n super.initialize({\r\n importSourceName: importSource.name,\r\n deps: _.defaults({\r\n i18n: importSource.i18n,\r\n repository: importSource.repository,\r\n }, deps),\r\n });\r\n }\r\n}\r\n","import _ from 'underscore';\r\nimport { ImportSource } from '@bingads-webui-campaign/import-components';\r\nimport { BaseScheduleImportStep, BaseScheduleFormView } from '../../shared/step/index';\r\n\r\nexport class ScheduleImportStep extends BaseScheduleImportStep {\r\n initialize({ deps }) {\r\n const importSource = ImportSource.google(deps.i18n, deps.repository);\r\n super.initialize({\r\n importSourceName: importSource.name, // google\r\n deps: _.defaults({\r\n i18n: importSource.i18n,\r\n repository: importSource.repository,\r\n }, deps),\r\n });\r\n }\r\n}\r\n\r\nexport class ScheduleFormView extends BaseScheduleFormView {\r\n initialize({ deps, options }) {\r\n const importSource = ImportSource.google(deps.i18n, deps.repository);\r\n super.initialize({\r\n importSourceName: importSource.name, // google\r\n deps: _.defaults({\r\n i18n: importSource.i18n,\r\n repository: importSource.repository,\r\n }, deps),\r\n options,\r\n });\r\n }\r\n}\r\n","import { ImportSource } from '@bingads-webui-campaign/import-components';\r\nimport { CampaignGridView } from '../shared/step/campaign-selection-step/grid';\r\n\r\nexport function createGoogleCampaignGridView({\r\n data,\r\n signupMode,\r\n appConfig,\r\n isAIMImportEnabled,\r\n i18n,\r\n repo,\r\n ...others\r\n}) {\r\n const importSource = ImportSource.google(i18n, repo);\r\n const view = new CampaignGridView({\r\n data,\r\n signupMode,\r\n appConfig,\r\n isAIMImportEnabled,\r\n i18n: importSource.i18n,\r\n repo: importSource.repository,\r\n ...others,\r\n });\r\n return view;\r\n}\r\n","import _ from 'underscore';\r\n\r\nimport {\r\n AccountTitleStep\r\n} from '@bingads-webui-campaign/import-components';\r\n\r\nimport {\r\n AccountSelectionStep,\r\n CampaignSelectionStep,\r\n ImportOptionsStep,\r\n BaseScheduleImportStep,\r\n ImportSummaryStep,\r\n} from '../shared/step/index';\r\n\r\nimport {\r\n GoogleLoginStep,\r\n} from '../step/index';\r\n\r\nfunction createAccountTitleStep(deps) {\r\n return {\r\n stepName: 'account-title-step',\r\n stepView: new AccountTitleStep({\r\n deps,\r\n }),\r\n };\r\n}\r\n\r\nfunction createGoogleLoginStep(deps) {\r\n return {\r\n stepName: 'google-login-step',\r\n stepView: new GoogleLoginStep({\r\n deps: _.defaults({ linkTextForTitle: deps.i18n.get('GoogleImport_Logout_Title') }, deps),\r\n }),\r\n };\r\n}\r\n\r\nfunction createGoogleAccountStep(deps) {\r\n return {\r\n stepName: 'google-account-step',\r\n stepView: new AccountSelectionStep({\r\n importSourceName: deps.importSource.name, // 'google'\r\n getStateAdapter: deps.importSource.getStateAdapter,\r\n deps: _.defaults({ previousStepName: 'google-login-step', i18n: deps.importSource.i18n }, deps),\r\n }),\r\n };\r\n}\r\n\r\nfunction createGoogleCampaignStep(deps) {\r\n const {\r\n config = {},\r\n importSource: {\r\n name,\r\n getStateAdapter,\r\n } = {},\r\n } = deps || {};\r\n const permissions = config.get('Permissions') || {};\r\n const signupMode = deps.uxMode === 'signup';\r\n\r\n return {\r\n stepName: 'google-campaign-step',\r\n stepView: new CampaignSelectionStep({\r\n importSourceName: name, // google\r\n getStateAdapter,\r\n isAIMImportEnabled: permissions.IsAIMCampaignEnabled,\r\n isAdGroupLevelImportEnabled: !signupMode,\r\n deps: _.defaults({\r\n previousStepName: 'google-account-step',\r\n i18n: deps.importSource.i18n,\r\n repository: deps.importSource.repository,\r\n }, deps),\r\n }),\r\n };\r\n}\r\n\r\nfunction createImportOptionsStep(deps) {\r\n return {\r\n stepName: 'import-options-step',\r\n stepView: new ImportOptionsStep({\r\n importSourceName: 'google',\r\n deps: _.defaults({ previousStepName: 'google-campaign-step' }, deps),\r\n }),\r\n };\r\n}\r\n\r\nfunction createScheduleImportStep(deps) {\r\n return {\r\n stepName: 'schedule-import-step',\r\n stepView: new BaseScheduleImportStep({\r\n importSourceName: deps.importSource.name, // google\r\n deps: _.defaults({\r\n previousStepName: 'import-options-step',\r\n i18n: deps.importSource.i18n,\r\n repository: deps.importSource.repository,\r\n }, deps),\r\n }),\r\n };\r\n}\r\n\r\nfunction createImportSummaryStep(deps) {\r\n const signupMode = deps.uxMode === 'signup';\r\n return {\r\n stepName: 'import-summary-step',\r\n stepView: new ImportSummaryStep({\r\n importSourceName: deps.importSource.name, // google\r\n isAdGroupLevelImportEnabled: !signupMode,\r\n getStateAdapter: deps.importSource.getStateAdapter,\r\n deps: _.defaults({\r\n i18n: deps.importSource.i18n,\r\n repository: deps.importSource.repository,\r\n }, deps),\r\n }),\r\n };\r\n}\r\n\r\nexport class GoogleImportStepFactory {\r\n static createSteps(deps) {\r\n deps.check();\r\n const steps = [];\r\n steps.push(createAccountTitleStep(deps));\r\n steps.push(createGoogleLoginStep(deps));\r\n steps.push(createGoogleAccountStep(deps));\r\n steps.push(createGoogleCampaignStep(deps));\r\n steps.push(createImportOptionsStep(deps));\r\n steps.push(createScheduleImportStep(deps));\r\n steps.push(createImportSummaryStep(deps));\r\n\r\n return steps;\r\n }\r\n\r\n static createStepsForSignup(deps) {\r\n const steps = [];\r\n\r\n steps.push(createGoogleLoginStep(deps));\r\n steps.push(createGoogleAccountStep(deps));\r\n steps.push(createGoogleCampaignStep(deps));\r\n steps.push(createImportSummaryStep(deps));\r\n return steps;\r\n }\r\n}\r\n","import React from 'react';\r\nimport ReactDom from 'react-dom';\r\nimport Backbone from 'backbone';\r\nimport Promise from 'bluebird';\r\nimport _ from 'underscore';\r\nimport $ from 'jquery';\r\n\r\nimport { BaseImportView, ImportSource } from '@bingads-webui-campaign/import-components';\r\nimport { PerfMarkerFactory } from '@bingads-webui/performance-marker';\r\nimport { CouponLightboxNew, CouponBannerNew } from '@bingads-webui-react/feature-adoption-coupon';\r\nimport { withUiBlock } from '@bingads-webui/uiblocker';\r\nimport { GoogleImportRepository } from '@bingads-webui-campaign/import-shared-repositories';\r\nimport { Constants as CCUIConstants } from '@bingads-webui-clientcenter/entity-utils';\r\n\r\nimport { GoogleImportStepFactory } from './google-import-step-factory';\r\nimport { ImportOptionsStep as GoogleImportOptionsStep } from '../shared/step/index';\r\n\r\nconst FAC_STATUS_ACTIVE = CCUIConstants.RecommendationAdoptionStatus.Active;\r\nconst FAC_STATUS_NOT_IN_PROGRESS = CCUIConstants.RecommendationAdoptionStatus.NotInProgess;\r\n\r\n// Common dependency checks should happen in base-import-view\r\nfunction checkRequiredDepsForGoogleImport(deps) {\r\n deps.check('edm');\r\n deps.check('jsData');\r\n deps.check('google');\r\n deps.check('timeZoneMapper');\r\n deps.check('uxMode');\r\n deps.check('cookieHelperForEditImport');\r\n}\r\n\r\nexport class GoogleImportPage extends Backbone.View {\r\n initialize({\r\n deps,\r\n options = {},\r\n }) {\r\n checkRequiredDepsForGoogleImport(deps);\r\n this.deps = deps;\r\n this.perfMarker = this.deps.perfMarker || PerfMarkerFactory.createMarker('GoogleImport', { autoEnd: false });\r\n this.isSignUpMode = this.deps.uxMode === 'signup';\r\n\r\n if (this.isSignUpMode) {\r\n this.options = _.extend({\r\n isSignUpMode: true,\r\n subTitle: deps.pageSubTitle,\r\n }, options);\r\n } else {\r\n this.options = _.extend({\r\n pageTitle: deps.i18n.get('GoogleImport_PageTitle'),\r\n subTitle: deps.i18n.get('GoogleImport_PageDescription'),\r\n }, options);\r\n }\r\n\r\n this.isGoogleAccountSkipped = false;\r\n this.googleImportRepository = new GoogleImportRepository({ deps });\r\n this.initialState = {};\r\n this.baseImportOptions = this.options;\r\n\r\n this.importSource = ImportSource.google(deps.i18n, this.googleImportRepository);\r\n\r\n if (this.isSignUpMode) {\r\n _.extend(deps, {\r\n generateImportUserPreferencesFromPreviousOptions:\r\n GoogleImportOptionsStep.generateImportUserPreferencesFromPreviousOptions,\r\n });\r\n\r\n this.steps = GoogleImportStepFactory.createStepsForSignup(_.extend(deps, {\r\n repository: this.googleImportRepository,\r\n isContinueImport: false,\r\n importSource: this.importSource,\r\n }));\r\n\r\n this.baseImportOptions.showAllStepsInLastStepFunc = () => true;\r\n this.baseImportOptions.enableEdit = false;\r\n } else {\r\n this.steps = GoogleImportStepFactory.createSteps(_.extend(deps, {\r\n repository: this.googleImportRepository,\r\n isContinueImport: !!options.importId,\r\n subFieldsBlacklist: options.subFieldsBlacklist,\r\n onCredentialsError: this.onCredentialsError.bind(this),\r\n importSource: this.importSource,\r\n }));\r\n this.baseImportOptions.showAllStepsInLastStepFunc =\r\n wizard => wizard.currentStepInstance.isScheduledImport;\r\n if (this.options.importId) {\r\n this.initialState.importId = options.importId;\r\n this.baseImportOptions.currentStep = 'schedule-import-step';\r\n }\r\n this.baseImportOptions.enableEdit = true;\r\n\r\n this.onSwitchFinished = () => {\r\n $('[data-step-name=\"google-login-step\"] .edit-step').hide();\r\n $('[data-step-name=\"account-title-step\"] .edit-step').hide();\r\n const $accountEdit = $('[data-step-name=\"google-account-step\"] .edit-step');\r\n\r\n if (this.isGoogleAccountSkipped) {\r\n $accountEdit.hide();\r\n } else {\r\n $accountEdit.show();\r\n }\r\n };\r\n this.onSwitchFinished.bind(this);\r\n }\r\n }\r\n\r\n logTrace(...args) {\r\n this.googleImportRepository.logTrace(...args);\r\n }\r\n\r\n render() {\r\n this.perfMarker.willRender();\r\n let initBaseViewPromise = Promise.resolve([]);\r\n\r\n if (this.isSignUpMode) {\r\n this.baseImportView = new BaseImportView({\r\n deps: this.deps,\r\n steps: this.steps,\r\n options: this.baseImportOptions,\r\n initialState: {},\r\n });\r\n this.logTrace('sign up mode in Import SPA');\r\n this.logTrace('GoogleImportWizardSignUp');\r\n } else {\r\n let initialStateFetchPromise = Promise.resolve([]);\r\n\r\n if (this.options.taskItemId) {\r\n this.logTrace('taskItemId is passed');\r\n\r\n initialStateFetchPromise =\r\n this.googleImportRepository.getImportTaskItem(this.options.taskItemId)\r\n .then((taskItem) => {\r\n // in this case, if user has signed in on import schedule page, update session Id\r\n const currentUserId = _.propertyOf(this.deps.config.get('CurrentUser'))('Id');\r\n\r\n if (taskItem.ModifiedBy.Id !== currentUserId) {\r\n this.logTrace('a different user is editing');\r\n const { cookieHelperForEditImport } = this.deps;\r\n const sessionId = cookieHelperForEditImport.getSessionId(this.options.taskItemId);\r\n\r\n cookieHelperForEditImport.deleteCookie();\r\n if (sessionId) {\r\n taskItem.AdWordsImportContext.SessionId = sessionId; // eslint-disable-line\r\n }\r\n }\r\n\r\n this.initialState.initialSettings = taskItem;\r\n this.initialState.initialSettings.taskItemId = this.options.taskItemId;\r\n this.initialState.isEditingScheduledImport = true;\r\n });\r\n }\r\n\r\n initBaseViewPromise = initialStateFetchPromise.then(() => {\r\n this.baseImportView = new BaseImportView({\r\n deps: this.deps,\r\n steps: this.steps,\r\n options: this.baseImportOptions,\r\n initialState: this.initialState,\r\n onSwitchFinished: this.onSwitchFinished,\r\n });\r\n });\r\n }\r\n\r\n return initBaseViewPromise.then(() => (\r\n this.baseImportView.render()\r\n .then((baseImportView) => {\r\n this.$el.html(baseImportView.el);\r\n\r\n if (this.deps.coupon\r\n && this.deps.ccJsData) {\r\n this.enableFacOnScheduleStep = (shouldHaveCoupon) => {\r\n const scheduledImportStep = _.findWhere(this.steps, { stepName: 'schedule-import-step' }).stepView;\r\n scheduledImportStep.coupon = shouldHaveCoupon\r\n ? this.deps.coupon\r\n : undefined;\r\n };\r\n const disableFacEverywhere = () => {\r\n this.enableFacOnScheduleStep(false);\r\n const googleCampaignStepView = _.findWhere(this.steps, { stepName: 'google-campaign-step' }).stepView;\r\n googleCampaignStepView.coupon = undefined;\r\n };\r\n\r\n const addCouponBanner = () => {\r\n this.enableFacOnScheduleStep(true);\r\n\r\n const bannerContainer = $('
')[0];\r\n const topBannerElement = React.createElement(\r\n CouponBannerNew,\r\n {\r\n i18n: this.deps.i18nAmdLoader,\r\n coupon: this.deps.coupon,\r\n titleKey: 'FAC_Coupon_Banner_Title',\r\n messageKey: 'FAC_GImport_Coupon_Banner_Message',\r\n }\r\n );\r\n\r\n this.$el.prepend(bannerContainer);\r\n ReactDom.render(topBannerElement, bannerContainer);\r\n };\r\n\r\n if (this.deps.coupon.rawData.Status === FAC_STATUS_NOT_IN_PROGRESS) {\r\n const $modal = $('
');\r\n this.$el.append($modal);\r\n const closeLightbox = () => {\r\n const closeBlock = withUiBlock();\r\n this.googleImportRepository.updateFACCoupon(FAC_STATUS_ACTIVE)\r\n .tap(addCouponBanner)\r\n .catch((err) => {\r\n if (this.deps.showAlertHandler) {\r\n const errorCode = err.Errors && err.Errors[0] && err.Errors[0].Code;\r\n const errorMessageKey = errorCode === 'CCMTErrorNumber_CouponBankDepleted'\r\n ? 'FACDepletedErrorMessage'\r\n : 'GenericFACAdoptionStartErrorMessage';\r\n\r\n this.deps.showAlertHandler({\r\n message: this.deps.i18nAmdLoader.getString(errorMessageKey),\r\n level: 'Error',\r\n });\r\n }\r\n throw err;\r\n })\r\n .catch(disableFacEverywhere)\r\n .finally(() => {\r\n ReactDom.unmountComponentAtNode($modal[0]);\r\n $modal.remove();\r\n closeBlock();\r\n });\r\n };\r\n\r\n const modalElement = React.createElement(\r\n CouponLightboxNew,\r\n {\r\n coupon: this.deps.coupon,\r\n i18n: this.deps.i18nAmdLoader,\r\n onSubmit: closeLightbox,\r\n onCancel: closeLightbox,\r\n }\r\n );\r\n ReactDom.render(modalElement, $modal[0]);\r\n } else {\r\n addCouponBanner();\r\n }\r\n }\r\n\r\n this.$('[data-step-name=\"account-title-step\"] .edit-step').hide();\r\n\r\n if (this.isSignUpMode) {\r\n this.$('[data-step-name=\"import-summary-step\"]').closest('.step-container').hide();\r\n }\r\n\r\n this.attachPageEventHandlers();\r\n this.perfMarker.done();\r\n return this;\r\n })\r\n ));\r\n }\r\n\r\n remove() {\r\n if (this.baseImportView) {\r\n this.baseImportView.remove();\r\n }\r\n super.remove();\r\n }\r\n\r\n attachPageEventHandlers() {\r\n const googleLoginStepView = _.findWhere(this.steps, { stepName: 'google-login-step' }).stepView;\r\n const googleAccountStepView = _.findWhere(this.steps, { stepName: 'google-account-step' }).stepView;\r\n const googleCampaignStepView = _.findWhere(this.steps, { stepName: 'google-campaign-step' }).stepView;\r\n\r\n if (this.enableFacOnScheduleStep) {\r\n googleCampaignStepView.on('enableFacOnScheduleStep', this.enableFacOnScheduleStep);\r\n }\r\n\r\n this.baseImportView.on('click:step.header.link', (e) => {\r\n const stepName = $(e.target).closest('.step-header').attr('data-step-name');\r\n\r\n if (stepName === 'google-login-step') {\r\n this.logTrace('signout clicked. start to log out and go to google login step');\r\n googleLoginStepView.logoutGoogle();\r\n this.baseImportView.currentStepInstance.setState({\r\n savedSetting: _.result(googleCampaignStepView, 'getCurrentSetting') || {},\r\n isEditEnabledForWizard: !this.isSignUpMode,\r\n });\r\n\r\n if (!_.isEmpty(this.initialState)) {\r\n this.initialState.initialSettings.AdWordsImportContext = null;\r\n }\r\n this.baseImportView.currentStepInstance.patchState(this.initialState);\r\n this.baseImportView.goToStep(stepName);\r\n }\r\n });\r\n\r\n googleLoginStepView.on('switch:step', (obj) => {\r\n if (obj) {\r\n this.logTrace('directly go to google campaign step');\r\n googleAccountStepView.patchState(obj);\r\n googleLoginStepView.patchState({\r\n 'google-account-step.isEdited': true,\r\n });\r\n this.isGoogleAccountSkipped = true;\r\n this.baseImportView.goToStep('google-campaign-step');\r\n } else {\r\n this.isGoogleAccountSkipped = false;\r\n this.baseImportView.goToStep('google-account-step');\r\n }\r\n });\r\n }\r\n\r\n onCredentialsError() {\r\n this.logTrace('call onCredentialsError');\r\n\r\n const googleLoginStepView = _.findWhere(this.steps, { stepName: 'google-login-step' }).stepView;\r\n googleLoginStepView.logoutGoogleWithErrorMessage();\r\n this.baseImportView.currentStepInstance.setState({});\r\n this.baseImportView.goToStep('google-login-step');\r\n }\r\n\r\n // this needs to be called after this view has been attached to dom\r\n // otherwise UI blocker throws exception\r\n startPollingAfterContinueImport() {\r\n if (this.options.importId) {\r\n this.logTrace('importId is passed, go to next step');\r\n\r\n this.baseImportView.goToNextStep();\r\n } else if (this.options.taskItemId && !this.baseImportView.onContinueImportView) {\r\n this.logTrace('taskItemId is passed, set cookie');\r\n\r\n const googleLoginStepView = _.findWhere(this.steps, { stepName: 'google-login-step' }).stepView;\r\n const { AccountName, SessionId } = this.initialState.initialSettings.AdWordsImportContext;\r\n\r\n this.logTrace(`set adwords context to cookie: AccountName - ${AccountName}, SessionId - ${SessionId} `);\r\n this.googleImportRepository.setGoogleImportAccountInfoInCookie({\r\n loginAccount: AccountName,\r\n sessionId: SessionId,\r\n });\r\n\r\n googleLoginStepView.continue();\r\n }\r\n }\r\n}\r\n","import _ from 'underscore';\r\n\r\nimport { ImportMode } from '@bingads-webui-campaign/imports-core';\r\nimport { CommonPermissionFactory } from '@bingads-webui-campaign/import-shared-repositories';\r\n\r\nexport class PermissionFactory extends CommonPermissionFactory {\r\n constructor({\r\n permissions,\r\n importMode,\r\n }) {\r\n super({\r\n permissions,\r\n });\r\n\r\n this.permissions = permissions;\r\n this.importMode = importMode;\r\n }\r\n\r\n isMerchantCenterStoreMappingStepEnabled = (campaignsWithMerchantId) => {\r\n if (_.size(campaignsWithMerchantId) === 0) {\r\n return false;\r\n }\r\n\r\n const { IsBSCSmartImportEnabled } = this.permissions;\r\n // right now check only pilot flag && campaignsWithMerchantId.\r\n // check multiaccount import once implemented.\r\n return this.importMode !== ImportMode.Multi && IsBSCSmartImportEnabled;\r\n };\r\n\r\n // be able to switch between single/multi import mode when user choose\r\n // single/multi account in choose-google-account-step\r\n isImportModeSwitchEnabled = () => {\r\n const { IsSmartImportV2Enabled } = this.permissions;\r\n // return false;\r\n return IsSmartImportV2Enabled;\r\n };\r\n\r\n toggleImportMode = (mode) => {\r\n this.importMode = mode;\r\n };\r\n\r\n // relocate currency converter in import option step instead of account selection step\r\n isCurrencyConvertorRelocateEnabled = () => {\r\n const { IsSmartImportCurrencyConversionOptionEnabled } = this.permissions;\r\n return IsSmartImportCurrencyConversionOptionEnabled && this.importMode !== ImportMode.Multi;\r\n };\r\n\r\n // bug fix: when edit expert mode schedule import, if user start import in smart import step\r\n // the schedule import should keep expert mode\r\n IsSmartImportEditExpertImportEnabled = () => {\r\n const { IsSmartImportEditExpertImportEnabled } = this.permissions;\r\n return IsSmartImportEditExpertImportEnabled;\r\n };\r\n\r\n IsGoogleImportVideoAdsEnabled = () => {\r\n const { IsGoogleImportVideoAdsEnabled } = this.permissions;\r\n return IsGoogleImportVideoAdsEnabled;\r\n };\r\n\r\n IsOneClickImportEnabled = () => this.permissions && this.permissions.dynamic && this.permissions.dynamic.ImportOneClick;\r\n\r\n IsImportFromMetaButtonEnabled = () =>\r\n this.permissions && this.permissions.dynamic &&\r\n this.permissions.dynamic.FBImportForGoogleImportSummary &&\r\n this.permissions.dynamic.FacebookImport;\r\n}\r\n","/* eslint-disable no-undef */\r\n\r\nexport const StepConstants = {\r\n SignInStep: {\r\n path: 'signInStep',\r\n stepName: _TL_('Sign in with Google'),\r\n title: _TL_('Sign in with Google'),\r\n },\r\n ChooseAccounts: {\r\n path: 'chooseAccounts',\r\n stepName: _TL_('Choose accounts'),\r\n title: _TL_('Choose accounts'),\r\n },\r\n ChooseAccountsGoogleAccount: {\r\n path: 'chooseAccounts.googleAccount',\r\n stepName: _TL_('Choose accounts'),\r\n title: _TL_('Choose accounts'),\r\n },\r\n ChooseAccountsBingAccountMapping: {\r\n path: 'chooseAccounts.bingAccountMapping',\r\n stepName: _TL_('Choose accounts'),\r\n title: _TL_('Choose accounts'),\r\n },\r\n StartImportSmart: {\r\n path: 'startImport.smart',\r\n stepName: _TL_('Set schedule'),\r\n title: _TL_('You\\'re ready to start your import'),\r\n },\r\n GoogleCampaignStep: {\r\n path: 'googleCampaignStep',\r\n stepName: _TL_('Choose campaigns and ad groups'),\r\n title: _TL_('Which campaigns and ad groups do you want to import?'),\r\n },\r\n ImportSummaryStep: {\r\n path: 'importSummaryStep',\r\n title: _TL_('Import Summary'),\r\n },\r\n ImportOptionStep: {\r\n path: 'importOptionStep',\r\n stepName: _TL_('Choose items and options'),\r\n title: _TL_('Choose which items to import and the options to set for them.'),\r\n },\r\n StartImportAdvanced: {\r\n path: 'startImport.advanced',\r\n stepName: _TL_('Set schedule'),\r\n title: _TL_('Set schedule'),\r\n },\r\n ImportStatusStep: {\r\n path: 'importStatusStep',\r\n title: _TL_('Import Status'),\r\n },\r\n MerchantCenterStoreMappingStep: {\r\n path: 'merchantCenterStoreMappingStep',\r\n stepName: _TL_('Choose Microsoft Merchant Center store'),\r\n title: _TL_('Choose Microsoft Merchant Center stores for shopping campaigns'),\r\n },\r\n SmartCampaignSignInStep: {\r\n path: 'smartCampaignSignInStep',\r\n title: _TL_('Import from Google Ads'),\r\n },\r\n ESCSignInStep: {\r\n path: 'escSignInStep',\r\n title: _TL_('Import your smart campaigns from Google Ads'),\r\n },\r\n};\r\n","/* eslint-disable react-hooks/rules-of-hooks */\r\n/* eslint-disable no-param-reassign */\r\nimport React, { useContext, useState } from 'react';\r\nimport PropTypes from 'prop-types';\r\nimport $ from 'jquery';\r\nimport _ from 'underscore';\r\nimport Promise from 'bluebird';\r\nimport { ImportCoreContext, ImportType } from '@bingads-webui-campaign/imports-core';\r\nimport { withUiBlock } from '@bingads-webui/uiblocker';\r\n\r\nimport { StepConstants } from '../../page/step-config';\r\n\r\nexport const withLoginStepPrefetch = (PreExecuteStep) => {\r\n const LoginStepPrefetch = React.memo((props) => {\r\n const importCoreContext = useContext(ImportCoreContext);\r\n\r\n const {\r\n deps,\r\n repository,\r\n toggleImportType,\r\n patchState,\r\n googleAccount: existingGoogleAccount,\r\n logOutButtonClicked = false,\r\n goToNextStep,\r\n } = importCoreContext;\r\n\r\n const {\r\n taskItemId,\r\n config,\r\n i18n,\r\n scope,\r\n } = deps;\r\n\r\n // creation workflow\r\n if (!taskItemId) {\r\n // jump login step after upgrading account mode from smart to expert in smart campaigns import\r\n if (scope.values.didSwitchToExpertFromImport && !existingGoogleAccount) {\r\n // get session Id from cookie\r\n const sessionId = repository.getGoogleImportInfoFromCookie().googleSessionId;\r\n\r\n // show login step if no available session Id\r\n if (!sessionId) {\r\n return ;\r\n }\r\n\r\n // patch state and go to next step if available session Id\r\n patchState({\r\n isLoggedIn: true,\r\n });\r\n\r\n if (goToNextStep) {\r\n goToNextStep(props.nextStepPath);\r\n }\r\n }\r\n\r\n return ;\r\n }\r\n\r\n // edit workflow\r\n const [loading, setLoading] = useState(true); // to notify api is loading.\r\n const [dispatchedOdataCall, setDispatchedOdataCall] = useState(false);\r\n\r\n let initialState = {};\r\n let keepAccountSelectionDueToDifferentEmail = false;\r\n\r\n if (loading &&\r\n !dispatchedOdataCall &&\r\n (!logOutButtonClicked && !existingGoogleAccount)\r\n ) {\r\n setDispatchedOdataCall(true);\r\n repository.getImportTaskItem(deps.taskItemId)\r\n .then((taskItem) => {\r\n // in this case, if user has signed in on import schedule page, update session Id\r\n const currentUserId = _.propertyOf(config.get('CurrentUser'))('Id');\r\n\r\n if (taskItem.ModifiedBy.Id !== currentUserId ||\r\n // For BAE, we need to check if SessionType is null (from campaign ui workflow)\r\n (deps.serverContext.ApplicationName === 'BingAdsEditor' && taskItem.AdWordsImportContext.SessionType === null) ||\r\n // For campaign ui, we need to check if sessionType is CloudImport (from BAE workflow)\r\n (deps.serverContext.ApplicationName !== 'BingAdsEditor' && taskItem.AdWordsImportContext.SessionType === 'CloudImport')) {\r\n const { cookieHelperForEditImport } = deps;\r\n const sessionId = cookieHelperForEditImport.getSessionId(deps.taskItemId);\r\n\r\n cookieHelperForEditImport.deleteCookie();\r\n if (sessionId) {\r\n taskItem.AdWordsImportContext.SessionId = sessionId; // eslint-disable-line\r\n taskItem.AdWordsImportContext.AccountName = null; // eslint-disable-line\r\n keepAccountSelectionDueToDifferentEmail = true;\r\n patchState({\r\n keepAccountSelectionDueToDifferentEmail: true,\r\n });\r\n } else {\r\n repository.logTrace(`Edit task met different userid. currentUserId: ${currentUserId} and taskItem.ModifiedBy.Id:${taskItem.ModifiedBy.Id}`);\r\n repository.logout();\r\n taskItem.AdWordsImportContext.SessionId = null; // eslint-disable-line\r\n }\r\n }\r\n\r\n // currently DefaultImportSettings is a value set by Import MT to have some customized settings\r\n // if DefaultImportSettings is PMaxRecommendation, override the IsSmartImport and treat the import task as an expert import during edit workflow\r\n if (taskItem.DefaultImportSettings === 'PMaxRecommendation') {\r\n taskItem.IsSmartImport = false;\r\n taskItem.DefaultImportSettings = null;\r\n\r\n repository.logTrace({\r\n TaskType: 'PmaxRecommendationImportTask',\r\n TaskId: taskItem.Id,\r\n Event: 'Enter edit workflow and override settings as normal expert task',\r\n });\r\n }\r\n\r\n initialState.initialSettings = taskItem;\r\n initialState.initialSettings.taskItemId = deps.taskItemId;\r\n // the name is from last import\r\n initialState.isNameEdit = true;\r\n initialState.isEditingScheduledImport = true;\r\n if (initialState.initialSettings.ImportUserPreference) {\r\n initialState.initialSettings.ImportUserPreference.UserPreferenceTrackingTemplate =\r\n initialState.initialSettings.ImportUserPreference.AdWordsAccountTrackingTemplate ||\r\n initialState.initialSettings.ImportUserPreference.AdWordsAccountFinalUrlSuffix;\r\n }\r\n\r\n return taskItem;\r\n })\r\n .then((taskItem) => {\r\n const {\r\n AccountName,\r\n SessionId,\r\n } = taskItem.AdWordsImportContext;\r\n\r\n if (SessionId) {\r\n let initialPromise = Promise.resolve([]);\r\n if (!AccountName) {\r\n initialPromise = repository.fetchGoogleLoginEmail(SessionId)\r\n .then((loginAccount) => {\r\n taskItem.AdWordsImportContext.AccountName = loginAccount; // eslint-disable-line\r\n });\r\n }\r\n return initialPromise.then(() => {\r\n repository.setGoogleImportAccountInfoInCookie({\r\n loginAccount: taskItem.AdWordsImportContext.AccountName,\r\n sessionId: SessionId,\r\n });\r\n });\r\n }\r\n return Promise.resolve();\r\n })\r\n .then(() => {\r\n if (initialState && initialState.isEditingScheduledImport\r\n && initialState.initialSettings.AdWordsImportContext.SessionId) {\r\n let { importStep } = scope.values;\r\n if (keepAccountSelectionDueToDifferentEmail) {\r\n importStep = undefined;\r\n }\r\n if (importStep === StepConstants.GoogleCampaignStep.path ||\r\n importStep === StepConstants.ImportOptionStep.path ||\r\n importStep === StepConstants.StartImportAdvanced.path) {\r\n patchState({\r\n otherFieldsExpanded: true,\r\n skipAccountSelectionDueToDirectJump: true,\r\n });\r\n toggleImportType(ImportType.Advanced);\r\n }\r\n\r\n const {\r\n AdWordsImportContext: {\r\n // AccountName,\r\n // AdWordsSessionUserId,\r\n CampaignIds,\r\n GoogleEntitiesBlobName,\r\n // LoginCustomerId,\r\n // SessionId,\r\n },\r\n ImportUserPreference,\r\n IsAutoFrequency,\r\n IsSmartImport,\r\n TimeZoneId,\r\n Cron,\r\n NotificationEmailAddresses,\r\n NotificationType,\r\n Name,\r\n } = initialState.initialSettings;\r\n\r\n let autoConvertCurrencyEnabled = ImportUserPreference &&\r\n ImportUserPreference.EnableAutoCurrencyConversion;\r\n if (_.isUndefined(autoConvertCurrencyEnabled) ||\r\n _.isNull(autoConvertCurrencyEnabled)) {\r\n autoConvertCurrencyEnabled = true;\r\n }\r\n\r\n initialState = _.extend(initialState, {\r\n IsAutoFrequency: !!IsAutoFrequency,\r\n IsSmartImport: !!IsSmartImport,\r\n ImportUserPreference,\r\n TimeZoneId,\r\n Cron,\r\n NotificationEmailAddresses,\r\n NotificationType,\r\n Name,\r\n CampaignIds,\r\n GoogleEntitiesBlobName,\r\n autoConvertCurrencyEnabled,\r\n });\r\n\r\n return importStep;\r\n }\r\n return StepConstants.SignInStep.path;\r\n })\r\n .then((importStep) => {\r\n patchState(initialState);\r\n // Go directly to importStep if passed in.\r\n if (importStep) {\r\n goToNextStep(importStep);\r\n }\r\n setLoading(false);\r\n })\r\n .finally(withUiBlock($('.google-import-root'), i18n.getString('Loading')));\r\n } else if (existingGoogleAccount || logOutButtonClicked) {\r\n return ();\r\n }\r\n\r\n return (\r\n
\r\n {\r\n loading ?
: \r\n }\r\n
\r\n );\r\n });\r\n\r\n LoginStepPrefetch.propTypes = {\r\n nextStepPath: PropTypes.string.isRequired,\r\n };\r\n\r\n return LoginStepPrefetch;\r\n};\r\n","import React from 'react';\r\n\r\nimport {\r\n GoogleLoginStep as GeneralGoogleLoginStep,\r\n renderDescription as generalRenderDescription,\r\n LoginContainer as GeneralLoginContainer,\r\n} from '@bingads-webui-campaign/imports-core';\r\n\r\nimport { StepConstants } from '../../page/step-config';\r\nimport { withLoginStepPrefetch } from './login-step-prefetch';\r\n\r\nexport const GoogleLoginStep = props => (\r\n \r\n);\r\n\r\nexport const renderDescription = (step, i18n, repository) =>\r\n generalRenderDescription(step, i18n, repository, StepConstants.SignInStep.path);\r\n\r\nexport const LoginContainerWithoutPrefetch = props => (\r\n \r\n);\r\n","import React from 'react';\r\nimport PropTypes from 'prop-types';\r\nimport _ from 'underscore';\r\n\r\nimport {\r\n Callout,\r\n CommandButton,\r\n Icon,\r\n FocusZone,\r\n FocusZoneDirection\r\n} from '@fluentui/react';\r\n\r\nimport { Pagination } from '@bingads-webui-react/pagination';\r\nimport { SearchBox } from '@bingads-webui-react/fabric-with-signal';\r\nimport { UiBlocker } from '@bingads-webui-react/ui-blocker';\r\n\r\nconst PAGE_SIZE = 5;\r\nconst INITIAL_PAGE_NUMBER = 0;\r\nconst INITIAL_SEARCH_QUERY = '';\r\n\r\nexport class BingAccountDropDownList extends React.PureComponent {\r\n constructor(props) {\r\n super(props);\r\n this.newI18n = props.context.deps.newI18n;\r\n this.dropDownButtonPlaceHolderText = this.newI18n.getString(_TL_('Select account'));\r\n this.searchBoxPlaceHolderText = this.newI18n.getString(_TL_('Search Microsoft Advertising account'));\r\n this.bingAccountHeaderText = this.newI18n.getString(_TL_('Available accounts:'));\r\n this.loadingText = this.newI18n.getString(_TL_('Loading'));\r\n\r\n const defaultSelectedBingAccount = _.filter(\r\n props.googleToBingAccountMap,\r\n mapItem => mapItem.GoogleAccount.Id === props.googleAccount.CustomerId\r\n )[0].BingAccount;\r\n this.state = {\r\n isOpen: false,\r\n currentPageAccounts: this.props.firstPageBingAccounts,\r\n isSelected: !_.isEmpty(defaultSelectedBingAccount),\r\n selectedAccountName: _.isEmpty(defaultSelectedBingAccount) ?\r\n '' :\r\n defaultSelectedBingAccount.Name,\r\n searchQuery: INITIAL_SEARCH_QUERY,\r\n pageNumber: INITIAL_PAGE_NUMBER,\r\n availableCount: props.bingAccountCount,\r\n blocking: false,\r\n };\r\n this.dropDownRef = React.createRef();\r\n }\r\n\r\n onDropDownClick = () => {\r\n const { isOpen } = this.state;\r\n this.setState({\r\n isOpen: !isOpen,\r\n });\r\n }\r\n\r\n onDropDownKeyDown = (event) => {\r\n if (event.key === 'Enter') {\r\n const { isOpen } = this.state;\r\n this.setState({\r\n isOpen: !isOpen,\r\n });\r\n }\r\n }\r\n\r\n onItemClick = (bingAccount) => {\r\n const { onSelect } = this.props;\r\n this.setState({\r\n isSelected: true,\r\n selectedAccountName: bingAccount.Name,\r\n currentPageAccounts: this.props.firstPageBingAccounts,\r\n isOpen: false,\r\n });\r\n onSelect(bingAccount);\r\n }\r\n\r\n onSearch = (__, searchQuery) => {\r\n this.setState({\r\n searchQuery,\r\n pageNumber: INITIAL_PAGE_NUMBER,\r\n });\r\n this.onFetch(PAGE_SIZE, INITIAL_PAGE_NUMBER, searchQuery.toLowerCase());\r\n }\r\n\r\n onPageNumberChanged = (pageNumber) => {\r\n this.setState({ pageNumber });\r\n const skip = PAGE_SIZE * pageNumber;\r\n this.onFetch(PAGE_SIZE, skip, this.state.searchQuery);\r\n }\r\n\r\n onFetch = (top, skip, searchQuery) => {\r\n this.setUiBlocker(true);\r\n this.props.context.repository.getBingAccounts(top, skip, searchQuery)\r\n .then((currentPageAccountsRaw) => {\r\n const currentPageAccounts = currentPageAccountsRaw.value;\r\n const filterAccountCount = currentPageAccountsRaw['@odata.count'];\r\n this.setState({\r\n currentPageAccounts,\r\n availableCount: filterAccountCount,\r\n });\r\n })\r\n .catch(() => {\r\n // log error\r\n })\r\n .finally(() => this.setUiBlocker(false));\r\n }\r\n\r\n onDropDownDismiss = () => {\r\n this.setState({\r\n isOpen: false,\r\n currentPageAccounts: this.props.firstPageBingAccounts,\r\n });\r\n }\r\n\r\n setUiBlocker = blocking => this.setState({ blocking });\r\n\r\n isBingAccountMapped = (bingAccount) => {\r\n const { googleToBingAccountMap } = this.props;\r\n return _.some(\r\n googleToBingAccountMap,\r\n mapItem => mapItem.BingAccount && mapItem.BingAccount.Id === bingAccount.Id\r\n );\r\n }\r\n\r\n render() {\r\n const {\r\n classes,\r\n } = this.props;\r\n\r\n const {\r\n isOpen, isSelected, selectedAccountName, currentPageAccounts,\r\n } = this.state;\r\n\r\n return (\r\n
\r\n \r\n \r\n {isSelected ? selectedAccountName : this.dropDownButtonPlaceHolderText}\r\n \r\n \r\n \r\n \r\n
\r\n {isOpen &&\r\n \r\n \r\n
\r\n \r\n
\r\n {`${this.bingAccountHeaderText} ${this.state.availableCount}`}\r\n
\r\n
\r\n \r\n {currentPageAccounts.map(bingAccount => (\r\n \r\n ))}\r\n \r\n
\r\n {(this.state.availableCount > PAGE_SIZE) &&\r\n \r\n }\r\n
\r\n \r\n \r\n }\r\n
\r\n );\r\n }\r\n}\r\n\r\nBingAccountDropDownList.propTypes = {\r\n context: PropTypes.shape({\r\n deps: PropTypes.shape({\r\n newI18n: PropTypes.shape({}),\r\n }),\r\n repository: PropTypes.shape({\r\n getBingAccounts: PropTypes.func.isRequired,\r\n }).isRequired,\r\n }).isRequired,\r\n classes: PropTypes.shape({}).isRequired,\r\n firstPageBingAccounts: PropTypes.shape({}).isRequired,\r\n googleToBingAccountMap: PropTypes.shape([]).isRequired,\r\n bingAccountCount: PropTypes.number.isRequired,\r\n googleAccount: PropTypes.shape({\r\n CustomerId: PropTypes.number.isRequired,\r\n }).isRequired,\r\n onSelect: PropTypes.func.isRequired,\r\n};\r\n","import React from 'react';\r\nimport _ from 'underscore';\r\nimport PropTypes from 'prop-types';\r\nimport classNames from 'classnames';\r\nimport { withDefaultStyles } from '@bingads-webui-react/with-default-styles';\r\nimport { withActivityContext } from '@bingads-webui-react/hoc-with-signal';\r\n\r\nimport {\r\n DetailsList,\r\n SelectionMode,\r\n} from '@fluentui/react';\r\n\r\nimport { getBingAccountSelectionStepStyles } from './bing-account-selector-styles';\r\nimport { BingAccountDropDownList } from './bing-account-dropdown-list';\r\nimport { withBingAccountMappingStepPrefetch } from './bing-account-step-prefetch';\r\n\r\nexport class BingAccountSelectorInternal extends React.PureComponent {\r\n constructor(props) {\r\n super(props);\r\n this.newI18n = props.context.deps.newI18n;\r\n this.patchState = props.context.patchState;\r\n this.columns = this.getBingAccountSelectorColumns(this.newI18n);\r\n this.state = {\r\n googleToBingAccountMap: _.isEmpty(props.googleToBingAccountMap) ?\r\n _.map(\r\n props.context.googleAccount,\r\n // eslint-disable-next-line max-len\r\n account => ({ GoogleAccount: { Id: account.CustomerId, Name: account.AccountName, Currency: account.Currency } })\r\n ) :\r\n props.googleToBingAccountMap,\r\n };\r\n }\r\n\r\n componentDidMount() {\r\n const { context } = this.props;\r\n const { bingAccountFetcherPerfMarker } = context;\r\n\r\n if (bingAccountFetcherPerfMarker) {\r\n bingAccountFetcherPerfMarker.done();\r\n }\r\n\r\n if (this.props.activity) {\r\n this.props.activity.signal('BingAccountMappingGridLoaded');\r\n }\r\n }\r\n\r\n onSelectMappedBingAccount = (googleAccount, bingAccount) => {\r\n const updatedAccountMap = _.map(\r\n this.state.googleToBingAccountMap,\r\n item => (item.GoogleAccount.Id === googleAccount.CustomerId ?\r\n _.extend(item, {\r\n BingAccount: {\r\n Id: bingAccount.Id,\r\n Name: bingAccount.Name,\r\n Currency: bingAccount.Currency,\r\n },\r\n }) :\r\n item)\r\n );\r\n\r\n this.setState({\r\n googleToBingAccountMap: updatedAccountMap,\r\n }, () => {\r\n this.patchState({\r\n googleToBingAccountMap: this.state.googleToBingAccountMap,\r\n });\r\n });\r\n }\r\n\r\n onRenderItemColumn = (item, index, column) => {\r\n const {\r\n context,\r\n classes,\r\n } = this.props;\r\n\r\n const { firstPageBingAccounts, bingAccountCount } = context;\r\n const { googleToBingAccountMap } = this.state;\r\n\r\n switch (column.key) {\r\n case 'bing-account-selection': return (\r\n \r\n );\r\n // eslint-disable-next-line max-len\r\n default: return ( {item[column.fieldName]} );\r\n }\r\n }\r\n\r\n getBingAccountSelectorColumns = newI18n => ([{\r\n key: 'google-account-name',\r\n name: newI18n.getString(_TL_('Google Ads account name')),\r\n fieldName: 'AccountName',\r\n minWidth: 300,\r\n maxWidth: 600,\r\n isResizable: true,\r\n isMultiline: true,\r\n }, {\r\n key: 'google-account-id',\r\n name: newI18n.getString(_TL_('Google Ads account ID')),\r\n fieldName: 'CustomerId',\r\n minWidth: 180,\r\n maxWidth: 200,\r\n isResizable: false,\r\n }, {\r\n key: 'bing-account-selection',\r\n name: newI18n.getString(_TL_('Microsoft Advertising account name')),\r\n fieldName: 'BingAccountSelection',\r\n minWidth: 300,\r\n maxWidth: 600,\r\n }])\r\n\r\n render() {\r\n const {\r\n context,\r\n classes,\r\n rootClassName,\r\n } = this.props;\r\n const { selectedAccounts } = context;\r\n return (\r\n
\r\n
\r\n {this.newI18n.getString(_TL_('Select the Microsoft Advertising accounts that your Google Ads accounts will be imported to.'))}\r\n
\r\n
\r\n \r\n
\r\n
\r\n );\r\n }\r\n}\r\n\r\nBingAccountSelectorInternal.defaultProps = {\r\n googleToBingAccountMap: [],\r\n};\r\n\r\nBingAccountSelectorInternal.propTypes = {\r\n context: PropTypes.shape({\r\n deps: PropTypes.shape({\r\n newI18n: PropTypes.shape({}),\r\n }),\r\n patchState: PropTypes.func.isRequired,\r\n googleAccount: PropTypes.shape([]).isRequired,\r\n selectedAccounts: PropTypes.shape().isRequired, // selected google accounts\r\n firstPageBingAccounts: PropTypes.shape().isRequired,\r\n bingAccountCount: PropTypes.number.isRequired,\r\n }).isRequired,\r\n classes: PropTypes.shape({}).isRequired,\r\n rootClassName: PropTypes.string.isRequired,\r\n activity: PropTypes.shape({\r\n signal: PropTypes.func,\r\n }).isRequired,\r\n googleToBingAccountMap: PropTypes.shape([]),\r\n};\r\n\r\nexport const BingAccountSelector = withBingAccountMappingStepPrefetch(withDefaultStyles(\r\n withActivityContext(BingAccountSelectorInternal),\r\n getBingAccountSelectionStepStyles\r\n));\r\n","import React, { useContext, useState } from 'react';\r\nimport $ from 'jquery';\r\nimport { ImportCoreContext } from '@bingads-webui-campaign/imports-core';\r\nimport { withUiBlock } from '@bingads-webui/uiblocker';\r\nimport { StepConstants } from '../../../page/step-config';\r\n\r\nexport const withBingAccountMappingStepPrefetch = PreExecuteStep => React.memo((props) => {\r\n const importCoreContext = useContext(ImportCoreContext);\r\n const {\r\n repository,\r\n patchState,\r\n deps,\r\n goToPrevStep,\r\n firstPageBingAccounts: existingfirstPageBingAccounts,\r\n googleToBingAccountMap: existingGoogleToBingAccountMap,\r\n } = importCoreContext;\r\n\r\n const {\r\n perfMarker,\r\n i18n,\r\n } = deps;\r\n\r\n const [loading, setLoading] = useState(true); // to notify api is loading.\r\n const [dispatchedOdataCall, setDispatchedOdataCall] = useState(false);\r\n\r\n if (loading && !dispatchedOdataCall && !existingfirstPageBingAccounts) {\r\n setDispatchedOdataCall(true);\r\n const bingAccountFetcherPerfMarker = perfMarker.createChild('Smart_Import_BingAccountMapping_Step');\r\n bingAccountFetcherPerfMarker.willInit();\r\n repository.getBingAccounts()\r\n .then((firstPageBingAccountsRaw) => {\r\n const firstPageBingAccounts = firstPageBingAccountsRaw.value;\r\n const bingAccountCount = firstPageBingAccountsRaw['@odata.count'];\r\n patchState({\r\n firstPageBingAccounts,\r\n bingAccountFetcherPerfMarker,\r\n bingAccountCount,\r\n });\r\n setLoading(false);\r\n })\r\n .catch(() => {\r\n goToPrevStep(StepConstants.ChooseAccountsGoogleAccount);\r\n })\r\n .finally(withUiBlock($('.google-import-root'), i18n.getString('Loading')));\r\n } else if (existingfirstPageBingAccounts && !dispatchedOdataCall) {\r\n // display firstPageBingAccounts from cache rather than calling API again.\r\n return ();\r\n }\r\n\r\n return (\r\n
\r\n {\r\n loading\r\n ?
\r\n : \r\n }\r\n
\r\n );\r\n});\r\n","import { paginationStyle } from '@bingads-webui-campaign-react/common-styles';\r\nimport { extend } from 'jquery';\r\n\r\nexport const getBingAccountSelectionStepStyles = (_, { palette = {} }) => ({\r\n stepText: {\r\n marginBottom: '10px',\r\n marginTop: '10px',\r\n },\r\n bingAccountMappingStep: {\r\n height: 'auto',\r\n },\r\n accountDetailList: {\r\n },\r\n gridItem: {\r\n fontSize: '14px',\r\n verticalAlign: 'middle',\r\n },\r\n bingAccountDropdownList: {\r\n padding: '0px',\r\n },\r\n bingAccountDropdownButton: {\r\n padding: '0px',\r\n margin: '0px',\r\n fontSize: '14px',\r\n fontWeight: '400',\r\n position: 'relative',\r\n },\r\n bingAccountDropdownPlaceholder: {\r\n padding: '0px 28px 0px 8px',\r\n borderStyle: 'solid',\r\n borderWidth: '1px',\r\n borderColor: 'rgb(96, 94, 92)',\r\n borderRadius: '2px',\r\n cursor: 'pointer',\r\n display: 'block',\r\n height: '32px',\r\n lineHeight: '30px',\r\n positon: 'relative',\r\n overflow: 'hidden',\r\n whiteSpace: 'no-wrap',\r\n textOverflow: 'ellipsis',\r\n },\r\n bingAccountDropdownCaretDown: {\r\n position: 'absolute',\r\n top: '1px',\r\n right: '8px',\r\n height: '32px',\r\n curson: 'pointer',\r\n lineHeight: '30px',\r\n },\r\n bingAccountCallout: {\r\n padding: '5px',\r\n },\r\n bingAccountSelectionBox: extend(\r\n {},\r\n paginationStyle({ palette }),\r\n {\r\n borderStyle: 'solid',\r\n borderWidth: '1px',\r\n padding: '5px',\r\n }\r\n ),\r\n bingAccountSearchBox: {\r\n\r\n },\r\n bingAccountHeader: {\r\n border: 'solid 1px transparent',\r\n fontWeight: 'bold',\r\n padding: '0px 6px',\r\n lineHeight: '36px',\r\n width: '100%',\r\n },\r\n bingAccountItem: {\r\n width: '100%',\r\n },\r\n});\r\n","import React from 'react';\r\nimport PropTypes from 'prop-types';\r\nimport { StepContainer, ImportCoreContext } from '@bingads-webui-campaign/imports-core';\r\nimport { Activity } from '@bingads-webui-react/hoc-with-signal';\r\n\r\nimport { getActionBarItems } from './action-bar-config';\r\nimport { BingAccountSelector } from './bing-account-selector';\r\n\r\nclass BingAccountStepInternal extends React.PureComponent {\r\n render() {\r\n const {\r\n contextValues,\r\n } = this.props;\r\n\r\n const { deps } = contextValues;\r\n\r\n const { getUniqueImportGUID } = deps;\r\n\r\n const uniqueImportId = (getUniqueImportGUID && getUniqueImportGUID()) || '';\r\n\r\n return (\r\n \r\n \r\n \r\n \r\n \r\n );\r\n }\r\n}\r\n\r\nBingAccountStepInternal.propTypes = {\r\n contextValues: PropTypes.shape({}).isRequired,\r\n};\r\n\r\nexport const BingAccountStep = React.memo(props => (\r\n \r\n {\r\n contextValues => (\r\n \r\n )\r\n }\r\n \r\n));\r\n","import { StepConstants } from '../../../page/step-config';\r\n\r\nexport const getActionBarItems = () => {\r\n const config = [{\r\n type: 'button-back',\r\n prevStepName: StepConstants.ChooseAccountsGoogleAccount.path,\r\n }, {\r\n type: 'button-next',\r\n nextStepName: StepConstants.StartImportSmart.path,\r\n }, {\r\n type: 'button-cancel',\r\n extraLeftPadding: true,\r\n }];\r\n\r\n return config;\r\n};\r\n","import React from 'react';\r\nimport PropTypes from 'prop-types';\r\n\r\nimport {\r\n GoogleAccountStep as GeneralGoogleAccountStep,\r\n ImportMode,\r\n withSmartGoogleImportAccountSelectionStepPrefetch,\r\n} from '@bingads-webui-campaign/imports-core';\r\n\r\nimport { StepConstants } from '../../page/step-config';\r\n\r\nexport { BingAccountStep } from './bing-account-mapping-step';\r\n\r\nconst getNextStepName = ({\r\n shouldGoToMerchantCenterStoreMappingStep,\r\n getImportMode,\r\n}) => {\r\n let nextStepName;\r\n if (getImportMode() === ImportMode.Multi) {\r\n nextStepName = StepConstants.ChooseAccountsBingAccountMapping.path;\r\n } else if (shouldGoToMerchantCenterStoreMappingStep()) {\r\n nextStepName = StepConstants.MerchantCenterStoreMappingStep.path;\r\n } else {\r\n nextStepName = StepConstants.StartImportSmart.path;\r\n }\r\n return nextStepName;\r\n};\r\n\r\nconst getPrevStepName = ({ isEscImport }) => (isEscImport ? StepConstants.ESCSignInStep.path : StepConstants.SignInStep.path);\r\n\r\nexport const GoogleAccountStep = props => (\r\n StepConstants.ImportSummaryStep.path : getNextStepName}\r\n stepPrefetchHoc={withSmartGoogleImportAccountSelectionStepPrefetch}\r\n prevStepNameIfPrefetchFail={StepConstants.SignInStep.path}\r\n nextStepNameIfPrefetchOnlyOneAccount={StepConstants.StartImportSmart.path}\r\n rootContainerClassName=\"google-import-root\"\r\n showCancelButton={!props.isEscImport}\r\n {...props}\r\n />\r\n);\r\n\r\nGoogleAccountStep.propTypes = {\r\n isEscImport: PropTypes.bool.isRequired,\r\n};\r\n","/* eslint-disable no-param-reassign */\r\nimport _ from 'underscore';\r\nimport React from 'react';\r\n\r\nimport {\r\n StartImportSmartStep as GeneralStartImportStep,\r\n getDefaultActionBarItemsForStartImportStep,\r\n getSmartImportStepPrefetchHOC,\r\n} from '@bingads-webui-campaign/imports-core';\r\n\r\nimport { StepConstants } from '../../page/step-config';\r\n\r\nconst getAdvancedCustomizingStepName = (hasAccountsWithNoCampaigns) => {\r\n if (hasAccountsWithNoCampaigns) {\r\n return StepConstants.ImportOptionStep.path;\r\n }\r\n return StepConstants.GoogleCampaignStep.path;\r\n};\r\n\r\nconst getPrevStepName = ({ isMerchantCenterStoreMappingStepEnabled }) => {\r\n if (isMerchantCenterStoreMappingStepEnabled) {\r\n return StepConstants.MerchantCenterStoreMappingStep.path;\r\n }\r\n return StepConstants.ChooseAccountsGoogleAccount.path;\r\n};\r\n\r\nconst getNextStepName = ({ isRunNowImport }) => {\r\n if (isRunNowImport) {\r\n return StepConstants.ImportStatusStep.path;\r\n }\r\n return StepConstants.ImportSummaryStep.path;\r\n};\r\n\r\nconst formatTaskData = (contextValues, taskData, activity = null) => {\r\n const {\r\n patchState,\r\n selectedAccounts,\r\n initialSettings,\r\n permissionFactory,\r\n isNoCustomSettingOnSmartStep,\r\n defaultImportOptions,\r\n SmartOptionSettingsKeys,\r\n } = contextValues;\r\n\r\n let { importOptions: importUserPreferences } = contextValues;\r\n\r\n // In edit scheduled import scenario, if the scheduled import is expert import\r\n // We need to keep it as expert import\r\n let IsSmartImport = true;\r\n if (permissionFactory && permissionFactory.IsSmartImportEditExpertImportEnabled() &&\r\n initialSettings && !_.isUndefined(initialSettings.IsSmartImport)) {\r\n // in edit scheduled import, only keep import mode when selected account is not changed\r\n if (initialSettings && initialSettings.AdWordsImportContext &&\r\n initialSettings.AdWordsImportContext.CustomerId === selectedAccounts[0].CustomerId) {\r\n ({ IsSmartImport } = initialSettings);\r\n // is IsSmartImport from initialSettings is null, it means it's legacy import\r\n if (_.isNull(IsSmartImport)) {\r\n IsSmartImport = false;\r\n }\r\n }\r\n }\r\n\r\n if (permissionFactory && permissionFactory.IsImportSmartScheduleStepImprovementPhaseTwoEnabled() && IsSmartImport && isNoCustomSettingOnSmartStep === false) {\r\n IsSmartImport = false;\r\n\r\n const importOptionOverride = {};\r\n _.each(_.flatten(_.values(SmartOptionSettingsKeys)), (key) => {\r\n importOptionOverride[key] = _.clone(importUserPreferences[key]);\r\n });\r\n if (activity) {\r\n activity.signal(`IsImportSmartScheduleStepImprovementPhaseTwoEnabled: optionSettings=${JSON.stringify(importOptionOverride)}`);\r\n }\r\n importUserPreferences = { ...defaultImportOptions, ...importOptionOverride };\r\n }\r\n if (permissionFactory && permissionFactory.IsImportSmartScheduleStepImprovementPhaseTwoEnabled()) {\r\n if (activity) {\r\n activity.signal(`IsImportSmartScheduleStepImprovementPhaseTwoEnabled: IsSmartImport=${IsSmartImport} and isNoCustomSettingOnSmartStep=${isNoCustomSettingOnSmartStep}`);\r\n }\r\n }\r\n\r\n patchState({\r\n IsSmartImport,\r\n IsExpertModeImport: !IsSmartImport,\r\n });\r\n\r\n let scheduleStepState = {\r\n googleCustomerId: selectedAccounts[0].CustomerId,\r\n campaignIds: [],\r\n loginCustomerId: selectedAccounts[0].LoginCustomerId,\r\n };\r\n\r\n // if it's edit expert schedule import scenario, should patch campaign\r\n // selection data and import option data into task data\r\n if (IsSmartImport === false) {\r\n const {\r\n googleEntitiesSelectionData,\r\n CampaignIds,\r\n } = contextValues;\r\n\r\n scheduleStepState = _.extend(\r\n {},\r\n scheduleStepState,\r\n { campaignIds: CampaignIds, googleEntitiesSelectionData }\r\n );\r\n\r\n importUserPreferences = _.omit(importUserPreferences, 'UserPreferenceTrackingTemplate', 'TrackingTemplateValue', 'FinalUrlSuffixValue');\r\n\r\n taskData.importOptions = _.extend(\r\n {},\r\n taskData.importOptions,\r\n { importUserPreferences, IsSmartImport }\r\n );\r\n taskData.importOptionsRunnow = _.extend(\r\n {},\r\n taskData.importOptionsRunnow,\r\n { importUserPreferences, IsSmartImport }\r\n );\r\n }\r\n\r\n return {\r\n ...taskData,\r\n scheduleStepState,\r\n };\r\n};\r\n\r\nconst rootContainerClassName = 'google-import-root';\r\n\r\nconst withSmartImportStepPrefetch = getSmartImportStepPrefetchHOC({\r\n rootContainerClassName,\r\n merchantCenterStoreMappingStepPath: StepConstants.MerchantCenterStoreMappingStep.path,\r\n prevStepNameIfPrefetchFail: StepConstants.ChooseAccountsGoogleAccount.path,\r\n loginStepName: StepConstants.SignInStep.path,\r\n});\r\n\r\nexport const StartImportSmartStep = props => (\r\n \r\n);\r\n\r\n","import _ from 'underscore';\r\nimport React from 'react';\r\nimport PropTypes from 'prop-types';\r\n\r\nimport { GoogleCampaignAndAdGroupStep } from '@bingads-webui-campaign/google-import-page';\r\nimport { GoogleImportRepository } from '@bingads-webui-campaign/import-shared-repositories';\r\nimport { withActivityContext } from '@bingads-webui-react/hoc-with-signal';\r\nimport { withDefaultStyles } from '@bingads-webui-react/with-default-styles';\r\nimport { getCampaignSelectionStepStyles } from './campaign-selection-styles';\r\n\r\nexport class CampaignSelectorInternal extends React.PureComponent {\r\n constructor(props) {\r\n super(props);\r\n this.repository = props.context.repository;\r\n this.deps = props.context.deps;\r\n this.selectionData = _.size(props.context.googleEntitiesSelectionData) ?\r\n props.context.googleEntitiesSelectionData : {};\r\n\r\n this.stateGetter = props.stateGetter;\r\n this.triggerError = props.triggerError;\r\n this.triggerEdit = props.triggerEdit;\r\n }\r\n\r\n componentDidMount() {\r\n const isAllCampaignsSelected = _.isEmpty(this.selectionData)\r\n || _.every(this.selectionData, _.isEmpty);\r\n\r\n if (isAllCampaignsSelected) {\r\n this.importAllCampaignsSelected();\r\n } else {\r\n this.importSpecificCampaignSelectedLog();\r\n }\r\n }\r\n\r\n importSpecificCampaignSelectedLog = () => {\r\n if (this.props.activity) {\r\n this.props.activity.signal('ImportSpecificCampaignSelected');\r\n }\r\n }\r\n\r\n importAllCampaignsSelected = () => {\r\n if (this.props.activity) {\r\n this.props.activity.signal('ImportAllCampaignsSelected');\r\n }\r\n }\r\n\r\n render() {\r\n const { context, classes } = this.props;\r\n const { googleCampaigns, selectedAccounts } = context;\r\n\r\n return (\r\n
\r\n \r\n
\r\n );\r\n }\r\n}\r\n\r\nCampaignSelectorInternal.propTypes = {\r\n context: PropTypes.shape({\r\n deps: PropTypes.shape({\r\n i18n: PropTypes.shape({}),\r\n newI18n: PropTypes.shape({}),\r\n }).isRequired,\r\n repository: PropTypes.instanceOf(GoogleImportRepository).isRequired,\r\n patchState: PropTypes.func.isRequired,\r\n googleEntitiesSelectionData: PropTypes.shape().isRequired,\r\n }).isRequired,\r\n stateGetter: PropTypes.shape({\r\n setSelectedDataGetter: PropTypes.func.isRequired,\r\n setImportAllGetter: PropTypes.func.isRequired,\r\n }).isRequired,\r\n triggerError: PropTypes.func.isRequired,\r\n triggerEdit: PropTypes.func.isRequired,\r\n classes: PropTypes.shape().isRequired,\r\n activity: PropTypes.shape({\r\n signal: PropTypes.func,\r\n }).isRequired,\r\n};\r\n\r\nexport const CampaignSelector = withDefaultStyles(\r\n withActivityContext(CampaignSelectorInternal),\r\n getCampaignSelectionStepStyles\r\n);\r\n","import { paginationStyle, statusStyle } from '@bingads-webui-campaign-react/common-styles';\r\nimport { extend } from 'jquery';\r\n\r\nexport const getCampaignSelectionStepStyles = (_, { palette = {} }, iconFontFamily = 'MsAds MDL2 Assets') => ({\r\n CampaignAndAdGroupSelector: extend(\r\n {},\r\n paginationStyle({ palette }),\r\n statusStyle({ palette }),\r\n {\r\n maxWidth: '900px',\r\n\r\n '& #SelectCampaignDesc': {\r\n display: 'none',\r\n },\r\n\r\n '& .radio>label': {\r\n display: 'inline-block',\r\n },\r\n\r\n '& .ba-search-box': {\r\n '& .search-box__input-group': {\r\n position: 'relative',\r\n\r\n '& .search-box__input': {\r\n height: '48px',\r\n paddingLeft: '40px',\r\n },\r\n\r\n '& .search-box__icon': {\r\n top: '12px',\r\n color: palette.themePrimary,\r\n left: '12px',\r\n width: '16px',\r\n height: '16px',\r\n position: 'absolute',\r\n fontSize: '16px',\r\n fontFamily: iconFontFamily,\r\n margin: 0,\r\n cursor: 'pointer',\r\n border: 'none',\r\n minWidth: 0,\r\n padding: 0,\r\n background: 'none',\r\n },\r\n\r\n '& .search-box__icon:before': {\r\n content: '\"\\\\E721\"',\r\n },\r\n },\r\n },\r\n\r\n '& .campaign-and-ad-group-selector': {\r\n paddingTop: 4,\r\n width: '900px',\r\n\r\n '& .full-treeview-table': {\r\n borderBottomStyle: 'groove',\r\n borderBottomWidth: '2px',\r\n borderLeftStyle: 'groove',\r\n borderLeftWidth: '2px',\r\n borderRightStyle: 'groove',\r\n borderRightWidth: '2px',\r\n\r\n '& .table-bordered': {\r\n marginBottom: 0,\r\n border: 0,\r\n\r\n '& .adgroup-level-header': {\r\n '& th': {\r\n borderLeft: 0,\r\n borderRight: 0,\r\n borderBottom: 0,\r\n borderTop: 0,\r\n paddingBottom: 0,\r\n },\r\n\r\n '& .column-header-select-all': {\r\n width: 69,\r\n },\r\n\r\n '& .column-header-name-sortable': {\r\n cursor: 'pointer',\r\n width: 382,\r\n lineHeight: '33px',\r\n fontWeight: 'bold',\r\n },\r\n\r\n '& .column-header-type-sortable': {\r\n cursor: 'pointer',\r\n width: 180,\r\n lineHeight: '33px',\r\n fontWeight: 'bold',\r\n },\r\n\r\n '& .column-header-selection-status': {\r\n lineHeight: '33px',\r\n fontWeight: 'bold',\r\n },\r\n },\r\n },\r\n\r\n '& .tree-view-container': {\r\n height: '300px',\r\n\r\n '& .ReactVirtualized__Grid': {\r\n paddingLeft: 5,\r\n\r\n '& .ReactVirtualized__Grid__innerScrollContainer': {\r\n '& .glyph-caret-right, & .glyph-caret-down': {\r\n fontFamily: iconFontFamily,\r\n cursor: 'pointer',\r\n fontSize: 16,\r\n paddingRight: 10,\r\n paddingLeft: 2,\r\n verticalAlign: 'middle',\r\n },\r\n\r\n '& .glyph-caret-right:before': {\r\n content: '\"\\\\E970\"',\r\n },\r\n\r\n '& .glyph-caret-down:before': {\r\n content: '\"\\\\E96E\"',\r\n },\r\n\r\n '& .tree-node': {\r\n '& .leaf-node': {\r\n paddingLeft: 30,\r\n },\r\n\r\n '& .checkbox-inline span': {\r\n verticalAlign: 'middle',\r\n },\r\n\r\n '& .checkbox-inline:focus-within': {\r\n outline: 'none',\r\n },\r\n\r\n '& .checkbox-inline>input[type=\"checkbox\"]:focus': {\r\n outline: `1px solid ${palette.neutralSecondary}`,\r\n outlineOffset: 1,\r\n },\r\n\r\n '& .statusEnabled_icon, & .statusPaused_icon': {\r\n paddingRight: 5,\r\n },\r\n\r\n '& .node-name': {\r\n display: 'inline-block',\r\n width: 380,\r\n overflow: 'hidden',\r\n textOverflow: 'ellipsis',\r\n whiteSpace: 'nowrap',\r\n },\r\n\r\n '& .node-type': {\r\n display: 'inline-block',\r\n width: 180,\r\n },\r\n\r\n '& .node-selection': {\r\n display: 'inline-block',\r\n width: 200,\r\n overflow: 'hidden',\r\n textOverflow: 'ellipsis',\r\n whiteSpace: 'nowrap',\r\n },\r\n },\r\n },\r\n },\r\n },\r\n },\r\n },\r\n\r\n '& .error': {\r\n color: '#d13438',\r\n fontSize: '14px',\r\n },\r\n }\r\n ),\r\n});\r\n","/* eslint-disable max-len */\r\nimport React from 'react';\r\nimport PropTypes from 'prop-types';\r\nimport Promise from 'bluebird';\r\nimport _ from 'underscore';\r\nimport { getShowNoActiveCampaignCouponAlert } from '@bingads-webui-campaign/import-components';\r\n\r\nimport { StepContainer, ImportCoreContext, ImportType } from '@bingads-webui-campaign/imports-core';\r\nimport { Activity, withActivityContext } from '@bingads-webui-react/hoc-with-signal';\r\nimport { ByPassConfirmationModal } from '@bingads-webui-react/feature-adoption-coupon';\r\n\r\nimport { getActionBarItems } from './action-bar-config';\r\nimport { CampaignSelector } from './campaign-selector';\r\nimport { StepConstants } from '../../page/step-config';\r\n\r\nclass GoogleCampaignStepInternal extends React.PureComponent {\r\n constructor(props) {\r\n super(props);\r\n\r\n this.state = {\r\n isEdited: false,\r\n hasError: false,\r\n showNoActiveCampaignsFacModal: false,\r\n };\r\n\r\n this.stateGetter = {\r\n setSelectedDataGetter: (getter) => {\r\n this.selectedDataGetter = getter;\r\n },\r\n setImportAllGetter: (getter) => {\r\n this.importAllGetter = getter;\r\n },\r\n getSelectedData: () => this.selectedDataGetter(),\r\n getImportAll: () => this.importAllGetter(),\r\n };\r\n this.triggerError = (hasError) => { this.state.hasError = !!hasError; };\r\n this.triggerEdit = () => {\r\n this.state.isEdited = true;\r\n this.updateFacData();\r\n };\r\n }\r\n\r\n componentDidMount() {\r\n const { campaignSelectionPerfMarker } = this.props.contextValues;\r\n\r\n if (campaignSelectionPerfMarker) {\r\n campaignSelectionPerfMarker.done();\r\n }\r\n\r\n if (this.props.activity) {\r\n this.props.activity.signal('CampaignSelectionPageLoaded');\r\n }\r\n }\r\n\r\n getStateData() {\r\n const stateData = {};\r\n\r\n if (this.stateGetter.getImportAll()) {\r\n stateData.selectionData = {};\r\n stateData.areAnyPausedCampaignsSelected = false;\r\n } else {\r\n stateData.selectionData = this.stateGetter.getSelectedData();\r\n stateData.areAnyPausedCampaignsSelected = true;\r\n }\r\n return stateData;\r\n }\r\n\r\n updateFacData() {\r\n const {\r\n contextValues: {\r\n googleCampaigns,\r\n deps,\r\n },\r\n facNoActiveCampaigns: facNoActiveCampaignsFromProps,\r\n } = this.props;\r\n\r\n // use setTimeout so stateData is updated.\r\n setTimeout(() => {\r\n const stateData = this.getStateData();\r\n\r\n const facNoActiveCampaigns = !this.stateGetter.getImportAll()\r\n && getShowNoActiveCampaignCouponAlert(\r\n deps.coupon,\r\n googleCampaigns,\r\n stateData.selectionData\r\n );\r\n\r\n if (deps.setNoActiveCampaigns && facNoActiveCampaignsFromProps !== facNoActiveCampaigns) {\r\n deps.setNoActiveCampaigns(facNoActiveCampaigns);\r\n }\r\n }, 0);\r\n }\r\n\r\n validateAndSaveData(shouldSwitchMode = false) {\r\n // if user clicks next button, will run this check\r\n // if user clicks back button, will not check\r\n if (!shouldSwitchMode && this.state.hasError) {\r\n return new Promise(resolve => resolve(false));\r\n }\r\n\r\n const {\r\n contextValues,\r\n } = this.props;\r\n const {\r\n patchState,\r\n deps,\r\n isEditingScheduledImport,\r\n } = contextValues;\r\n\r\n const { perfMarker } = deps;\r\n\r\n const stateData = this.getStateData();\r\n\r\n // will save data when user clicks next button or back button\r\n // need to discuss later about if we need to save user's selection when go back\r\n patchState({\r\n campaignIds: _.union(\r\n stateData.selectionData.selectedCampaignIds,\r\n stateData.selectionData.selectedWithActiveOnly,\r\n _.map(_.keys(stateData.selectionData.selectedAdGroupMap), id => parseInt(id, 10))\r\n ),\r\n googleEntitiesSelectionData: stateData.selectionData,\r\n includePausedCampaigns: stateData.areAnyPausedCampaignsSelected\r\n && !isEditingScheduledImport,\r\n });\r\n\r\n if (shouldSwitchMode) {\r\n const smartImportStartPerfMarker = perfMarker.createChild('Smart_Import_StartImportSmart_Step');\r\n smartImportStartPerfMarker.willInit();\r\n\r\n // switch to smart import mode if we go back from google campaign step\r\n this.props.contextValues.toggleImportType(ImportType.Smart);\r\n\r\n return new Promise(resolve => resolve(true));\r\n }\r\n\r\n const finishStep = () => {\r\n const expertImportOptionsPerfMarker = perfMarker.createChild('Smart_Import_Expert_Import_Options_Step');\r\n expertImportOptionsPerfMarker.willInit();\r\n\r\n patchState({\r\n expertImportOptionsPerfMarker,\r\n });\r\n\r\n return new Promise(resolve => resolve(true));\r\n };\r\n\r\n if (this.props.facNoActiveCampaigns) {\r\n return new Promise((resolve) => {\r\n this.setState({\r\n showNoActiveCampaignsFacModal: true,\r\n onNoActiveCampaignFacModalConfirm: () => {\r\n this.dismissFacBypassModal();\r\n resolve(finishStep());\r\n },\r\n onNoActiveCampaignFacModalDismiss: () => {\r\n this.dismissFacBypassModal();\r\n resolve(false);\r\n },\r\n });\r\n });\r\n }\r\n\r\n return finishStep();\r\n }\r\n\r\n dismissFacBypassModal() {\r\n this.setState({\r\n showNoActiveCampaignsFacModal: false,\r\n onNoActiveCampaignFacModalConfirm: undefined,\r\n onNoActiveCampaignFacModalDismiss: undefined,\r\n });\r\n }\r\n\r\n render() {\r\n return (\r\n \r\n {\r\n contextValues => (\r\n this.validateAndSaveData(true), () => this.validateAndSaveData(false))}\r\n >\r\n \r\n {this.state.showNoActiveCampaignsFacModal && (\r\n \r\n )}\r\n \r\n )\r\n }\r\n \r\n );\r\n }\r\n}\r\n\r\nGoogleCampaignStepInternal.propTypes = {\r\n contextValues: PropTypes.shape({\r\n toggleImportType: PropTypes.func.isRequired,\r\n campaignSelectionPerfMarker: PropTypes.shape({}).isRequired,\r\n }).isRequired,\r\n activity: PropTypes.shape({\r\n signal: PropTypes.func,\r\n }).isRequired,\r\n facNoActiveCampaigns: PropTypes.bool,\r\n};\r\n\r\nGoogleCampaignStepInternal.defaultProps = {\r\n facNoActiveCampaigns: false,\r\n};\r\n\r\nconst GoogleCampaignStepWithActivity = withActivityContext(GoogleCampaignStepInternal);\r\n\r\nexport const GoogleCampaignStep = React.memo(props => (\r\n\r\n \r\n {\r\n (contextValues) => {\r\n const { deps } = contextValues;\r\n const { getUniqueImportGUID } = deps;\r\n const uniqueImportId = (getUniqueImportGUID && getUniqueImportGUID()) || '';\r\n\r\n return (\r\n \r\n \r\n \r\n );\r\n }\r\n }\r\n \r\n));\r\n","import { StepConstants } from '../../page/step-config';\r\n\r\nexport const getActionBarItems = (shouldGoToPreviousStep, shouldGoToNextStep) => {\r\n const config = [{\r\n type: 'button-back',\r\n validateFunction: shouldGoToPreviousStep,\r\n prevStepName: StepConstants.StartImportSmart.path,\r\n }, {\r\n type: 'button-next',\r\n validateFunction: shouldGoToNextStep,\r\n nextStepName: StepConstants.ImportOptionStep.path,\r\n }, {\r\n type: 'button-cancel',\r\n extraLeftPadding: true,\r\n }];\r\n\r\n return config;\r\n};\r\n","import { StepConstants } from '../../page/step-config';\r\n\r\nexport const getActionBarItems = (\r\n shouldGoToNextStep,\r\n shouldGoToPreviousStep,\r\n hasAccountsWithNoCampaigns,\r\n nextButtonEnabled\r\n) => {\r\n const config = [{\r\n type: 'button-back',\r\n validateFunction: shouldGoToPreviousStep,\r\n prevStepName: hasAccountsWithNoCampaigns ?\r\n StepConstants.StartImportSmart.path :\r\n StepConstants.GoogleCampaignStep.path,\r\n }, {\r\n type: 'button-next',\r\n validateFunction: shouldGoToNextStep,\r\n disabled: !nextButtonEnabled,\r\n nextStepName: StepConstants.StartImportAdvanced.path,\r\n }, {\r\n type: 'button-cancel',\r\n extraLeftPadding: true,\r\n }];\r\n\r\n return config;\r\n};\r\n","import React from 'react';\r\nimport {\r\n ImportOptionsStep,\r\n withSmartGoogleImportAccountSelectionStepPrefetch,\r\n getSmartImportStepPrefetchHOC,\r\n} from '@bingads-webui-campaign/imports-core';\r\nimport { getActionBarItems } from './action-bar-config';\r\nimport { StepConstants } from '../../page/step-config';\r\n\r\nconst rootContainerClassName = 'google-import-root';\r\n\r\nconst withSmartImportStepPrefetch = getSmartImportStepPrefetchHOC({\r\n rootContainerClassName,\r\n merchantCenterStoreMappingStepPath: StepConstants.MerchantCenterStoreMappingStep.path,\r\n prevStepNameIfPrefetchFail: StepConstants.ChooseAccountsGoogleAccount.path,\r\n loginStepName: StepConstants.SignInStep.path,\r\n});\r\n\r\nconst GoogleImportOptionsStepWithoutHOCs = props => (\r\n \r\n);\r\n\r\nexport const GoogleImportOptionsStep =\r\n // eslint-disable-next-line\r\n withSmartGoogleImportAccountSelectionStepPrefetch(withSmartImportStepPrefetch(GoogleImportOptionsStepWithoutHOCs));\r\n","import React from 'react';\r\n\r\nimport {\r\n ImportStatusStep as GeneralImportStatusStep,\r\n} from '@bingads-webui-campaign/imports-core';\r\n\r\nimport { StepConstants } from '../../page/step-config';\r\n\r\nexport const ImportStatusStep = props => (\r\n \r\n);\r\n","import { StepConstants } from '../../page/step-config';\r\n\r\nexport const getActionBarItems = (\r\n i18n,\r\n startImporting,\r\n isReadOnly,\r\n scheduleOnly\r\n) => {\r\n const config = [{\r\n type: 'button-back',\r\n prevStepName: StepConstants.ImportOptionStep.path,\r\n }, {\r\n type: 'button',\r\n primary: true,\r\n className: 'start-import',\r\n text: scheduleOnly ? i18n.getString(_TL_('Set schedule')) : i18n.getString(_TL_('Start import')),\r\n onClick: startImporting,\r\n disabled: isReadOnly,\r\n }, {\r\n type: 'button-cancel',\r\n extraLeftPadding: true,\r\n }];\r\n\r\n return config;\r\n};\r\n","import React from 'react';\r\nimport {\r\n StartImportAdvancedStep as GeneralStartImportAdvancedStep,\r\n createImportAndGoNextWhenReady\r\n} from '@bingads-webui-campaign/imports-core';\r\nimport { getActionBarItems } from './action-bar-config';\r\nimport { StepConstants } from '../../page/step-config';\r\n\r\nconst getNextStepName = ({ isRunNowImport }) => (isRunNowImport\r\n ? StepConstants.ImportStatusStep.path\r\n : StepConstants.ImportSummaryStep.path);\r\n\r\nconst formatTaskData = (contextValues, taskData) => {\r\n const {\r\n selectedAccounts,\r\n googleEntitiesSelectionData,\r\n campaignIds,\r\n } = contextValues;\r\n const scheduleStepState = {\r\n googleCustomerId: selectedAccounts[0].CustomerId,\r\n campaignIds,\r\n loginCustomerId: selectedAccounts[0].LoginCustomerId,\r\n googleEntitiesSelectionData,\r\n };\r\n return {\r\n ...taskData,\r\n scheduleStepState,\r\n };\r\n};\r\n\r\nexport const StartImportAdvancedStep = props => (\r\n \r\n);\r\n","import React from 'react';\r\nimport _ from 'underscore';\r\nimport Promise from 'bluebird';\r\nimport PropTypes from 'prop-types';\r\nimport { StepContainer, ImportCoreContext } from '@bingads-webui-campaign/imports-core';\r\nimport { Activity, withActivityContext } from '@bingads-webui-react/hoc-with-signal';\r\nimport { Alert } from '@bingads-webui-react/alert';\r\n\r\nimport { getActionBarItems } from './action-bar-config';\r\nimport { StepConstants } from '../../page/step-config';\r\n\r\nconst GMCToMMCMappingGridWithSignIn = React.lazy(() => import(/* webpackMode: \"eager\" */'@bingads-webui-campaign-react/gmc-to-mmc-mapping-grid')\r\n .then(module => ({\r\n default: module.GMCToMMCMappingGridWithSignIn,\r\n })));\r\n\r\nclass GoogleMerchantCenterStoreMappingStepInternal extends React.PureComponent {\r\n constructor(props) {\r\n super(props);\r\n\r\n const {\r\n context,\r\n } = props;\r\n\r\n const {\r\n mappingGridRows,\r\n infoForMMCGrid,\r\n GMCEmail,\r\n hasDraftStore,\r\n isGetMappingsError,\r\n scenario,\r\n loginErrorText,\r\n clientId,\r\n } = context;\r\n\r\n this.state = {\r\n mappingGridRows,\r\n infoForMMCGrid,\r\n GMCEmail,\r\n hasDraftStore,\r\n isGetMappingsError,\r\n scenario,\r\n loginErrorText,\r\n clientId,\r\n };\r\n }\r\n\r\n onMappingGridRowsUpdate = (mappingGridRows) => {\r\n this.setState({\r\n mappingGridRows,\r\n });\r\n };\r\n\r\n onGMCEmailAddressUpdate = (GMCEmail) => {\r\n this.setState({\r\n GMCEmail,\r\n });\r\n };\r\n\r\n onHasDraftStoreUpdate = (hasDraftStore) => {\r\n this.setState({\r\n hasDraftStore,\r\n });\r\n };\r\n\r\n onIsGetMappingsErrorUpdate = (isGetMappingsError) => {\r\n this.setState({\r\n isGetMappingsError,\r\n });\r\n };\r\n\r\n onInfoForMMCGridUpdate = (infoForMMCGrid) => {\r\n this.setState({\r\n infoForMMCGrid,\r\n });\r\n };\r\n\r\n onScenarioUpdate = (scenario) => {\r\n this.setState({\r\n scenario,\r\n });\r\n };\r\n\r\n onLoginErrorTextUpdate = (loginErrorText) => {\r\n this.setState({\r\n loginErrorText,\r\n });\r\n };\r\n\r\n onClientIdUpdate = (clientId) => {\r\n this.setState({\r\n clientId,\r\n });\r\n };\r\n\r\n generateMerchantIds = () => {\r\n const {\r\n context,\r\n } = this.props;\r\n\r\n const {\r\n accountToCampaignsOptionsMapping = {},\r\n selectedAccounts = [],\r\n } = context;\r\n\r\n const customerId = selectedAccounts[0].CustomerId;\r\n\r\n const { campaignsWithMerchantId } = accountToCampaignsOptionsMapping[customerId];\r\n\r\n const merchantIds = [];\r\n\r\n _.each(campaignsWithMerchantId, campaign => merchantIds.push(campaign.MerchantId));\r\n\r\n return merchantIds;\r\n };\r\n\r\n saveMappingGridConfig = () => {\r\n const {\r\n context,\r\n } = this.props;\r\n\r\n const {\r\n patchState,\r\n } = context;\r\n\r\n const skipSetMappings = this.state.isGetMappingsError\r\n || _.isEmpty(this.state.mappingGridRows);\r\n\r\n patchState({\r\n mappingGridRows: this.state.mappingGridRows,\r\n GMCEmail: this.state.GMCEmail,\r\n hasDraftStore: this.state.hasDraftStore,\r\n infoForMMCGrid: this.state.infoForMMCGrid,\r\n isGetMappingsError: this.state.isGetMappingsError,\r\n scenario: this.state.scenario,\r\n loginErrorText: this.state.loginErrorText,\r\n skipSetMappings,\r\n clientId: this.state.clientId,\r\n });\r\n\r\n // if get mappings fail with an error, we will still proceed\r\n // but skip the set mappings call.\r\n return new Promise(resolve => resolve(true));\r\n };\r\n\r\n render() {\r\n const {\r\n context,\r\n } = this.props;\r\n\r\n const {\r\n deps,\r\n merchantCenterMappingStepPerfMarker,\r\n repository,\r\n mappingGridRows,\r\n GMCEmail,\r\n hasDraftStore,\r\n infoForMMCGrid,\r\n isGetMappingsError,\r\n scenario,\r\n loginErrorText,\r\n clientId,\r\n permissionFactory,\r\n isOneClickTypeSelected,\r\n googleAccount,\r\n } = context;\r\n\r\n const {\r\n newI18n,\r\n google,\r\n merchantCenterMappingLearnMoreLinkCallback: learnMoreLinkCallback,\r\n onDraftStoreLinkClick,\r\n disableGMCSignIn,\r\n onGMCSignInRedirectLinkClick,\r\n } = deps;\r\n\r\n // logTrace not used currently.\r\n // These methods logs into clienterr & clienttrace\r\n const logger = {\r\n logError: repository.logError,\r\n logTrace: repository.logTrace,\r\n };\r\n\r\n const merchantIds = this.generateMerchantIds();\r\n const isImportOneClickMultiAdAccountEnabled = repository.permissions && repository.permissions.dynamic && repository.permissions.dynamic.ImportOneClickMultiAdAccount;\r\n // when with one click mode, there is only one google account but has campaigns with merchant id, we will show the alert.\r\n const GmcHeaderMoreInfos = permissionFactory.IsOneClickImportEnabled() && isOneClickTypeSelected && ((googleAccount && googleAccount.length === 1) || isImportOneClickMultiAdAccountEnabled) ? (\r\n
\r\n \r\n {`${newI18n.getString(_TL_(\"Since you have multiple shopping campaigns under your Google Merchant Center account, we can't continue with Quick import. You'll need to set up your store first.\"))} `}\r\n \r\n }\r\n level=\"Warning\"\r\n icon={(
)}\r\n dismissible={false}\r\n />\r\n
\r\n ) : undefined;\r\n\r\n if (this.props.activity && GmcHeaderMoreInfos) {\r\n this.props.activity.signal('OneClick.custom.bsc');\r\n }\r\n\r\n return (\r\n \r\n
\r\n {/* The BSC Import grid does not support multi-account import at this time.\r\n More changes are needed to make it work. Details are in the\r\n BSC Import UI design doc (link in README of grid package),\r\n and the TODOs within the grid package. */}\r\n )}>\r\n \r\n \r\n
\r\n \r\n );\r\n }\r\n}\r\n\r\nGoogleMerchantCenterStoreMappingStepInternal.propTypes = {\r\n context: PropTypes.shape({}).isRequired,\r\n activity: PropTypes.shape({\r\n signal: PropTypes.func,\r\n }),\r\n};\r\n\r\nGoogleMerchantCenterStoreMappingStepInternal.defaultProps = {\r\n activity: null,\r\n};\r\n\r\nconst GoogleMerchantCenterStoreMappingStepInternalWithStyle = withActivityContext(GoogleMerchantCenterStoreMappingStepInternal);\r\n\r\nexport const GoogleMerchantCenterStoreMappingStep = React.memo(() => (\r\n \r\n {\r\n (contextValues) => {\r\n const {\r\n deps,\r\n } = contextValues;\r\n\r\n const {\r\n getUniqueImportGUID,\r\n } = deps;\r\n\r\n const uniqueImportId = (getUniqueImportGUID && getUniqueImportGUID()) || '';\r\n\r\n return (\r\n \r\n \r\n \r\n );\r\n }\r\n }\r\n \r\n));\r\n","import { StepConstants } from '../../page/step-config';\r\n\r\nexport const getActionBarItems = (saveMappingGridConfig) => {\r\n const config = [{\r\n type: 'button-back',\r\n prevStepName: StepConstants.ChooseAccountsGoogleAccount.path,\r\n validateFunction: () => saveMappingGridConfig(),\r\n }, {\r\n type: 'button-next',\r\n nextStepName: StepConstants.StartImportSmart.path,\r\n validateFunction: () => saveMappingGridConfig(),\r\n }, {\r\n type: 'button-cancel',\r\n extraLeftPadding: true,\r\n }];\r\n\r\n return config;\r\n};\r\n","import React from 'react';\r\n\r\nimport {\r\n SmartCampaignGoogleLoginStep as GeneralSmartCampaignGoogleLoginStep,\r\n} from '@bingads-webui-campaign/imports-core';\r\n\r\nimport { StepConstants } from '../../page/step-config';\r\n\r\nexport const SmartCampaignGoogleLoginStep = props => (\r\n \r\n);\r\n","import React from 'react';\r\n\r\nimport {\r\n ESCGoogleLoginStep as GeneralESCGoogleLoginStep,\r\n} from '@bingads-webui-campaign/imports-core';\r\n\r\nimport { StepConstants } from '../../page/step-config';\r\n\r\nexport const ESCGoogleLoginStep = props => (\r\n \r\n);\r\n","import React from 'react';\r\nimport PropTypes from 'prop-types';\r\nimport { VerticalSeparatedLayout } from '@bingads-webui-react/steps';\r\n\r\nimport { ImportType, ImportMode } from '@bingads-webui-campaign/imports-core';\r\n\r\nimport { StepConstants } from './step-config';\r\nimport { GoogleLoginStep, renderDescription } from '../steps/google-login-step';\r\nimport { GoogleAccountStep, BingAccountStep } from '../steps/google-account-choose-step';\r\nimport { ImportSummaryPage } from '../steps/google-import-summary-step';\r\nimport { StartImportSmartStep } from '../steps/start-import-smart-step';\r\nimport { GoogleCampaignStep } from '../steps/google-campaign-step';\r\nimport { GoogleImportOptionsStep } from '../steps/google-import-options-step';\r\nimport { ImportStatusStep } from '../steps/import-status-step';\r\nimport { StartImportAdvancedStep } from '../steps/start-import-advanced-step';\r\nimport { GoogleMerchantCenterStoreMappingStep } from '../steps/merchant-center-store-mapping-step';\r\nimport { SmartCampaignGoogleLoginStep } from '../steps/smart-campaign-google-login-step';\r\nimport { ESCGoogleLoginStep } from '../steps/esc-google-login-step';\r\n\r\nconst {\r\n Step,\r\n StepContainer,\r\n} = VerticalSeparatedLayout;\r\n\r\nexport const getGoogleLoginStep = ({\r\n i18n,\r\n repository,\r\n onLoginPageHelpLinkClick,\r\n getLoginPageDisclaimer,\r\n}) => {\r\n const title = i18n.getString(StepConstants.SignInStep.stepName);\r\n const { path } = StepConstants.SignInStep;\r\n return (\r\n renderDescription(step, i18n, repository)}\r\n >\r\n \r\n \r\n );\r\n};\r\n\r\ngetGoogleLoginStep.propTypes = {\r\n i18n: PropTypes.shape({}).isRequired,\r\n repository: PropTypes.shape({}).isRequired,\r\n onLoginPageHelpLinkClick: PropTypes.func,\r\n getLoginPageDisclaimer: PropTypes.func,\r\n};\r\n\r\ngetGoogleLoginStep.defaultProps = {\r\n onLoginPageHelpLinkClick: null,\r\n getLoginPageDisclaimer: null,\r\n};\r\n\r\nexport const getGoogleAccountsStep = ({\r\n i18n,\r\n getImportMode,\r\n isEscImport,\r\n}) => {\r\n const title = i18n.getString(StepConstants.ChooseAccounts.stepName);\r\n const { path } = StepConstants.ChooseAccounts;\r\n const googleAccountSubPath = StepConstants.ChooseAccountsGoogleAccount.path;\r\n const bingAccountSubPath = StepConstants.ChooseAccountsBingAccountMapping.path;\r\n const bingAccountSubStepEnabled = getImportMode() === ImportMode.Multi;\r\n return (\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n );\r\n};\r\n\r\ngetGoogleAccountsStep.propTypes = {\r\n i18n: PropTypes.shape({}).isRequired,\r\n getImportMode: PropTypes.func.isRequired,\r\n isEscImport: PropTypes.bool.isRequired,\r\n};\r\n\r\nexport const getImportSummaryStep = ({\r\n i18n,\r\n showImportSummary,\r\n redirectToCampaignsPage,\r\n redirectToImportHistoryPage,\r\n onImportSummaryPageHelpLinkClicked,\r\n onSetupUETtagLinkClick,\r\n getImportSummaryDisclaimerText,\r\n isSmartCampaignImport,\r\n}) => {\r\n const title = i18n.getString(StepConstants.ImportSummaryStep.title);\r\n const { path } = StepConstants.ImportSummaryStep;\r\n return (\r\n \r\n \r\n \r\n );\r\n};\r\n\r\ngetImportSummaryStep.propTypes = {\r\n i18n: PropTypes.shape({}).isRequired,\r\n showImportSummary: PropTypes.bool.isRequired,\r\n redirectToCampaignsPage: PropTypes.func.isRequired,\r\n redirectToImportHistoryPage: PropTypes.func.isRequired,\r\n onImportSummaryPageHelpLinkClicked: PropTypes.func.isRequired,\r\n onSetupUETtagLinkClick: PropTypes.func.isRequired,\r\n getImportSummaryDisclaimerText: PropTypes.func.isRequired,\r\n isSmartCampaignImport: PropTypes.bool,\r\n};\r\n\r\ngetImportSummaryStep.defaultProps = {\r\n isSmartCampaignImport: false,\r\n};\r\n\r\nexport const getStartImportSmartStep = ({\r\n i18n,\r\n getImportType,\r\n setImportStatus,\r\n facScheduleInvalid,\r\n getSchedulePageDisclaimer,\r\n getDefaultSchedule,\r\n}) => {\r\n const title = i18n.getString(StepConstants.StartImportSmart.stepName);\r\n const { path } = StepConstants.StartImportSmart;\r\n const isEnabled = getImportType() === ImportType.Smart;\r\n return (\r\n \r\n \r\n \r\n );\r\n};\r\ngetStartImportSmartStep.propTypes = {\r\n i18n: PropTypes.shape({}).isRequired,\r\n getImportType: PropTypes.func.isRequired,\r\n setImportStatus: PropTypes.func.isRequired,\r\n facScheduleInvalid: PropTypes.bool,\r\n getSchedulePageDisclaimer: PropTypes.func,\r\n getDefaultSchedule: PropTypes.func,\r\n};\r\n\r\ngetStartImportSmartStep.defaultProps = {\r\n facScheduleInvalid: false,\r\n getSchedulePageDisclaimer: null,\r\n getDefaultSchedule: null,\r\n};\r\n\r\nexport const getGoogleCampaignStep = ({\r\n i18n,\r\n getImportType,\r\n showCampaignSelectionStep,\r\n facNoActiveCampaigns,\r\n}) => {\r\n const title = i18n.getString(StepConstants.GoogleCampaignStep.stepName);\r\n const { path } = StepConstants.GoogleCampaignStep;\r\n const isEnabled = getImportType() === ImportType.Advanced && showCampaignSelectionStep;\r\n\r\n return (\r\n \r\n \r\n \r\n );\r\n};\r\n\r\ngetGoogleCampaignStep.propTypes = {\r\n i18n: PropTypes.shape({}).isRequired,\r\n getImportType: PropTypes.func.isRequired,\r\n showCampaignSelectionStep: PropTypes.bool.isRequired,\r\n facNoActiveCampaigns: PropTypes.bool,\r\n};\r\n\r\ngetGoogleCampaignStep.defaultProps = {\r\n facNoActiveCampaigns: false,\r\n};\r\n\r\nexport const getGoogleImportOptionsStep = ({\r\n i18n,\r\n deps,\r\n getImportType,\r\n}) => {\r\n const title = i18n.getString(StepConstants.ImportOptionStep.stepName);\r\n const { path } = StepConstants.ImportOptionStep;\r\n const isEnabled = getImportType() === ImportType.Advanced;\r\n const importAccountCurrencyTitle = i18n.getString(_TL_('Google Ads:'));\r\n\r\n return (\r\n \r\n \r\n \r\n );\r\n};\r\n\r\ngetGoogleImportOptionsStep.propTypes = {\r\n i18n: PropTypes.shape({}).isRequired,\r\n deps: PropTypes.shape({}).isRequired,\r\n getImportType: PropTypes.func.isRequired,\r\n};\r\n\r\nexport const getStartImportAdvancedStep = ({\r\n i18n,\r\n getImportType,\r\n setImportStatus,\r\n facScheduleInvalid,\r\n facNoActiveCampaigns,\r\n getSchedulePageDisclaimer,\r\n}) => {\r\n const title = i18n.getString(StepConstants.StartImportAdvanced.stepName);\r\n const { path } = StepConstants.StartImportAdvanced;\r\n const isEnabled = getImportType() === ImportType.Advanced;\r\n return (\r\n \r\n \r\n \r\n );\r\n};\r\n\r\ngetStartImportAdvancedStep.propTypes = {\r\n i18n: PropTypes.shape({}).isRequired,\r\n getImportType: PropTypes.func.isRequired,\r\n setImportStatus: PropTypes.func.isRequired,\r\n facScheduleInvalid: PropTypes.bool,\r\n facNoActiveCampaigns: PropTypes.bool,\r\n getSchedulePageDisclaimer: PropTypes.func,\r\n};\r\n\r\ngetStartImportAdvancedStep.defaultProps = {\r\n facScheduleInvalid: false,\r\n facNoActiveCampaigns: false,\r\n getSchedulePageDisclaimer: null,\r\n};\r\n\r\nexport const getImportStatusStep = ({\r\n i18n,\r\n getImportStatus,\r\n showImportStatusStep,\r\n redirectToImportHistoryPage,\r\n getImportStatusPageDisclaimer,\r\n getOverwriteImportStatusOrderToStepTitleMap,\r\n}) => {\r\n const title = i18n.getString(StepConstants.ImportStatusStep.title);\r\n const { path } = StepConstants.ImportStatusStep;\r\n\r\n return (\r\n \r\n \r\n \r\n );\r\n};\r\n\r\ngetImportStatusStep.propTypes = {\r\n i18n: PropTypes.shape({}).isRequired,\r\n getImportStatus: PropTypes.func.isRequired,\r\n showImportStatusStep: PropTypes.bool.isRequired,\r\n redirectToImportHistoryPage: PropTypes.func.isRequired,\r\n getImportStatusPageDisclaimer: PropTypes.func,\r\n getOverwriteImportStatusOrderToStepTitleMap: PropTypes.func,\r\n};\r\n\r\ngetImportStatusStep.defaultProps = {\r\n getImportStatusPageDisclaimer: null,\r\n getOverwriteImportStatusOrderToStepTitleMap: null,\r\n};\r\n\r\nexport const getMerchantCenterStoreMappingStep = ({\r\n i18n,\r\n showMerchantCenterStoreMappingStep,\r\n}) => {\r\n const title = i18n.getString(StepConstants.MerchantCenterStoreMappingStep.stepName);\r\n const { path } = StepConstants.MerchantCenterStoreMappingStep;\r\n\r\n return (\r\n \r\n \r\n \r\n );\r\n};\r\n\r\ngetMerchantCenterStoreMappingStep.propTypes = {\r\n i18n: PropTypes.shape({}).isRequired,\r\n showMerchantCenterStoreMappingStep: PropTypes.bool.isRequired,\r\n};\r\n\r\nexport const getSmartCampaignGoogleLoginStep = ({\r\n i18n,\r\n showSmartCampaignGoogleLoginStep,\r\n setImportStatus,\r\n permissions,\r\n}) => {\r\n const title = i18n.getString(StepConstants.SmartCampaignSignInStep.title);\r\n const { path } = StepConstants.SmartCampaignSignInStep;\r\n return (\r\n \r\n \r\n \r\n );\r\n};\r\n\r\ngetSmartCampaignGoogleLoginStep.propTypes = {\r\n i18n: PropTypes.shape({}).isRequired,\r\n showSmartCampaignGoogleLoginStep: PropTypes.bool.isRequired,\r\n setImportStatus: PropTypes.func.isRequired,\r\n permissions: PropTypes.shape({}).isRequired,\r\n};\r\n\r\nexport const getESCGoogleLoginStep = ({\r\n i18n,\r\n showESCGoogleLoginStep,\r\n setImportStatus,\r\n}) => {\r\n const title = i18n.getString(StepConstants.ESCSignInStep.title);\r\n const { path } = StepConstants.ESCSignInStep;\r\n return (\r\n \r\n \r\n \r\n );\r\n};\r\n\r\ngetESCGoogleLoginStep.propTypes = {\r\n i18n: PropTypes.shape({}).isRequired,\r\n showESCGoogleLoginStep: PropTypes.bool.isRequired,\r\n setImportStatus: PropTypes.func.isRequired,\r\n};\r\n","import React from 'react';\r\nimport PropTypes from 'prop-types';\r\nimport Promise from 'bluebird';\r\nimport $ from 'jquery';\r\nimport classnames from 'classnames';\r\nimport { memoize } from 'underscore';\r\nimport { ACCOUNT_MODE } from '@bingads-webui-campaign/campaign-ui-common';\r\nimport { BaseImportCore, checkRequiredDeps, ImportType, ImportMode } from '@bingads-webui-campaign/imports-core';\r\nimport { SmartImportRepository, GoogleLoginRepository } from '@bingads-webui-campaign/import-shared-repositories';\r\nimport { perfMarkerPropTypes } from '@bingads-webui/performance-marker';\r\nimport { Constants as CCUIConstants } from '@bingads-webui-clientcenter/entity-utils';\r\nimport { CouponLightboxNew, CouponBannerNew } from '@bingads-webui-react/feature-adoption-coupon';\r\nimport { withUiBlock } from '@bingads-webui/uiblocker';\r\nimport { Scenario } from '@bingads-webui-react/hoc-with-signal';\r\nimport { generateGuid } from '@bingads-webui-universal/primitive-utilities';\r\nimport { FacCallout } from '@bingads-webui-react/fac-callout';\r\n\r\nimport { PermissionFactory } from '../repository';\r\nimport { StepConstants } from './step-config';\r\n\r\nimport {\r\n getGoogleLoginStep,\r\n getGoogleAccountsStep,\r\n getImportSummaryStep,\r\n getStartImportSmartStep,\r\n getGoogleCampaignStep,\r\n getGoogleImportOptionsStep,\r\n getStartImportAdvancedStep,\r\n getImportStatusStep,\r\n getMerchantCenterStoreMappingStep,\r\n getSmartCampaignGoogleLoginStep,\r\n getESCGoogleLoginStep,\r\n} from './step-factory';\r\n\r\n// ImportScope indicates whether this import page url is account level or customer level.\r\n// It means that once this smart import page is initialized, ImportScope value will never change\r\n// ImportMode indicated whether this import end up to be a single or multi account import.\r\n// For now, these 2 things are identical.\r\n// In future, we will support scenario that user go to account level import page\r\n// but do a multi-account import\r\n// (in this case, ImportScope is Account but ImportMode is Multi),\r\n// or scenario that user go to customer level import page but do a single-account import\r\n// (in this case, ImportScope is Customer but ImportMode is Single)\r\n// The import mode switch scenario will be controlled by isImportModeSwitchEnabled\r\n// from permission factory\r\nexport const ImportScope = {\r\n Account: 0,\r\n Customer: 1,\r\n};\r\n\r\nconst FAC_STATUS_NOT_IN_PROGRESS = CCUIConstants.RecommendationAdoptionStatus.NotInProgess;\r\nconst FAC_STATUS_ACTIVE = CCUIConstants.RecommendationAdoptionStatus.Active;\r\n\r\nfunction checkRequiredDepsForGoogleImport(deps) {\r\n checkRequiredDeps(deps);\r\n deps.check('edm');\r\n deps.check('jsData');\r\n deps.check('google');\r\n deps.check('cookieHelperForEditImport');\r\n}\r\n\r\nexport class GoogleImportPage extends React.PureComponent {\r\n constructor(props) {\r\n super(props);\r\n this.perfMarker = props.perfMarker;\r\n this.steps = [];\r\n this.state = {\r\n isInit: false,\r\n importType: ImportType.Smart,\r\n importMode: ImportMode.Single,\r\n showImportSummary: false,\r\n showMerchantCenterStoreMappingStep: false,\r\n showImportStatusStep: false,\r\n importStatus: null,\r\n startStep: StepConstants.SignInStep, // google-login-step\r\n hideProgressList: false,\r\n showCouponBanner: false,\r\n showCouponLightbox: false,\r\n showCampaignSelectionStep: true,\r\n uniqueImportGUID: generateGuid(),\r\n facScheduleInvalid: false,\r\n facNoActiveCampaigns: false,\r\n showSmartCampaignGoogleLoginStep: false,\r\n isSmartCampaignImport: false,\r\n isEscImport: false,\r\n showESCGoogleLoginStep: false,\r\n };\r\n this.initialize(props);\r\n }\r\n\r\n componentDidUpdate = (prevProps) => {\r\n if (prevProps.location.key !== this.props.location.key) {\r\n // eslint-disable-next-line\r\n this.setState({\r\n isInit: false,\r\n importType: ImportType.Smart,\r\n importMode: ImportMode.Single,\r\n showImportSummary: false,\r\n showImportStatusStep: false,\r\n showMerchantCenterStoreMappingStep: false,\r\n importStatus: null,\r\n startStep: StepConstants.SignInStep, // google-login-step\r\n hideProgressList: false,\r\n showCouponBanner: false,\r\n showCouponLightbox: false,\r\n showCampaignSelectionStep: true,\r\n uniqueImportGUID: generateGuid(),\r\n facScheduleInvalid: false,\r\n facNoActiveCampaigns: false,\r\n showSmartCampaignGoogleLoginStep: false,\r\n isSmartCampaignImport: false,\r\n isEscImport: false,\r\n showESCGoogleLoginStep: false,\r\n });\r\n this.initialState = {};\r\n this.initialize(prevProps);\r\n }\r\n };\r\n\r\n getUniqueImportGUID = () => this.state.uniqueImportGUID;\r\n\r\n getImportType = () => this.state.importType;\r\n\r\n setImportStatus = (status) => {\r\n this.setState({\r\n importStatus: status,\r\n });\r\n };\r\n\r\n getImportStatus = () => this.state.importStatus;\r\n\r\n getImportMode = () => this.state.importMode;\r\n\r\n getImportScope = () => this.state.ImportScope;\r\n\r\n logTrace(...args) {\r\n this.repository.logTrace(...args);\r\n }\r\n\r\n initialize = (props) => {\r\n this.perfMarker.willFetchData();\r\n checkRequiredDepsForGoogleImport(props.deps);\r\n this.deps = props.deps;\r\n\r\n // don't take reject param, if coupon call fails, we will just not show the offer\r\n Promise.resolve().then(() => {\r\n // Deps.\r\n this.deps.newI18n = this.props.i18n;\r\n this.deps.importStatus = this.state.importStatus;\r\n this.deps.perfMarker = this.props.perfMarker;\r\n this.deps.scope = props.scope;\r\n this.deps.serverContext = props.serverContext;\r\n this.i18n = this.deps.i18n;\r\n this.deps.loginPerfMarker = this.props.perfMarker.createChild('Smart_Import_Login_Step');\r\n this.deps.loginPerfMarker.willInit();\r\n\r\n this.deps.setFacScheduleInvalid = (facScheduleInvalid) => {\r\n this.setState({ facScheduleInvalid });\r\n };\r\n this.deps.setNoActiveCampaigns = (facNoActiveCampaigns) => {\r\n this.setState({ facNoActiveCampaigns });\r\n };\r\n\r\n // Unique Import ID for substrate.\r\n this.deps.getUniqueImportGUID = this.getUniqueImportGUID;\r\n\r\n // Toggle functions.\r\n this.deps.toggleShowImportSummary = this.toggleShowImportSummary;\r\n this.deps.toggleShowImportStatusStep = this.toggleShowImportStatusStep;\r\n this.deps.toggleMerchantCenterStoreMappingStep = this.toggleMerchantCenterStoreMappingStep;\r\n this.deps.toggleCampaignsSelectionStep = this.toggleCampaignsSelectionStep;\r\n\r\n // Repository init.\r\n // TODO: this will removed after repository refactor with real aid.\r\n if (!props.scope.values.aid) {\r\n this.deps.isMultiAccountImport = true;\r\n }\r\n\r\n this.repository = this.deps.repository\r\n ? this.deps.repository\r\n : new SmartImportRepository({\r\n deps: this.deps,\r\n });\r\n\r\n this.logTrace(`GSILocal: ${props.permissions.dynamic.GSILocal}`);\r\n\r\n this.googleLoginRepository = this.deps.googleLoginRepository\r\n ? this.deps.googleLoginRepository\r\n : new GoogleLoginRepository({ deps: { google: window.google, GSILocal: props.permissions.dynamic.GSILocal } });\r\n\r\n this.permissionFactory = this.deps.permissionFactory\r\n ? this.deps.permissionFactory\r\n : new PermissionFactory({\r\n permissions: props.permissions,\r\n importMode: props.scope.values.aid ? ImportMode.Single : ImportMode.Multi,\r\n });\r\n\r\n // Default Coupon State.\r\n this.setState({\r\n // FAC_STATUS_NOT_IN_PROGRESS is lightbox popup before close lightbox\r\n // FAC_STATUS_ACTIVE is showing CouponBanner\r\n showCouponBanner: this.deps.coupon && this.deps.ccJsData &&\r\n this.deps.coupon.rawData.Status !== FAC_STATUS_NOT_IN_PROGRESS,\r\n showCouponLightbox: this.deps.coupon && this.deps.ccJsData &&\r\n (this.deps.coupon.rawData.Status === FAC_STATUS_NOT_IN_PROGRESS\r\n || (this.deps.serverContext.DynamicPermissions.FacCalloutRevamp && this.deps.coupon.rawData.Status === FAC_STATUS_ACTIVE)),\r\n // importScope: props.scope.values.aid ? ImportScope.Account : ImportScope.Customer,\r\n importMode: props.scope.values.aid ? ImportMode.Single : ImportMode.Multi,\r\n });\r\n\r\n if (props.scope.values.aid && this.deps.serverContext.CurrentAccount.AccountMode === ACCOUNT_MODE.UNIFIED_SMART) {\r\n // ESC import scenario\r\n this.logTrace('go to ESC google import page');\r\n this.setState({\r\n showESCGoogleLoginStep: true,\r\n startStep: StepConstants.ESCSignInStep,\r\n hideProgressList: true,\r\n isEscImport: true,\r\n });\r\n }\r\n\r\n if (this.deps.serverContext.CurrentAccount\r\n && this.deps.serverContext.CurrentAccount.AccountMode === ACCOUNT_MODE.SMART) {\r\n // smart campaign import scenario\r\n this.logTrace('go to smart campaign google import page');\r\n this.setState({\r\n showSmartCampaignGoogleLoginStep: true,\r\n startStep: StepConstants.SmartCampaignSignInStep,\r\n hideProgressList: true,\r\n isSmartCampaignImport: true,\r\n });\r\n }\r\n\r\n const initialStateFetchPromise = Promise.resolve([]);\r\n\r\n return initialStateFetchPromise.then(() => {\r\n this.setState({\r\n isInit: true,\r\n });\r\n });\r\n });\r\n };\r\n\r\n toggleShowImportSummary = (state) => {\r\n this.setState({\r\n showImportSummary: state,\r\n });\r\n };\r\n\r\n toggleShowImportStatusStep = (state) => {\r\n this.setState({\r\n showImportStatusStep: state,\r\n });\r\n };\r\n\r\n toggleImportType = (type) => {\r\n this.setState({\r\n importType: type,\r\n });\r\n };\r\n\r\n toggleImportMode = (mode) => {\r\n this.setState({\r\n importMode: mode,\r\n });\r\n this.permissionFactory.toggleImportMode(mode);\r\n };\r\n\r\n toggleMerchantCenterStoreMappingStep = (state) => {\r\n this.setState({\r\n showMerchantCenterStoreMappingStep: state,\r\n });\r\n };\r\n\r\n toggleCampaignsSelectionStep = (state) => {\r\n this.setState({\r\n showCampaignSelectionStep: state,\r\n });\r\n };\r\n\r\n constructSteps = (i18n) => {\r\n this.steps = [];\r\n // construct base step\r\n this.steps.push(getGoogleLoginStep({\r\n i18n,\r\n repository: this.repository,\r\n onLoginPageHelpLinkClick: this.props.onLoginPageHelpLinkClick,\r\n getLoginPageDisclaimer: this.props.getLoginPageDisclaimer,\r\n }));\r\n\r\n this.steps.push(getGoogleAccountsStep({\r\n i18n,\r\n getImportMode: this.getImportMode,\r\n isEscImport: this.state.isEscImport,\r\n }));\r\n\r\n this.steps.push(getMerchantCenterStoreMappingStep({\r\n i18n,\r\n showMerchantCenterStoreMappingStep: this.state.showMerchantCenterStoreMappingStep,\r\n }));\r\n\r\n this.steps.push(getStartImportSmartStep({\r\n i18n,\r\n getImportType: this.getImportType,\r\n setImportStatus: this.setImportStatus,\r\n facScheduleInvalid: this.state.facScheduleInvalid,\r\n getSchedulePageDisclaimer: this.props.getSchedulePageDisclaimer,\r\n getDefaultSchedule: this.props.getDefaultSchedule,\r\n }));\r\n\r\n this.steps.push(getGoogleCampaignStep({\r\n i18n,\r\n getImportType: this.getImportType,\r\n showCampaignSelectionStep: this.state.showCampaignSelectionStep,\r\n facNoActiveCampaigns: this.state.facNoActiveCampaigns,\r\n }));\r\n\r\n this.steps.push(getGoogleImportOptionsStep({\r\n i18n,\r\n deps: this.deps,\r\n getImportType: this.getImportType,\r\n }));\r\n\r\n this.steps.push(getStartImportAdvancedStep({\r\n i18n,\r\n getImportType: this.getImportType,\r\n setImportStatus: this.setImportStatus,\r\n facScheduleInvalid: this.state.facScheduleInvalid,\r\n facNoActiveCampaigns: this.state.facNoActiveCampaigns,\r\n getSchedulePageDisclaimer: this.props.getSchedulePageDisclaimer,\r\n }));\r\n\r\n this.steps.push(getImportStatusStep({\r\n i18n,\r\n getImportStatus: this.getImportStatus,\r\n showImportStatusStep: this.state.showImportStatusStep,\r\n redirectToImportHistoryPage: this.props.redirectToImportHistoryPage,\r\n getImportStatusPageDisclaimer: this.props.getImportStatusPageDisclaimer,\r\n getOverwriteImportStatusOrderToStepTitleMap:\r\n this.props.getOverwriteImportStatusOrderToStepTitleMap,\r\n }));\r\n\r\n this.steps.push(getImportSummaryStep({\r\n i18n,\r\n showImportSummary: this.state.showImportSummary,\r\n redirectToCampaignsPage: this.props.redirectToCampaignsPage,\r\n redirectToImportHistoryPage: this.props.redirectToImportHistoryPage,\r\n onImportSummaryPageHelpLinkClicked: this.props.onImportSummaryPageHelpLinkClicked,\r\n onSetupUETtagLinkClick: this.props.onSetupUETtagLinkClick,\r\n getImportSummaryDisclaimerText: this.props.getImportSummaryDisclaimerText,\r\n isSmartCampaignImport: this.state.isSmartCampaignImport,\r\n }));\r\n\r\n this.steps.push(getSmartCampaignGoogleLoginStep({\r\n i18n,\r\n repository: this.repository,\r\n showSmartCampaignGoogleLoginStep: this.state.showSmartCampaignGoogleLoginStep,\r\n setImportStatus: this.setImportStatus,\r\n permissions: this.props.permissions,\r\n }));\r\n\r\n this.steps.push(getESCGoogleLoginStep({\r\n i18n,\r\n repository: this.repository,\r\n showESCGoogleLoginStep: this.state.showESCGoogleLoginStep,\r\n setImportStatus: this.setImportStatus, // TODO: remove in the future if it is only related with import status step\r\n }));\r\n };\r\n\r\n closeLightbox = memoize(() => {\r\n const closeBlock = withUiBlock($('.ReactModal__Content'), this.deps.i18n.getString('Loading'), undefined, undefined, 1100);\r\n this.repository.updateFACCoupon(FAC_STATUS_ACTIVE)\r\n .tap(() => {\r\n this.setState({\r\n showCouponBanner: true,\r\n });\r\n })\r\n .tapCatch((err) => {\r\n if (this.deps.showAlertHandler) {\r\n const errorCode = err.Errors && err.Errors[0] && err.Errors[0].Code;\r\n const errorMessageKey = errorCode === 'CCMTErrorNumber_CouponBankDepleted'\r\n ? 'FACDepletedErrorMessage'\r\n : 'GenericFACAdoptionStartErrorMessage';\r\n\r\n this.deps.showAlertHandler({\r\n message: this.deps.i18nAmdLoader.getString(errorMessageKey),\r\n level: 'Error',\r\n });\r\n }\r\n })\r\n .catch(() => {\r\n // if there is an error, clear coupon from scheduled import step\r\n delete this.deps.coupon;\r\n })\r\n .finally(() => {\r\n this.setState({\r\n showCouponLightbox: false,\r\n });\r\n closeBlock();\r\n });\r\n });\r\n\r\n render() {\r\n const {\r\n rootClassName,\r\n i18n,\r\n serverContext,\r\n } = this.props;\r\n\r\n if (this.state.isInit) {\r\n this.steps = [];\r\n this.constructSteps(i18n);\r\n } else {\r\n return null;\r\n }\r\n\r\n const handleCancelButtonClick = () => {\r\n if (this.props.customCancelButtonClickHandler) {\r\n this.props.customCancelButtonClickHandler();\r\n } else {\r\n this.repository.redirectToCampaigns();\r\n }\r\n };\r\n\r\n let scenarioName = '';\r\n if (this.state.isSmartCampaignImport) {\r\n scenarioName = 'SmartCampaignsGoogleImportWizard';\r\n } else if (this.state.isEscImport) {\r\n scenarioName = 'ESCGoogleImportWizard';\r\n } else {\r\n scenarioName = 'SmartGoogleImportWizard';\r\n }\r\n\r\n return (\r\n \r\n {\r\n this.state.showCouponLightbox &&\r\n
\r\n { serverContext.DynamicPermissions.FacCalloutRevamp\r\n ? \r\n : \r\n }\r\n
\r\n }\r\n {\r\n this.state.showCouponBanner &&\r\n
\r\n \r\n
\r\n }\r\n \r\n \r\n \r\n
\r\n );\r\n }\r\n}\r\n\r\nGoogleImportPage.propTypes = {\r\n rootClassName: PropTypes.string.isRequired,\r\n perfMarker: perfMarkerPropTypes.isRequired,\r\n i18n: PropTypes.shape({}).isRequired,\r\n ccJsData: PropTypes.shape({\r\n FeatureAdoptionCoupon: PropTypes.shape({\r\n findAll: PropTypes.func,\r\n }),\r\n }),\r\n deps: PropTypes.shape({}).isRequired,\r\n location: PropTypes.shape({\r\n key: PropTypes.string,\r\n }).isRequired,\r\n permissions: PropTypes.shape({}).isRequired,\r\n redirectToCampaignsPage: PropTypes.func,\r\n redirectToImportHistoryPage: PropTypes.func,\r\n customCancelButtonClickHandler: PropTypes.func,\r\n onLoginPageHelpLinkClick: PropTypes.func,\r\n onSetupUETtagLinkClick: PropTypes.func,\r\n getLoginPageDisclaimer: PropTypes.func,\r\n getSchedulePageDisclaimer: PropTypes.func,\r\n onImportSummaryPageHelpLinkClicked: PropTypes.func,\r\n getImportSummaryDisclaimerText: PropTypes.func,\r\n getDefaultSchedule: PropTypes.func,\r\n getImportStatusPageDisclaimer: PropTypes.func,\r\n getOverwriteImportStatusOrderToStepTitleMap: PropTypes.func,\r\n serverContext: PropTypes.shape({\r\n DynamicPermissions: PropTypes.shape({\r\n FacCalloutRevamp: PropTypes.bool.isRequired,\r\n }).isRequired,\r\n }).isRequired,\r\n};\r\n\r\nGoogleImportPage.defaultProps = {\r\n ccJsData: null,\r\n redirectToCampaignsPage: null,\r\n redirectToImportHistoryPage: null,\r\n customCancelButtonClickHandler: null,\r\n onLoginPageHelpLinkClick: null,\r\n getLoginPageDisclaimer: null,\r\n getSchedulePageDisclaimer: null,\r\n onSetupUETtagLinkClick: null,\r\n onImportSummaryPageHelpLinkClicked: null,\r\n getImportSummaryDisclaimerText: null,\r\n getDefaultSchedule: null,\r\n getImportStatusPageDisclaimer: null,\r\n getOverwriteImportStatusOrderToStepTitleMap: null,\r\n};\r\n","import React from 'react';\r\nimport ReactDOM from 'react-dom';\r\nimport $ from 'jquery';\r\nimport { Callout } from '@bingads-webui-react/callout';\r\nimport { BackboneInstanceWrapper } from '@bingads-webui-react/backbone-instance-wrapper';\r\n\r\nconst calculatePlacement = (target, calloutWidth) => {\r\n const { left } = target.getBoundingClientRect();\r\n\r\n if (left <= calloutWidth) {\r\n return 'right';\r\n }\r\n return 'left';\r\n};\r\nexport const GLOBAL_CALLOUT_CONTAINER = 'call-out-container';\r\n\r\nexport const dismissCallout = () =>\r\n ReactDOM.unmountComponentAtNode(document.getElementById(GLOBAL_CALLOUT_CONTAINER));\r\n\r\nexport const renderImportCallout = ({\r\n view,\r\n content,\r\n target,\r\n popoverId,\r\n title,\r\n i18n,\r\n calloutWidth,\r\n hasCloseButton = true,\r\n}) => {\r\n ReactDOM.render(\r\n }\r\n target={target}\r\n popoverId={popoverId}\r\n title={title}\r\n show\r\n closeButton={hasCloseButton}\r\n focusLockContent\r\n placement={calculatePlacement(target, calloutWidth)}\r\n className={{\r\n calloutCloseButton: 'import-callout-close-button',\r\n calloutCloseButtonIcon: 'import-callout-close-icon',\r\n calloutTargetContainer: 'import-callout-container',\r\n }}\r\n onClose={dismissCallout}\r\n container={$(target).parents('.status-row')[0]}\r\n closeButtonAriaLabel={i18n.getString('CampaignImport_ButtonFinish')}\r\n shouldStopPropagation={false}\r\n />, document.getElementById(GLOBAL_CALLOUT_CONTAINER));\r\n};\r\n","/* eslint-disable import/extensions */\r\nimport _ from 'underscore';\r\nimport {\r\n ImportUpdateEntityPreference,\r\n ImportUserPreferences,\r\n ImportAppendDestUrlPreference,\r\n ImportSearchAndReplaceDestUrlPreference,\r\n AppendPreferencesForTrackingTemplate,\r\n SearchAndReplacePreferencesForTrackingTemplate,\r\n ImportPrefixAndSuffixForStringProperty,\r\n ImportSearchAndReplaceForStringProperty,\r\n ImportAdjustmentForNumericProperty,\r\n} from '@bingads-webui-campaign/campaign-ui-schemas';\r\nimport { createDisabledUETSelectorClass, getFacebookImportOptionBlackList, getFacebookImportOptionFields, facebookImportOptionFieldHelpIds } from '@bingads-webui-campaign/import-components';\r\nimport {\r\n getSubFieldsBlackList as getAmazonImportOptionBlackList,\r\n getImportOptionFields as getAmazonImportOptionFields,\r\n importOptionFieldHelpIds as amazonImportOptionFieldHelpIds,\r\n} from '@bingads-webui-campaign/amazon-import';\r\nimport {\r\n getSubFieldsBlackList as getPinterestImportOptionBlackList,\r\n getImportOptionFields as getPinterestImportOptionFields,\r\n importOptionFieldHelpIds as pinterestImportOptionFieldHelpIds,\r\n} from '@bingads-webui-campaign/pinterest-import';\r\nimport { getSubFieldsBlackList as getFileImportOptionBlackList } from '@bingads-webui-campaign/file-import-page';\r\nimport { renderImportCallout } from './import-callout';\r\n\r\nexport const renderImportSettingsCallout = ({\r\n gridView,\r\n event,\r\n i18n,\r\n calloutWidth,\r\n optionsFormLoader,\r\n uetTagSelectorViewLoader,\r\n subFieldsBlacklist,\r\n config,\r\n isMultiAccountImport,\r\n}) => {\r\n event.stopPropagation();\r\n\r\n const columnData = gridView.getColumnData(event);\r\n let getImportOptionFields = null;\r\n let isPauseAdGroupIfNoLocationSupportedEnabled = false;\r\n let isAudienceTargetForFBImportOptionEnabled = false;\r\n let importOptionFieldHelpIds = {};\r\n\r\n if (columnData.Type === 'FileBasedImport') {\r\n const permissions = config && config.get('Permissions');\r\n const facebookOptionBlackList = getFileImportOptionBlackList(permissions, columnData.TaskItem.ImportFormat) || [];\r\n subFieldsBlacklist.push(...facebookOptionBlackList);\r\n } else if (columnData.Type === 'FacebookImport') {\r\n const permissions = config && config.get('Permissions');\r\n const facebookOptionBlackList = getFacebookImportOptionBlackList(permissions) || [];\r\n subFieldsBlacklist.push(...facebookOptionBlackList);\r\n getImportOptionFields = getFacebookImportOptionFields;\r\n isPauseAdGroupIfNoLocationSupportedEnabled = true;\r\n isAudienceTargetForFBImportOptionEnabled = true;\r\n importOptionFieldHelpIds = facebookImportOptionFieldHelpIds;\r\n } else if (columnData.Type === 'AmazonImport') {\r\n const permissions = config && config.get('Permissions');\r\n const amazonOptionBlackList = getAmazonImportOptionBlackList(permissions) || [];\r\n subFieldsBlacklist.push(...amazonOptionBlackList);\r\n getImportOptionFields = getAmazonImportOptionFields;\r\n importOptionFieldHelpIds = amazonImportOptionFieldHelpIds;\r\n } else if (columnData.Type === 'PinterestImport') {\r\n const permissions = config && config.get('Permissions');\r\n const pinterestOptionBlackList = getPinterestImportOptionBlackList(permissions) || [];\r\n subFieldsBlacklist.push(...pinterestOptionBlackList);\r\n getImportOptionFields = getPinterestImportOptionFields;\r\n isPauseAdGroupIfNoLocationSupportedEnabled = true;\r\n isAudienceTargetForFBImportOptionEnabled = true;\r\n importOptionFieldHelpIds = pinterestImportOptionFieldHelpIds;\r\n }\r\n\r\n optionsFormLoader().then(({ ImportOptionsForm }) => {\r\n uetTagSelectorViewLoader().then(({ UetTagSelectorView }) => {\r\n const options = JSON.parse(columnData.ImportUserPreference);\r\n\r\n const searchAndReplaceSchema = _.clone(ImportSearchAndReplaceForStringProperty);\r\n // overriding schema here because import options still uses\r\n // old preference and we need to rename the name so options generated can be unique.\r\n\r\n searchAndReplaceSchema.name = 'SearchAndReplaceForCustomParameters';\r\n const findAndReplaceSuffixSchema = _.clone(ImportSearchAndReplaceForStringProperty);\r\n findAndReplaceSuffixSchema.name = 'SearchAndReplaceForFinalURLSuffix';\r\n const importOptionsForm = new ImportOptionsForm({\r\n jsonFormatImportOptions: options,\r\n deps: {\r\n i18n,\r\n config,\r\n schema: {\r\n ImportUpdateEntityPreference,\r\n ImportUserPreferences,\r\n LandingPageAppendPreference: ImportAppendDestUrlPreference,\r\n LandingPageReplacePreference: ImportSearchAndReplaceDestUrlPreference,\r\n AppendTrackingTemplatePreference: AppendPreferencesForTrackingTemplate,\r\n SearchAndReplacePreferencesForTrackingTemplate,\r\n ImportPrefixAndSuffixForStringProperty,\r\n SearchAndReplaceForCustomParameters: searchAndReplaceSchema,\r\n SearchAndReplaceForFinalURLSuffix: findAndReplaceSuffixSchema,\r\n ImportSearchAndReplaceForStringProperty,\r\n ImportAdjustmentForNumericProperty,\r\n },\r\n subFieldsBlacklist,\r\n // identify if it is multi account log grid -> customer level's record\r\n isCustomerLevel: !!columnData.isCustomerLevel,\r\n // For URL options's tracking tamplate and url suffix\r\n // Hide when click multi account log grid -> customer level's log.\r\n // Show when click single account log grid\r\n // SHow WHen click multi account log grid -> account level's log.\r\n isHideUrlDetailView: isMultiAccountImport && !!columnData.isCustomerLevel,\r\n isMultiAccountImport,\r\n UetTagSelectorView: createDisabledUETSelectorClass(UetTagSelectorView),\r\n importOptionFieldHelpIds,\r\n },\r\n getImportOptionFields,\r\n isPauseAdGroupIfNoLocationSupportedEnabled,\r\n isAudienceTargetForFBImportOptionEnabled,\r\n isGoogleImport: gridView.importType === 'googleimport',\r\n }).render();\r\n\r\n _.each(importOptionsForm.$('input[type=\"checkbox\"], input[type=\"text\"], select.input'), (input) => {\r\n input.setAttribute('disabled', 'disabled');\r\n });\r\n\r\n importOptionsForm.$('#AdExtensionOptionsNoBmcMessage').hide();\r\n\r\n renderImportCallout({\r\n view: importOptionsForm,\r\n target: event.target,\r\n popoverId: 'import-settings-callout',\r\n title: i18n.getString('Import_ImportSettings_Header'),\r\n i18n,\r\n calloutWidth,\r\n });\r\n });\r\n });\r\n};\r\n","/* eslint-disable import/extensions */\r\n/* eslint-disable import/no-extraneous-dependencies */\r\n/* eslint-disable import/no-unresolved,import/no-webpack-loader-syntax */\r\n/* eslint-enable import/no-unresolved */\r\n// FIXME:\r\nimport instrumentation from '@bingads-webui-static-legacy/instrumentation/index';\r\nimport constants from '@bingads-webui-static-legacy/instrumentation/constants';\r\n\r\nimport { renderImportCallout } from './import-callout';\r\n\r\nexport const renderImportSummaryCallout = ({\r\n gridView,\r\n event,\r\n i18n,\r\n calloutWidth,\r\n summaryTableLoader,\r\n}) => {\r\n event.stopPropagation();\r\n\r\n const logTrace = (action, message) => {\r\n instrumentation.logMessage([constants.LOGCATEGORY.TRACE], constants.LOGLEVEL.INFO, '/campaign/importcampaign', `Import_Error_Details ${action} ${message}`);\r\n };\r\n\r\n if (event.currentTarget && event.currentTarget.className === 'import-actions learn-more') {\r\n logTrace('click', 'Learn_More_Link');\r\n }\r\n\r\n const columnData = gridView.getColumnData(event);\r\n\r\n summaryTableLoader().then(({ getSummaryDetailsPopupViewPromise }) => {\r\n getSummaryDetailsPopupViewPromise({\r\n columnData,\r\n i18n,\r\n findImportTaskItem: gridView.findImportTaskItem,\r\n logTrace,\r\n }).then(view => renderImportCallout({\r\n view,\r\n target: event.target,\r\n popoverId: 'import-summary-callout',\r\n i18n,\r\n calloutWidth,\r\n }));\r\n });\r\n};\r\n\r\n","// IMPORT_TYPE is copied from private\\campaign-legacy\\packages\\scheduled-import\\view\\import-type.js for now to avoid circular reference\r\n// Will refactor the constants later to put it in a common repository\r\nexport const IMPORT_TYPE = {\r\n googleimport: 'googleimport',\r\n facebookimport: 'facebookimport',\r\n fileimport: 'fileimport',\r\n amazonImport: 'amazonImport',\r\n pinterestImport: 'pinterestImport',\r\n};\r\n\r\nexport const importRecommendationListNameMap = (columnData) => {\r\n if (columnData['@odata.type'] === '#Model.ImportTaskItem') {\r\n return 'GoogleImportTaskRecommendationList';\r\n } else if (columnData['@odata.type'] === '#Model.FacebookTaskItem') {\r\n return 'FacebookImportTaskRecommendationList';\r\n }\r\n return null;\r\n};\r\n\r\nexport const importChannelNameMap = (importRecommendationListName) => {\r\n let importChannel = '';\r\n\r\n switch (importRecommendationListName) {\r\n case 'GoogleImportTaskRecommendationList':\r\n importChannel = IMPORT_TYPE.googleimport;\r\n break;\r\n case 'FacebookImportTaskRecommendationList':\r\n importChannel = IMPORT_TYPE.facebookimport;\r\n break;\r\n default:\r\n break;\r\n }\r\n\r\n return importChannel;\r\n};\r\n\r\n// UI supported recommendation types\r\nexport const supportedRecommendationTypesList = () => {\r\n const supportedRecommendationTypes = {\r\n GoogleImportTaskRecommendationList: [\r\n 'SelectAdCustomizerFeedToImportExpandedTextAd',\r\n 'ProvideStoreToImportShoppingCampaign',\r\n 'EnableCurrencyConversion',\r\n 'EnableAutoFrequency',\r\n 'AdjustAdGroupBidPrice',\r\n 'GetGoogleAdsPermission',\r\n ],\r\n FacebookImportTaskRecommendationList: [\r\n 'AccessTokenExpiring',\r\n 'EnableAutoFrequency',\r\n ],\r\n };\r\n\r\n return supportedRecommendationTypes;\r\n};\r\n","/* eslint-disable max-len */\r\n/* eslint-disable import/extensions */\r\n/* eslint-disable import/no-extraneous-dependencies */\r\nimport React, { useState } from 'react';\r\nimport ReactDOM from 'react-dom';\r\nimport PropTypes from 'prop-types';\r\nimport { extend } from 'underscore';\r\nimport { Glyphicon } from '@bingads-webui-react/primitive';\r\nimport { submitEvent } from '@bingads-webui-universal/accessibility-helper';\r\n\r\n/* eslint-disable import/no-unresolved,import/no-webpack-loader-syntax */\r\nimport instrumentation from '@bingads-webui-static-legacy/instrumentation/index';\r\nimport constants from '@bingads-webui-static-legacy/instrumentation/constants';\r\n/* eslint-enable import/no-unresolved */\r\n\r\nimport { renderImportCallout, GLOBAL_CALLOUT_CONTAINER } from './import-callout';\r\nimport { importRecommendationListNameMap, importChannelNameMap, IMPORT_TYPE } from './import-recommendation-constants';\r\n\r\nconst dismissCallout = () => ReactDOM.unmountComponentAtNode(document.getElementById(GLOBAL_CALLOUT_CONTAINER));\r\nconst getCalloutConfig = ({\r\n i18n,\r\n shouldAdCustomizerRecommendationApplyDirectly,\r\n edm,\r\n jsData,\r\n logTrace,\r\n importChannel,\r\n}) => ({\r\n SelectAdCustomizerFeedToImportExpandedTextAd: {\r\n description: 'Import_Recommendation_AddAdCustomizer_Description',\r\n buttonText: shouldAdCustomizerRecommendationApplyDirectly ? 'Import_Recommendation_AddToSchedule_ButtonText' : 'Import_Recommendation_GoToSettings_ButtonText',\r\n click: ({\r\n columnData, gridView,\r\n }) => {\r\n dismissCallout();\r\n if (shouldAdCustomizerRecommendationApplyDirectly) {\r\n logTrace('apply', 'SelectAdCustomizerFeedToImportExpandedTextAd');\r\n gridView.applyAdCustomizerFeedRecommendation(columnData, i18n.getString('Import_Recommendation_AddAdCustomizer_Notification'), edm, jsData, 'SelectAdCustomizerFeedToImportExpandedTextAd');\r\n } else {\r\n logTrace('redirect', 'SelectAdCustomizerFeedToImportExpandedTextAd');\r\n gridView.goToGoogleImportWizard({\r\n model: columnData, importStep: 'importOptionStep',\r\n });\r\n }\r\n },\r\n },\r\n ProvideStoreToImportShoppingCampaign: {\r\n description: 'Import_Recommendation_AddMerchantCenter_Description',\r\n buttonText: 'Import_Recommendation_GoToSettings_ButtonText',\r\n click: ({\r\n columnData, gridView,\r\n }) => {\r\n dismissCallout();\r\n logTrace('redirect', 'ProvideStoreToImportShoppingCampaign');\r\n gridView.goToGoogleImportWizard({\r\n model: columnData, importStep: 'importOptionStep',\r\n });\r\n },\r\n },\r\n EnableCurrencyConversion: {\r\n description: 'Import_Recommendation_EnableCurrencyConversion_Description',\r\n buttonText: 'Import_Recommendation_EnableCurrencyConversion_ButtonText',\r\n click: ({\r\n columnData, gridView,\r\n }) => {\r\n dismissCallout();\r\n logTrace('apply', 'EnableCurrencyConversion');\r\n gridView.applyCurrencyConversionRecommendation(columnData, i18n.getString('Import_Recommendation_EnableCurrencyConversion_Notification'), edm, jsData, 'EnableCurrencyConversion');\r\n },\r\n },\r\n EnableAutoFrequency: {\r\n description: importChannel === IMPORT_TYPE.googleimport ? 'Import_Recommendation_EnableAutoFrequency_Description' : 'Import_Recommendation_EnableAutoFrequency_Facebook_Description',\r\n buttonText: 'Import_Recommendation_ScheduleImport_ButtonText',\r\n click: ({\r\n columnData, gridView,\r\n }) => {\r\n dismissCallout();\r\n logTrace('apply', 'EnableAutoFrequency');\r\n gridView.applyAutoFrequencyRecommendation(columnData, i18n.getString('Import_Recommendation_EnableAutoFrequency_Notification'), edm, jsData, 'EnableAutoFrequency');\r\n },\r\n },\r\n AdjustAdGroupBidPrice: {\r\n description: 'Import_Recommendation_AdjustAdGroupBidPrice_Description',\r\n buttonText: 'Import_Recommendation_AdjustAdGroupBidPrice_ButtonText',\r\n click: ({\r\n columnData, gridView,\r\n }) => {\r\n dismissCallout();\r\n logTrace('apply', 'AdjustAdGroupBidPrice');\r\n gridView.applySetMinBidValueAdjustRecommendation(columnData, i18n.getString('Import_Recommendation_AdjustAdGroupBidPrice_Notification'), edm, jsData, 'AdjustAdGroupBidPrice');\r\n },\r\n },\r\n GetGoogleAdsPermission: {\r\n description: 'Import_Recommendation_GetGoogleAdsPermission_Description',\r\n buttonText: 'Import_Recommendation_GetGoogleAdsPermission_ButtonText',\r\n click: ({\r\n columnData, gridView,\r\n }) => {\r\n dismissCallout();\r\n logTrace('relogin', 'GetGoogleAdsPermission');\r\n gridView.applyGetGoogleAdsPermissionRecommendation(columnData, i18n.getString('Import_Recommendation_GetGoogleAdsPermission_Notification'), edm, jsData, 'GetGoogleAdsPermission');\r\n },\r\n },\r\n AccessTokenExpiring: {\r\n description: 'Import_Recommendation_AccessTokenExpiring_Description',\r\n buttonText: 'Import_Recommendation_AccessTokenExpiring_ButtonText',\r\n click: ({\r\n columnData, gridView,\r\n }) => {\r\n dismissCallout();\r\n logTrace('relogin', 'AccessTokenExpiring');\r\n gridView.applyAccessTokenExpiringRecommendation(columnData, i18n.getString('Import_Recommendation_AccessTokenExpiring_Notification'), edm, jsData, 'AccessTokenExpiring');\r\n },\r\n },\r\n});\r\n\r\nconst RecommendationCallout = (props) => {\r\n const shouldAdCustomizerRecommendationApplyDirectly =\r\n props.columnData.ImportUserPreference.ImportNewEntities && props.columnData.ImportUserPreference.ImportUpdatedEntities;\r\n const calloutConfig = getCalloutConfig({\r\n shouldAdCustomizerRecommendationApplyDirectly,\r\n i18n: props.i18n,\r\n edm: props.edm,\r\n jsData: props.jsData,\r\n logTrace: props.logTrace,\r\n importChannel: props.importChannel,\r\n });\r\n const recommendationArr = props.columnData[props.importRecommendationListName];\r\n const [popupTypeIndex, setPopupTypeIndex] = useState(0);\r\n\r\n props.logTrace('view', `${recommendationArr[popupTypeIndex]}`);\r\n\r\n return (\r\n
\r\n
\r\n \r\n {props.i18n.getString(calloutConfig[recommendationArr[popupTypeIndex]].description)}\r\n
\r\n
\r\n calloutConfig[recommendationArr[popupTypeIndex]].click(props)}\r\n onKeyDown={e =>\r\n submitEvent(() => calloutConfig[recommendationArr[popupTypeIndex]].click(props))(e, extend({ isKeyboardEvent: true }))}\r\n className=\"btn btn-default add-to-options\"\r\n disabled={props.isReadOnly && recommendationArr[popupTypeIndex] === 'SelectAdCustomizerFeedToImportExpandedTextAd'}\r\n >\r\n {props.i18n.getString(calloutConfig[recommendationArr[popupTypeIndex]].buttonText)}\r\n \r\n
\r\n {popupTypeIndex > 0 && ( {\r\n setPopupTypeIndex(popupTypeIndex - 1);\r\n }}\r\n />)}\r\n {popupTypeIndex < recommendationArr.length - 1 && ( {\r\n setPopupTypeIndex(popupTypeIndex + 1);\r\n }}\r\n />)}\r\n
\r\n
\r\n
);\r\n};\r\n\r\nRecommendationCallout.propTypes = {\r\n columnData: PropTypes.shape({\r\n GoogleImportTaskRecommendationList: PropTypes.array.isRequired,\r\n ImportUserPreference: PropTypes.shape({\r\n ImportNewEntities: PropTypes.bool,\r\n ImportUpdatedEntities: PropTypes.bool,\r\n }).isRequired,\r\n Id: PropTypes.number.isRequired,\r\n }).isRequired,\r\n i18n: PropTypes.shape({\r\n getString: PropTypes.func,\r\n }).isRequired,\r\n isReadOnly: PropTypes.bool.isRequired,\r\n jsData: PropTypes.shape({\r\n TaskItem: PropTypes.object,\r\n }).isRequired,\r\n edm: PropTypes.shape({\r\n currentAccount: PropTypes.any,\r\n currentCustomer: PropTypes.any,\r\n }).isRequired,\r\n logTrace: PropTypes.func.isRequired,\r\n importRecommendationListName: PropTypes.string.isRequired,\r\n importChannel: PropTypes.string.isRequired,\r\n};\r\n\r\nconst RecommendationCalloutMemo = React.memo(RecommendationCallout);\r\nexport const renderImportRecommondationCallout = ({\r\n gridView,\r\n event,\r\n i18n,\r\n calloutWidth,\r\n scope,\r\n isReadOnly,\r\n edm,\r\n jsData,\r\n}) => {\r\n event.stopPropagation();\r\n const columnData = gridView.getColumnData(event);\r\n const importRecommendationListName = importRecommendationListNameMap(columnData);\r\n const importChannel = importChannelNameMap(importRecommendationListName);\r\n const logTrace = (action, type) => {\r\n instrumentation.logMessage([constants.LOGCATEGORY.TRACE], constants.LOGLEVEL.INFO, '/campaign/importcampaign', `Import_Recommendation ${columnData.Id} ${action} ${type} ${importChannel}`);\r\n };\r\n\r\n logTrace('render', columnData[importRecommendationListName]);\r\n\r\n renderImportCallout({\r\n content: (\r\n \r\n ),\r\n target: event.target,\r\n popoverId: 'import-recommendation-callout',\r\n i18n,\r\n calloutWidth,\r\n hasCloseButton: false,\r\n });\r\n};\r\n","import { getBlackList, getDefaultImportOptionFields } from '@bingads-webui-campaign/import-components';\r\n\r\nexport const getSubFieldsBlackList = (permissions) => {\r\n const subFieldsBlacklist = getBlackList(permissions);\r\n\r\n // filter out some options for P0 requirement\r\n subFieldsBlacklist.push('ImportAccountUrlOptions');\r\n subFieldsBlacklist.push('ImportDeletedEntities');\r\n subFieldsBlacklist.push('ImportUpdateEntityPreference_UpdateAdGroupAndKeywordBids');\r\n subFieldsBlacklist.push('ImportUpdateEntityPreference_UpdateAdGroupAndKeywordBidStrategies');\r\n subFieldsBlacklist.push('ImportUpdateEntityPreference_UpdateCampaignBudget');\r\n subFieldsBlacklist.push('RaiseLowBidsToMinServingBidsForBsc');\r\n subFieldsBlacklist.push('AutoDeviceBidOptimization');\r\n // other options\r\n subFieldsBlacklist.push('ImportAppendDestUrlPreference_UseAppendString');\r\n subFieldsBlacklist.push('ImportAppendDestUrlPreference_AppendStringForDestinationUrl');\r\n subFieldsBlacklist.push('AppendPreferencesForTrackingTemplate_UseAppendString');\r\n subFieldsBlacklist.push('AppendPreferencesForTrackingTemplate_AppendStringForTrackingTemplate');\r\n subFieldsBlacklist.push('SearchAndReplacePreferencesForTrackingTemplate_UseSearchAndReplaceString');\r\n subFieldsBlacklist.push('SearchAndReplacePreferencesForTrackingTemplate_SearchStringForTrackingTemplate');\r\n subFieldsBlacklist.push('SearchAndReplacePreferencesForTrackingTemplate_ReplaceStringForTrackingTemplate');\r\n subFieldsBlacklist.push('SearchAndReplaceForCustomParameters_EnableSearchAndReplace');\r\n subFieldsBlacklist.push('SearchAndReplaceForCustomParameters_SearchString');\r\n subFieldsBlacklist.push('SearchAndReplaceForCustomParameters_ReplaceString');\r\n subFieldsBlacklist.push('SearchAndReplaceForFinalURLSuffix_EnableSearchAndReplace');\r\n subFieldsBlacklist.push('SearchAndReplaceForFinalURLSuffix_SearchString');\r\n subFieldsBlacklist.push('SearchAndReplaceForFinalURLSuffix_ReplaceString');\r\n subFieldsBlacklist.push('ImportUpdateEntityPreference_UpdateNameForExistingCampaigns');\r\n subFieldsBlacklist.push('ImportNewOption_ImportNewCampaignsAndMarkAsPaused');\r\n subFieldsBlacklist.push('ImportSearchAndDsaMixedCampaignAsSearchCampaign');\r\n subFieldsBlacklist.push('ImportPrefixAndSuffixForStringProperty_EnablePrefixAndSuffix');\r\n subFieldsBlacklist.push('ImportPrefixAndSuffixForStringProperty_SuffixString');\r\n subFieldsBlacklist.push('ImportSearchAndReplaceForStringProperty_EnableSearchAndReplace');\r\n subFieldsBlacklist.push('ImportSearchAndReplaceForStringProperty_SearchString');\r\n subFieldsBlacklist.push('ImportSearchAndReplaceForStringProperty_ReplaceString');\r\n subFieldsBlacklist.push('ImportNewOption_ImportAllAdUnderAnAdGroup');\r\n subFieldsBlacklist.push('PauseParentIfNoLocationSupported');\r\n subFieldsBlacklist.push('EnableParentLocationMapping');\r\n subFieldsBlacklist.push('StoreIdForImportedProductAdExtensionsFlag');\r\n subFieldsBlacklist.push('StoreIdForImportedProductAdExtensions');\r\n subFieldsBlacklist.push('StoreIdForImportedProductAdExtensions');\r\n subFieldsBlacklist.push('AutoDeviceBidOptimization');\r\n subFieldsBlacklist.push('PauseAIMAdGroupIfAllAudienceCriterionNotImported');\r\n subFieldsBlacklist.push('ImportNewOption_ImportNewImageAdExtensions');\r\n subFieldsBlacklist.push('ImportUpdateEntityPreference_UpdateImageAdExtensions');\r\n subFieldsBlacklist.push('RenameCampaignNameWithSuffix');\r\n\r\n return subFieldsBlacklist;\r\n};\r\n\r\nexport const importOptionFieldHelpIds = {\r\n ImportNewEntities: 'Pop_BA_Import_FB_ItemsNotPreviouslyImported',\r\n UpdateEntityPreferences: 'pop_BA_Import_PI_UpdateExistingItems',\r\n DefaultBidsBelowMinToAdCenterMinBid: 'pop_BA_Import_PI_SetUnknownBid',\r\n DefaultCampaignBudgetBelowMinToAdCenterMinBudget: 'pop_BA_Import_PI_IncreaseCampBudget',\r\n AdjustmentForBids_EnableAdjustment: 'Pop_BA_Import_FB_AdjustBidValue',\r\n AdjustmentForCampaignBudgets_EnableAdjustment: 'Pop_BA_Import_FB_AdjustBudgValue',\r\n ImportNewOption_ImportNewActiveEntitiesOnly: 'pop_BA_Import_FB_PauseCampaigns',\r\n};\r\n\r\nexport const getImportOptionFields = (params) => {\r\n const optionFields = getDefaultImportOptionFields({\r\n ...params,\r\n hideEntityAdvancedOptions: true,\r\n helpIds: importOptionFieldHelpIds,\r\n isPauseAdGroupIfNoLocationSupportedEnabled: true,\r\n isAudienceTargetForFBImportOptionEnabled: true,\r\n });\r\n return optionFields;\r\n};\r\n","/* eslint-disable no-undef */\r\n\r\nexport const StepConstants = {\r\n SignInStep: {\r\n path: 'signInStep',\r\n stepName: _TL_('Sign in to Pinterest Ads'),\r\n title: _TL_('Sign in to Pinterest Ads'),\r\n },\r\n ChooseAccounts: {\r\n path: 'chooseAccounts',\r\n stepName: _TL_('Choose accounts'),\r\n title: _TL_('Choose accounts'),\r\n },\r\n StartImportSmart: {\r\n path: 'startImport.smart',\r\n stepName: _TL_('Set schedule'),\r\n title: _TL_('You\\'re ready to start your import'),\r\n },\r\n PinterestCampaignStep: {\r\n path: 'pinterestCampaignStep',\r\n stepName: _TL_('Choose campaigns'),\r\n title: _TL_('Which campaigns do you want to import?'),\r\n },\r\n ImportSummaryStep: {\r\n path: 'importSummaryStep',\r\n title: _TL_('Import Summary'),\r\n },\r\n ImportOptionStep: {\r\n path: 'importOptionStep',\r\n stepName: _TL_('Choose items and options'),\r\n title: _TL_('Choose which items to import and the options to set for them.'),\r\n },\r\n StartImportAdvanced: {\r\n path: 'startImport.advanced',\r\n stepName: _TL_('Set schedule'),\r\n title: _TL_('Set schedule'),\r\n },\r\n ImportStatusStep: {\r\n path: 'importStatusStep',\r\n title: _TL_('Import Status'),\r\n },\r\n};\r\n","// import Promise from 'bluebird';\r\nimport { CommonImportRepository } from '@bingads-webui-campaign/import-shared-repositories';\r\nimport Promise from 'bluebird';\r\nimport { StringPayload } from '@bingads-webui/azure-upload';\r\nimport _ from 'underscore';\r\nimport { filterAndLocalizePinterestCampaignsUtil } from './pinterest-import-repository-utils';\r\n\r\nconst startPinterestSessionUrlTmpl = '/ImportSession/StartPinterestSession(CustomerId=:customer_id,AccountId=:account_id)?authCode={{AuthCode}}&redirectUri={{redirectUri}}';\r\nconst startPinterestSessionWithTokenUrlTmpl =\r\n 'ImportSession/StartPinterestSession(CustomerId=:customer_id,AccountId=:account_id)?refreshToken={{Token}}';\r\nconst pinterestAccountsUrlTmpl =\r\n '/ImportSession/PinterestAccounts(CustomerId=:customer_id,AccountId=:account_id,SessionId={{SessionId}})';\r\nconst pinterestCampaignsUrlTmpl =\r\n '/ImportSession/PinterestCampaigns(CustomerId=:customer_id,AccountId=:account_id,SessionId={{SessionId}})';\r\nconst keyNameOfSessionIdInCookie = 'OAuth2_PinterestImportSessionId';\r\nconst keyNameOfLoginAccountInCookie = 'OAuth2_PinterestLoginAccount';\r\nconst pinterestEntitiesBulkFileTypeNum = 17;\r\nconst importType = 'PinterestImport';\r\nconst pinterestAdsEntityBulkFileType = 'GoogleAdsEntityIdFile';\r\n\r\nexport class PinterestImportRepository extends CommonImportRepository {\r\n constructor({ deps }) {\r\n super({ deps, type: 'PinterestImport', importType });\r\n this.edm = deps.edm;\r\n this.jsData = deps.jsData;\r\n if (this.edm != null) {\r\n this.taskItemOptions = {\r\n adapter: 'odata',\r\n entitySet: this.edm.currentAccount.TaskItems,\r\n };\r\n }\r\n this.ccJsData = deps.ccJsData;\r\n }\r\n\r\n getPinterestSessionIdFromCookie() {\r\n return this.getValueInSubImportCookieByAccountId(keyNameOfSessionIdInCookie)[0];\r\n }\r\n\r\n isUserLoggedIn() {\r\n return !!this.getPinterestSessionIdFromCookie();\r\n }\r\n\r\n setPinterestImportAccountInfoInCookie({ loginAccount, sessionId }) {\r\n this.addSubCookieToImportCookie({\r\n [keyNameOfLoginAccountInCookie]: loginAccount,\r\n [keyNameOfSessionIdInCookie]: sessionId,\r\n });\r\n }\r\n\r\n startPinterestSessionInternal(url, notUpdateCookie = false) {\r\n return this.odata.post(url)\r\n .then(({ PinterestSessionId: sessionId, PinterestUsername: loginAccount }) => {\r\n if (sessionId && !notUpdateCookie) {\r\n this.setPinterestImportAccountInfoInCookie({\r\n sessionId,\r\n loginAccount,\r\n });\r\n return sessionId;\r\n }\r\n return sessionId;\r\n });\r\n }\r\n\r\n startPinterestSession(authCode, notUpdateCookie) {\r\n const url = startPinterestSessionUrlTmpl\r\n .replace('{{AuthCode}}', authCode)\r\n .replace(':account_id', this.aid)\r\n .replace('{{redirectUri}}', `${window.location.origin}/campaign/vnext/pinterestimport`);\r\n\r\n return this.startPinterestSessionInternal(url, notUpdateCookie);\r\n }\r\n\r\n startPinterestSessionWithToken(token) {\r\n const url = startPinterestSessionWithTokenUrlTmpl\r\n .replace('{{Token}}', token)\r\n .replace(':account_id', this.aid);\r\n\r\n return this.startPinterestSessionInternal(url);\r\n }\r\n\r\n logout() {\r\n this.removeImportCookieValue(keyNameOfSessionIdInCookie, keyNameOfLoginAccountInCookie);\r\n }\r\n\r\n getPinterestLoginAccountFromCookie() {\r\n return this.getValueInSubImportCookieByAccountId(keyNameOfLoginAccountInCookie)[0];\r\n }\r\n\r\n getPinterestAccountName() {\r\n return this.getPinterestLoginAccountFromCookie();\r\n }\r\n\r\n getPinterestAccounts() {\r\n const sessionId = this.getPinterestSessionIdFromCookie();\r\n const url = pinterestAccountsUrlTmpl\r\n .replace('{{SessionId}}', sessionId);\r\n\r\n return this.odata.get(url).then(accounts => _.map(accounts, account => ({\r\n ...account,\r\n Currency: String(account.Currency).toUpperCase(),\r\n })));\r\n }\r\n\r\n getSelectionDataFromBlob(blobName) {\r\n return this.getEntitiesBlob(blobName)\r\n .then(blob =>\r\n ({\r\n selectedCampaignIds: blob.CampaignIds,\r\n }));\r\n }\r\n\r\n getEntitiesBlob(blobName) {\r\n return this.getBulkBlob(blobName, pinterestEntitiesBulkFileTypeNum);\r\n }\r\n\r\n getPinterestCampaigns(pinterestAccountId) {\r\n const sessionId = this.getPinterestSessionIdFromCookie();\r\n let url = pinterestCampaignsUrlTmpl.replace('{{SessionId}}', sessionId);\r\n\r\n url = this.formatUrl({\r\n url,\r\n queryParameters: {\r\n ExternalAccountId: pinterestAccountId,\r\n },\r\n });\r\n\r\n return this.odata.get(url).then(data =>\r\n filterAndLocalizePinterestCampaignsUtil(data, this.deps.newI18n, this.logError));\r\n }\r\n\r\n prepareForCampaignSelectionStep(customerId, blobName) {\r\n const promises = {};\r\n promises.pinterestCampaigns = this.getPinterestCampaigns(customerId);\r\n\r\n if (blobName) {\r\n promises.selectionData = this.getSelectionDataFromBlob(blobName)\r\n .then((selectionData) => {\r\n const finalState = {};\r\n finalState.selectedCampaignIds = selectionData.selectedCampaignIds;\r\n return finalState;\r\n });\r\n }\r\n\r\n return Promise.props(promises)\r\n .then(({ pinterestCampaigns, selectionData }) => {\r\n const finalState = { pinterestCampaigns };\r\n if (selectionData) {\r\n const availableIdBoolMap = _.object(_.map(pinterestCampaigns, obj => [obj.Id, true]));\r\n const campaignIdFilter = ids => _.filter(ids, id => availableIdBoolMap[id]);\r\n const selectedCampaignIds = campaignIdFilter(selectionData.selectedCampaignIds);\r\n _.extend(finalState, {\r\n selectedCampaignIds: _.isEmpty(selectedCampaignIds) ? null : selectedCampaignIds,\r\n });\r\n }\r\n return finalState;\r\n });\r\n }\r\n\r\n getPinterestImportUserPreferences() {\r\n let preferences = {};\r\n\r\n return this.getImportUserPreferencesWithBMCandMinInfo('PinterestImport')\r\n .then((userPref) => {\r\n preferences = _.extend(preferences, userPref);\r\n\r\n return preferences;\r\n });\r\n }\r\n\r\n getPinterestImportInfoFromCookie() {\r\n const result = this.getValueInSubImportCookieByAccountId(\r\n keyNameOfSessionIdInCookie,\r\n keyNameOfLoginAccountInCookie\r\n );\r\n\r\n return {\r\n sessionId: result[0],\r\n pinterestAccountName: result[1],\r\n };\r\n }\r\n\r\n serializePinterestEntitiesSelectionDataToStringPayload(selectionData) {\r\n return new StringPayload({\r\n content: JSON.stringify({\r\n CampaignIds: selectionData.selectedCampaignIds,\r\n }),\r\n });\r\n }\r\n\r\n preparePinterestImportContext({\r\n pinterestCustomerId,\r\n initialPinterestAccount,\r\n pinterestEntitiesSelectionData,\r\n uid,\r\n }) {\r\n let sessionId;\r\n let pinterestAccountName;\r\n\r\n if (initialPinterestAccount) {\r\n ({ sessionId } = initialPinterestAccount);\r\n ({ pinterestAccountName } = initialPinterestAccount);\r\n } else {\r\n const info = this.getPinterestImportInfoFromCookie();\r\n\r\n ({ sessionId } = info);\r\n ({ pinterestAccountName } = info);\r\n\r\n if (!sessionId) {\r\n this.logTrace(`preparePinterestImportContext: failed to getPinterestImportInfoFromCookie with info ${JSON.stringify(info)}`);\r\n sessionId = this.getPinterestSessionIdFromCookie();\r\n pinterestAccountName = this.getPinterestAccountName();\r\n\r\n if (!sessionId) {\r\n this.logTrace(`preparePinterestImportContext: failed to getPinterestSessionIdFromCookie with sessionId ${sessionId} pinterestAccountName ${pinterestAccountName}`);\r\n }\r\n }\r\n }\r\n\r\n const pinterestImportContext = {\r\n '@odata.type': '#Model.PinterestImportContext',\r\n SessionId: sessionId,\r\n AccountId: pinterestCustomerId,\r\n AccountName: pinterestAccountName,\r\n PinterestSessionUserId: uid,\r\n };\r\n\r\n if (pinterestEntitiesSelectionData) {\r\n return this.uploadToAzureBlobViaOdata({\r\n bulkFileType: pinterestAdsEntityBulkFileType,\r\n // eslint-disable-next-line max-len\r\n payload: this.serializePinterestEntitiesSelectionDataToStringPayload(pinterestEntitiesSelectionData),\r\n }).then(blob =>\r\n ({\r\n ...pinterestImportContext,\r\n PinterestEntitiesBlobName: blob.BlobName,\r\n }));\r\n }\r\n\r\n return Promise.resolve(pinterestImportContext);\r\n }\r\n\r\n preparePinterestImportTaskItem({\r\n importOptions,\r\n stepState,\r\n }) {\r\n const {\r\n importUserPreferences = {},\r\n notificationType,\r\n notificationEmailAddresses,\r\n timeZoneId,\r\n name,\r\n cron,\r\n taskItemState,\r\n } = importOptions;\r\n\r\n const {\r\n pinterestCustomerId,\r\n initialPinterestAccount,\r\n pinterestEntitiesSelectionData,\r\n } = stepState;\r\n\r\n return this.preparePinterestImportContext({\r\n pinterestCustomerId,\r\n initialPinterestAccount,\r\n pinterestEntitiesSelectionData,\r\n uid: this.uid,\r\n })\r\n .then(pinterestImportContext =>\r\n (_.extend(\r\n this.prepareCompleteImportTaskItem(importUserPreferences, timeZoneId), {\r\n NotificationType: notificationType,\r\n NotificationEmailAddresses: notificationEmailAddresses,\r\n PinterestImportContext: pinterestImportContext,\r\n ImportType: importType,\r\n '@odata.type': '#Model.PinterestImportTaskItem',\r\n Type: `PinterestImport${this.testTypeSuffix}`,\r\n },\r\n // pass IsAutoFrequency and IsSmartImport if the properties exist\r\n _.pick(importOptions, 'IsAutoFrequency', 'IsSmartImport'),\r\n !!name && { Name: name },\r\n !!taskItemState && { State: taskItemState },\r\n !!cron && { Cron: cron }\r\n )));\r\n }\r\n}\r\n","import _ from 'underscore';\r\n\r\nexport const filterAndLocalizePinterestCampaignsUtil = (campaigns, i18n) => {\r\n const filteredAndLocalized = _.chain(campaigns)\r\n .filter((campaign) => {\r\n const status = campaign.Status;\r\n\r\n return status !== 'Draft' && status !== 'Delete' && status !== 'Deleted';\r\n })\r\n .map(({\r\n Id,\r\n Name,\r\n Status,\r\n }) => ({\r\n Id,\r\n Name,\r\n Status,\r\n Type: i18n.getString(_TL_('Audience')), // default type for Pinterest campaign\r\n }))\r\n .value();\r\n\r\n return filteredAndLocalized;\r\n};\r\n","import Promise from 'bluebird';\r\nimport _ from 'underscore';\r\nimport { getParameter } from '@bingads-webui/url-util';\r\n\r\nfunction getCode(windowObj) {\r\n try {\r\n const code = getParameter('code', windowObj.location.href);\r\n if (!_.isEmpty(code)) {\r\n return code;\r\n }\r\n return false;\r\n } catch (e) {\r\n return false;\r\n }\r\n}\r\n\r\nfunction showPopup(url, title, w, h, callback = _.noop, errorhandle = _.noop) {\r\n const windowWidth = w || 450;\r\n const windowHeight = h || 650;\r\n\r\n const { documentElement } = document;\r\n const { screen } = window;\r\n\r\n // Multi Screen Popup Positioning (http://stackoverflow.com/a/16861050)\r\n // Credit: http://www.xtf.dk/2011/08/center-new-popup-window-even-on.html\r\n // Fixes dual-screen position Most browsers Firefox\r\n const dualScreenLeft = window.screenLeft === undefined ? screen.left : window.screenLeft;\r\n const dualScreenTop = window.screenTop === undefined ? screen.top : window.screenTop;\r\n\r\n const width = window.innerWidth || documentElement.clientWidth || screen.width;\r\n const height = window.innerHeight || documentElement.clientHeight || screen.height;\r\n\r\n\r\n const left = ((width - windowWidth) / 2) + dualScreenLeft;\r\n const top = ((height - windowHeight) / 2) + dualScreenTop;\r\n\r\n const newWindow = window.open(url, title, `resizable=yes, height=${windowHeight},width=${windowWidth},left=${left},top=${top}`);\r\n\r\n newWindow.focus();\r\n const timer = setInterval(() => {\r\n if (newWindow.closed) {\r\n window.clearInterval(timer);\r\n errorhandle({ error: 'popup_closed_by_user' });\r\n } else {\r\n const code = getCode(newWindow);\r\n if (code) {\r\n window.clearInterval(timer);\r\n newWindow.close();\r\n callback(code);\r\n }\r\n }\r\n }, 100);\r\n}\r\n\r\nexport class PinterestLoginRepository {\r\n static CLIENT_ID = '1467464';\r\n static SCOPE = 'ads:read,user_accounts:read,pins:read,boards:read,pins:read_secret,boards:read_secret';\r\n static REDIRECTURI = `${window.location.origin}/campaign/vnext/pinterestimport`;\r\n\r\n constructor(config) {\r\n this.config = config;\r\n }\r\n\r\n login() {\r\n const state = encodeURIComponent(`callback&cid=${this.config.get('CurrentCustomer').Id}&uid=${this.config.get('CurrentUser').Id}&aid=${this.config.get('CurrentAccount').Id}`);\r\n const url = `https://www.pinterest.com/oauth/?scope=${PinterestLoginRepository.SCOPE}&response_type=code&client_id=${PinterestLoginRepository.CLIENT_ID}&redirect_uri=${PinterestLoginRepository.REDIRECTURI}&state=${state}`;\r\n return new Promise((resolve, reject) => {\r\n showPopup(url, 'Pinterest login', 400, 600, resolve, reject);\r\n });\r\n }\r\n\r\n logout() {\r\n }\r\n}\r\n","import { CommonPermissionFactory } from '@bingads-webui-campaign/import-shared-repositories';\r\n\r\nexport class PermissionFactory extends CommonPermissionFactory {\r\n constructor({\r\n permissions,\r\n }) {\r\n super({\r\n permissions,\r\n });\r\n\r\n this.permissions = permissions;\r\n }\r\n\r\n // TODO: enable the pilots when implementing for Pinterest\r\n IsImportSmartScheduleStepImprovementPhaseTwoEnabled = () => false;\r\n IsImportSmartScheduleStepPanelImprovementEnabled = () => false;\r\n IsImportSmartScheduleStepPanelDataRestoreImprovementEnabled = () => false;\r\n}\r\n","import _ from 'underscore';\r\nimport { withAccountSelectionStepPrefetch, handlePinterestLoginError } from '@bingads-webui-campaign/imports-core';\r\n\r\nconst prefetchConfig = {\r\n handleError: ({\r\n err,\r\n newI18n,\r\n handleGenericError,\r\n patchState,\r\n }) => {\r\n const msg = handlePinterestLoginError(err, newI18n);\r\n if (msg) {\r\n // this error will be shown in pinterest sign in step\r\n patchState({\r\n isLoggedIn: false,\r\n loginErrorMessage: msg,\r\n });\r\n } else {\r\n // this error will be shown on top of page\r\n handleGenericError(err);\r\n }\r\n },\r\n fetchAccounts: repository =>\r\n repository.getPinterestAccounts(),\r\n getExistingAccounts: context => context.pinterestAccounts,\r\n getExistingSelectedAccount: context => context.selectedAccounts,\r\n getSelectedAccounts: (accounts, initialSettings) => {\r\n let selectedAccounts = [];\r\n if (initialSettings.PinterestImportContext &&\r\n initialSettings.PinterestImportContext.AccountId) {\r\n const { AccountId } = initialSettings.PinterestImportContext;\r\n\r\n selectedAccounts = _.filter(accounts, item => item.Id === AccountId);\r\n }\r\n return selectedAccounts;\r\n },\r\n getNewStateAfterAccountsLoaded: (accounts, __, originalState) => ({\r\n ...originalState,\r\n pinterestAccounts: accounts,\r\n }),\r\n};\r\n\r\nexport const withPinterestImportAccountSelectionStepPrefetch = Step =>\r\n withAccountSelectionStepPrefetch(Step, prefetchConfig);\r\n","/* eslint-disable jsx-a11y/anchor-is-valid */\r\nimport React from 'react';\r\nimport $ from 'jquery';\r\nimport PropTypes from 'prop-types';\r\nimport classnames from 'classnames';\r\nimport { HelpLink } from '@bingads-webui-react/help-link';\r\nimport { ImportType, LoginDescription, handlePinterestLoginError } from '@bingads-webui-campaign/imports-core';\r\nimport { PrimaryButton, DefaultButton } from '@bingads-webui-react/fabric-with-signal';\r\nimport { withActivityContext } from '@bingads-webui-react/hoc-with-signal';\r\nimport { withDefaultStyles } from '@bingads-webui-react/with-default-styles';\r\nimport { withUiBlock } from '@bingads-webui/uiblocker';\r\n\r\nconst logoutResetData = {\r\n // account seletor page data\r\n selectedAccounts: [],\r\n pinterestAccounts: null,\r\n autoConvertCurrencyEnabled: true,\r\n\r\n // option page data\r\n importOptions: null,\r\n previousImportOptions: null,\r\n // campagin selector page data\r\n CampaignIds: null,\r\n pinterestEntitiesSelectionData: null,\r\n};\r\n\r\nfunction style() {\r\n return {\r\n descriptionBox: {\r\n fontSize: 14,\r\n lineHeight: '25px',\r\n marginBottom: 80,\r\n },\r\n link: {\r\n color: '#0078D4',\r\n textDecoration: 'underline',\r\n '& a.HelpTopic:focus': {\r\n outline: '1px solid #605e5c',\r\n },\r\n },\r\n errorMessage: {\r\n color: '#d13438',\r\n marginTop: 20,\r\n },\r\n buttonMargin: {\r\n marginTop: '10px',\r\n marginRight: '10px',\r\n },\r\n };\r\n}\r\n\r\nexport class UnstyledLoginContainer extends React.PureComponent {\r\n constructor(props) {\r\n super(props);\r\n this.deps = props.context.deps;\r\n this.repository = props.context.repository;\r\n this.loginRepository = props.context.loginRepository;\r\n this.goToNextStep = props.context.goToNextStep;\r\n this.handleGenericError = props.context.handleGenericError;\r\n this.patchState = props.context.patchState;\r\n this.newI18n = this.deps.newI18n;\r\n this.perfMarker = this.deps.perfMarker;\r\n this.loginPerfMarker = this.deps.loginPerfMarker;\r\n this.state = {\r\n errorMsg: null || props.context.loginErrorMessage,\r\n };\r\n }\r\n\r\n componentDidMount() {\r\n if (this.loginPerfMarker) {\r\n this.loginPerfMarker.done();\r\n }\r\n }\r\n\r\n loginToPinterest = () => {\r\n let startSessionPromise;\r\n if (this.deps.token) {\r\n startSessionPromise = this.repository.startPinterestSessionWithToken(this.deps.token);\r\n } else {\r\n startSessionPromise = this.loginRepository.login()\r\n .then(authCode => this.repository.startPinterestSession(authCode));\r\n }\r\n return startSessionPromise\r\n .then(() => this.toNextStep())\r\n .catch(this.handleError)\r\n .finally(withUiBlock($(`.${this.props.rootContainerClassName}`), this.newI18n.getString(_TL_('Loading'))));\r\n };\r\n\r\n logout = () => {\r\n this.repository.logout();\r\n this.patchState({\r\n isLoggedIn: false,\r\n ...logoutResetData,\r\n });\r\n };\r\n\r\n handleError = (res) => {\r\n this.setState({\r\n errorMsg: handlePinterestLoginError(res, this.newI18n),\r\n });\r\n };\r\n\r\n toNextStep = () => {\r\n const sessionId = this.repository.getPinterestSessionIdFromCookie();\r\n if (!sessionId) {\r\n this.logout();\r\n this.setState({\r\n errorMsg: handlePinterestLoginError({ error: 'pinterest_already_signed_out' }, this.newI18n),\r\n });\r\n return;\r\n }\r\n this.goToNextStep(this.props.nextStepPath);\r\n this.patchState({\r\n isLoggedIn: true,\r\n });\r\n };\r\n\r\n isLoggedIn = () => this.repository.isUserLoggedIn();\r\n\r\n render() {\r\n const { classes } = this.props;\r\n const isInActiveAccount = this.deps.config.get('CurrentAccountInActive');\r\n\r\n return (\r\n
\r\n
\r\n \r\n {this.newI18n.getString(_TL_('Get your campaigns up and running quickly by importing them directly from Pinterest Ads into Microsoft Advertising account.'))} \r\n \r\n \r\n {this.newI18n.getString(_TL_('Before you start, make sure you understand')) } \r\n \r\n \r\n { this.newI18n.getString(_TL_('what will be imported')) }.\r\n \r\n \r\n \r\n
\r\n
\r\n {this.isLoggedIn() ? (\r\n
\r\n \r\n \r\n
\r\n ) : (\r\n \r\n )}\r\n
\r\n
\r\n { isInActiveAccount && { this.newI18n.getString(_TL_('Imports can only be ran from active accounts.'))}}\r\n { this.state.errorMsg }\r\n
\r\n
\r\n );\r\n }\r\n}\r\n\r\nUnstyledLoginContainer.propTypes = {\r\n context: PropTypes.shape({\r\n loginRepository: PropTypes.shape({}).isRequired,\r\n deps: PropTypes.shape({\r\n logTrace: PropTypes.func,\r\n newI18n: PropTypes.shape({}),\r\n }).isRequired,\r\n loginErrorMessage: PropTypes.string,\r\n repository: PropTypes.shape({}).isRequired,\r\n patchState: PropTypes.func.isRequired,\r\n goToNextStep: PropTypes.func.isRequired,\r\n handleGenericError: PropTypes.func.isRequired,\r\n }).isRequired,\r\n classes: PropTypes.shape().isRequired,\r\n nextStepPath: PropTypes.string.isRequired, // eslint-disable-line\r\n rootContainerClassName: PropTypes.string.isRequired,\r\n};\r\n\r\nexport const LoginContainer = withDefaultStyles(\r\n withActivityContext(UnstyledLoginContainer),\r\n style\r\n);\r\n\r\nexport const renderDescription = (i18n, nextStepPath, repository) => {\r\n const signOut = (contextValues) => {\r\n const {\r\n goToNextStep,\r\n patchState,\r\n toggleImportType,\r\n } = contextValues;\r\n\r\n repository.logout();\r\n patchState({\r\n isLoggedIn: false,\r\n logOutButtonClicked: true,\r\n ...logoutResetData,\r\n });\r\n\r\n toggleImportType(ImportType.Smart);\r\n goToNextStep(nextStepPath);\r\n };\r\n\r\n return (\r\n \r\n );\r\n};\r\n","import React from 'react';\r\nimport PropTypes from 'prop-types';\r\nimport { Activity } from '@bingads-webui-react/hoc-with-signal';\r\nimport { ImportCoreContext, StepContainer } from '@bingads-webui-campaign/imports-core';\r\nimport { LoginContainer } from './login-container';\r\nimport { getActionBarItems } from './action-bar-config';\r\nimport { withLoginStepPrefetch } from './prefetch';\r\n\r\nfunction PinterestLoginStepWithoutPrefetch(props) {\r\n const { stepTitle, stepPrefetchHoc, rootContainerClassName } = props;\r\n const WrappedLoginContainer =\r\n stepPrefetchHoc ? stepPrefetchHoc(LoginContainer) : LoginContainer;\r\n\r\n return (\r\n \r\n {\r\n (contextValues) => {\r\n const { deps } = contextValues;\r\n const { getUniqueImportGUID } = deps;\r\n const uniqueImportId = (getUniqueImportGUID && getUniqueImportGUID()) || '';\r\n\r\n return (\r\n \r\n \r\n \r\n \r\n \r\n );\r\n }\r\n }\r\n \r\n );\r\n}\r\n\r\nPinterestLoginStepWithoutPrefetch.propTypes = {\r\n stepTitle: PropTypes.string.isRequired,\r\n nextStepPath: PropTypes.string.isRequired,\r\n stepPrefetchHoc: PropTypes.func,\r\n rootContainerClassName: PropTypes.string.isRequired,\r\n};\r\n\r\nPinterestLoginStepWithoutPrefetch.defaultProps = {\r\n stepPrefetchHoc: null,\r\n};\r\n\r\nexport const PinterestLoginStep = withLoginStepPrefetch(PinterestLoginStepWithoutPrefetch);\r\n\r\nexport { renderDescription } from './login-container';\r\n","export const getActionBarItems = () => {\r\n const config = [{\r\n type: 'button-cancel',\r\n }];\r\n\r\n return config;\r\n};\r\n","/* eslint-disable react-hooks/rules-of-hooks */\r\nimport React, { useContext, useState } from 'react';\r\nimport PropTypes from 'prop-types';\r\nimport $ from 'jquery';\r\nimport _ from 'underscore';\r\nimport { ImportCoreContext } from '@bingads-webui-campaign/imports-core';\r\nimport { withUiBlock } from '@bingads-webui/uiblocker';\r\n\r\nimport { StepConstants } from '../../page/step-config';\r\n\r\nexport const withLoginStepPrefetch = (PreExecuteStep) => {\r\n const LoginStepPrefetch = React.memo((props) => {\r\n const importCoreContext = useContext(ImportCoreContext);\r\n\r\n const {\r\n rootContainerClassName,\r\n } = props;\r\n\r\n const {\r\n deps,\r\n repository,\r\n patchState,\r\n pinterestAccounts: existingPinterestAccount,\r\n logOutButtonClicked = false,\r\n goToNextStep,\r\n } = importCoreContext;\r\n\r\n const {\r\n taskItemId,\r\n config,\r\n newI18n,\r\n scope,\r\n } = deps;\r\n\r\n if (!taskItemId) {\r\n return ;\r\n }\r\n\r\n const [loading, setLoading] = useState(true); // to notify api is loading.\r\n const [dispatchedOdataCall, setDispatchedOdataCall] = useState(false);\r\n\r\n let initialState = {};\r\n\r\n if (loading &&\r\n !dispatchedOdataCall &&\r\n (!logOutButtonClicked && !existingPinterestAccount)\r\n ) {\r\n setDispatchedOdataCall(true);\r\n repository.getImportTaskItem(deps.taskItemId)\r\n .then((taskItem) => {\r\n // in this case, if user has signed in on import schedule page, update session Id\r\n const currentUserId = _.propertyOf(config.get('CurrentUser'))('Id');\r\n\r\n if (taskItem.ModifiedBy.Id !== currentUserId) {\r\n const { cookieHelperForEditImport } = deps;\r\n const sessionId = cookieHelperForEditImport.getSessionId(deps.taskItemId);\r\n\r\n cookieHelperForEditImport.deleteCookie();\r\n if (sessionId) {\r\n taskItem.PinterestImportContext.SessionId = sessionId; // eslint-disable-line\r\n } else {\r\n repository.logTrace(`Edit task met different userid. currentUserId: ${currentUserId} and taskItem.ModifiedBy.Id:${taskItem.ModifiedBy.Id}`);\r\n repository.logout();\r\n taskItem.PinterestImportContext.SessionId = null; // eslint-disable-line\r\n }\r\n }\r\n\r\n initialState.initialSettings = taskItem;\r\n initialState.initialSettings.taskItemId = deps.taskItemId;\r\n // the name is from last import\r\n initialState.isNameEdit = true;\r\n initialState.isEditingScheduledImport = true;\r\n\r\n return taskItem;\r\n })\r\n .then((taskItem) => {\r\n const {\r\n AccountName,\r\n SessionId,\r\n } = taskItem.PinterestImportContext;\r\n\r\n if (SessionId) {\r\n repository.setPinterestImportAccountInfoInCookie({\r\n loginAccount: AccountName,\r\n sessionId: SessionId,\r\n });\r\n }\r\n })\r\n .then(() => {\r\n if (initialState && initialState.isEditingScheduledImport) {\r\n const {\r\n PinterestImportContext: {\r\n CampaignIds,\r\n PinterestEntitiesBlobName,\r\n },\r\n ImportUserPreference,\r\n IsAutoFrequency,\r\n IsSmartImport,\r\n TimeZoneId,\r\n Cron,\r\n NotificationEmailAddresses,\r\n NotificationType,\r\n Name,\r\n } = initialState.initialSettings;\r\n let autoConvertCurrencyEnabled = ImportUserPreference &&\r\n ImportUserPreference.EnableAutoCurrencyConversion;\r\n if (_.isUndefined(autoConvertCurrencyEnabled) ||\r\n _.isNull(autoConvertCurrencyEnabled)) {\r\n autoConvertCurrencyEnabled = true;\r\n }\r\n\r\n initialState = _.extend(initialState, {\r\n IsAutoFrequency: !!IsAutoFrequency,\r\n IsSmartImport: !!IsSmartImport,\r\n ImportUserPreference,\r\n TimeZoneId,\r\n Cron,\r\n NotificationEmailAddresses,\r\n NotificationType,\r\n Name,\r\n CampaignIds,\r\n PinterestEntitiesBlobName,\r\n autoConvertCurrencyEnabled,\r\n });\r\n }\r\n return StepConstants.SignInStep.path;\r\n })\r\n .then(() => {\r\n patchState(initialState);\r\n // Go directly to importStep if passed in.\r\n const { importStep } = scope.values;\r\n\r\n if (importStep) {\r\n goToNextStep(importStep);\r\n }\r\n setLoading(false);\r\n })\r\n .finally(withUiBlock($(`.${rootContainerClassName}`), newI18n.getString(_TL_('Loading'))));\r\n } else if (existingPinterestAccount || logOutButtonClicked) {\r\n return ();\r\n }\r\n\r\n return loading ? null : ;\r\n });\r\n\r\n LoginStepPrefetch.propTypes = {\r\n rootContainerClassName: PropTypes.string.isRequired,\r\n };\r\n\r\n return LoginStepPrefetch;\r\n};\r\n","export const getActionBarItems = ({\r\n shouldGoToNextStep,\r\n prevStepName,\r\n nextStepName,\r\n nextButtonDisabled,\r\n}) => {\r\n const config = [{\r\n type: 'button-back',\r\n prevStepName,\r\n }, {\r\n type: 'button-next',\r\n validateFunction: shouldGoToNextStep,\r\n nextStepName,\r\n disabled: !!nextButtonDisabled,\r\n }, {\r\n type: 'button-cancel',\r\n extraLeftPadding: true,\r\n }];\r\n\r\n return config;\r\n};\r\n","import React from 'react';\r\nimport PropTypes from 'prop-types';\r\nimport {\r\n ADD_COLUMN,\r\n REMOVE_COLUMN,\r\n AccountSelector\r\n} from '@bingads-webui-campaign/imports-core';\r\n\r\nexport function PinterestImportAccountSelector(props) {\r\n const getSelectedListColumns = i18n => ([{\r\n key: 'account-name',\r\n name: i18n.getString(_TL_('Account name')),\r\n fieldName: 'Name',\r\n }, {\r\n key: REMOVE_COLUMN,\r\n name: '',\r\n fieldName: REMOVE_COLUMN,\r\n }]);\r\n\r\n const getAccountListColumns = i18n => ([{\r\n key: 'account-name',\r\n name: i18n.getString(_TL_('Pinterest Ads account name')),\r\n fieldName: 'Name',\r\n minWidth: 100,\r\n maxWidth: 450,\r\n isResizable: true,\r\n }, {\r\n key: 'account-id',\r\n name: i18n.getString(_TL_('Pinterest Ads account ID')),\r\n fieldName: 'Id',\r\n minWidth: 170,\r\n maxWidth: 170,\r\n isResizable: false,\r\n }, {\r\n key: 'currency',\r\n name: i18n.getString(_TL_('Pinterest Ads currency')),\r\n fieldName: 'Currency',\r\n minWidth: 155,\r\n maxWidth: 155,\r\n isResizable: false,\r\n }, {\r\n key: ADD_COLUMN,\r\n name: i18n.getString(_TL_('Add Button')),\r\n headerClassName: 'account-selector-add-column-header',\r\n fieldName: ADD_COLUMN,\r\n minWidth: 70,\r\n maxWidth: 70,\r\n }]);\r\n\r\n const { pinterestAccounts } = props.context;\r\n\r\n // will remove this condition later once we want to enable multi-single conversion scenarios.\r\n const maxSelectedItems = 1;\r\n\r\n return (\r\n \r\n );\r\n}\r\n\r\nPinterestImportAccountSelector.propTypes = {\r\n context: PropTypes.shape({}).isRequired,\r\n};\r\n","import React from 'react';\r\nimport PropTypes from 'prop-types';\r\nimport _ from 'underscore';\r\nimport Promise from 'bluebird';\r\n\r\nimport { Activity } from '@bingads-webui-react/hoc-with-signal';\r\nimport { StepContainer, ImportCoreContext, ErrorContainer } from '@bingads-webui-campaign/imports-core';\r\n\r\nimport { getActionBarItems } from './action-bar-config';\r\nimport { PinterestImportAccountSelector as AccountSelector } from './account-selector';\r\n\r\nclass PinterestAccountStepInternal extends React.PureComponent {\r\n constructor(props) {\r\n super(props);\r\n this.state = {\r\n error: false,\r\n errorMsg: '',\r\n };\r\n this.WrappedAccountSelector =\r\n props.stepPrefetchHoc ? props.stepPrefetchHoc(AccountSelector) : AccountSelector;\r\n }\r\n\r\n componentDidUpdate() {\r\n const {\r\n contextValues,\r\n } = this.props;\r\n\r\n const {\r\n accountsPageError,\r\n } = contextValues;\r\n\r\n if (accountsPageError) {\r\n this.setError(accountsPageError);\r\n }\r\n }\r\n\r\n setError = msg => (\r\n this.setState({\r\n error: true,\r\n errorMsg: msg,\r\n })\r\n );\r\n\r\n clearError = () => (\r\n this.setState({\r\n error: false,\r\n })\r\n );\r\n\r\n validate = () => {\r\n const {\r\n contextValues,\r\n } = this.props;\r\n\r\n const {\r\n deps,\r\n selectedAccounts,\r\n } = contextValues;\r\n\r\n const i18n = deps.newI18n;\r\n\r\n if (_.isEmpty(selectedAccounts) || selectedAccounts.length === 0) {\r\n this.setError(i18n.getString(_TL_('Please choose a Pinterest Ads account')));\r\n return new Promise(resolve => resolve(false));\r\n }\r\n\r\n return new Promise(resolve => resolve(true));\r\n };\r\n\r\n render() {\r\n const {\r\n contextValues,\r\n stepTitle,\r\n prevStepName,\r\n nextStepName,\r\n prevStepNameIfPrefetchFail,\r\n nextStepNameIfPrefetchOnlyOneAccount,\r\n rootContainerClassName,\r\n isCurrencyConvertorDisabled,\r\n } = this.props;\r\n\r\n const { WrappedAccountSelector } = this;\r\n const { deps, accountsPageError, selectedAccounts } = contextValues;\r\n\r\n const { getUniqueImportGUID } = deps;\r\n\r\n const uniqueImportId = (getUniqueImportGUID && getUniqueImportGUID()) || '';\r\n\r\n const nextButtonDisabled = _.isEmpty(selectedAccounts);\r\n\r\n return (\r\n \r\n \r\n {/* the StepContainer asks for a single child */}\r\n \r\n \r\n {(this.state.error || accountsPageError)\r\n ? ()\r\n : null\r\n }\r\n \r\n \r\n \r\n );\r\n }\r\n}\r\n\r\nPinterestAccountStepInternal.propTypes = {\r\n contextValues: PropTypes.shape({}).isRequired,\r\n stepTitle: PropTypes.string.isRequired,\r\n prevStepName: PropTypes.string.isRequired,\r\n nextStepName: PropTypes.string.isRequired,\r\n stepPrefetchHoc: PropTypes.func,\r\n prevStepNameIfPrefetchFail: PropTypes.string.isRequired,\r\n nextStepNameIfPrefetchOnlyOneAccount: PropTypes.string.isRequired,\r\n rootContainerClassName: PropTypes.string,\r\n isCurrencyConvertorDisabled: PropTypes.bool,\r\n};\r\n\r\nPinterestAccountStepInternal.defaultProps = {\r\n stepPrefetchHoc: null,\r\n isCurrencyConvertorDisabled: false,\r\n rootContainerClassName: 'pinterest-import-root',\r\n};\r\n\r\nexport const PinterestAccountStep = React.memo(props => (\r\n \r\n {\r\n contextValues => (\r\n \r\n )\r\n }\r\n \r\n));\r\n","import _ from 'underscore';\r\n\r\nexport const getActionBarItems = ({\r\n i18n,\r\n startImporting,\r\n isReadOnly,\r\n scheduleOnly,\r\n onSwitchCustomizeMode,\r\n getPrevStepName,\r\n permissionFactory,\r\n}) => {\r\n const config = _.compact([{\r\n type: 'button-back',\r\n prevStepName: getPrevStepName(),\r\n }, {\r\n type: 'button',\r\n primary: true,\r\n className: 'start-import',\r\n text: scheduleOnly ? i18n.getString(_TL_('Set schedule')) : i18n.getString(_TL_('Start import')),\r\n onClick: startImporting,\r\n disabled: isReadOnly,\r\n },\r\n !(permissionFactory && permissionFactory.IsImportSmartScheduleStepImprovementEnabled && permissionFactory.IsImportSmartScheduleStepImprovementEnabled())\r\n && onSwitchCustomizeMode ? {\r\n type: 'button-link',\r\n className: 'customize-import-button',\r\n text: i18n.getString(_TL_('Advanced import')),\r\n onClick: onSwitchCustomizeMode,\r\n } : null,\r\n ]);\r\n\r\n return config;\r\n};\r\n","/* eslint-disable max-len */\r\nimport React, { useContext, useState } from 'react';\r\nimport PropTypes from 'prop-types';\r\nimport _ from 'underscore';\r\nimport $ from 'jquery';\r\nimport Promise from 'bluebird';\r\nimport { ImportCoreContext } from '@bingads-webui-campaign/imports-core';\r\nimport { withUiBlock } from '@bingads-webui/uiblocker';\r\n\r\nexport const withSmartImportStepPrefetch = (PreExecuteComponent) => {\r\n const SmartImportStepPrefetch = React.memo((props) => {\r\n const importCoreContext = useContext(ImportCoreContext);\r\n\r\n const {\r\n rootContainerClassName,\r\n } = props;\r\n\r\n const {\r\n deps,\r\n repository,\r\n patchState,\r\n selectedAccounts,\r\n previousImportOptions,\r\n PinterestEntitiesBlobName,\r\n isEditingScheduledImport,\r\n CampaignIds,\r\n accountToCampaignsOptionsMapping = {},\r\n ImportUserPreference,\r\n IsSmartImport,\r\n } = importCoreContext;\r\n\r\n const {\r\n i18n,\r\n toggleCampaignsSelectionStep,\r\n } = deps;\r\n\r\n const doAllAccountsHaveCampaign = ({\r\n accountsToCampaign,\r\n }) => {\r\n const accountIdsWithNoCampaign = [];\r\n\r\n _.each(accountsToCampaign, (campaigns, customerId) => {\r\n // for single account we get data as: { AccountId: { pinterestCampaigns: [] }}\r\n // eslint-disable-next-line no-param-reassign\r\n campaigns = campaigns.pinterestCampaigns;\r\n\r\n if ((campaigns && campaigns.length === 0) || _.isEmpty(campaigns)) {\r\n accountIdsWithNoCampaign.push(customerId);\r\n }\r\n });\r\n\r\n const accountWithNoCampaigns = [];\r\n\r\n if (accountIdsWithNoCampaign.length > 0) {\r\n _.each(accountIdsWithNoCampaign, (accountId) => {\r\n const accountMatchingCustomerId = _.filter(selectedAccounts, account => (account.Id === parseInt(accountId, 10)));\r\n\r\n if (accountMatchingCustomerId.length > 0) {\r\n accountWithNoCampaigns.push(accountMatchingCustomerId[0].Name);\r\n }\r\n });\r\n }\r\n\r\n // check if all the accounts have no campaings.\r\n // for single account this will always be 1.\r\n // for multiaccount all the accounts shouldn't have campaigns for us to hide the campaigns step.\r\n if (accountWithNoCampaigns.length === selectedAccounts.length) {\r\n return false;\r\n }\r\n\r\n return true;\r\n };\r\n\r\n const [loading, setLoading] = useState(true); // to notify api is loading.\r\n const [dispatchedOdataCall, setDispatchedOdataCall] = useState(false);\r\n\r\n const accountIdsToFetch = _.filter(selectedAccounts, account => !_.has(accountToCampaignsOptionsMapping, account.Id));\r\n\r\n if (loading &&\r\n !dispatchedOdataCall &&\r\n accountIdsToFetch.length !== 0\r\n ) {\r\n setDispatchedOdataCall(true);\r\n\r\n // promise object holding each\r\n // customerId : promise to getCampaigns\r\n // userPreference: promise to get options for the cid or aid.\r\n const promiseObject = {};\r\n\r\n const customerId = selectedAccounts[0].Id;\r\n\r\n promiseObject[customerId] = repository.prepareForCampaignSelectionStep(customerId, PinterestEntitiesBlobName);\r\n\r\n\r\n // if account change, previousImportOptions is null, we will call api to get it\r\n if (!previousImportOptions) {\r\n promiseObject.getUserPreferences = repository.getPinterestImportUserPreferences(selectedAccounts[0].Id);\r\n }\r\n\r\n Promise.props(promiseObject)\r\n // campaignState if it's editing schedule import:\r\n .then((result) => {\r\n const preferences = result.getUserPreferences;\r\n\r\n // remove the preference from promise result object\r\n // eslint-disable-next-line\r\n delete result.getUserPreferences;\r\n // already selected accounts\r\n const alreadySelectedPinterestAccounts = {};\r\n\r\n _.each(accountToCampaignsOptionsMapping, (mapping, cid) => {\r\n alreadySelectedPinterestAccounts[cid] = mapping.campaignsData;\r\n });\r\n\r\n // check if any of the accounts dont have campaigns.\r\n // if we have any accounts with no campaigns we skip the campaign selection step.\r\n const hasAccountsWithNoCampaigns = !doAllAccountsHaveCampaign({\r\n accountsToCampaign: { ...result, ...alreadySelectedPinterestAccounts },\r\n });\r\n\r\n // patch campaign selection data for editing scheduled import scenario\r\n const pinterestEntitiesSelectionData = {};\r\n const { pinterestCampaigns } = result[selectedAccounts[0].Id];\r\n\r\n // for single account mode we need additional data from getCampaigns call.\r\n const {\r\n selectedCampaignIds,\r\n } = result[selectedAccounts[0].Id];\r\n\r\n if (isEditingScheduledImport) {\r\n if (!selectedCampaignIds && CampaignIds) {\r\n pinterestEntitiesSelectionData.selectedCampaignIds = CampaignIds;\r\n }\r\n _.extend(\r\n pinterestEntitiesSelectionData,\r\n !!selectedCampaignIds && { selectedCampaignIds }\r\n );\r\n }\r\n\r\n // map each customer's customerId to their campaigns.\r\n _.each(result, (pinterestCampaingsForCustomerId, cid) => {\r\n accountToCampaignsOptionsMapping[cid] = {\r\n campaignsData: {\r\n ...pinterestCampaingsForCustomerId,\r\n },\r\n preference: {\r\n ...preferences,\r\n },\r\n };\r\n });\r\n\r\n let importOptions = preferences;\r\n if (isEditingScheduledImport && ImportUserPreference && !IsSmartImport) {\r\n importOptions = ImportUserPreference;\r\n }\r\n\r\n patchState({\r\n pinterestCampaigns,\r\n ...previousImportOptions ? {} : {\r\n previousImportOptions: preferences,\r\n importOptions,\r\n },\r\n pinterestEntitiesSelectionData,\r\n selectedAccounts,\r\n accountToCampaignsOptionsMapping,\r\n accountsPageError: null,\r\n hasAccountsWithNoCampaigns,\r\n CampaignIds: selectedCampaignIds,\r\n });\r\n\r\n if (hasAccountsWithNoCampaigns) {\r\n toggleCampaignsSelectionStep(false);\r\n } else {\r\n toggleCampaignsSelectionStep(true);\r\n }\r\n\r\n setLoading(false);\r\n })\r\n .finally(withUiBlock($(`.${rootContainerClassName}`), i18n.getString(_TL_('Loading'))));\r\n } else if (accountIdsToFetch.length === 0 && !dispatchedOdataCall) {\r\n const filteredAccountsToCampaign = {};\r\n\r\n _.each(accountToCampaignsOptionsMapping, (mapping, customerId) => {\r\n filteredAccountsToCampaign[customerId] = mapping.campaignsData;\r\n });\r\n\r\n const hasAccountsWithNoCampaigns = !doAllAccountsHaveCampaign({\r\n accountsToCampaign: filteredAccountsToCampaign,\r\n });\r\n\r\n const customerId = selectedAccounts[0].Id;\r\n\r\n const { pinterestCampaigns } = accountToCampaignsOptionsMapping[customerId].campaignsData;\r\n\r\n const { preference } = accountToCampaignsOptionsMapping[customerId];\r\n\r\n let importOptions = preference;\r\n if (isEditingScheduledImport && ImportUserPreference && !IsSmartImport) {\r\n importOptions = ImportUserPreference;\r\n }\r\n\r\n patchState({\r\n accountsPageError: null,\r\n pinterestCampaigns,\r\n hasAccountsWithNoCampaigns,\r\n ...previousImportOptions ? {} : {\r\n previousImportOptions: preference,\r\n importOptions,\r\n },\r\n });\r\n\r\n if (hasAccountsWithNoCampaigns) {\r\n toggleCampaignsSelectionStep(false);\r\n } else {\r\n toggleCampaignsSelectionStep(true);\r\n }\r\n\r\n return ();\r\n }\r\n\r\n return (\r\n
\r\n {\r\n loading ?
: \r\n }\r\n
\r\n );\r\n });\r\n\r\n SmartImportStepPrefetch.propTypes = {\r\n rootContainerClassName: PropTypes.string.isRequired,\r\n };\r\n\r\n return SmartImportStepPrefetch;\r\n};\r\n\r\n","\r\nimport $ from 'jquery';\r\nimport Promise from 'bluebird';\r\nimport { first, chain, once } from 'underscore';\r\nimport { Constants as CCUIConstants } from '@bingads-webui-clientcenter/entity-utils';\r\nimport { withUiBlock } from '@bingads-webui/uiblocker';\r\n\r\nconst FAC_STATUS_PICKEDUP = CCUIConstants.RecommendationAdoptionStatus.PickedUp;\r\n\r\nexport const createScheduledImportAndGoNextWhenReady = (\r\n taskItemBody,\r\n state\r\n) => {\r\n const { repository, deps } = state;\r\n let taskItemPromise;\r\n\r\n if (state.isEditingScheduledImport) {\r\n taskItemPromise = repository.updateScheduledImportTaskItem(\r\n taskItemBody,\r\n state.initialSettings.taskItemId\r\n );\r\n } else {\r\n taskItemPromise = repository.createScheduledImportTaskItem(taskItemBody);\r\n }\r\n\r\n // runnow/once/recurring jobs are all update coupon status.\r\n if (deps.calloutcardCoupon) {\r\n taskItemPromise = repository.updateCouponStatus(\r\n taskItemPromise,\r\n FAC_STATUS_PICKEDUP,\r\n true\r\n );\r\n }\r\n\r\n return taskItemPromise;\r\n};\r\n\r\nconst StartImportErrorCodes = {\r\n TaskSchedulingInvalid: _TL_('An error occured while saving the import. Time chosen to schedule the import is invalid.'),\r\n PinterestSyncApiInternalError: _TL_('Pinterest Advertising encountered an unexpected error. Please try restarting your import or contact Support.'),\r\n PinterestSyncThrottlingLimitReached: _TL_('Pinterest Advertising is currently limiting the number of import requests that can be made. Please try your import again later.'),\r\n PinterestSyncAccessDenied: _TL_('Pinterest Advertising has denied permission to import from the linked account. Please log out of Pinterest and try importing again, or contact Support.'),\r\n GenericImportError: _TL_('Microsoft Ads has encountered an error. Please try again later or contact support.'),\r\n};\r\n\r\nexport const createRunNowImportAndGoNextWhenReady = (\r\n taskItemBody,\r\n state,\r\n setImportStatus,\r\n getNextStepName,\r\n isRunNowImport\r\n) => {\r\n const {\r\n repository,\r\n deps,\r\n goToNextStep,\r\n patchState,\r\n } = state;\r\n\r\n let taskItemPromise = repository.createRunNowImportTaskItem(taskItemBody);\r\n // runnow/once/recurring jobs are all update coupon status.\r\n if (isRunNowImport && deps.calloutcardCoupon) {\r\n taskItemPromise = repository.updateCouponStatus(\r\n taskItemPromise,\r\n FAC_STATUS_PICKEDUP,\r\n true\r\n );\r\n }\r\n\r\n return taskItemPromise\r\n .then((response) => {\r\n deps.toggleShowImportStatusStep(true);\r\n\r\n setImportStatus({\r\n taskItemExecutionId: first(response.TaskItemExecutions).Id,\r\n });\r\n patchState({\r\n hideProgressList: true,\r\n });\r\n\r\n goToNextStep(getNextStepName({ isRunNowImport: true }));\r\n });\r\n};\r\n\r\nexport const formatTaskData = (contextValues, taskData) => {\r\n const {\r\n selectedAccounts,\r\n pinterestEntitiesSelectionData,\r\n CampaignIds,\r\n } = contextValues;\r\n const scheduleStepState = {\r\n pinterestCustomerId: selectedAccounts[0].Id,\r\n campaignIds: CampaignIds,\r\n pinterestEntitiesSelectionData,\r\n };\r\n return {\r\n ...taskData,\r\n scheduleStepState,\r\n };\r\n};\r\n\r\nexport const createImportAndGoNextWhenReady = ({\r\n state,\r\n generateTaskData,\r\n setImportStatus,\r\n activity,\r\n getNextStepName,\r\n rootContainerClassName,\r\n showErrorMessage,\r\n}) => {\r\n const {\r\n repository,\r\n patchState,\r\n goToNextStep,\r\n deps,\r\n } = state;\r\n\r\n const {\r\n isRunNowWithScheduledImport,\r\n isRunNowImport,\r\n isScheduledImport,\r\n scheduleStepState,\r\n importOptions,\r\n importOptionsRunnow,\r\n } = generateTaskData();\r\n\r\n // adopt import callout card recommendation\r\n const adoptResumeImportCalloutCardRecommendation = once((info) => {\r\n const { defaultLogActivity, odata, adoptResumeImportRecommendation } = deps;\r\n if (defaultLogActivity && odata && adoptResumeImportRecommendation) {\r\n adoptResumeImportRecommendation({ odata, loggerApi: defaultLogActivity, info });\r\n }\r\n });\r\n\r\n return Promise.resolve()\r\n .then(() => {\r\n if (isRunNowWithScheduledImport || isScheduledImport) {\r\n return repository.preparePinterestImportTaskItem({\r\n importOptions,\r\n stepState: scheduleStepState,\r\n }).then((scheduleBody) => {\r\n adoptResumeImportCalloutCardRecommendation(scheduleBody);\r\n return createScheduledImportAndGoNextWhenReady(\r\n scheduleBody,\r\n state\r\n );\r\n });\r\n }\r\n\r\n return Promise.resolve(true);\r\n })\r\n .then(() => {\r\n if (isRunNowImport || isRunNowWithScheduledImport) {\r\n return repository.preparePinterestImportTaskItem({\r\n importOptions: importOptionsRunnow,\r\n stepState: scheduleStepState,\r\n }).then((runNowBody) => {\r\n adoptResumeImportCalloutCardRecommendation(runNowBody);\r\n return createRunNowImportAndGoNextWhenReady(runNowBody, state, setImportStatus, getNextStepName, isRunNowImport) // eslint-disable-line\r\n });\r\n }\r\n patchState({\r\n hideProgressList: true,\r\n });\r\n deps.toggleShowImportSummary(true);\r\n\r\n goToNextStep(getNextStepName({ isRunNowImport: false }));\r\n return Promise.resolve(false);\r\n })\r\n .catch((errors) => {\r\n const ODataError = chain(errors)\r\n .result('responseJSON')\r\n .result('value')\r\n .result('0')\r\n .result('Code')\r\n .value();\r\n const errorMessage = StartImportErrorCodes[ODataError] ||\r\n StartImportErrorCodes.GenericImportError;\r\n\r\n showErrorMessage(deps.newI18n.getString(errorMessage));\r\n\r\n if (activity) {\r\n activity.signal(`step wizard encountered an error while importing - ${JSON.stringify(errors)}`);\r\n }\r\n })\r\n .finally(withUiBlock($(`.${rootContainerClassName}`), deps.newI18n.getString(_TL_('Loading'))));\r\n};\r\n","import React from 'react';\r\n\r\nimport { StartImportSmartStep as GeneralStartImportStep } from '@bingads-webui-campaign/imports-core';\r\n\r\nimport { StepConstants } from '../../page/step-config';\r\nimport { getActionBarItems } from './action-bar-config';\r\nimport { withSmartImportStepPrefetch } from './smart-import-step-prefetch';\r\nimport { createImportAndGoNextWhenReady } from '../helpers/create-schedule-runnow-job';\r\n\r\nconst getAdvancedCustomizingStepName = (hasAccountsWithNoCampaigns) => {\r\n if (hasAccountsWithNoCampaigns) {\r\n return StepConstants.ImportOptionStep.path;\r\n }\r\n return StepConstants.PinterestCampaignStep.path;\r\n};\r\n\r\nconst getPrevStepName = () => StepConstants.ChooseAccounts.path;\r\n\r\nconst getNextStepName = ({ isRunNowImport }) => {\r\n if (isRunNowImport) {\r\n return StepConstants.ImportStatusStep.path;\r\n }\r\n return StepConstants.ImportSummaryStep.path;\r\n};\r\n\r\nconst formatTaskData = (contextValues, taskData) => {\r\n const {\r\n selectedAccounts,\r\n } = contextValues;\r\n const scheduleStepState = {\r\n pinterestCustomerId: selectedAccounts[0].Id,\r\n campaignIds: [],\r\n pinterestEntitiesSelectionData: null,\r\n };\r\n return {\r\n ...taskData,\r\n scheduleStepState,\r\n };\r\n};\r\n\r\nexport const StartImportSmartStep = props => (\r\n \r\n);\r\n","import { StepConstants } from '../../page/step-config';\r\n\r\nexport const getActionBarItems = (\r\n shouldGoToNextStep,\r\n shouldGoToPreviousStep,\r\n hasAccountsWithNoCampaigns\r\n) => {\r\n const config = [{\r\n type: 'button-back',\r\n validateFunction: shouldGoToPreviousStep,\r\n prevStepName: hasAccountsWithNoCampaigns ?\r\n StepConstants.StartImportSmart.path :\r\n StepConstants.PinterestCampaignStep.path,\r\n }, {\r\n type: 'button-next',\r\n validateFunction: shouldGoToNextStep,\r\n nextStepName: StepConstants.StartImportAdvanced.path,\r\n }, {\r\n type: 'button-cancel',\r\n extraLeftPadding: true,\r\n }];\r\n\r\n return config;\r\n};\r\n","import React from 'react';\r\nimport PropTypes from 'prop-types';\r\nimport { ImportOptionsStep } from '@bingads-webui-campaign/imports-core';\r\nimport { getActionBarItems } from './action-bar-config';\r\nimport { withSmartImportStepPrefetch } from '../start-smart-import-step/smart-import-step-prefetch';\r\nimport { withPinterestImportAccountSelectionStepPrefetch } from '../pinterest-account-step/prefetch';\r\nimport { StepConstants } from '../../page/step-config';\r\nimport { getImportOptionFields, getSubFieldsBlackList } from './pinterest-import-option-config';\r\n\r\nconst PinterestImportOptionsStepWithoutHOCs = props => (\r\n \r\n);\r\n\r\nPinterestImportOptionsStepWithoutHOCs.propTypes = {\r\n permissions: PropTypes.shape({}).isRequired,\r\n};\r\n\r\nexport const PinterestImportOptionsStep =\r\n // eslint-disable-next-line\r\n withPinterestImportAccountSelectionStepPrefetch(withSmartImportStepPrefetch(PinterestImportOptionsStepWithoutHOCs));\r\n","import { StepConstants } from '../../page/step-config';\r\n\r\nexport const getActionBarItems = (\r\n i18n,\r\n startImporting,\r\n isReadOnly,\r\n scheduleOnly\r\n) => {\r\n const config = [{\r\n type: 'button-back',\r\n prevStepName: StepConstants.ImportOptionStep.path,\r\n }, {\r\n type: 'button',\r\n primary: true,\r\n className: 'start-import',\r\n text: scheduleOnly ? i18n.getString(_TL_('Set schedule')) : i18n.getString(_TL_('Start import')),\r\n onClick: startImporting,\r\n disabled: isReadOnly,\r\n }, {\r\n type: 'button-cancel',\r\n extraLeftPadding: true,\r\n }];\r\n\r\n return config;\r\n};\r\n","import React from 'react';\r\nimport {\r\n StartImportAdvancedStep as GeneralStartImportAdvancedStep,\r\n} from '@bingads-webui-campaign/imports-core';\r\nimport { getActionBarItems } from './action-bar-config';\r\nimport { StepConstants } from '../../page/step-config';\r\nimport { formatTaskData, createImportAndGoNextWhenReady } from '../helpers/create-schedule-runnow-job';\r\n\r\nexport const getNextStepName = ({ isRunNowImport }) => (isRunNowImport\r\n ? StepConstants.ImportStatusStep.path\r\n : StepConstants.ImportSummaryStep.path);\r\n\r\nexport const StartImportAdvancedStep = props => (\r\n \r\n);\r\n","import $ from 'jquery';\r\nimport _ from 'underscore';\r\nimport { withUiBlock } from '@bingads-webui/uiblocker';\r\nimport { notificationApi, NotificationLevel } from '@bingads-webui-react/notification-center';\r\n\r\nexport const onSavePinterestImportScheduleInfo = ({\r\n contextValues,\r\n tasks,\r\n displaystring,\r\n onEditScheduleClose,\r\n}) => {\r\n const { scheduledTaskItemBody } = tasks;\r\n const {\r\n Name,\r\n isNameEdit,\r\n getStateValue,\r\n patchState,\r\n repository,\r\n deps,\r\n IsSmartImport,\r\n importOptions: importUserPreferences,\r\n pinterestEntitiesSelectionData,\r\n } = contextValues;\r\n\r\n const { i18n } = deps;\r\n\r\n const scheduleStepState = {\r\n pinterestCustomerId: getStateValue('selectedAccounts')[0].Id,\r\n pinterestEntitiesSelectionData: IsSmartImport ? null : pinterestEntitiesSelectionData,\r\n };\r\n\r\n const importOptions = {\r\n notificationType: scheduledTaskItemBody.NotificationType,\r\n notificationEmailAddresses: scheduledTaskItemBody.NotificationEmailAddresses,\r\n timeZoneId: scheduledTaskItemBody.TimeZoneId,\r\n name: isNameEdit ? Name : scheduledTaskItemBody.defaultName,\r\n cron: scheduledTaskItemBody.Cron,\r\n IsAutoFrequency: scheduledTaskItemBody.IsAutoFrequency,\r\n IsSmartImport,\r\n importUserPreferences: IsSmartImport ? null : importUserPreferences,\r\n };\r\n\r\n if (scheduledTaskItemBody) {\r\n repository.preparePinterestImportTaskItem({\r\n importOptions,\r\n stepState: scheduleStepState,\r\n })\r\n .then(finalBody => (\r\n repository.createScheduledImportTaskItem(finalBody)\r\n ))\r\n .then(() => {\r\n notificationApi.add({\r\n severity: NotificationLevel.Confirmation,\r\n title: '',\r\n message: i18n.get('Scheduled_Import_Summary_Header').replace('{0}', displaystring),\r\n target: 'FloatingBanner',\r\n });\r\n patchState({\r\n isRunNowImport: false,\r\n isRunNowWithScheduledImport: true,\r\n Name: isNameEdit ? Name : scheduledTaskItemBody.defaultName,\r\n scheduleSummaryString: displaystring,\r\n });\r\n onEditScheduleClose();\r\n })\r\n .finally(withUiBlock(\r\n /* target */ $('.schedule-setting-editor-panel .panel-content'),\r\n /* loadingText */ i18n.getString('Loading'),\r\n /* shouldFocus */ _,\r\n /* delayedLoading */ _,\r\n /* overlayZIndex */ '1010'\r\n ));\r\n }\r\n};\r\n","import {\r\n parseCronToDisplayString,\r\n ImportSchedulingOptions,\r\n} from '@bingads-webui-campaign/imports-core';\r\n\r\nexport const getPinterestImportDetailsView = (contextValues) => {\r\n const {\r\n deps,\r\n getStateValue,\r\n IsAutoFrequency,\r\n TimeZoneId,\r\n Cron,\r\n repository,\r\n isScheduledImport,\r\n isRunNowWithScheduledImport,\r\n selectedAccounts,\r\n } = contextValues;\r\n\r\n const importSchedulingOptions = new ImportSchedulingOptions(deps.i18n);\r\n\r\n\r\n const { config, newI18n } = deps;\r\n const scheduleSummaryString = getStateValue('scheduleSummaryString') || parseCronToDisplayString(\r\n deps.newI18n,\r\n IsAutoFrequency,\r\n Cron,\r\n TimeZoneId,\r\n importSchedulingOptions,\r\n false,\r\n deps.timeZoneMapper\r\n );\r\n\r\n const frequencyStat = scheduleSummaryString;\r\n\r\n const importDetails = [{\r\n label: newI18n.getString(_TL_('Import name')),\r\n value: getStateValue('Name'),\r\n labelClassName: 'import-name',\r\n }, {\r\n label: newI18n.getString(_TL_('Pinterest account')),\r\n value: repository.getPinterestAccountName(),\r\n labelClassName: 'import-pinterest-email import-email',\r\n }, {\r\n label: newI18n.getString(_TL_('Pinterest Ads account')),\r\n value: selectedAccounts[0].Name,\r\n labelClassName: 'import-pinterest-account-name import-account-name',\r\n }, {\r\n label: newI18n.getString(_TL_('Microsoft Advertising account')),\r\n value: config.get('CurrentAccount').Title,\r\n labelClassName: 'import-microsoft-account-name',\r\n }, (isScheduledImport || isRunNowWithScheduledImport) && {\r\n label: newI18n.getString(_TL_('Schedule and frequency')),\r\n value: frequencyStat,\r\n labelClassName: 'import-schedule-and-frequency',\r\n }];\r\n\r\n return importDetails;\r\n};\r\n","import React from 'react';\r\nimport { ImportSummaryPage as GenericImportSummaryPage } from '@bingads-webui-campaign/imports-core';\r\nimport { onSavePinterestImportScheduleInfo } from './save-schedule-info';\r\nimport { getPinterestImportDetailsView } from './get-import-details-view';\r\n\r\nconst errorMessage = _TL_('Note: Some of your data might have been skipped or modified during import because of differences between Microsoft Advertising and Pinterest Ads.');\r\nconst learnMoreText = _TL_('Learn more about importing campaigns from Pinterest Ads.');\r\nconst noCampaignAlert = _TL_('We were unable to import any campaigns from this account. Going forward, we\\'ll keep your Pinterest Ads account in sync with this Microsoft Advertising account.');\r\nconst cardPanelTitles = {\r\n Additions: _TL_('New items imported from Pinterest Ads'),\r\n};\r\n\r\nexport const PinterestImportSummaryStep = props => (\r\n \r\n);\r\n","import React from 'react';\r\n\r\nimport {\r\n ImportStatusStep as GeneralImportStatusStep,\r\n} from '@bingads-webui-campaign/imports-core';\r\n\r\nimport { StepConstants } from '../../page/step-config';\r\n\r\nexport const ImportStatusStep = props => (\r\n \r\n);\r\n","import React from 'react';\r\nimport PropTypes from 'prop-types';\r\nimport { VerticalSeparatedLayout } from '@bingads-webui-react/steps';\r\nimport { ImportType, CampaignSelectionStep } from '@bingads-webui-campaign/imports-core';\r\n\r\nimport { withPinterestImportAccountSelectionStepPrefetch } from '../steps/pinterest-account-step/prefetch';\r\nimport { StepConstants } from './step-config';\r\nimport { PinterestLoginStep, renderDescription } from '../steps/pinterest-login-step';\r\nimport { PinterestAccountStep } from '../steps/pinterest-account-step';\r\nimport { StartImportSmartStep } from '../steps/start-smart-import-step';\r\nimport { PinterestImportOptionsStep } from '../steps/pinterest-import-option-step';\r\nimport { StartImportAdvancedStep } from '../steps/start-import-advanced-step';\r\nimport { PinterestImportSummaryStep } from '../steps/pinterest-import-summary-step';\r\nimport { ImportStatusStep } from '../steps/import-status-step';\r\n\r\nconst {\r\n Step,\r\n} = VerticalSeparatedLayout;\r\n\r\nexport const getPinterestLoginStep = ({\r\n i18n,\r\n repository,\r\n rootContainerClassName,\r\n}) => {\r\n const title = i18n.getString(StepConstants.SignInStep.stepName);\r\n const { path } = StepConstants.SignInStep;\r\n return (\r\n renderDescription(i18n, StepConstants.SignInStep.path, repository)}\r\n >\r\n \r\n \r\n );\r\n};\r\n\r\ngetPinterestLoginStep.propTypes = {\r\n i18n: PropTypes.shape({}).isRequired,\r\n repository: PropTypes.shape({}).isRequired,\r\n rootContainerClassName: PropTypes.string.isRequired,\r\n};\r\n\r\nexport const getPinterestAccountStep = ({\r\n i18n,\r\n rootContainerClassName,\r\n}) => {\r\n const title = i18n.getString(StepConstants.ChooseAccounts.stepName);\r\n const { path } = StepConstants.ChooseAccounts;\r\n const prevStepName = StepConstants.SignInStep.path;\r\n const nextStepName = StepConstants.StartImportSmart.path;\r\n return (\r\n \r\n \r\n \r\n );\r\n};\r\n\r\ngetPinterestAccountStep.propTypes = {\r\n i18n: PropTypes.shape({}).isRequired,\r\n rootContainerClassName: PropTypes.string.isRequired,\r\n};\r\n\r\nexport const getStartImportSmartStep = ({\r\n i18n,\r\n getImportType,\r\n setImportStatus,\r\n rootContainerClassName,\r\n}) => {\r\n const title = i18n.getString(StepConstants.StartImportSmart.stepName);\r\n const { path } = StepConstants.StartImportSmart;\r\n const isEnabled = getImportType() === ImportType.Smart;\r\n return (\r\n \r\n \r\n \r\n );\r\n};\r\ngetStartImportSmartStep.propTypes = {\r\n i18n: PropTypes.shape({}).isRequired,\r\n getImportType: PropTypes.func.isRequired,\r\n setImportStatus: PropTypes.func.isRequired,\r\n rootContainerClassName: PropTypes.string.isRequired,\r\n};\r\n\r\nexport const getPinterestCampaignStep = ({\r\n i18n,\r\n getImportType,\r\n showCampaignSelectionStep,\r\n rootContainerClassName,\r\n repository,\r\n permissions,\r\n}) => {\r\n const title = i18n.getString(StepConstants.PinterestCampaignStep.stepName);\r\n const { path } = StepConstants.PinterestCampaignStep;\r\n const isEnabled = getImportType() === ImportType.Advanced && showCampaignSelectionStep;\r\n\r\n return (\r\n \r\n \r\n repository.getPinterestCampaigns(selectedAccount.Id)}\r\n entitiesSelectionDataName=\"pinterestEntitiesSelectionData\"\r\n permissions={permissions}\r\n />\r\n \r\n );\r\n};\r\n\r\ngetPinterestCampaignStep.propTypes = {\r\n i18n: PropTypes.shape({}).isRequired,\r\n getImportType: PropTypes.func.isRequired,\r\n showCampaignSelectionStep: PropTypes.bool.isRequired,\r\n rootContainerClassName: PropTypes.string.isRequired,\r\n repository: PropTypes.shape({}).isRequired,\r\n permissions: PropTypes.shape({}).isRequired,\r\n};\r\n\r\nexport const getPinterestImportOptionsStep = ({\r\n i18n,\r\n deps,\r\n getImportType,\r\n permissions,\r\n rootContainerClassName,\r\n}) => {\r\n const title = i18n.getString(StepConstants.ImportOptionStep.stepName);\r\n const { path } = StepConstants.ImportOptionStep;\r\n const isEnabled = getImportType() === ImportType.Advanced;\r\n const importAccountCurrencyTitle = i18n.getString(_TL_('Pinterest Ads:'));\r\n\r\n return (\r\n \r\n \r\n \r\n );\r\n};\r\n\r\ngetPinterestImportOptionsStep.propTypes = {\r\n i18n: PropTypes.shape({}).isRequired,\r\n deps: PropTypes.shape({}).isRequired,\r\n getImportType: PropTypes.func.isRequired,\r\n permissions: PropTypes.shape({}).isRequired,\r\n rootContainerClassName: PropTypes.string.isRequired,\r\n};\r\n\r\nexport const getStartImportAdvancedStep = ({\r\n i18n,\r\n getImportType,\r\n setImportStatus,\r\n rootContainerClassName,\r\n}) => {\r\n const title = i18n.getString(StepConstants.StartImportAdvanced.stepName);\r\n const { path } = StepConstants.StartImportAdvanced;\r\n const isEnabled = getImportType() === ImportType.Advanced;\r\n return (\r\n \r\n \r\n \r\n );\r\n};\r\n\r\ngetStartImportAdvancedStep.propTypes = {\r\n i18n: PropTypes.shape({}).isRequired,\r\n getImportType: PropTypes.func.isRequired,\r\n setImportStatus: PropTypes.func.isRequired,\r\n rootContainerClassName: PropTypes.string.isRequired,\r\n};\r\n\r\nexport const getImportSummaryStep = ({\r\n i18n,\r\n showImportSummary,\r\n}) => {\r\n const title = i18n.getString(StepConstants.ImportSummaryStep.title);\r\n const { path } = StepConstants.ImportSummaryStep;\r\n return (\r\n \r\n \r\n \r\n );\r\n};\r\n\r\ngetImportSummaryStep.propTypes = {\r\n i18n: PropTypes.shape({}).isRequired,\r\n showImportSummary: PropTypes.bool.isRequired,\r\n};\r\n\r\nexport const getImportStatusStep = ({\r\n i18n,\r\n getImportStatus,\r\n showImportStatusStep,\r\n rootContainerClassName,\r\n}) => {\r\n const title = i18n.getString(StepConstants.ImportStatusStep.title);\r\n const { path } = StepConstants.ImportStatusStep;\r\n\r\n return (\r\n \r\n \r\n \r\n );\r\n};\r\n\r\ngetImportStatusStep.propTypes = {\r\n i18n: PropTypes.shape({}).isRequired,\r\n getImportStatus: PropTypes.func.isRequired,\r\n showImportStatusStep: PropTypes.bool.isRequired,\r\n rootContainerClassName: PropTypes.string.isRequired,\r\n};\r\n","import React from 'react';\r\nimport PropTypes from 'prop-types';\r\nimport Promise from 'bluebird';\r\n// import $ from 'jquery';\r\nimport { BaseImportCore, checkRequiredDeps, ImportType, ImportMode } from '@bingads-webui-campaign/imports-core';\r\nimport { perfMarkerPropTypes } from '@bingads-webui/performance-marker';\r\n// import { Constants as CCUIConstants } from '@bingads-webui-clientcenter/entity-utils';\r\n// import { withUiBlock } from '@bingads-webui/uiblocker';\r\nimport { Scenario } from '@bingads-webui-react/hoc-with-signal';\r\nimport { generateGuid } from '@bingads-webui-universal/primitive-utilities';\r\nimport { importOptionFieldHelpIds } from '../steps/pinterest-import-option-step/pinterest-import-option-config';\r\nimport { StepConstants } from './step-config';\r\nimport { PinterestImportRepository, PinterestLoginRepository, PermissionFactory } from '../repository';\r\n\r\nimport {\r\n getPinterestLoginStep,\r\n getPinterestAccountStep,\r\n getStartImportSmartStep,\r\n getPinterestCampaignStep,\r\n getPinterestImportOptionsStep,\r\n getStartImportAdvancedStep,\r\n getImportSummaryStep,\r\n getImportStatusStep,\r\n} from './step-factory';\r\n\r\nfunction checkRequiredDepsForPinterestImport(deps) {\r\n checkRequiredDeps(deps);\r\n deps.check('edm');\r\n deps.check('jsData');\r\n deps.check('cookieHelperForEditImport');\r\n}\r\n\r\nconst rootContainerClassName = 'pinterest-import-root';\r\n\r\nexport class PinterestImportPage extends React.PureComponent {\r\n constructor(props) {\r\n super(props);\r\n this.perfMarker = props.perfMarker;\r\n this.steps = [];\r\n this.state = {\r\n isInit: false,\r\n importType: ImportType.Smart,\r\n importMode: ImportMode.Single,\r\n showImportSummary: false, // eslint-disable-line\r\n showImportStatusStep: false, // eslint-disable-line\r\n importStatus: null,\r\n startStep: StepConstants.SignInStep, // pinterest-login-step\r\n hideProgressList: false,\r\n showCampaignSelectionStep: true, // eslint-disable-line\r\n uniqueImportGUID: generateGuid(),\r\n };\r\n this.initialize(props);\r\n }\r\n\r\n componentDidUpdate = (prevProps) => {\r\n if (prevProps.location.key !== this.props.location.key) {\r\n // eslint-disable-next-line\r\n this.setState({\r\n isInit: false,\r\n importType: ImportType.Smart,\r\n importMode: ImportMode.Single,\r\n showImportSummary: false, // eslint-disable-line\r\n showImportStatusStep: false, // eslint-disable-line\r\n importStatus: null,\r\n startStep: StepConstants.SignInStep,\r\n hideProgressList: false,\r\n showCampaignSelectionStep: true, // eslint-disable-line\r\n uniqueImportGUID: generateGuid(),\r\n });\r\n this.initialState = {};\r\n this.initialize(prevProps);\r\n }\r\n }\r\n\r\n getUniqueImportGUID = () => this.state.uniqueImportGUID;\r\n\r\n getImportType = () => this.state.importType;\r\n\r\n setImportStatus = (status) => {\r\n this.setState({\r\n importStatus: status,\r\n });\r\n }\r\n\r\n getImportStatus = () => this.state.importStatus;\r\n\r\n getImportMode = () => this.state.importMode;\r\n\r\n getImportScope = () => this.state.ImportScope;\r\n\r\n logTrace(...args) {\r\n this.repository.logTrace(...args);\r\n }\r\n\r\n initialize = (props) => {\r\n this.perfMarker.willFetchData();\r\n\r\n // don't take reject param, if coupon call fails, we will just not show the offer\r\n Promise.resolve().then(() => {\r\n checkRequiredDepsForPinterestImport(props.deps);\r\n this.deps = props.deps;\r\n\r\n // Deps.\r\n this.deps.newI18n = this.props.i18n;\r\n this.deps.importStatus = this.state.importStatus;\r\n this.deps.perfMarker = this.props.perfMarker;\r\n this.deps.scope = props.scope;\r\n this.deps.serverContext = props.serverContext;\r\n this.i18n = this.deps.i18n;\r\n this.deps.loginPerfMarker = this.props.perfMarker.createChild('Smart_Import_Login_Step');\r\n this.deps.loginPerfMarker.willInit();\r\n\r\n // Unique Import ID for substrate.\r\n this.deps.getUniqueImportGUID = this.getUniqueImportGUID;\r\n\r\n // Toggle functions.\r\n this.deps.toggleShowImportSummary = this.toggleShowImportSummary;\r\n this.deps.toggleShowImportStatusStep = this.toggleShowImportStatusStep;\r\n this.deps.toggleCampaignsSelectionStep = this.toggleCampaignsSelectionStep;\r\n\r\n // Import options help Ids\r\n this.deps.importOptionFieldHelpIds = importOptionFieldHelpIds;\r\n\r\n // Repository init.\r\n this.repository = new PinterestImportRepository({\r\n deps: this.deps,\r\n });\r\n\r\n this.pinterestLoginRepository = new PinterestLoginRepository(this.deps.config);\r\n\r\n this.permissionFactory = this.deps.permissionFactory\r\n ? this.deps.permissionFactory\r\n : new PermissionFactory({\r\n permissions: props.permissions,\r\n importMode: props.scope.values.aid ? ImportMode.Single : ImportMode.Multi,\r\n });\r\n\r\n const initialStateFetchPromise = Promise.resolve([]);\r\n\r\n return initialStateFetchPromise.then(() => {\r\n this.setState({\r\n isInit: true,\r\n });\r\n });\r\n });\r\n }\r\n\r\n toggleShowImportSummary = (state) => {\r\n this.setState({\r\n showImportSummary: state, // eslint-disable-line\r\n });\r\n }\r\n\r\n toggleShowImportStatusStep = (state) => {\r\n this.setState({\r\n showImportStatusStep: state, // eslint-disable-line\r\n });\r\n }\r\n\r\n toggleImportType = (type) => {\r\n this.setState({\r\n importType: type,\r\n });\r\n }\r\n\r\n toggleImportMode = (mode) => {\r\n this.setState({\r\n importMode: mode,\r\n });\r\n this.permissionFactory.toggleImportMode(mode);\r\n }\r\n\r\n toggleCampaignsSelectionStep = (state) => {\r\n this.setState({\r\n showCampaignSelectionStep: state, // eslint-disable-line\r\n });\r\n }\r\n\r\n constructSteps = (i18n) => {\r\n this.steps = [];\r\n // construct base step\r\n this.steps.push(getPinterestLoginStep({\r\n i18n,\r\n repository: this.repository,\r\n rootContainerClassName,\r\n }));\r\n this.steps.push(getPinterestAccountStep({\r\n i18n,\r\n rootContainerClassName,\r\n }));\r\n this.steps.push(getStartImportSmartStep({\r\n i18n,\r\n getImportType: this.getImportType,\r\n setImportStatus: this.setImportStatus,\r\n rootContainerClassName,\r\n }));\r\n this.steps.push(getPinterestCampaignStep({\r\n i18n,\r\n getImportType: this.getImportType,\r\n showCampaignSelectionStep: this.state.showCampaignSelectionStep,\r\n rootContainerClassName,\r\n repository: this.repository,\r\n permissions: this.props.permissions,\r\n }));\r\n this.steps.push(getPinterestImportOptionsStep({\r\n i18n,\r\n deps: this.deps,\r\n getImportType: this.getImportType,\r\n permissions: this.props.permissions,\r\n rootContainerClassName,\r\n }));\r\n this.steps.push(getStartImportAdvancedStep({\r\n i18n,\r\n getImportType: this.getImportType,\r\n setImportStatus: this.setImportStatus,\r\n rootContainerClassName,\r\n }));\r\n this.steps.push(getImportSummaryStep({\r\n i18n,\r\n showImportSummary: this.state.showImportSummary,\r\n }));\r\n this.steps.push(getImportStatusStep({\r\n i18n,\r\n getImportStatus: this.getImportStatus,\r\n showImportStatusStep: this.state.showImportStatusStep,\r\n rootContainerClassName,\r\n }));\r\n }\r\n\r\n render() {\r\n const {\r\n rootClassName,\r\n i18n,\r\n } = this.props;\r\n\r\n if (this.state.isInit) {\r\n this.steps = [];\r\n this.constructSteps(i18n);\r\n } else {\r\n return null;\r\n }\r\n\r\n const handleCancelButtonClick = () => this.repository.redirectToCampaigns();\r\n\r\n return (\r\n \r\n \r\n \r\n \r\n
\r\n );\r\n }\r\n}\r\n\r\nPinterestImportPage.propTypes = {\r\n rootClassName: PropTypes.string.isRequired,\r\n perfMarker: perfMarkerPropTypes.isRequired,\r\n i18n: PropTypes.shape({}).isRequired,\r\n ccJsData: PropTypes.shape({\r\n FeatureAdoptionCoupon: PropTypes.shape({\r\n findAll: PropTypes.func,\r\n }),\r\n }),\r\n deps: PropTypes.shape({}).isRequired,\r\n location: PropTypes.shape({\r\n key: PropTypes.string,\r\n }).isRequired,\r\n permissions: PropTypes.shape({}).isRequired,\r\n};\r\n\r\nPinterestImportPage.defaultProps = {\r\n ccJsData: null,\r\n};\r\n","var pug = require(\"!../../../../../../../node_modules/.pnpm/pug@2.0.4/node_modules/pug-runtime/index.js\");\n\nfunction template(locals) {var pug_html = \"\", pug_mixins = {}, pug_interp;;var locals_for_with = (locals || {});(function (i18n) {pug_html = pug_html + \"\\u003Cdiv class=\\\"form-horizontal\\\"\\u003E\\u003Cdiv class=\\\"form-group multi-account-title-grid\\\"\\u003E\" + (pug.escape(null == (pug_interp = i18n.get('GoogleImport_MicrosoftAdvertising_Account_Select')) ? \"\" : pug_interp)) + \"\\u003C\\u002Fdiv\\u003E\\u003Cdiv class=\\\"row\\\"\\u003E\\u003Cdiv class=\\\"col-sm-9\\\"\\u003E\\u003Cdiv class=\\\"multi-bing-account-grid\\\"\\u003E\\u003C\\u002Fdiv\\u003E\\u003C\\u002Fdiv\\u003E\\u003C\\u002Fdiv\\u003E\\u003Cdiv class=\\\"error-message-no-bing-account-grid\\\"\\u003E\\u003Cdiv class=\\\"error\\\" data-bind=\\\"visible: showValidationError\\\" role=\\\"alert\\\"\\u003E\" + (pug.escape(null == (pug_interp = i18n.get('GoogleImport_MultiAccount_SelectBingadsAccount_Required')) ? \"\" : pug_interp)) + \"\\u003C\\u002Fdiv\\u003E\\u003C\\u002Fdiv\\u003E\\u003C\\u002Fdiv\\u003E\";}.call(this,\"i18n\" in locals_for_with?locals_for_with.i18n:typeof i18n!==\"undefined\"?i18n:undefined));;return pug_html;};\nmodule.exports = template;","var pug = require(\"!../../../../../../../node_modules/.pnpm/pug@2.0.4/node_modules/pug-runtime/index.js\");\n\nfunction template(locals) {var pug_html = \"\", pug_mixins = {}, pug_interp;pug_html = pug_html + \"\\u003Cdiv class=\\\"dlbItem-status-icon #:data.StatusCssClass#\\\"\\u003E\\u003C\\u002Fdiv\\u003E\\u003Cdiv class=\\\"dlbItem-text\\\"\\u003E\" + (pug.escape(null == (pug_interp = \"#:data.Name#\") ? \"\" : pug_interp)) + \"\\u003C\\u002Fdiv\\u003E\";;return pug_html;};\nmodule.exports = template;","var pug = require(\"!../../../../../../../node_modules/.pnpm/pug@2.0.4/node_modules/pug-runtime/index.js\");\n\nfunction template(locals) {var pug_html = \"\", pug_mixins = {}, pug_interp;;var locals_for_with = (locals || {});(function (i18n) {pug_html = pug_html + \"\\u003Cdiv class=\\\"dlbItem clearfix\\\" data-id=\\\"#:_uniqueId#\\\" id=\\\"selectedItem-#:_uniqueId#\\\" role=\\\"option\\\"\\u003E\\u003Cdiv class=\\\"dlbItem-content\\\"\\u003E\\u003C!--content--\\u003E\\u003C\\u002Fdiv\\u003E\\u003Cdiv class=\\\"dlbItem-actions\\\"\\u003E\\u003Ca\" + (\" class=\\\"arrow-button remove a11y-k-listview-button selectedAction-deselect\\\"\"+\" role=\\\"button\\\"\"+pug.attr(\"title\", i18n.get('Bulk_Download_Edit_Scope_Deselect'), true, true)+\" href=\\\"javascript:void(0);\\\" tabindex=\\\"-1\\\"\") + \"\\u003E\\u003C\\u002Fa\\u003E\\u003C\\u002Fdiv\\u003E\\u003C\\u002Fdiv\\u003E\";}.call(this,\"i18n\" in locals_for_with?locals_for_with.i18n:typeof i18n!==\"undefined\"?i18n:undefined));;return pug_html;};\nmodule.exports = template;","var pug = require(\"!../../../../../../../node_modules/.pnpm/pug@2.0.4/node_modules/pug-runtime/index.js\");\n\nfunction template(locals) {var pug_html = \"\", pug_mixins = {}, pug_interp;;var locals_for_with = (locals || {});(function (i18n) {pug_html = pug_html + \"\\u003Cdiv class=\\\"dlbItem clearfix #:selected#\\\" data-id=\\\"#:_uniqueId#\\\" id=\\\"sourceItem-#:_uniqueId#\\\" role=\\\"option\\\"\\u003E\\u003Cdiv class=\\\"dlbItem-content\\\"\\u003E\\u003C!--content--\\u003E\\u003C\\u002Fdiv\\u003E\\u003Cdiv class=\\\"dlbItem-actions\\\"\\u003E\\u003Ca\" + (\" class=\\\"arrow-button a11y-k-listview-button sourceAction-select #if (selected) {# disabled #} else {# enabled #}#\\\"\"+\" role=\\\"button\\\"\"+pug.attr(\"title\", i18n.get('Bulk_Download_Edit_Scope_Select'), true, true)+\" href=\\\"javascript:void(0);\\\" tabindex=\\\"-1\\\"\") + \"\\u003E\\u003C\\u002Fa\\u003E\\u003C\\u002Fdiv\\u003E\\u003C\\u002Fdiv\\u003E\";}.call(this,\"i18n\" in locals_for_with?locals_for_with.i18n:typeof i18n!==\"undefined\"?i18n:undefined));;return pug_html;};\nmodule.exports = template;","var pug = require(\"!../../../../../../../node_modules/.pnpm/pug@2.0.4/node_modules/pug-runtime/index.js\");\n\nfunction template(locals) {var pug_html = \"\", pug_mixins = {}, pug_interp;;var locals_for_with = (locals || {});(function (selectedAccounts) {pug_html = pug_html + \"\\u003Cdiv class=\\\"selected-account\\\"\\u003E\";\n// iterate selectedAccounts\n;(function(){\n var $$obj = selectedAccounts;\n if ('number' == typeof $$obj.length) {\n for (var pug_index0 = 0, $$l = $$obj.length; pug_index0 < $$l; pug_index0++) {\n var val = $$obj[pug_index0];\npug_html = pug_html + \"\\u003Ch6 class=\\\"main-item truncated\\\"\\u003E\" + (pug.escape(null == (pug_interp = val) ? \"\" : pug_interp)) + \"\\u003C\\u002Fh6\\u003E\";\n }\n } else {\n var $$l = 0;\n for (var pug_index0 in $$obj) {\n $$l++;\n var val = $$obj[pug_index0];\npug_html = pug_html + \"\\u003Ch6 class=\\\"main-item truncated\\\"\\u003E\" + (pug.escape(null == (pug_interp = val) ? \"\" : pug_interp)) + \"\\u003C\\u002Fh6\\u003E\";\n }\n }\n}).call(this);\n\npug_html = pug_html + \"\\u003C\\u002Fdiv\\u003E\";}.call(this,\"selectedAccounts\" in locals_for_with?locals_for_with.selectedAccounts:typeof selectedAccounts!==\"undefined\"?selectedAccounts:undefined));;return pug_html;};\nmodule.exports = template;","var pug = require(\"!../../../../../../../../node_modules/.pnpm/pug@2.0.4/node_modules/pug-runtime/index.js\");\n\nfunction template(locals) {var pug_html = \"\", pug_mixins = {}, pug_interp;;var locals_for_with = (locals || {});(function (enableToggleButton, isDropdownMenuExpanded, selectedBingAccountName) {pug_html = pug_html + \"\\u003Cdiv class=\\\"bing-account-selector\\\"\\u003E\\u003Cdiv class=\\\"ba-dropdown-selector\\\"\\u003E\\u003Cbutton\" + (\" class=\\\"btn btn-default dropdown-toggle\\\"\"+\" type=\\\"button\\\" role=\\\"button\\\"\"+pug.attr(\"disabled\", !enableToggleButton, true, true)+\" tabindex=\\\"0\\\" style=\\\"display: flex; justify-content: space-between;\\\"\"+pug.attr(\"aria-expanded\", isDropdownMenuExpanded() ? 'true' : 'false', true, true)+pug.attr(\"aria-label\", selectedBingAccountName, true, true)) + \"\\u003E\\u003Cspan class=\\\"truncated\\\"\\u003E\" + (pug.escape(null == (pug_interp = selectedBingAccountName) ? \"\" : pug_interp)) + \"\\u003C\\u002Fspan\\u003E\\u003Cdiv class=\\\"icon-right glyphicon glyphicon-triangle-bottom\\\"\\u003E\\u003C\\u002Fdiv\\u003E\\u003C\\u002Fbutton\\u003E\\u003C\\u002Fdiv\\u003E\\u003C\\u002Fdiv\\u003E\";}.call(this,\"enableToggleButton\" in locals_for_with?locals_for_with.enableToggleButton:typeof enableToggleButton!==\"undefined\"?enableToggleButton:undefined,\"isDropdownMenuExpanded\" in locals_for_with?locals_for_with.isDropdownMenuExpanded:typeof isDropdownMenuExpanded!==\"undefined\"?isDropdownMenuExpanded:undefined,\"selectedBingAccountName\" in locals_for_with?locals_for_with.selectedBingAccountName:typeof selectedBingAccountName!==\"undefined\"?selectedBingAccountName:undefined));;return pug_html;};\nmodule.exports = template;","var pug = require(\"!../../../../../../../node_modules/.pnpm/pug@2.0.4/node_modules/pug-runtime/index.js\");\n\nfunction template(locals) {var pug_html = \"\", pug_mixins = {}, pug_interp;;var locals_for_with = (locals || {});(function (SelectedAcountMaxCount, i18n) {pug_html = pug_html + \"\\u003Cdiv class=\\\"form-group\\\"\\u003E\\u003Cspan id=\\\"SelectGoogleAccountDesc\\\"\\u003E\" + (pug.escape(null == (pug_interp = i18n.get('GoogleImport_MultiAccount_SelectGoogleAccount_Description')) ? \"\" : pug_interp)) + \"\\u003C\\u002Fspan\\u003E\\u003C\\u002Fdiv\\u003E\\u003Cdiv class=\\\"import-grid\\\"\\u003E\\u003Cdiv class=\\\"grid-toolbar\\\"\\u003E\\u003Cdiv class=\\\"grid-toolbar grid-toolbar-container\\\" role=\\\"toolbar\\\"\\u003E\\u003Cdiv class=\\\"grid-filter-container\\\"\\u003E\\u003C\\u002Fdiv\\u003E\\u003C\\u002Fdiv\\u003E\\u003C\\u002Fdiv\\u003E\\u003Cdiv class=\\\"grid-table grid\\\"\\u003E\\u003C\\u002Fdiv\\u003E\\u003Cdiv class=\\\"grid-noresult\\\"\\u003E\\u003C\\u002Fdiv\\u003E\\u003Cdiv class=\\\"ba-dropdown-list-popup\\\"\\u003E\\u003C\\u002Fdiv\\u003E\\u003Cdiv class=\\\"error\\\" data-bind=\\\"visible: showNoSelectedGoogleAccountError\\\" role=\\\"alert\\\"\\u003E\" + (pug.escape(null == (pug_interp = i18n.get('Validation_SelectedAccountRequired')) ? \"\" : pug_interp)) + \"\\u003C\\u002Fdiv\\u003E\\u003Cdiv class=\\\"error\\\" data-bind=\\\"visible: showNoSelectedBingAccountError\\\" role=\\\"alert\\\"\\u003E\" + (pug.escape(null == (pug_interp = i18n.get('GoogleImport_MultiAccount_GoogleAccountGrid_SelectedBingAccountRequired')) ? \"\" : pug_interp)) + \"\\u003C\\u002Fdiv\\u003E\\u003Cdiv class=\\\"error\\\" data-bind=\\\"visible: showSelectedAccountCountExceedLimitError\\\" role=\\\"alert\\\"\\u003E\" + (pug.escape(null == (pug_interp = i18n.get('GoogleImport_MultiAccount_GoogleAccountGrid_SelectedAccountCountExceedLimit', {count: SelectedAcountMaxCount})) ? \"\" : pug_interp)) + \"\\u003C\\u002Fdiv\\u003E\\u003Cdiv class=\\\"error\\\" data-bind=\\\"visible: showSelectedGoogleAccountNoCampaignError\\\" role=\\\"alert\\\"\\u003E\" + (pug.escape(null == (pug_interp = i18n.get('GoogleImport_MultiAccount_GoogleAccountGrid_SelectedAccountNoCampaign')) ? \"\" : pug_interp)) + \"\\u003Cspan data-bind=\\\"text: hasNoCampaignsCustomerNameList\\\"\\u003E\\u003C\\u002Fspan\\u003E\\u003C\\u002Fdiv\\u003E\\u003C\\u002Fdiv\\u003E\";}.call(this,\"SelectedAcountMaxCount\" in locals_for_with?locals_for_with.SelectedAcountMaxCount:typeof SelectedAcountMaxCount!==\"undefined\"?SelectedAcountMaxCount:undefined,\"i18n\" in locals_for_with?locals_for_with.i18n:typeof i18n!==\"undefined\"?i18n:undefined));;return pug_html;};\nmodule.exports = template;","var pug = require(\"!../../../../../../node_modules/.pnpm/pug@2.0.4/node_modules/pug-runtime/index.js\");\n\nfunction template(locals) {var pug_html = \"\", pug_mixins = {}, pug_interp;;var locals_for_with = (locals || {});(function (hasNoData, i18n) {pug_html = pug_html + \"\\u003Cdiv class=\\\"form-group\\\"\\u003E\";\nif (hasNoData) {\npug_html = pug_html + \"\\u003Cdiv class=\\\"error\\\" role=\\\"alert\\\"\\u003E\" + (pug.escape(null == (pug_interp = i18n.get('GoogleImport_SelectAccount_NoAvailableAccounts')) ? \"\" : pug_interp)) + \"\\u003C\\u002Fdiv\\u003E\";\n}\nelse {\npug_html = pug_html + \"\\u003Cdiv class=\\\"multi-google-account-grid\\\"\\u003E\\u003C\\u002Fdiv\\u003E\\u003Cdiv class=\\\"currency-conversion-control\\\"\\u003E\\u003C\\u002Fdiv\\u003E\";\n}\npug_html = pug_html + \"\\u003C\\u002Fdiv\\u003E\";}.call(this,\"hasNoData\" in locals_for_with?locals_for_with.hasNoData:typeof hasNoData!==\"undefined\"?hasNoData:undefined,\"i18n\" in locals_for_with?locals_for_with.i18n:typeof i18n!==\"undefined\"?i18n:undefined));;return pug_html;};\nmodule.exports = template;","var pug = require(\"!../../../../../../../node_modules/.pnpm/pug@2.0.4/node_modules/pug-runtime/index.js\");\n\nfunction template(locals) {var pug_html = \"\", pug_mixins = {}, pug_interp;;var locals_for_with = (locals || {});(function (i18n) {pug_html = pug_html + \"\\u003Cdiv class=\\\"form-group\\\"\\u003E\\u003Cspan id=\\\"SelectCampaignDesc\\\"\\u003E\" + (pug.escape(null == (pug_interp = i18n.get('GoogleImport_MultiAccount_SelectCampaign_Description')) ? \"\" : pug_interp)) + \"\\u003C\\u002Fspan\\u003E\\u003C\\u002Fdiv\\u003E\\u003Cdiv class=\\\"form-group\\\"\\u003E\\u003Cdiv class=\\\"google-account-selector\\\"\\u003E\\u003C\\u002Fdiv\\u003E\\u003C\\u002Fdiv\\u003E\\u003Cdiv class=\\\"form-group\\\"\\u003E\\u003Cdiv class=\\\"google-campaign-grid-for-single-account\\\"\\u003E\\u003C\\u002Fdiv\\u003E\\u003C\\u002Fdiv\\u003E\";}.call(this,\"i18n\" in locals_for_with?locals_for_with.i18n:typeof i18n!==\"undefined\"?i18n:undefined));;return pug_html;};\nmodule.exports = template;","var pug = require(\"!../../../../../../node_modules/.pnpm/pug@2.0.4/node_modules/pug-runtime/index.js\");\n\nfunction template(locals) {var pug_html = \"\", pug_mixins = {}, pug_interp;pug_html = pug_html + \"\\u003Cdiv class=\\\"form-group multi-google-campaign-grid\\\"\\u003E\\u003C\\u002Fdiv\\u003E\";;return pug_html;};\nmodule.exports = template;","var pug = require(\"!../../../../../../node_modules/.pnpm/pug@2.0.4/node_modules/pug-runtime/index.js\");\n\nfunction template(locals) {var pug_html = \"\", pug_mixins = {}, pug_interp;;var locals_for_with = (locals || {});(function (i18n, showAlert, summaryText) {pug_html = pug_html + \"\\u003Cdiv class=\\\"form-group\\\"\\u003E\" + (pug.escape(null == (pug_interp = summaryText) ? \"\" : pug_interp)) + \"\\u003C\\u002Fdiv\\u003E\";\nif (showAlert) {\npug_html = pug_html + \"\\u003Cdiv class=\\\"alert alert-info\\\" role=\\\"alert\\\" style=\\\"margin-bottom: 15px\\\"\\u003E\\u003Cspan class=\\\"infomark infoalign\\\"\\u003E\\u003C\\u002Fspan\\u003E\\u003Cspan\\u003E\" + (pug.escape(null == (pug_interp = i18n.get('Import_SelectCampaign_DisplayCampaignAlert')) ? \"\" : pug_interp)) + \"\\u003C\\u002Fspan\\u003E\\u003C\\u002Fdiv\\u003E\";\n}}.call(this,\"i18n\" in locals_for_with?locals_for_with.i18n:typeof i18n!==\"undefined\"?i18n:undefined,\"showAlert\" in locals_for_with?locals_for_with.showAlert:typeof showAlert!==\"undefined\"?showAlert:undefined,\"summaryText\" in locals_for_with?locals_for_with.summaryText:typeof summaryText!==\"undefined\"?summaryText:undefined));;return pug_html;};\nmodule.exports = template;","var pug = require(\"!../../../../../../node_modules/.pnpm/pug@2.0.4/node_modules/pug-runtime/index.js\");\n\nfunction template(locals) {var pug_html = \"\", pug_mixins = {}, pug_interp;;var locals_for_with = (locals || {});(function (currentAccount, currentFacebookAccount, i18n, singleAccountMode) {pug_html = pug_html + \"\\u003Cdiv class=\\\"form-group\\\"\\u003E\\u003C!-- ko ifnot: isLoggedIn--\\u003E\";\nif (singleAccountMode) {\npug_html = pug_html + ((pug.escape(null == (pug_interp = i18n.get('FacebookImport_LoginDisclaimer')) ? \"\" : pug_interp)) + \" \" + (pug.escape(null == (pug_interp = i18n.get('GoogleImport_BingAdsAccount_LoggedOut_Title')) ? \"\" : pug_interp)) + (pug.escape(null == (pug_interp = currentAccount) ? \"\" : pug_interp)));\n}\nelse {\npug_html = pug_html + (pug.escape(null == (pug_interp = i18n.get('FacebookImport_MultiAccount_LoginDisclaimer')) ? \"\" : pug_interp));\n}\npug_html = pug_html + \"\\u003C!-- \\u002Fko--\\u003E\\u003C!-- ko if: isLoggedIn--\\u003E\";\nif (singleAccountMode) {\npug_html = pug_html + ((pug.escape(null == (pug_interp = i18n.get('GoogleImport_BingAdsAccount_Title')) ? \"\" : pug_interp)) + (pug.escape(null == (pug_interp = currentAccount) ? \"\" : pug_interp)) + \", \" + (pug.escape(null == (pug_interp = i18n.get('FacebookImport_LoginAccount_WithBingAdsAccount_Title')) ? \"\" : pug_interp)) + (pug.escape(null == (pug_interp = currentFacebookAccount) ? \"\" : pug_interp)));\n}\nelse {\npug_html = pug_html + ((pug.escape(null == (pug_interp = i18n.get('FacebookImport_MultiLoginAccount_WithBingAdsAccount_Title')) ? \"\" : pug_interp)) + (pug.escape(null == (pug_interp = currentFacebookAccount) ? \"\" : pug_interp)));\n}\npug_html = pug_html + \"\\u003C!-- \\u002Fko--\\u003E\\u003C\\u002Fdiv\\u003E\\u003Cdiv class=\\\"form-group\\\"\\u003E\\u003Cspan class=\\\"error\\\" data-bind=\\\"text:errorMsg, attr: { role: errorMsgRole }\\\"\\u003E\\u003C\\u002Fspan\\u003E\\u003C\\u002Fdiv\\u003E\";}.call(this,\"currentAccount\" in locals_for_with?locals_for_with.currentAccount:typeof currentAccount!==\"undefined\"?currentAccount:undefined,\"currentFacebookAccount\" in locals_for_with?locals_for_with.currentFacebookAccount:typeof currentFacebookAccount!==\"undefined\"?currentFacebookAccount:undefined,\"i18n\" in locals_for_with?locals_for_with.i18n:typeof i18n!==\"undefined\"?i18n:undefined,\"singleAccountMode\" in locals_for_with?locals_for_with.singleAccountMode:typeof singleAccountMode!==\"undefined\"?singleAccountMode:undefined));;return pug_html;};\nmodule.exports = template;","var pug = require(\"!../../../../../../node_modules/.pnpm/pug@2.0.4/node_modules/pug-runtime/index.js\");\n\nfunction template(locals) {var pug_html = \"\", pug_mixins = {}, pug_interp;;var locals_for_with = (locals || {});(function (i18n) {var columnTitle=i18n.get('Import_ImportSummary_ColumnMatchingSummary')\npug_html = pug_html + \"\\u003Cdiv class=\\\"form-group\\\"\\u003E\" + (pug.escape(null == (pug_interp = i18n.get('FileImport_ColumnMatching_Description')) ? \"\" : pug_interp)) + \"\\u003Ca\" + (\" class=\\\"helpbutton\\\"\"+\" topic=\\\"Page_Import_FromFile_ColumnMatching\\\" type=\\\"helppopup\\\" href=\\\"javascript:void(0);\\\"\"+pug.attr(\"aria-label\", i18n.get('Click to learn more about {{item}}', { item: columnTitle}), true, true)+\" onclick=\\\"PopupController.PopupJsClick(this)\\\"\"+pug.attr(\"title\", columnTitle, true, true)) + \"\\u003E\\u003C\\u002Fa\\u003E\\u003C\\u002Fdiv\\u003E\\u003Cdiv class=\\\"form-group column-matching-grid bingadsgrid\\\"\\u003E\\u003C\\u002Fdiv\\u003E\\u003Cdiv class=\\\"error\\\" data-bind=\\\"visible: showAllNotMappedError\\\"\\u003E\" + (pug.escape(null == (pug_interp = i18n.get('FileImport_ColumnMatching_AllNotMappedError')) ? \"\" : pug_interp)) + \"\\u003C\\u002Fdiv\\u003E\";}.call(this,\"i18n\" in locals_for_with?locals_for_with.i18n:typeof i18n!==\"undefined\"?i18n:undefined));;return pug_html;};\nmodule.exports = template;","var pug = require(\"!../../../../../../../node_modules/.pnpm/pug@2.0.4/node_modules/pug-runtime/index.js\");\n\nfunction template(locals) {var pug_html = \"\", pug_mixins = {}, pug_interp;;var locals_for_with = (locals || {});(function (cellIndex, defaultColumns, selectedOption, showError) {var id = 'columnOptions-' + cellIndex\npug_html = pug_html + \"\\u003Cselect\" + (pug.attr(\"class\", pug.classes([showError ? 'error': ''], [true]), false, true)+pug.attr(\"id\", id, true, true)+pug.attr(\"name\", id, true, true)) + \"\\u003E\";\n// iterate defaultColumns \n;(function(){\n var $$obj = defaultColumns ;\n if ('number' == typeof $$obj.length) {\n for (var columnEnum = 0, $$l = $$obj.length; columnEnum < $$l; columnEnum++) {\n var columnValue = $$obj[columnEnum];\npug_html = pug_html + \"\\u003Coption\" + (pug.attr(\"value\", columnEnum, true, true)+pug.attr(\"selected\", selectedOption==columnEnum, true, true)) + \"\\u003E\" + (pug.escape(null == (pug_interp = columnValue.LocalizedText) ? \"\" : pug_interp)) + \"\\u003C\\u002Foption\\u003E\";\n }\n } else {\n var $$l = 0;\n for (var columnEnum in $$obj) {\n $$l++;\n var columnValue = $$obj[columnEnum];\npug_html = pug_html + \"\\u003Coption\" + (pug.attr(\"value\", columnEnum, true, true)+pug.attr(\"selected\", selectedOption==columnEnum, true, true)) + \"\\u003E\" + (pug.escape(null == (pug_interp = columnValue.LocalizedText) ? \"\" : pug_interp)) + \"\\u003C\\u002Foption\\u003E\";\n }\n }\n}).call(this);\n\npug_html = pug_html + \"\\u003C\\u002Fselect\\u003E\";}.call(this,\"cellIndex\" in locals_for_with?locals_for_with.cellIndex:typeof cellIndex!==\"undefined\"?cellIndex:undefined,\"defaultColumns\" in locals_for_with?locals_for_with.defaultColumns:typeof defaultColumns!==\"undefined\"?defaultColumns:undefined,\"selectedOption\" in locals_for_with?locals_for_with.selectedOption:typeof selectedOption!==\"undefined\"?selectedOption:undefined,\"showError\" in locals_for_with?locals_for_with.showError:typeof showError!==\"undefined\"?showError:undefined));;return pug_html;};\nmodule.exports = template;","var pug = require(\"!../../../../../../node_modules/.pnpm/pug@2.0.4/node_modules/pug-runtime/index.js\");\n\nfunction template(locals) {var pug_html = \"\", pug_mixins = {}, pug_interp;pug_html = pug_html + \"\\u003Cdiv class=\\\"import-options-container\\\"\\u003E\\u003C\\u002Fdiv\\u003E\\u003Cdiv class=\\\"error-panel\\\"\\u003E\\u003C\\u002Fdiv\\u003E\";;return pug_html;};\nmodule.exports = template;","var pug = require(\"!../../../../../../../node_modules/.pnpm/pug@2.0.4/node_modules/pug-runtime/index.js\");\n\nfunction template(locals) {var pug_html = \"\", pug_mixins = {}, pug_interp;;var locals_for_with = (locals || {});(function (validationErrorMessage, valueMessages, values) {// iterate values\n;(function(){\n var $$obj = values;\n if ('number' == typeof $$obj.length) {\n for (var index = 0, $$l = $$obj.length; index < $$l; index++) {\n var value = $$obj[index];\npug_html = pug_html + \"\\u003Clabel class=\\\"radio-inline\\\"\\u003E\\u003Cinput\" + (pug.attr(\"id\", value, true, true)+\" type=\\\"radio\\\"\"+pug.attr(\"value\", value, true, true)+\" data-bind=\\\"checked: selectedFormatValue\\\"\") + \"\\u003E\\u003Cspan\\u003E\" + (pug.escape(null == (pug_interp = valueMessages[index]) ? \"\" : pug_interp)) + \"\\u003C\\u002Fspan\\u003E\\u003C\\u002Flabel\\u003E\";\n }\n } else {\n var $$l = 0;\n for (var index in $$obj) {\n $$l++;\n var value = $$obj[index];\npug_html = pug_html + \"\\u003Clabel class=\\\"radio-inline\\\"\\u003E\\u003Cinput\" + (pug.attr(\"id\", value, true, true)+\" type=\\\"radio\\\"\"+pug.attr(\"value\", value, true, true)+\" data-bind=\\\"checked: selectedFormatValue\\\"\") + \"\\u003E\\u003Cspan\\u003E\" + (pug.escape(null == (pug_interp = valueMessages[index]) ? \"\" : pug_interp)) + \"\\u003C\\u002Fspan\\u003E\\u003C\\u002Flabel\\u003E\";\n }\n }\n}).call(this);\n\npug_html = pug_html + \"\\u003Cdiv class=\\\"error\\\" role=\\\"alert\\\" data-bind=\\\"visible: showErrorMessage\\\"\\u003E\" + (pug.escape(null == (pug_interp = validationErrorMessage) ? \"\" : pug_interp)) + \"\\u003C\\u002Fdiv\\u003E\";}.call(this,\"validationErrorMessage\" in locals_for_with?locals_for_with.validationErrorMessage:typeof validationErrorMessage!==\"undefined\"?validationErrorMessage:undefined,\"valueMessages\" in locals_for_with?locals_for_with.valueMessages:typeof valueMessages!==\"undefined\"?valueMessages:undefined,\"values\" in locals_for_with?locals_for_with.values:typeof values!==\"undefined\"?values:undefined));;return pug_html;};\nmodule.exports = template;","var pug = require(\"!../../../../../../node_modules/.pnpm/pug@2.0.4/node_modules/pug-runtime/index.js\");\n\nfunction template(locals) {var pug_html = \"\", pug_mixins = {}, pug_interp;;var locals_for_with = (locals || {});(function (i18n, importTemplateUrl, isBaiduFileImportEnabled) {pug_html = pug_html + \"\\u003Cdiv class=\\\"form-group\\\"\\u003E\\u003Cdiv class=\\\"file-picker\\\"\\u003E\\u003C\\u002Fdiv\\u003E\\u003C\\u002Fdiv\\u003E\\u003Cdiv class=\\\"form-group\\\"\\u003E\\u003Cdiv class=\\\"file-format\\\"\\u003E\\u003C\\u002Fdiv\\u003E\\u003C\\u002Fdiv\\u003E\\u003Cdiv class=\\\"form-group\\\"\\u003E\\u003Cspan\\u003E\" + (pug.escape(null == (pug_interp = i18n.get('FileImport_TemplateText')) ? \"\" : pug_interp)) + \"\\u003C\\u002Fspan\\u003E\";\nif (isBaiduFileImportEnabled) {\npug_html = pug_html + \" \\u003Cspan\\u003E\" + (pug.escape(null == (pug_interp = i18n.get('FileImport_TemplateText_Baidu')) ? \"\" : pug_interp)) + \"\\u003C\\u002Fspan\\u003E\";\n}\npug_html = pug_html + \" \\u003Ca\" + (pug.attr(\"href\", importTemplateUrl, true, true)) + \"\\u003E\" + (pug.escape(null == (pug_interp = i18n.get('FileImport_DownloadTemplateLink')) ? \"\" : pug_interp)) + \"\\u003C\\u002Fa\\u003E\\u003C\\u002Fdiv\\u003E\";\nif (isBaiduFileImportEnabled) {\npug_html = pug_html + \"\\u003Cdiv class=\\\"form-group\\\"\\u003E\\u003Cspan class=\\\"baidu-file-import-more-info\\\"\\u003E\\u003C\\u002Fspan\\u003E\\u003C\\u002Fdiv\\u003E\";\n}}.call(this,\"i18n\" in locals_for_with?locals_for_with.i18n:typeof i18n!==\"undefined\"?i18n:undefined,\"importTemplateUrl\" in locals_for_with?locals_for_with.importTemplateUrl:typeof importTemplateUrl!==\"undefined\"?importTemplateUrl:undefined,\"isBaiduFileImportEnabled\" in locals_for_with?locals_for_with.isBaiduFileImportEnabled:typeof isBaiduFileImportEnabled!==\"undefined\"?isBaiduFileImportEnabled:undefined));;return pug_html;};\nmodule.exports = template;","var pug = require(\"!../../../../../../node_modules/.pnpm/pug@2.0.4/node_modules/pug-runtime/index.js\");\n\nfunction template(locals) {var pug_html = \"\", pug_mixins = {}, pug_interp;;var locals_for_with = (locals || {});(function (hasStats, i18n) {pug_html = pug_html + \"\\u003Cdiv class=\\\"form-group\\\"\\u003E\\u003Ch3 class=\\\"bold\\\"\\u003E\" + (pug.escape(null == (pug_interp = i18n.get('Import_ImportPreview_TableTitle')) ? \"\" : pug_interp)) + \"\\u003C\\u002Fh3\\u003E\\u003C\\u002Fdiv\\u003E\\u003Cdiv class=\\\"form-group\\\"\\u003E\";\nif (hasStats) {\npug_html = pug_html + \"\\u003Cdiv class=\\\"import-preview-grid bingadsgrid\\\"\\u003E\\u003C\\u002Fdiv\\u003E\";\n}\nelse {\npug_html = pug_html + \"\\u003Cspan\\u003E\" + (pug.escape(null == (pug_interp = i18n.get('Import_LastImport_NoImportStatistics')) ? \"\" : pug_interp)) + \"\\u003C\\u002Fspan\\u003E\";\n}\npug_html = pug_html + \"\\u003C\\u002Fdiv\\u003E\";}.call(this,\"hasStats\" in locals_for_with?locals_for_with.hasStats:typeof hasStats!==\"undefined\"?hasStats:undefined,\"i18n\" in locals_for_with?locals_for_with.i18n:typeof i18n!==\"undefined\"?i18n:undefined));;return pug_html;};\nmodule.exports = template;","var pug = require(\"!../../../../../../node_modules/.pnpm/pug@2.0.4/node_modules/pug-runtime/index.js\");\n\nfunction template(locals) {var pug_html = \"\", pug_mixins = {}, pug_interp;;var locals_for_with = (locals || {});(function (i18n) {pug_html = pug_html + \"\\u003Cinput class=\\\"grid-filter-input\\\" data-bind=\\\"attr: { placeholder: placeholder, "aria-label": placeholder }, textInput: searchString\\\"\\u003E\\u003C!-- ko ifnot: inEditMode--\\u003E\\u003Cbutton class=\\\"filter_search_icon_small spritedimage spritedimagealign\\\" disabled=\\\"\\\" data-bind=\\\"attr: { "aria-label": placeholder }\\\"\\u003E\\u003C\\u002Fbutton\\u003E\\u003C!-- \\u002Fko--\\u003E\\u003C!-- ko if: inEditMode--\\u003E\\u003Cbutton\" + (\" class=\\\"filtercloseimage spritedimage spritedimagealign\\\"\"+pug.attr(\"aria-label\", i18n.get('Remove'), true, true)) + \"\\u003E\\u003C\\u002Fbutton\\u003E\\u003C!-- \\u002Fko--\\u003E\";}.call(this,\"i18n\" in locals_for_with?locals_for_with.i18n:typeof i18n!==\"undefined\"?i18n:undefined));;return pug_html;};\nmodule.exports = template;","var pug = require(\"!../../../../../../node_modules/.pnpm/pug@2.0.4/node_modules/pug-runtime/index.js\");\n\nfunction template(locals) {var pug_html = \"\", pug_mixins = {}, pug_interp;;var locals_for_with = (locals || {});(function (i18n) {pug_html = pug_html + \"\\u003Cdiv class=\\\"checkbox\\\"\\u003E\\u003Clabel\\u003E\\u003Cinput id=\\\"ShowPausedCampaigns\\\" type=\\\"checkbox\\\" data-bind=\\\"checked:showPaused, disable: disableShowPause\\\"\\u003E\" + (pug.escape(null == (pug_interp = i18n.get('GoogleImport_SelectCampaign_ShowPaused')) ? \"\" : pug_interp)) + \"\\u003C\\u002Flabel\\u003E\\u003C\\u002Fdiv\\u003E\";}.call(this,\"i18n\" in locals_for_with?locals_for_with.i18n:typeof i18n!==\"undefined\"?i18n:undefined));;return pug_html;};\nmodule.exports = template;","var pug = require(\"!../../../../../../../node_modules/.pnpm/pug@2.0.4/node_modules/pug-runtime/index.js\");\n\nfunction template(locals) {var pug_html = \"\", pug_mixins = {}, pug_interp;;var locals_for_with = (locals || {});(function (hasNoData, i18n) {pug_html = pug_html + \"\\u003Cdiv class=\\\"form-group\\\"\\u003E\";\nif (hasNoData) {\npug_html = pug_html + \"\\u003Cdiv class=\\\"error\\\" role=\\\"alert\\\"\\u003E\" + (pug.escape(null == (pug_interp = i18n.get('Import_SelectAccount_NoAvailableAccounts')) ? \"\" : pug_interp)) + \"\\u003C\\u002Fdiv\\u003E\";\n}\nelse {\npug_html = pug_html + \"\\u003Cdiv class=\\\"import-account-grid\\\"\\u003E\\u003C\\u002Fdiv\\u003E\\u003Cdiv class=\\\"currency-conversion-control\\\"\\u003E\\u003C\\u002Fdiv\\u003E\";\n}\npug_html = pug_html + \"\\u003C\\u002Fdiv\\u003E\";}.call(this,\"hasNoData\" in locals_for_with?locals_for_with.hasNoData:typeof hasNoData!==\"undefined\"?hasNoData:undefined,\"i18n\" in locals_for_with?locals_for_with.i18n:typeof i18n!==\"undefined\"?i18n:undefined));;return pug_html;};\nmodule.exports = template;","var pug = require(\"!../../../../../../../../node_modules/.pnpm/pug@2.0.4/node_modules/pug-runtime/index.js\");\n\nfunction template(locals) {var pug_html = \"\", pug_mixins = {}, pug_interp;;var locals_for_with = (locals || {});(function (i18n, singleAccountMode) {pug_html = pug_html + \"\\u003Cdiv class=\\\"currencyConversionInnerView\\\" data-bind=\\\"visible: shouldShow\\\"\\u003E\\u003Cdiv class=\\\"form-group\\\"\\u003E\\u003Cspan id=\\\"currencyConversionDisc\\\"\\u003E\" + (pug.escape(null == (pug_interp = i18n.get('Import_AccountCurrencyConversion_Description')) ? \"\" : pug_interp)) + \"\\u003C\\u002Fspan\\u003E\\u003C\\u002Fdiv\\u003E\";\nif (singleAccountMode) {\npug_html = pug_html + \"\\u003Cdiv class=\\\"form-group\\\"\\u003E\\u003Cdiv class=\\\"importSourceAccountCurrency\\\"\\u003E\\u003Cspan class=\\\"inline-bold\\\"\\u003E\" + (pug.escape(null == (pug_interp = i18n.get('Import_AccountCurrencyConversion_AccountLabel')) ? \"\" : pug_interp)) + \"\\u003C\\u002Fspan\\u003E\\u003Cspan data-bind=\\\"text: importSourceAccountCurrency\\\"\\u003E\\u003C\\u002Fspan\\u003E\\u003C\\u002Fdiv\\u003E\\u003Cdiv class=\\\"bingAccountCurrency\\\"\\u003E\\u003Cspan class=\\\"inline-bold\\\"\\u003E\" + (pug.escape(null == (pug_interp = i18n.get('Import_AccountCurrencyConversion_BingAccountLabel')) ? \"\" : pug_interp)) + \"\\u003C\\u002Fspan\\u003E\\u003Cspan data-bind=\\\"text: bingAccountCurrency\\\"\\u003E\\u003C\\u002Fspan\\u003E\\u003C\\u002Fdiv\\u003E\\u003C\\u002Fdiv\\u003E\";\n}\npug_html = pug_html + \"\\u003Cdiv class=\\\"form-group\\\"\\u003E\\u003Cdiv class=\\\"currencyConversionToolTip\\\"\\u003E\\u003Cspan class=\\\"bold\\\"\\u003E\" + (pug.escape(null == (pug_interp = i18n.get('Import_AccountCurrencyConversion_Tooltip')) ? \"\" : pug_interp)) + \"\\u003C\\u002Fspan\\u003E\\u003C\\u002Fdiv\\u003E\\u003C\\u002Fdiv\\u003E\\u003Cdiv class=\\\"form-group\\\"\\u003E\\u003Cdiv class=\\\"radio\\\"\\u003E\\u003Cinput type=\\\"radio\\\" role=\\\"radio\\\" name=\\\"currencyConvert\\\" value=\\\"true\\\" data-bind=\\\"checked:doConvert.Editing\\\"\\u003E\" + (pug.escape(null == (pug_interp = i18n.get('Import_AccountCurrencyConversion_Convert')) ? \"\" : pug_interp)) + \"\\u003C\\u002Fdiv\\u003E\\u003Cdiv class=\\\"radio\\\"\\u003E\\u003Cinput type=\\\"radio\\\" role=\\\"radio\\\" name=\\\"currencyConvert\\\" value=\\\"false\\\" data-bind=\\\"checked:doConvert.Editing\\\"\\u003E\" + (pug.escape(null == (pug_interp = i18n.get('Import_AccountCurrencyConversion_NotConvert')) ? \"\" : pug_interp)) + \"\\u003C\\u002Fdiv\\u003E\\u003C\\u002Fdiv\\u003E\\u003C\\u002Fdiv\\u003E\";}.call(this,\"i18n\" in locals_for_with?locals_for_with.i18n:typeof i18n!==\"undefined\"?i18n:undefined,\"singleAccountMode\" in locals_for_with?locals_for_with.singleAccountMode:typeof singleAccountMode!==\"undefined\"?singleAccountMode:undefined));;return pug_html;};\nmodule.exports = template;","var pug = require(\"!../../../../../../../../node_modules/.pnpm/pug@2.0.4/node_modules/pug-runtime/index.js\");\n\nfunction template(locals) {var pug_html = \"\", pug_mixins = {}, pug_interp;;var locals_for_with = (locals || {});(function (i18n) {pug_html = pug_html + \"\\u003Cdiv class=\\\"import-grid\\\"\\u003E\\u003Cdiv class=\\\"grid-toolbar\\\"\\u003E\\u003Cdiv class=\\\"grid-toolbar grid-toolbar-container\\\" role=\\\"toolbar\\\"\\u003E\\u003Cdiv class=\\\"grid-filter-container\\\"\\u003E\\u003C\\u002Fdiv\\u003E\\u003C\\u002Fdiv\\u003E\\u003C\\u002Fdiv\\u003E\\u003Cdiv class=\\\"grid-table grid\\\"\\u003E\\u003C\\u002Fdiv\\u003E\\u003Cdiv class=\\\"grid-noresult\\\"\\u003E\\u003C\\u002Fdiv\\u003E\\u003Cdiv class=\\\"error\\\" data-bind=\\\"visible: showValidationError\\\" role=\\\"alert\\\"\\u003E\" + (pug.escape(null == (pug_interp = i18n.get('Validation_SelectedAccountRequired')) ? \"\" : pug_interp)) + \"\\u003C\\u002Fdiv\\u003E\\u003Cdiv class=\\\"error\\\" data-bind=\\\"visible: showNoCampaignsError, text: noCampaignsErrorMessage\\\" role=\\\"alert\\\"\\u003E\\u003C\\u002Fdiv\\u003E\\u003C\\u002Fdiv\\u003E\";}.call(this,\"i18n\" in locals_for_with?locals_for_with.i18n:typeof i18n!==\"undefined\"?i18n:undefined));;return pug_html;};\nmodule.exports = template;","var pug = require(\"!../../../../../../../node_modules/.pnpm/pug@2.0.4/node_modules/pug-runtime/index.js\");\n\nfunction template(locals) {var pug_html = \"\", pug_mixins = {}, pug_interp;pug_html = pug_html + \"\\u003Cdiv class=\\\"form-group importsource-campaign-grid\\\"\\u003E\\u003C\\u002Fdiv\\u003E\";;return pug_html;};\nmodule.exports = template;","var pug = require(\"!../../../../../../../../node_modules/.pnpm/pug@2.0.4/node_modules/pug-runtime/index.js\");\n\nfunction template(locals) {var pug_html = \"\", pug_mixins = {}, pug_interp;;var locals_for_with = (locals || {});(function (i18n, signupMode, singleAccountMode) {if (singleAccountMode) {\npug_html = pug_html + \"\\u003Cdiv class=\\\"form-group\\\"\\u003E\\u003Cspan id=\\\"SelectCampaignDesc\\\"\\u003E\" + (pug.escape(null == (pug_interp = i18n.get('Import_SelectCampaign_Description')) ? \"\" : pug_interp)) + \"\\u003C\\u002Fspan\\u003E\\u003C\\u002Fdiv\\u003E\";\n}\npug_html = pug_html + \"\\u003Cdiv class=\\\"form-group\\\"\\u003E\\u003Cdiv role=\\\"radiogroup\\\" aria-labelledby=\\\"CampaignTitle SelectCampaignDesc\\\"\\u003E\\u003Clabel class=\\\"radio-inline\\\"\\u003E\\u003Cinput type=\\\"radio\\\" role=\\\"radio\\\" name=\\\"importCampaigns\\\" value=\\\"true\\\" data-bind=\\\"checked:importAll.Editing\\\"\\u003E\";\nif (signupMode) {\npug_html = pug_html + (pug.escape(null == (pug_interp = i18n.get('Import_SelectCampaign_ImportAll_ForSignUp')) ? \"\" : pug_interp));\n}\nelse {\npug_html = pug_html + (pug.escape(null == (pug_interp = i18n.get('Import_SelectCampaign_ImportAll')) ? \"\" : pug_interp));\n}\npug_html = pug_html + \"\\u003C\\u002Flabel\\u003E\\u003Clabel class=\\\"radio-inline\\\"\\u003E\\u003Cinput type=\\\"radio\\\" role=\\\"radio\\\" name=\\\"importCampaigns\\\" value=\\\"false\\\" data-bind=\\\"checked:importAll.Editing\\\"\\u003E\" + (pug.escape(null == (pug_interp = i18n.get('Import_SelectCampaign_ImportSpecific')) ? \"\" : pug_interp)) + \"\\u003C\\u002Flabel\\u003E\\u003C\\u002Fdiv\\u003E\\u003C\\u002Fdiv\\u003E\\u003Cdiv class=\\\"importCampaignsGrid\\\" data-bind=\\\"visible: !importAll()\\\"\\u003E\\u003Cdiv class=\\\"form-group\\\"\\u003E\\u003Cdiv class=\\\"grid-toolbar\\\"\\u003E\\u003Cdiv class=\\\"grid-toolbar grid-toolbar-container\\\" role=\\\"toolbar\\\"\\u003E\\u003Cdiv class=\\\"grid-filter-container\\\"\\u003E\\u003C\\u002Fdiv\\u003E\\u003C\\u002Fdiv\\u003E\\u003C\\u002Fdiv\\u003E\\u003Cdiv class=\\\"grid-table grid\\\"\\u003E\\u003C\\u002Fdiv\\u003E\\u003Cdiv class=\\\"error\\\" data-bind=\\\"visible: showValidationError\\\" role=\\\"alert\\\"\\u003E\" + (pug.escape(null == (pug_interp = i18n.get('Validation_CampaignSelectionRequired')) ? \"\" : pug_interp)) + \"\\u003C\\u002Fdiv\\u003E\\u003C\\u002Fdiv\\u003E\\u003Cdiv class=\\\"show-paused-filter form-group\\\"\\u003E\\u003C\\u002Fdiv\\u003E\\u003C\\u002Fdiv\\u003E\";}.call(this,\"i18n\" in locals_for_with?locals_for_with.i18n:typeof i18n!==\"undefined\"?i18n:undefined,\"signupMode\" in locals_for_with?locals_for_with.signupMode:typeof signupMode!==\"undefined\"?signupMode:undefined,\"singleAccountMode\" in locals_for_with?locals_for_with.singleAccountMode:typeof singleAccountMode!==\"undefined\"?singleAccountMode:undefined));;return pug_html;};\nmodule.exports = template;","var pug = require(\"!../../../../../../../../node_modules/.pnpm/pug@2.0.4/node_modules/pug-runtime/index.js\");\n\nfunction template(locals) {var pug_html = \"\", pug_mixins = {}, pug_interp;;var locals_for_with = (locals || {});(function (doneText, navigateToButtonText) {pug_html = pug_html + \"\\u003Cdiv class=\\\"scheduling\\\"\\u003E\\u003Cdiv class=\\\"panel-body form-horizontal schedule\\\"\\u003E\\u003Cdiv class=\\\"section-item schedule form-group\\\"\\u003E\\u003Cdiv class=\\\"section-item\\\"\\u003E\\u003Cdiv class=\\\"col-xs-12\\\"\\u003E\\u003Ch6 style=\\\"font-size:14px;\\\"\\u003E\" + (pug.escape(null == (pug_interp = doneText) ? \"\" : pug_interp)) + \"\\u003C\\u002Fh6\\u003E\\u003C\\u002Fdiv\\u003E\\u003Cdiv class=\\\"col-xs-12\\\"\\u003E\\u003Cbutton class=\\\"btn btn-default view-import-history-log-grid\\\"\\u003E\" + (pug.escape(null == (pug_interp = navigateToButtonText) ? \"\" : pug_interp)) + \"\\u003C\\u002Fbutton\\u003E\\u003C\\u002Fdiv\\u003E\\u003C\\u002Fdiv\\u003E\\u003C\\u002Fdiv\\u003E\\u003C\\u002Fdiv\\u003E\\u003C\\u002Fdiv\\u003E\";}.call(this,\"doneText\" in locals_for_with?locals_for_with.doneText:typeof doneText!==\"undefined\"?doneText:undefined,\"navigateToButtonText\" in locals_for_with?locals_for_with.navigateToButtonText:typeof navigateToButtonText!==\"undefined\"?navigateToButtonText:undefined));;return pug_html;};\nmodule.exports = template;","var pug = require(\"!../../../../../../../../node_modules/.pnpm/pug@2.0.4/node_modules/pug-runtime/index.js\");\n\nfunction template(locals) {var pug_html = \"\", pug_mixins = {}, pug_interp;;var locals_for_with = (locals || {});(function (i18n, importSourceName) {pug_mixins[\"koValidationError\"] = pug_interp = function(item, id){\nvar block = (this && this.block), attributes = (this && this.attributes) || {};\npug_html = pug_html + \"\\u003Cul\" + (pug.attr(\"data-bind\", 'visible: !' + item + '.isValid(), foreach: ' + item + '.errors, attr: {\"aria-hidden\": ' + item + '.isValid()}', true, true)+pug.attr(\"id\", id ? id : item + 'ValidationError', true, true)+\" role=\\\"alert\\\"\") + \"\\u003E\\u003Cli\\u003E\\u003Cdiv class=\\\"error\\\" data-bind=\\\"html: $data\\\"\\u003E\\u003C\\u002Fdiv\\u003E\\u003C\\u002Fli\\u003E\\u003C\\u002Ful\\u003E\";\n};\npug_mixins[\"popupHelp\"] = pug_interp = function(popupId, ariaLabelContext, arialLabelText){\nvar block = (this && this.block), attributes = (this && this.attributes) || {};\npug_html = pug_html + \"\\u003Ca\" + (\" class=\\\"helpbutton\\\"\"+\" type=\\\"helppopup\\\"\"+pug.attr(\"topic\", popupId, true, true)+pug.attr(\"data-help\", true, true, true)+\" onclick=\\\"PopupController.PopupJsClick(this)\\\" href=\\\"javascript:void(0);\\\"\"+pug.attr(\"aria-label\", (arialLabelText || 'Learn more') + ' ' + (ariaLabelContext || ''), true, true)) + \"\\u003E\\u003C\\u002Fa\\u003E\";\n};\npug_mixins[\"koCharactersRemaining\"] = pug_interp = function(item, id){\nvar block = (this && this.block), attributes = (this && this.attributes) || {};\npug_html = pug_html + \"\\u003Cdiv class=\\\"remaining-hint help-block\\\"\\u003E\\u003Cspan\" + (pug.attr(\"data-bind\", 'text:' + item + '.char_rem', true, true)+pug.attr(\"id\", id ? id : item + '_CharactersRemaining', true, true)+\" role=\\\"status\\\" aria-live=\\\"polite\\\"\") + \"\\u003E\\u003C\\u002Fspan\\u003E\\u003C\\u002Fdiv\\u003E\";\n};\npug_html = pug_html + (\"\\u003Cdiv class=\\\"scheduling\\\"\\u003E\\u003Cdiv class=\\\"panel-body form-horizontal schedule\\\"\\u003E\\u003Cdiv class=\\\"section-item schedule form-group\\\"\\u003E\\u003Ch5 data-bind=\\\"visible: !scheduleFromImportSummary\\\"\\u003E\" + (pug.escape(null == (pug_interp = i18n.get('Scheduled_Import_Header')) ? \"\" : pug_interp)) + \"\\u003C\\u002Fh5\\u003E\\u003Ch5 data-bind=\\\"visible: scheduleFromImportSummary\\\"\\u003E\" + (pug.escape(null == (pug_interp = i18n.get('Import_RunNow_Schedule_Import_Message')) ? \"\" : pug_interp)) + \"\\u003C\\u002Fh5\\u003E\\u003C\\u002Fdiv\\u003E\\u003Cdiv class=\\\"schedule\\\"\\u003E\\u003Cdiv class=\\\"section-item form-group\\\"\\u003E\\u003Clabel class=\\\"control-label col-xs-2\\\"\\u003E\" + (pug.escape(null == (pug_interp = i18n.get('AutomatedRules_RuleAuthoring_Filter')) ? \"\" : pug_interp)));\npug_mixins[\"popupHelp\"]((importSourceName === 'facebook' ? 'pop_BA_Import_FB_ScheduleWhen' : 'pop_BA_Import_ScheduleWhen'), i18n.get('AutomatedRules_RuleAuthoring_Filter'), i18n.get('LearnMoreLinkText'));\npug_html = pug_html + \"\\u003C\\u002Flabel\\u003E\\u003Cdiv class=\\\"section-item\\\"\\u003E\\u003Cdiv class=\\\"col-xs-2\\\"\\u003E\\u003Cselect\" + (\" class=\\\"form-control form-control\\\"\"+\" data-bind=\\\"options: availableFrequencies, optionsText: 'text', value: chosenFrequency\\\"\"+pug.attr(\"data-analyticsid\", `omniture-${importSourceName}-import-schedule-dropdown`, true, true)+pug.attr(\"aria-label\", i18n.get('Scheduled_Import_Available_Frequencies'), true, true)) + \"\\u003E\\u003C\\u002Fselect\\u003E\\u003C\\u002Fdiv\\u003E\\u003Cdiv class=\\\"col-xs-2\\\" data-bind=\\\"visible: chosenFrequency().value === 'Monthly'\\\"\\u003E\\u003Clabel class=\\\"control-label col-xs-4\\\"\\u003E\" + (pug.escape(null == (pug_interp = i18n.get('Scheduled_Import_On_Day')) ? \"\" : pug_interp)) + \"\\u003C\\u002Flabel\\u003E\\u003Cdiv class=\\\"col-xs-8\\\"\\u003E\\u003Cselect\" + (\" class=\\\"form-control\\\"\"+\" data-bind=\\\"options: availableDaysOfTheMonth, value: chosenDayOfTheMonth, visible: chosenFrequency().value === 'Monthly'\\\"\"+pug.attr(\"aria-label\", i18n.get('Scheduled_Import_Available_DaysOfTheMonth'), true, true)) + \"\\u003E\\u003C\\u002Fselect\\u003E\\u003C\\u002Fdiv\\u003E\\u003C\\u002Fdiv\\u003E\\u003Cdiv class=\\\"col-xs-2\\\" data-bind=\\\"visible: chosenFrequency().value === 'Weekly'\\\"\\u003E\\u003Cselect\" + (\" class=\\\"form-control form-control\\\"\"+\" data-bind=\\\"options: availableDays, optionsText: 'text', value: chosenDay, visible: chosenFrequency().value === 'Weekly'\\\"\"+pug.attr(\"aria-label\", i18n.get('Scheduled_Import_Available_Days'), true, true)) + \"\\u003E\\u003C\\u002Fselect\\u003E\\u003C\\u002Fdiv\\u003E\\u003Cdiv class=\\\"col-xs-2 date-picker\\\" data-bind=\\\"visible: chosenFrequency().value === 'Once'\\\"\\u003E\\u003C\\u002Fdiv\\u003E\\u003Clabel class=\\\"control-label col-xs-1\\\" data-bind=\\\"visible: nonAutoScheduledImport()\\\"\\u003E\" + (pug.escape(null == (pug_interp = i18n.get('Scheduled_Import_At')) ? \"\" : pug_interp)) + \"\\u003C\\u002Flabel\\u003E\\u003Cdiv class=\\\"col-xs-2\\\"\\u003E\\u003Cselect\" + (\" class=\\\"form-control form-control\\\"\"+\" data-bind=\\\"options: availableTimes, optionsText: 'twelveHourDisplay', value: chosenTime, visible: nonAutoScheduledImport() && is12Hour()\\\"\"+pug.attr(\"aria-label\", i18n.get('Scheduled_Import_Available_Times_12_Hour_Display'), true, true)) + \"\\u003E\\u003C\\u002Fselect\\u003E\\u003Cselect\" + (\" class=\\\"form-control form-control\\\"\"+\" data-bind=\\\"options: availableTimes, optionsText: 'twentyFourHourDisplay', value: chosenTime, visible: nonAutoScheduledImport() && !is12Hour()\\\"\"+pug.attr(\"aria-label\", i18n.get('Scheduled_Import_Available_Times_24_Hour_Display'), true, true)) + \"\\u003E\\u003C\\u002Fselect\\u003E\\u003C\\u002Fdiv\\u003E\\u003C\\u002Fdiv\\u003E\\u003C\\u002Fdiv\\u003E\\u003C!-- ko if: facCoupon && (chosenFrequency().value === 'Once' || chosenFrequency().value === 'Now')--\\u003E\\u003Cdiv class=\\\"section-item fac-coupon-alert\\\" data-bind=\\\"css: { 'fac-coupon-alert-now': chosenFrequency().value === 'Now' }\\\"\\u003E\\u003Cdiv class=\\\"alert alert-info\\\" role=\\\"alert\\\"\\u003E\\u003Cspan class=\\\"alert__icon alert-image\\\" aria-hidden=\\\"true\\\"\\u003E\\u003C\\u002Fspan\\u003E\\u003Cdiv class=\\\"alert__content\\\"\\u003E\" + (null == (pug_interp = i18n.get('FAC_GImport_Inline_MustBeRecurring').replace(/{{bold}}/g, '').replace(/{{\\/bold}}/g, '')) ? \"\" : pug_interp) + \"\\u003C\\u002Fdiv\\u003E\\u003C\\u002Fdiv\\u003E\\u003C\\u002Fdiv\\u003E\\u003C!-- \\u002Fko--\\u003E\\u003Cul class=\\\"col-sm-12 col-xs-offset-1 panel-body\\\" data-bind=\\\"visible: timeError() && chosenFrequency().value === 'Once'\\\" role=\\\"alert\\\"\\u003E\\u003Cli\\u003E\\u003Cdiv class=\\\"error\\\"\\u003E\" + (pug.escape(null == (pug_interp = i18n.get('AutomatedRules_Validate_ScheduleTimeInvalid')) ? \"\" : pug_interp)) + \"\\u003C\\u002Fdiv\\u003E\\u003C\\u002Fli\\u003E\\u003C\\u002Ful\\u003E\\u003Cul class=\\\"col-sm-12 col-xs-offset-1 panel-body\\\" data-bind=\\\"visible: showUnSupportedDayOfMonth() && chosenFrequency().value === 'Monthly'\\\" role=\\\"alert\\\"\\u003E\\u003Cli\\u003E\\u003Cdiv class=\\\"alert alert-warning\\\" role=\\\"alert\\\"\\u003E\\u003Cspan class=\\\"alert-image\\\"\\u003E\\u003C\\u002Fspan\\u003E\\u003Cspan\\u003E\" + (pug.escape(null == (pug_interp = i18n.get('Scheduled_Import_UnSupported_DayOfMonth')) ? \"\" : pug_interp)) + \"\\u003C\\u002Fspan\\u003E\\u003C\\u002Fdiv\\u003E\\u003C\\u002Fli\\u003E\\u003C\\u002Ful\\u003E\\u003Cdiv class=\\\"section-item form-group\\\" data-bind=\\\"visible: nonAutoScheduledImport() && showRunNow()\\\"\\u003E\\u003Clabel class=\\\"item-label section-item-label col-xs-2 control-label\\\"\\u003E\\u003C\\u002Flabel\\u003E\\u003Cdiv class=\\\"col-xs-6\\\"\\u003E\\u003Cinput\" + (\" type=\\\"checkbox\\\" name=\\\"runNowWithScheduled\\\" data-bind=\\\"checked: runNowWithScheduled\\\"\"+pug.attr(\"aria-label\", i18n.get('Import_RunNow'), true, true)+\" style=\\\"vertical-align:bottom;\\\"\") + \"\\u003E\\u003Cspan style=\\\"padding:4px;\\\"\\u003E\" + (pug.escape(null == (pug_interp = i18n.get('Import_RunNow')) ? \"\" : pug_interp)) + \"\\u003C\\u002Fspan\\u003E\\u003C\\u002Fdiv\\u003E\\u003C\\u002Fdiv\\u003E\\u003Cdiv class=\\\"section-item form-group\\\" data-bind=\\\"visible: nonAutoScheduledImport()\\\"\\u003E\\u003Clabel class=\\\"item-label section-item-label col-xs-2 control-label\\\"\\u003E\" + (pug.escape(null == (pug_interp = i18n.get('Scheduled_Import_DisplayTime')) ? \"\" : pug_interp)) + \"\\u003C\\u002Flabel\\u003E\\u003Cdiv class=\\\"col-xs-6\\\"\\u003E\\u003Cspan class=\\\"col-md-3 radio\\\"\\u003E\\u003Cinput\" + (\" type=\\\"radio\\\" name=\\\"timeformat\\\" value=\\\"12hour\\\" data-bind=\\\"checked: timeFormat\\\"\"+pug.attr(\"aria-label\", i18n.get('ImprovedAdScheduling_12_Hour_Label'), true, true)) + \"\\u003E\\u003Cspan\\u003E\" + (pug.escape(null == (pug_interp = i18n.get('ImprovedAdScheduling_12_Hour_Label')) ? \"\" : pug_interp)) + \"\\u003C\\u002Fspan\\u003E\\u003C\\u002Fspan\\u003E\\u003Cspan class=\\\"col-md-3 radio\\\"\\u003E\\u003Cinput\" + (\" type=\\\"radio\\\" name=\\\"timeformat\\\" value=\\\"24hour\\\" data-bind=\\\"checked: timeFormat\\\"\"+pug.attr(\"aria-label\", i18n.get('ImprovedAdScheduling_24_Hour_Label'), true, true)) + \"\\u003E\\u003Cspan\\u003E\" + (pug.escape(null == (pug_interp = i18n.get('ImprovedAdScheduling_24_Hour_Label')) ? \"\" : pug_interp)) + \"\\u003C\\u002Fspan\\u003E\\u003C\\u002Fspan\\u003E\\u003C\\u002Fdiv\\u003E\\u003C\\u002Fdiv\\u003E\\u003Cdiv class=\\\"section-item form-group\\\" data-bind=\\\"visible: nonAutoScheduledImport()\\\"\\u003E\\u003Clabel class=\\\"item-label section-item-label col-xs-2 control-label\\\"\\u003E\" + (pug.escape(null == (pug_interp = i18n.get('CampaignSetting_TimeZone')) ? \"\" : pug_interp)) + \"\\u003C\\u002Flabel\\u003E\\u003Cdiv class=\\\"col-xs-4\\\"\\u003E\\u003Cselect\" + (\" class=\\\"form-control form-control\\\"\"+\" data-bind=\\\"options: timeZones, value: chosenTimeZone\\\"\"+pug.attr(\"aria-label\", i18n.get('CampaignSetting_TimeZone'), true, true)) + \"\\u003E\\u003C\\u002Fselect\\u003E\\u003C\\u002Fdiv\\u003E\\u003C\\u002Fdiv\\u003E\\u003Cdiv class=\\\"section-item form-group\\\" data-bind=\\\"visible: scheduledImport()\\\"\\u003E\\u003Clabel class=\\\"item-label section-item-label col-xs-2 control-label\\\"\\u003E\" + (pug.escape(null == (pug_interp = i18n.get('Scheduled_Import_Name')) ? \"\" : pug_interp)) + \"\\u003C\\u002Flabel\\u003E\\u003Cdiv class=\\\"col-xs-4\\\"\\u003E\\u003Cinput\" + (\" class=\\\"form-control form-control\\\"\"+\" type=\\\"text\\\" name=\\\"importname\\\" data-bind=\\\"textInput: importName, attr: { maxlength: maxLength }, css: {"error": !importName.isValid()}\\\" aria-describedby=\\\"ScheduledImportValidationError\\\"\"+pug.attr(\"aria-label\", i18n.get('Scheduled_Import_Name'), true, true)) + \"\\u003E\\u003Cdiv class=\\\"fieldInfoAd\\\"\\u003E\";\npug_mixins[\"koCharactersRemaining\"]('importName');\npug_html = pug_html + \"\\u003C\\u002Fdiv\\u003E\";\npug_mixins[\"koValidationError\"]('importName', 'ScheduledImportValidationError');\npug_html = pug_html + \"\\u003C\\u002Fdiv\\u003E\\u003C\\u002Fdiv\\u003E\\u003Cdiv class=\\\"section-item form-group\\\" data-bind=\\\"visible: scheduledImport()\\\"\\u003E\\u003Clabel class=\\\"item-label section-item-label col-xs-2 control-label\\\"\\u003E\" + (pug.escape(null == (pug_interp = i18n.get('AutomatedRules_RuleAuthoring_EmailResults')) ? \"\" : pug_interp)) + \"\\u003C\\u002Flabel\\u003E\\u003Cdiv class=\\\"col-xs-4\\\"\\u003E\\u003Cselect\" + (\" class=\\\"form-control form-control\\\"\"+\" data-bind=\\\"options: emailOptions, optionsText: 'text', value: chosenEmailOption\\\"\"+pug.attr(\"aria-label\", i18n.get('AutomatedRules_RuleAuthoring_EmailResults'), true, true)) + \"\\u003E\\u003C\\u002Fselect\\u003E\\u003C\\u002Fdiv\\u003E\\u003C\\u002Fdiv\\u003E\\u003Cdiv class=\\\"section-item form-group notification-email-addresses\\\" data-bind=\\\"visible: scheduledImport() && showMultiEmail()\\\"\\u003E\\u003Clabel class=\\\"item-label-section-item-label col-xs-2 control-label\\\"\\u003E\" + (pug.escape(null == (pug_interp = i18n.get('Scheduled_Import_MultiEmail')) ? \"\" : pug_interp)) + \"\\u003C\\u002Flabel\\u003E\\u003Cdiv class=\\\"col-xs-4\\\"\\u003E\\u003Ctextarea class=\\\"form-control\\\" name=\\\"\\\" cols=\\\"20\\\" rows=\\\"3\\\" data-bind=\\\"textInput: emailAddresses\\\"\\u003E\\u003C\\u002Ftextarea\\u003E\\u003Cdiv class=\\\"fieldInfoAd\\\"\\u003E\\u003Cdiv class=\\\"remaining-hint help-block\\\"\\u003E\\u003Cspan\\u003E\" + (pug.escape(null == (pug_interp = i18n.get('Scheduled_Import_MultiEmail_Hint')) ? \"\" : pug_interp)) + \"\\u003C\\u002Fspan\\u003E\\u003C\\u002Fdiv\\u003E\\u003C\\u002Fdiv\\u003E\\u003Cspan class=\\\"email-address-error error\\\" data-bind=\\\"visible: emailAddressError(), text: emailAddressErrorMessage()\\\"\\u003E\\u003C\\u002Fspan\\u003E\\u003C\\u002Fdiv\\u003E\\u003C\\u002Fdiv\\u003E\\u003Cdiv class=\\\"section-item form-group\\\" data-bind=\\\"visible: scheduledImport() && scheduleFromImportSummary\\\"\\u003E\\u003Cbutton class=\\\"btn btn-primary schedule-from-import-summary-button\\\" style=\\\"margin-left:10px;\\\"\\u003E\" + (pug.escape(null == (pug_interp = i18n.get('Scheduled_Import_Schedule_Button')) ? \"\" : pug_interp)) + \"\\u003C\\u002Fbutton\\u003E\\u003C\\u002Fdiv\\u003E\\u003C\\u002Fdiv\\u003E\\u003C\\u002Fdiv\\u003E\\u003C\\u002Fdiv\\u003E\";}.call(this,\"i18n\" in locals_for_with?locals_for_with.i18n:typeof i18n!==\"undefined\"?i18n:undefined,\"importSourceName\" in locals_for_with?locals_for_with.importSourceName:typeof importSourceName!==\"undefined\"?importSourceName:undefined));;return pug_html;};\nmodule.exports = template;","var pug = require(\"!../../../../../../../node_modules/.pnpm/pug@2.0.4/node_modules/pug-runtime/index.js\");\n\nfunction template(locals) {var pug_html = \"\", pug_mixins = {}, pug_interp;pug_html = pug_html + \"\\u003Cdiv class=\\\"schedule-import-container\\\"\\u003E\\u003C\\u002Fdiv\\u003E\\u003Cdiv class=\\\"error-panel\\\"\\u003E\\u003C\\u002Fdiv\\u003E\";;return pug_html;};\nmodule.exports = template;","var pug = require(\"!../../../../../../../node_modules/.pnpm/pug@2.0.4/node_modules/pug-runtime/index.js\");\n\nfunction template(locals) {var pug_html = \"\", pug_mixins = {}, pug_interp;;var locals_for_with = (locals || {});(function (i18n, merchantCenterPlaceholderStoreNote, showAlert, summaryText) {pug_html = pug_html + \"\\u003Cdiv class=\\\"form-group\\\"\\u003E\\u003Cdiv\\u003E\" + (pug.escape(null == (pug_interp = summaryText) ? \"\" : pug_interp)) + \"\\u003C\\u002Fdiv\\u003E\\u003Cdiv\\u003E\" + (pug.escape(null == (pug_interp = merchantCenterPlaceholderStoreNote) ? \"\" : pug_interp)) + \"\\u003C\\u002Fdiv\\u003E\\u003C\\u002Fdiv\\u003E\";\nif (showAlert) {\npug_html = pug_html + \"\\u003Cdiv class=\\\"alert alert-info\\\" role=\\\"alert\\\" style=\\\"margin-bottom: 15px\\\"\\u003E\\u003Cspan class=\\\"infomark infoalign\\\"\\u003E\\u003C\\u002Fspan\\u003E\\u003Cspan\\u003E\" + (pug.escape(null == (pug_interp = i18n.get('Import_SelectCampaign_DisplayCampaignAlert')) ? \"\" : pug_interp)) + \"\\u003C\\u002Fspan\\u003E\\u003C\\u002Fdiv\\u003E\";\n}}.call(this,\"i18n\" in locals_for_with?locals_for_with.i18n:typeof i18n!==\"undefined\"?i18n:undefined,\"merchantCenterPlaceholderStoreNote\" in locals_for_with?locals_for_with.merchantCenterPlaceholderStoreNote:typeof merchantCenterPlaceholderStoreNote!==\"undefined\"?merchantCenterPlaceholderStoreNote:undefined,\"showAlert\" in locals_for_with?locals_for_with.showAlert:typeof showAlert!==\"undefined\"?showAlert:undefined,\"summaryText\" in locals_for_with?locals_for_with.summaryText:typeof summaryText!==\"undefined\"?summaryText:undefined));;return pug_html;};\nmodule.exports = template;","var pug = require(\"!../../../../../../node_modules/.pnpm/pug@2.0.4/node_modules/pug-runtime/index.js\");\n\nfunction template(locals) {var pug_html = \"\", pug_mixins = {}, pug_interp;;var locals_for_with = (locals || {});(function (currentAccount, currentGoogleAccount, i18n, singleAccountMode) {pug_html = pug_html + \"\\u003Cdiv class=\\\"form-group\\\"\\u003E\\u003C!-- ko ifnot: isLoggedIn--\\u003E\";\nif (singleAccountMode) {\npug_html = pug_html + ((pug.escape(null == (pug_interp = i18n.get('GoogleImport_LoginDisclaimer')) ? \"\" : pug_interp)) + (pug.escape(null == (pug_interp = i18n.get('GoogleImport_BingAdsAccount_LoggedOut_Title')) ? \"\" : pug_interp)) + (pug.escape(null == (pug_interp = currentAccount) ? \"\" : pug_interp)));\n}\nelse {\npug_html = pug_html + (pug.escape(null == (pug_interp = i18n.get('GoogleImport_MultiAccount_LoginDisclaimer')) ? \"\" : pug_interp));\n}\npug_html = pug_html + \"\\u003C!-- \\u002Fko--\\u003E\\u003C!-- ko if: isLoggedIn--\\u003E\";\nif (singleAccountMode) {\npug_html = pug_html + ((pug.escape(null == (pug_interp = i18n.get('GoogleImport_BingAdsAccount_Title')) ? \"\" : pug_interp)) + (pug.escape(null == (pug_interp = currentAccount) ? \"\" : pug_interp)) + \"\" + (pug.escape(null == (pug_interp = i18n.get('GoogleImport_LoginAccount_WithBingAdsAccount_Title')) ? \"\" : pug_interp)) + (pug.escape(null == (pug_interp = currentGoogleAccount) ? \"\" : pug_interp)));\n}\nelse {\npug_html = pug_html + ((pug.escape(null == (pug_interp = i18n.get('GoogleImport_MultiLoginAccount_WithBingAdsAccount_Title')) ? \"\" : pug_interp)) + (pug.escape(null == (pug_interp = currentGoogleAccount) ? \"\" : pug_interp)));\n}\npug_html = pug_html + \"\\u003C!-- \\u002Fko--\\u003E\\u003C\\u002Fdiv\\u003E\\u003Cdiv class=\\\"form-group\\\"\\u003E\\u003Cspan class=\\\"error\\\" data-bind=\\\"html:errorMsg, attr: { role: errorMsgRole }\\\"\\u003E\\u003C\\u002Fspan\\u003E\\u003C\\u002Fdiv\\u003E\\u003Ciframe name=\\\"logoutIFrame\\\" style=\\\"display: none;\\\"\\u003E\\u003C\\u002Fiframe\\u003E\";}.call(this,\"currentAccount\" in locals_for_with?locals_for_with.currentAccount:typeof currentAccount!==\"undefined\"?currentAccount:undefined,\"currentGoogleAccount\" in locals_for_with?locals_for_with.currentGoogleAccount:typeof currentGoogleAccount!==\"undefined\"?currentGoogleAccount:undefined,\"i18n\" in locals_for_with?locals_for_with.i18n:typeof i18n!==\"undefined\"?i18n:undefined,\"singleAccountMode\" in locals_for_with?locals_for_with.singleAccountMode:typeof singleAccountMode!==\"undefined\"?singleAccountMode:undefined));;return pug_html;};\nmodule.exports = template;"],"names":["defaultOptions","ImportNewEntities","ImportUpdatedEntities","importType","MultiAccountGoogleImportRepository","_GoogleImportReposito","_ref","deps","_classCallCheck","_callSuper","_inherits","_createClass","key","value","authCode","url","_","AccountId","this","aid","AuthCode","startGoogleSessionInternal","token","Token","sessionId","SessionId","odata","get","arguments","length","undefined","getGoogleSessionIdFromCookie","googleCustomerId","formatUrl","queryParameters","getGoogleCampaignsInternal","timeZoneId","bingAccountInfo","adWordsImportContext","Id","AdWordsImportContext","CampaignTimeZone","timeZoneEnumMapper","getEnumbyId","config","CultureName","LCID","AdGroupMedium","adGroupMedium","Language","language","CustomerMarket","market","ImportType","AccountName","Name","AccountNumber","UserName","_ref2","googleAccountName","_this","importOptions","stepState","importUserPreferences","notificationType","notificationEmailAddresses","taskItemState","name","cron","loginCustomerId","initialAdWordsAccount","selectedCampaignIds","selectedGoogleAccountToBingAccountMap","selectedGoogleAccounts","bingAccount","info","getGoogleImportInfoFromCookie","googleSessionId","importTaskItemList","forEach","googleAccount","campaignIds","CustomerId","LoginCustomerId","CampaignIds","bingAccountId","GoogleCustomerId","BingAccountId","singleAccountGoogleImportTaskItem","prepareSingleAccountGoogleImportTaskItem","push","multiAccountGoogleImportTaskItem","ImportUserPreference","NotificationEmailAddresses","ImportTaskItemList","NotificationType","Type","concat","testTypeSuffix","NotificationMedium","TimeZoneId","State","Cron","Promise","googleCustomerList","_this2","preferences","getMultiAccountImportUserPreferenceWithBMCandMinInfo","then","userPref","googleCustomerIdList","getMultiAccountGoogleAccountProperties","join","result","TrackingTemplate","FinalUrlSuffix","item","trackingTemplate","finalUrlSuffix","AdWordsAccountTrackingTemplate","AdWordsAccountFinalUrlSuffix","storeIds","storeList","id","parseInt","AvailableStoreValues","AvailableStoreValueMessages","getImportUserPreference","logTrace","options","routerValue","addDefaultParameters","cid","uid","urlUtil","isForVNext","router","navigateToRoute","formatCustomerLevelUrl","navigateToUrl","GoogleImportRepository","BingAccountGridViewModel","i18n","AccountSelectionList","SelectedAccountIdList","selectedlists","ko","listDataCallBack","cb","accountlist","fetch","done","response","accounts","account","AccountMode","setStatusCssClass","items","total","setSelectedList","Status","StatusCssClass","selectedAccountNumbers","accountSelectionHash","selectedAccountNumber","showValidationError","hasError","stringsMapping","sourceItems","selectedItems","BingAccountTitleGridView","_Backbone$View","DoubleListBox","$el","html","template","koModel","el","subscribe","trigger","doubleListControlOptions","$","strings","data","itemIdField","itemFilterField","selectedPageSize","pageSize","useCallbackForFetchOnly","features","selectAll","deselectAll","filtering","paging","templates","sourceItemLayoutTemplate","sourceItemTemplate","selectedItemLayoutTemplate","selectedItemTemplate","sourceItemContentTemplate","itemContentTemplate","selectedItemContentTemplate","itemActions","doubleListBox","render","newValue","attr","Backbone","BingAccountTitleStep","_BaseImportStep","_superPropGet","isContinueButtonEnabled","buildTitle","activeTitle","summaryTitle","state","getState","isEditingScheduledImport","initialSettings","selectedBingAccountIds","strMultiAccountPreSelectedAccountIds","preSelectedAccountIds","split","accontId","set","grid","accountSelectionLists","on","isEdited","isValid","patchState","singleAccount","original","enabled","BaseImportStep","MultiGoogleAccountGridViewModel","SelectedAcountMaxCount","selectedAccount","accountMap","selectedAccountsHasCampaigns","hasNoCampaignsCustomerNameList","isDropdownMenuExpanded","showNoSelectedGoogleAccountError","showNoSelectedBingAccountError","showSelectedAccountCountExceedLimitError","showSelectedGoogleAccountNoCampaignError","BingAccountDropDownMenu","_React$PureComponent","props","onSelect","selectedItem","setState","updateSelection","onFetch","_ref$query","query","pageNumber","filterItems","bingAccountList","toLowerCase","indexOf","slice","totalCount","renderEmptyList","_jsx","className","children","getString","renderItem","_jsxs","title","Currency","selectedBingAccountId","enableArrowKeysSupport","ariaLabel","FocusLock","EntitySelector","React","defaultProps","BingAccountListDropDownView","_len","args","Array","_key","selectedItemId","updateBingAccountId","updatedAccountMap","selectorString","bingAccountSelectionPlaceholder","updateBingAccountName","innerText","dropdownToggleSelector","setAttribute","remove","document","off","eventName","dropDownMenu","unavailableBingAccountIdList","toString","dropdownToggleString","element","grandparentEle","parentEle","createElement","appendChild","_element$getBoundingC","getBoundingClientRect","top","left","height","width","style","ReactDOM","ref","MultiGoogleAccountGridView","isRowSelected","selectedBingAccount","accountPair","parentElement","googleAccountData","bingAccountData","initialAccountMap","event","stopPropagation","target","closest","getAttribute","bingAccountListView","view","e","hasClass","parents","innerHTML","append","dataSource","type","primaryKey","selection","single","bodyClasses","headClasses","scrolling","virtualized","header","columns","sortable","accountName","field","property","helpId","local","enableToggleButton","selectedBingAccountName","BingAccountSelectionColTemplate","tableClasses","plugins","a11y","filter","search","container","placeholder","text","uiBlocker","generateConfig","obj","projectionGrid","vnext","use","a11yPlugin","placeholderPlugin","generateFilterPlugin","assistedSelectionPlugin","uiBlockerPlugin","create","gridView","memoryFilter","changes","addClass","itemArray","selected","removeClass","once","initialSelectedAccount","selectRow","googleCampaignsForSelectedAccounts","_this3","invalidCustomerNameList","googleCampaigns","invalidCustomerName","MultiAccountGoogleAccountStep","getSelectedItem","checkIfShouldUpdateAndResetFlagIfTrue","logActivities","renderSelectAdWordsAccount","start","hasNoData","currencyConversionView","CurrencyConversionView","ImportSource","google","importSourceAccountCurrency","bingAccountCurrency","isSingleAccountMode","googleCurrency","bingCurrency","stop","promises","repository","getGoogleCampaigns","autoCurrencyConversionEnabled","doConvert","validateSelectedAccountsHasCampaigns","catch","err","handleErrorInImport","finally","withUiBlock","GoogleAccountSelector","switchGoogleAccount","googleAccountList","dropdownMenuAriaLabel","DropdownSelector","mode","PageSize","renderSelectedItem","MultiAccountGoogleCampaignGridViewModel","editGoogleCampaignSelection","googleCampaignList","selectedGoogleCustomerId","selectedGoogleAccountFullCampaignList","cloneDeep","initCampaignSelection","itemCampaignIds","editItem","multiAccountsCampaignSelectionInfo","MultiAccountGoogleCampaignGridView","appConfig","repo","showPaused","renderGoogleAccountSelector","renderSingleAccountCampaignGridView","applyInitialSelection","googleAccountSelectorProps","bind","googleAccountSelectorElement","singleAccountView","createGoogleCampaignGridView","multiAccountMode","isAIMImportEnabled","IsAIMCampaignEnabled","disabled","updateMultiAccountCampaignSelectionInfo","getCurrentSetting","reservedInfoForSelectedAccount","selectCampaigns","importAll","selectedCustomerId","updatedMultiAccountsCampaignSelectionInfo","selectedCampaigns","allCampaigns","selectedCampaignId","campaignId","selectedCampaign","MultiAccountGoogleCampaignStep","generateImportUserPreferencesFromPreviousOptions","permissions","renderSelectAdWordsCampaigns","itemCustomerId","htmlAttributes","googleCampaignsSummary","getSummaryInfo","includePausedCampaigns","areAnyPausedCampaignsSelected","campaigns","allSelected","userCampaignSelection","totalCampaigns","CampaignSelection","getMultiAccountGoogleImportUserPreferences","previousImportOptions","onCredentialsError","handleGenericError","MultiAccountScheduleImportStep","_ScheduleImportStep","IsMultiAccountImport","taskItemBody","scheduleFormView","serializeImportSchedulingOptions","scheduledTaskItemBody","runNowTaskItemBody","prepareMultiAccountGoogleImportTaskItem","scheduleBody","createScheduledImportAndGoNextWhenReady","isScheduledImport","runNowBody","createRunNowImportAndGoNextWhenReady","ImportUserSettings","ScheduleFrequency","viewModel","chosenFrequency","ImportOptions","finalBody","scheduledTimeDisplayString","getDisplayString","updateScheduledImportTaskItem","taskItemId","createScheduledImportTaskItem","importButtonEnabled","_this4","createRunNowImportTaskItem","ScheduleImportStep","MultiAccountImportSummaryStep","_ImportSummaryStep","showDisplayCampaignAlert","containDisplayType","getSelectedCampaigns","summaryText","replace","showAlert","displayText","method","class","redirectToImportScheduleAndHistory","tmp","campaign","cm","includes","ImportSummaryStep","MultiAccountGoogleImportStepFactory","check","steps","stepName","stepView","linkTextForTitle","createBingAccountTitleStep","GoogleLoginStep","previousStepName","singleAccountMode","createGoogleLoginStep","createGoogleAccountStep","createGoogleCampaignStep","GoogleImportOptionsStep","isCustomerLevel","createImportOptionsStep","createScheduleImportStep","createImportSummaryStep","MultiAccountGoogleImportPage","_ref$options","checkRequiredDepsForGoogleImport","perfMarker","pageTitle","subTitle","isGoogleAccountSkipped","googleImportRepository","initialState","baseImportOptions","createSteps","isContinueImport","importId","subFieldsBlacklist","showAllStepsInLastStepFunc","currentStep","enableEdit","onSwitchFinished","hide","$accountEdit","show","_this$googleImportRep","apply","willRender","initialStateFetchPromise","getImportTaskItem","taskItem","currentUserId","ModifiedBy","cookieHelperForEditImport","getSessionId","deleteCookie","baseImportView","BaseImportView","attachPageEventHandlers","googleLoginStepView","googleCampaignStepView","logoutGoogle","currentStepInstance","savedSetting","isEditEnabledForWizard","goToStep","targetRect","PopoverView","position","isAbsolute","bottom","containerClassName","setContent","contents","TitledContent","setTitle","setBody","BingAccountViewDetailsTempalte","selectedAccounts","tempGoogleCustomerName","tempBingAccountName","customizedContents","showPopoverTableView","logoutGoogleWithErrorMessage","onContinueImportView","_this$initialState$in","setGoogleImportAccountInfoInCookie","loginAccount","StepConstants","SignInStep","path","_TL_","ChooseAccounts","StartImportSmart","AmazonCampaignStep","ImportOptionStep","StartImportAdvanced","ImportStatusStep","keyNameOfSessionIdInCookie","keyNameOfLoginAccountInCookie","AmazonImportRepository","_CommonImportReposito","edm","jsData","taskItemOptions","adapter","entitySet","currentAccount","TaskItems","ccJsData","getValueInSubImportCookieByAccountId","getAmazonSessionIdFromCookie","addSubCookieToImportCookie","_defineProperty","notUpdateCookie","post","_ref3","AmazonSessionId","AmazonLoginEmail","setAmazonImportAccountInfoInCookie","startAmazonSessionInternal","removeImportCookieValue","getAmazonLoginAccountFromCookie","_objectSpread","String","toUpperCase","blobName","getEntitiesBlob","blob","getBulkBlob","amazonAccountId","marketPlace","ExternalAccountId","AmazonMarketPlace","status","map","filterAndLocalizeAmazonCampaignsUtil","newI18n","logError","customerId","amazonCampaigns","getAmazonCampaigns","selectionData","getSelectionDataFromBlob","finalState","_ref4","ids","availableIdBoolMap","getImportUserPreferencesWithBMCandMinInfo","amazonAccountName","StringPayload","content","JSON","stringify","_ref5","amazonCustomerId","initialAmazonAccount","amazonEntitiesSelectionData","getAmazonImportInfoFromCookie","getAmazonAccountName","amazonImportContext","ProfileId","AmazonSessionUserId","AmazonMarketPlaceType","uploadToAzureBlobViaOdata","bulkFileType","payload","serializeAmazonEntitiesSelectionDataToStringPayload","AmazonEntitiesBlobName","BlobName","_ref6","_importOptions$import","prepareAmazonImportContext","prepareCompleteImportTaskItem","AmazonImportContext","CommonImportRepository","AmazonLoginRepository","empty","isAmazonLoginReady","window","amazon","resolve","onAmazonLoginReady","Login","setClientId","CLIENT_ID","setUseCookie","require","ensureAmazonLoginReady","reject","authorize","interactive","popup","scope","SCOPE","response_type","code_challenge_method","error","code","logout","PermissionFactory","_CommonPermissionFact","IsImportSmartScheduleStepImprovementPhaseTwoEnabled","IsImportSmartScheduleStepPanelImprovementEnabled","IsImportSmartScheduleStepPanelDataRestoreImprovementEnabled","CommonPermissionFactory","prefetchConfig","handleError","fetchAccounts","getAmazonAccounts","getExistingAccounts","context","amazonAccounts","getExistingSelectedAccount","getSelectedAccounts","getNewStateAfterAccountsLoaded","__","originalState","withAmazonImportAccountSelectionStepPrefetch","Step","withAccountSelectionStepPrefetch","logoutResetData","autoConvertCurrencyEnabled","UnstyledLoginContainer","loginToAmazon","startAmazonSessionWithToken","toNextStep","loginRepository","login","startAmazonSession","isLoggedIn","res","errorMsg","handleAmazonLoginError","goToNextStep","nextStepPath","isUserLoggedIn","loginPerfMarker","classes","isInActiveAccount","descriptionBox","link","HelpLink","PrimaryButton","buttonMargin","onClick","DefaultButton","classnames","errorMessage","LoginContainer","withDefaultStyles","withActivityContext","fontSize","lineHeight","marginBottom","color","textDecoration","outline","marginTop","marginRight","AmazonLoginStepWithoutPrefetch","stepTitle","stepPrefetchHoc","WrappedLoginContainer","ImportCoreContext","Consumer","contextValues","getUniqueImportGUID","uniqueImportId","Activity","StepContainer","actionBarConfig","AmazonLoginStep","PreExecuteStep","LoginStepPrefetch","importCoreContext","useContext","rootContainerClassName","existingAmazonAccount","_importCoreContext$lo","logOutButtonClicked","_useState","useState","_useState2","_slicedToArray","loading","setLoading","_useState3","_useState4","dispatchedOdataCall","setDispatchedOdataCall","isNameEdit","_taskItem$AmazonImpor","_initialState$initial","_initialState$initial2","IsAutoFrequency","IsSmartImport","EnableAutoCurrencyConversion","importStep","values","withLoginStepPrefetch","getActionBarItems","shouldGoToNextStep","prevStepName","validateFunction","nextStepName","nextButtonDisabled","extraLeftPadding","AmazonImportAccountSelector","AccountSelector","getSelectedListColumns","fieldName","REMOVE_COLUMN","getAccountListColumns","minWidth","maxWidth","isResizable","ADD_COLUMN","headerClassName","maxSelectedItems","sortableColumns","searchableField","primaryField","description","currencyViewDescription","importAccountCurrencyTitle","AmazonAccountStepInternal","setError","msg","clearError","validate","WrappedAccountSelector","accountsPageError","_this$props","prevStepNameIfPrefetchFail","nextStepNameIfPrefetchOnlyOneAccount","isCurrencyConvertorDisabled","rootClassName","ErrorContainer","AmazonAccountStep","startImporting","isReadOnly","scheduleOnly","onSwitchCustomizeMode","getPrevStepName","permissionFactory","primary","IsImportSmartScheduleStepImprovementEnabled","withSmartImportStepPrefetch","PreExecuteComponent","SmartImportStepPrefetch","_importCoreContext$ac","accountToCampaignsOptionsMapping","toggleCampaignsSelectionStep","doAllAccountsHaveCampaign","accountsToCampaign","accountIdsWithNoCampaign","accountWithNoCampaigns","accountId","accountMatchingCustomerId","accountIdsToFetch","promiseObject","MarketPlace","prepareForCampaignSelectionStep","getUserPreferences","getAmazonImportUserPreferences","alreadySelectedAmazonAccounts","mapping","campaignsData","hasAccountsWithNoCampaigns","amazonCampaingsForCustomerId","preference","filteredAccountsToCampaign","StartImportErrorCodes","TaskSchedulingInvalid","AmazonSyncApiInternalError","AmazonSyncThrottlingLimitReached","AmazonSyncAccessDenied","GenericImportError","formatTaskData","taskData","scheduleStepState","createImportAndGoNextWhenReady","generateTaskData","setImportStatus","activity","getNextStepName","showErrorMessage","_generateTaskData","isRunNowWithScheduledImport","isRunNowImport","importOptionsRunnow","prepareAmazonImportTaskItem","toggleShowImportStatusStep","taskItemExecutionId","first","TaskItemExecutions","hideProgressList","toggleShowImportSummary","errors","ODataError","chain","signal","getAdvancedCustomizingStepName","StartImportSmartStep","GeneralStartImportStep","isCustomizingModeEnabled","shouldGoToPreviousStep","getSubFieldsBlackList","getBlackList","importOptionFieldHelpIds","UpdateEntityPreferences","DefaultBidsBelowMinToAdCenterMinBid","DefaultCampaignBudgetBelowMinToAdCenterMinBudget","AdjustmentForBids_EnableAdjustment","AdjustmentForCampaignBudgets_EnableAdjustment","ImportNewOption_ImportNewActiveEntitiesOnly","getImportOptionFields","params","optionFields","getDefaultImportOptionFields","hideEntityAdvancedOptions","helpIds","opt","fields","newField","label","showLabel","AmazonImportOptionsStep","ImportOptionsStep","isGoogleImport","StartImportAdvancedStep","GeneralStartImportAdvancedStep","noFacAlert","noCampaignErrorMessage","onSaveAmazonImportScheduleInfo","tasks","displaystring","onEditScheduleClose","getStateValue","defaultName","notificationApi","add","severity","NotificationLevel","Confirmation","message","scheduleSummaryString","getAmazonImportDetailsView","importSchedulingOptions","ImportSchedulingOptions","frequencyStat","parseCronToDisplayString","timeZoneMapper","labelClassName","Title","cardPanelTitles","Additions","AmazonImportSummaryStep","GenericImportSummaryPage","importName","onSaveScheduleInfo","getImportDetailsView","learnMoreText","noCampaignAlert","GeneralImportStatusStep","VerticalSeparatedLayout","getAmazonLoginStep","renderDescription","LoginDescription","signOut","toggleImportType","Smart","AmazonImportPage","componentDidUpdate","prevProps","location","isInit","importMode","ImportMode","Single","showImportSummary","showImportStatusStep","importStatus","startStep","showCampaignSelectionStep","uniqueImportGUID","generateGuid","initialize","getImportType","getImportStatus","getImportMode","getImportScope","ImportScope","willFetchData","checkRequiredDeps","serverContext","createChild","willInit","amazonLoginRepository","Multi","toggleImportMode","constructSteps","getAmazonAccountStep","isEnabled","brandName","getStartImportSmartStep","Advanced","CampaignSelectionStep","campaignsName","getCampaigns","entitiesSelectionDataName","getAmazonCampaignStep","getAmazonImportOptionsStep","facScheduleInvalid","facNoActiveCampaigns","getStartImportAdvancedStep","_ref7","getImportSummaryStep","_ref8","getImportStatusStep","_this$repository","minHeight","display","flexDirection","Scenario","BaseImportCore","stepConstants","handleCancelButtonClick","redirectToCampaigns","createFacebookLoginStep","FacebookLoginStep","createFacebookAccountStep","AccountSelectionStep","importSourceName","importSource","getStateAdapter","createFacebookCampaignStep","isAdGroupLevelImportEnabled","getCampaignGridConfig","defaultConfig","getDefaultCampaignGridConfig","c","splice","pausedFilter","alwaysEnable","labels","summaryDisclaimerKey","summaryDisclaimerHelpLinkKey","loginSummary","accountSummary","campaignsAndAdGroupsSummary","campaignSummary","summaryHelpTopic","FacebookImportStepFactory","AccountTitleStep","createAccountTitleStep","isPauseAdGroupIfNoLocationSupportedEnabled","BaseScheduleImportStep","FacebookImportPage","checkRequiredDepsForFacebookImport","PerfMarkerFactory","createMarker","autoEnd","isFacebookAccountSkipped","facebookImportRepository","FacebookImportRepository","facebook","wizard","_this$facebookImportR","_this$facebookImportR2","initBaseViewPromise","FacebookImportContext","isLoadingFBScriptFailed","FB","Error","facebookLoginStepView","facebookAccountStepView","facebookCampaignStepView","logoutFacebook","isSignUpMode","logoutFacebookWithErrorMessage","setFacebookImportAccountInfoInCookie","continue","_ref$singleAccountMod","signupMode","uxMode","permissionsDeclined","actions","getFacebookAccountName","errorMsgRole","FacebookLoginTemplate","currentFacebookAccount","logInAccount","startSignal","logScenario","clickOnSignInButton","rerequest","onSuccess","accessToken","startSessionPromise","startFacebookSession","processSignIn","onPermissionsDeclined","permissionsDescription","declinedScopes","ds","onFail","authErrors","stopSignal","getFacebookImportInfoFromCookie","facebookSessionId","getFacebookAccounts","accountData","facebookAccount","ExtensionData","facebookLoginSummary","shouldConvertCurrency","FacebookEntitiesBlobName","extraState","facebookAccountSummary","validateSelectedAccountCampaigns","facebookCampaigns","accountSelectionSkipped","soleFacebookAccount","facebookCustomerId","startFacebookSessionWithToken","body","i18nErrors","_this5","postLogout","errMsg","FileImportRepository","azureUploader","isBaiduFileImportEnabled","dynamic","BaiduFileImport","CNMarketExpansion","typeFieldWhenCreatingTaskExecution","importFile","file","blobUrl","fileFormat","filePath","lcId","ImportFormat","formattedData","SampleRows","row","cell","index","formatSampleData","isImportStatusValid","CurrentImportStatus","filterLocalizedEntities","fileName","columnMapping","model","ImportAction","ImportColToAdCenterMapField","FileImportContext","UploadedFileName","FilePath","createImportTaskItemExecution","prepareBaseImportTaskItem","ImportId","ImportStatus","FileFormatViewModel","selectedFormatValue","FileFormatView","_View","valueMessages","fileFormatTemplate","validationErrorMessage","View","FILE_FORMATS","FILE_FORMATS_STRINGS","FileUploadStep","isFileFormatEnabled","IsImportFileFormatEnabled","hasNoFileSelected","filePickerView","FilePicker","theme","allowedFileExtensions","validateFileExtensionsFailedMessage","validator","size","isNative","displayFilePath","fileFormatView","importTemplateUrl","resetStatus","entityNames","fileObject","hasErrors","addExternalValidationErrors","getSelectedValue","uploadFile","fileUploadSummary","getColumnMapping","columnMappingData","localizedError","getLocalizedErrorMessage","onSelectChanged","$target","val","notMappedValueStr","ColumnMatchingGridView","defaultColumns","notMappedValue","ImportHeader","customizedHeaderCells","attributes","selectedColumnKey","found","EnumName","ColumnMappingStrings","headerCellDropDownTmpl","cellIndex","selectedOption","showError","rows","headRows","cells","tableAttributes","allMapped","allNotMapped","each","elem","ColumnMatchingStep","showAllNotMappedError","getMappingState","renderImportColumnMatching","columnMatchingSummary","getFileImportUserPreferences","FileImportOptionsStep","_ImportOptionsStep","stepRemoved","subFieldsBlacklistForBaidu","PauseNewCampaigns","ImportActiveOnlyNewCampaigns","subFieldsBlacklistForDefault","renderForm","preparePreviewPromise","closeBlock","isEditedOrFirstSubmit","cancelCurrentImport","createPreviewTaskExecutionAndStartPolling","pollGetImportStatus","importOptionsForm","IsSkipFileImportPreviewStepEnabled","getImportSummary","summary","applyButtonEnabled","getImportPreview","preview","customized","errorCode","importPref","getImportOptions","updateStateWithFormInfo","createFullTaskExecution","taskExecutionId","pollTaskItemExecutionStatus","createPreviewTaskExecution","ImportPreviewStep","renderImportPreview","hasStats","prepareSummaryPromise","hasImportPreviewBeenApplied","createCommitTaskExecution","FileImportSummaryStep","summaryInfos","importOptionsSummary","FileImportStepFactory","createFileUploadStep","createColumnMatchingStep","createImportPreviewStep","FileImportPage","checkRequiredDepsForFileImport","renderPromise","isPreviewImportFromLogGrid","startPollingAfterContinueImport","InstantSearchViewModel","searchString","inEditMode","InstantSearch","_ref$placeholder","trimmedVal","preventDefault","which","ShowPausedFilterViewModel","disableShowPause","disable","ShowPausedFilter","shouldDisableThisFilter","func","_ref$logTrace","definePlugin","searchBoxView","searchValue","showPausedView","showPausedChecked","activeData","filterConfig","searchConfig","searchProperty","pausedConfig","showPausedFilterProperty","searchFilter","isActive","generateFilterFunction","filterConditions","setFilter","forceHide","hasNoActiveData","filteredData","checked","totalDataWithActiveFilter","enableShowPaused","getShowPausedValue","CampaignGridViewModel","_ref$isAIMImportEnabl","hasDiplayCampaign","Editing","read","write","columnsConfig","toolbar","tableName","CampaignGridView","_ref$data","_ref$showPaused","_ref$multiAccountMode","getGridConfig","localizedData","sortedData","getConfig","toolbarList","dataForImportAll","maxLen","ensureRenderImportSpecific","renderImportSpecific","memo","wrappedSetCampaigns","setSelectedCampaignsInGrid","_isRendered","_this6","totalCampaignsNumber","selectedCampaignsNumber","totalActiveCampaignsNumber","arrayOf","shape","number","isRequired","string","getGoogleAdGroupsByCampaignId","availableWithFilter","bool","parseDecimal","selectedWithActiveOnly","selectedAdGroupMap","PropTypes","setSelectedDataGetter","setImportAllGetter","GoogleCampaignAndAdGroupHeader","handleSelectAllFilterChange","onSelectAllCheckboxChange","sortString","sortInDescendingOrder","sortIcon","Checkbox","selectAllChecked","onChange","sortedProperty","onSortChange","tabIndex","onKeyDown","keyCode","Enter","Space","ACTIVE_STATUS","PAUSED_STATUS","SELECTALL_CHECKBOX_STATUS","ListNode","node","TooltipHost","overflowMode","TooltipOverflowMode","Parent","isExpandable","selectionStatus","CampaignAdGroupTree","onNodeExpanded","unused","isThrottlingRequired","onErrorOrWarning","setUiBlocker","expandedAdGroupData","prevState","nodes","newState","n","expandNode","expanded","collapseNode","onNodeCollapsed","rebuildWithReplaceAction","onNodeSelected","isDisplayType","showPausedAdGroups","removeCampaignSelection","selectCampaignNode","onSelectionChange","updateSelectAllFilter","initialSelection","parentId","parentNode","determineSelectionStatus","campaignSelectedStatus","ALL_EXISTING_AND_NEW","ALL_EXISTING_AND_NEW_ENABLED","SPECIFIC_SELECTED","newSelection","parentChecked","selectAdGroupNode","getClassNames","getFilteredCampaignIds","annotatedData","filteredNodes","isMaxSelectedSpecificCampaignReached","initializeSelectionAndExpansionData","callback","combineOrDiff","combine","arr1","arr2","arr","action","checkAndPropogateEmptyError","checkAndRemoveThrotllingAlert","selectAllFiltered","selectAllCheckboxStatus","filteredCampaignIds","updateNodes","campaignNode","buildAdGroupNodes","selectedData","indeterminate","adGroupNode","resultNode","resultSelectionStatus","newChildren","NONE","newProps","buildNodes","allSelectedIds","remainingUnselectedCampaigns","toggleSelectAllCheckboxOnGridUpdate","expandedId","visCount","op","isExpanded","updateTypeHandlers","NodeOperations","SELECTED","EXPANDED","COLLAPSED","TreeView","treeViewClassNames","nodeRenderer","CheckBoxNode","nodeChildRenderer","expandableNodeAriaLabel","expandIconAriaLabel","initialDataState","initialNodeState","stateGetter","GoogleCampaignAndAdGroupSelector","_Component","setTimeout","getSelectedData","selectionToLog","adGroups","campaignSelectionChanged","onCampaignFilterChange","updates","_this$buildAnnotatedD","buildAnnotatedData","availableCount","Math","floor","onPageNumberChanged","pageNumberChange","onQuery","onCampaignFilter","showPausedCampaigns","onAdGroupFilter","selectAllCheckboxChecked","blocking","sortAnnotatedData","reverse","initializeState","selectAllCampaigns","searchInCampaign","getShowNoActiveCampaignCouponAlert","coupon","showNoActiveCampaignCouponAlert","pausedCampaigns","showPausedCampaignsDisabled","initialAnnotatedState","headerAriaLabel","showPausedAdGroupMessage","TypeId","UiBlocker","loadingText","SearchBox","onSearch","onQueryChange","Pagination","itemCount","i18nAmdLoader","SearchResultLiveRegion","emptyText","searchText","resultText","Alert","level","hasIcon","icon","dismissible","Component","GoogleCampaignAndAdGroupStep","handleRadioChange","importAllCampaignsSelected","importSpecificCampaignSelectedLog","handleErrorOrWarning","selectedDisplayIds","warning","onError","handleSelectionChange","radioItems","RadioGroup","role","dataHasDisplayType","selectedIds","renderDisplayCampaignAlert","GoogleCampaignAndAdGroupView","getter","selectedDataGetter","importAllGetter","getImportAll","triggerError","triggerEdit","parentEl","stateData","stateAdapter","importSourceCustomerId","importSourceCampaigns","importContext","selectCampaign","finishStep","completeSchedule","startImportForSignup","getStateData","updateState","importSourceEntitiesSelectionData","importSourceCampaignsSummary","detachModal","ByPassConfirmationModal","messageKey","onDismiss","onConfirm","prepareImportTaskItem","selectedAccountCampaigns","INITIAL_ACCOUNT_CAMPAIGNS","AccountGridViewModel","_ref$signupMode","noCampaignsErrorMessage","showNoCampaignsError","AccountGridView","_ref$accountData","firstAccountCampaigns","clearNoCampaignError","accountWithoutCampaignSelected","CurrencyConversionViewModel","shouldShow","withCurrencyConversionText","withoutCurrencyConversionText","summaryInfo","currencyConversionDisplayed","importSourceAccount","accountList","count","logger","currencyConversionChanged","tempSelectedItem","tempSelectedAccount","selectAccountById","selectAccount","loginId","entitiesBlobName","setSelectedAccountCampaigns","importSourceAccountSummary","getSelectedAccountName","ImportOptionsSummaryBuilder","_BaseImportOptionsSum","newExistingSummary","ImportDeletedEntities","BaseImportOptionsSummaryBuilder","_BaseImportOptionsSte","summaryBuilder","BaseImportOptionsStep","failedValidators","validators","v","errorMessages","failed","messages","observable","observableWrapper","rawValue","process","blockInput","failedValidations","hasBeenValid","notifySubscribers","extend","notify","mapCronToFrequency","test","prepareCron","chosenTime","chosenDate","chosenDay","chosenDayOfTheMonth","getDate","getMonth","getFullYear","timeError","twentyFourHourDisplay","twelveHourDisplay","withAutoOption","num","getTimeZoneIdByText","timeZoneText","timeZoneObject","getTimeZoneOptions","ScheduleFormViewModel","enableAutoFrequency","facCoupon","currentUser","scheduleFromImportSummary","toggleImportButtonStatus","isMultiAccountImport","availableFrequencies","observableArray","getFrequenciesForRunNowScheduling","getFrequencies","emailOptions","getEmailOptions","availableTimes","getHours","availableDays","getDaysOfWeek","availableDaysOfTheMonth","getDaysOfMonth","timeZones","availableTimeZones","showUnSupportedDayOfMonth","runNowWithScheduled","isScheduledFromImportSummaryDone","frequency","chosenEmailOption","initialDayOfTheMonth","emailAddresses","isDayLightSavingTime","moment","isDST","time","utc","minutes","timeZoneOffsetValue","hours","day","Email","timeFormat","chosenTimeZone","defaultTimeZone","defaultimportName","computed","dateUtil","format","Date","Validation","required","input","summaryMessage","isTitleActive","isTitleDisabled","isSummaryVisible","isFormBodyVisible","scheduleImportText","emailAddressError","maxLength","emailAddressErrorMessage","remainingCharacters","char_rem","is12Hour","isAutoFrequency","scheduledImport","nonAutoScheduledImport","showRunNow","showMultiEmail","ScheduleFormView","logTraceFunction","initialTimeZoneId","getTimeZoneTextById","getTimeZoneOffset","datePickerAriaLabel","minDate","year","month","date","hour","minute","second","maxDate","setYear","datePicker","DatePicker","selectedDate","getInitialDatePickerDate","_this$datePicker","ScheduleFormTemplate","importNameChanged","scheduleOption","applyOpportunityIfApplicable","tap","logApplyOpportunityInfoIfIfApplicable","ScheduleFromDoneTemplate","doneText","navigateToButtonText","handleErrors","currentDate","splitCron","today","getTime","getDateFromCron","setDate","serializedEmails","emailAddressArray","email","trim","areAllEmailsValid","validateEmailAddress","minTime","validateEmailAddresses","validateScheduleTime","serializeEmailAddresses","logTraceFunc","Code","listener","datePickerValue","displayString","cronToDisplayString","toLocaleDateString","FAC_STATUS_ADOPTED","CCUIConstants","RecommendationAdoptionStatus","Adopted","enable","nextActionText","importOmnitureTrackingId","attachFrequencyListener","changeActionTextOnFrequencyChange","frequencyChanged","updateAction","i18nKey","replaceActionText","facCouponValidate","unmount","pollRunningImportStatusAndGoNextWhenReady","createImportRunNowWithScheduledAndGoNextWhenReady","importSummaryData","taskItemPromise","updateFACCoupon","showAlertHandler","isBillToCustomer","href","couponDetailsUrl","logOpportunity","isBatch","_this7","_BaseImportSummarySte","_ref$labels","summaryDataContextManager","dataContextManager","default","merchantCenterPlaceholderStoreNote","onSignupComplete","ScheduledImportSummaryTemplate","importSourceLoginSummary","successEmitter","redirectToAddPayment","BaseImportSummaryStep","GSILocal","googleLoginRepository","GoogleLoginRepository","getGoogleAccountName","signInFailedEmptySessionId","GoogleLoginTemplate","currentGoogleAccount","signIntoGoogleInDevEnvWithToken","googleSignIn","useConsentPrompt","onGoogleAuthSuccess","getGoogleAccounts","googleLoginSummary","GoogleEntitiesBlobName","googleAccountSummary","soleGoogleAccount","startGoogleSession","startGoogleSessionWithToken","_BaseScheduleImportSt","others","_objectWithoutProperties","_excluded","_ref$config","_ref$importSource","_ref$importSource2","GoogleImportStepFactory","FAC_STATUS_ACTIVE","Active","FAC_STATUS_NOT_IN_PROGRESS","NotInProgess","GoogleImportPage","pageSubTitle","createStepsForSignup","enableFacOnScheduleStep","shouldHaveCoupon","disableFacEverywhere","addCouponBanner","bannerContainer","topBannerElement","CouponBannerNew","titleKey","prepend","ReactDom","rawData","$modal","closeLightbox","errorMessageKey","Errors","modalElement","CouponLightboxNew","onSubmit","onCancel","googleAccountStepView","isMerchantCenterStoreMappingStepEnabled","campaignsWithMerchantId","IsBSCSmartImportEnabled","isImportModeSwitchEnabled","IsSmartImportV2Enabled","isCurrencyConvertorRelocateEnabled","IsSmartImportCurrencyConversionOptionEnabled","IsSmartImportEditExpertImportEnabled","IsGoogleImportVideoAdsEnabled","IsOneClickImportEnabled","ImportOneClick","IsImportFromMetaButtonEnabled","FBImportForGoogleImportSummary","FacebookImport","ChooseAccountsGoogleAccount","ChooseAccountsBingAccountMapping","GoogleCampaignStep","MerchantCenterStoreMappingStep","SmartCampaignSignInStep","ESCSignInStep","existingGoogleAccount","didSwitchToExpertFromImport","keepAccountSelectionDueToDifferentEmail","ApplicationName","SessionType","DefaultImportSettings","TaskType","TaskId","Event","UserPreferenceTrackingTemplate","_taskItem$AdWordsImpo","initialPromise","fetchGoogleLoginEmail","otherFieldsExpanded","skipAccountSelectionDueToDirectJump","GeneralGoogleLoginStep","BingAccountDropDownList","onDropDownClick","isOpen","onDropDownKeyDown","onItemClick","isSelected","selectedAccountName","currentPageAccounts","firstPageBingAccounts","searchQuery","skip","getBingAccounts","currentPageAccountsRaw","filterAccountCount","onDropDownDismiss","isBingAccountMapped","googleToBingAccountMap","mapItem","BingAccount","dropDownButtonPlaceHolderText","searchBoxPlaceHolderText","bingAccountHeaderText","defaultSelectedBingAccount","GoogleAccount","bingAccountCount","dropDownRef","_this$state","bingAccountDropdownList","bingAccountDropdownButton","bingAccountDropdownPlaceholder","bingAccountDropdownCaretDown","Icon","iconName","Callout","bingAccountCallout","current","calloutWidth","clientWidth","isBeakVisible","gapSpace","setInitialFocus","bingAccountSelectionBox","bingAccountSearchBox","underlined","bingAccountHeader","bingAccountListWrapper","FocusZone","direction","FocusZoneDirection","vertical","CommandButton","bingAccountItem","BingAccountSelectorInternal","onSelectMappedBingAccount","onRenderItemColumn","column","gridItem","getBingAccountSelectorColumns","isMultiline","bingAccountFetcherPerfMarker","_this$props2","classNames","bingAccountMappingStep","stepText","accountMappingList","DetailsList","selectionMode","SelectionMode","none","BingAccountSelector","_ref$palette","palette","accountDetailList","verticalAlign","padding","margin","fontWeight","borderStyle","borderWidth","borderColor","borderRadius","cursor","positon","overflow","whiteSpace","textOverflow","right","curson","paginationStyle","border","goToPrevStep","existingfirstPageBingAccounts","existingGoogleToBingAccountMap","firstPageBingAccountsRaw","BingAccountStepInternal","BingAccountStep","shouldGoToMerchantCenterStoreMappingStep","isEscImport","GoogleAccountStep","GeneralGoogleAccountStep","withSmartGoogleImportAccountSelectionStepPrefetch","showCancelButton","isNoCustomSettingOnSmartStep","defaultImportOptions","SmartOptionSettingsKeys","importOptionOverride","IsExpertModeImport","googleEntitiesSelectionData","getSmartImportStepPrefetchHOC","merchantCenterStoreMappingStepPath","loginStepName","getDefaultActionBarItemsForStartImportStep","CampaignSelectorInternal","CampaignAndAdGroupSelector","CampaignSelector","iconFontFamily","statusStyle","paddingLeft","themePrimary","fontFamily","background","paddingTop","borderBottomStyle","borderBottomWidth","borderLeftStyle","borderLeftWidth","borderRightStyle","borderRightWidth","borderLeft","borderRight","borderBottom","borderTop","paddingBottom","paddingRight","neutralSecondary","outlineOffset","GoogleCampaignStepInternal","showNoActiveCampaignsFacModal","updateFacData","campaignSelectionPerfMarker","_this$props$contextVa","facNoActiveCampaignsFromProps","setNoActiveCampaigns","shouldSwitchMode","expertImportOptionsPerfMarker","onNoActiveCampaignFacModalConfirm","dismissFacBypassModal","onNoActiveCampaignFacModalDismiss","validateAndSaveData","GoogleCampaignStepWithActivity","nextButtonEnabled","GMCToMMCMappingGridWithSignIn","module","GoogleMerchantCenterStoreMappingStepInternal","onMappingGridRowsUpdate","mappingGridRows","onGMCEmailAddressUpdate","GMCEmail","onHasDraftStoreUpdate","hasDraftStore","onIsGetMappingsErrorUpdate","isGetMappingsError","onInfoForMMCGridUpdate","infoForMMCGrid","onScenarioUpdate","scenario","onLoginErrorTextUpdate","loginErrorText","onClientIdUpdate","clientId","generateMerchantIds","_context$accountToCam","_context$selectedAcco","merchantIds","MerchantId","saveMappingGridConfig","skipSetMappings","merchantCenterMappingStepPerfMarker","isOneClickTypeSelected","learnMoreLinkCallback","merchantCenterMappingLearnMoreLinkCallback","onDraftStoreLinkClick","disableGMCSignIn","onGMCSignInRedirectLinkClick","isImportOneClickMultiAdAccountEnabled","ImportOneClickMultiAdAccount","GmcHeaderMoreInfos","fallback","gmcEmail","GoogleMerchantCenterStoreMappingStepInternalWithStyle","GoogleMerchantCenterStoreMappingStep","SmartCampaignGoogleLoginStep","GeneralSmartCampaignGoogleLoginStep","ESCGoogleLoginStep","GeneralESCGoogleLoginStep","nextStepPathIfOnlyOneAccount","nextStepPathIfMultipleAccounts","getGoogleLoginStep","onLoginPageHelpLinkClick","getLoginPageDisclaimer","step","generalRenderDescription","redirectToCampaignsPage","redirectToImportHistoryPage","onImportSummaryPageHelpLinkClicked","onSetupUETtagLinkClick","getImportSummaryDisclaimerText","isSmartCampaignImport","ImportSummaryPage","learnMoreId","getSchedulePageDisclaimer","getDefaultSchedule","getGoogleCampaignStep","getImportStatusPageDisclaimer","getOverwriteImportStatusOrderToStepTitleMap","showMerchantCenterStoreMappingStep","showCouponBanner","showCouponLightbox","showSmartCampaignGoogleLoginStep","showESCGoogleLoginStep","setFacScheduleInvalid","toggleMerchantCenterStoreMappingStep","SmartImportRepository","DynamicPermissions","FacCalloutRevamp","CurrentAccount","ACCOUNT_MODE","UNIFIED_SMART","SMART","googleAccountSubPath","bingAccountSubPath","bingAccountSubStepEnabled","getGoogleAccountsStep","_ref9","getMerchantCenterStoreMappingStep","getGoogleImportOptionsStep","_ref10","getSmartCampaignGoogleLoginStep","_ref11","getESCGoogleLoginStep","memoize","tapCatch","scenarioName","FacCallout","onActivate","userPreferenceService","UserPreference","customCancelButtonClickHandler","calculatePlacement","GLOBAL_CALLOUT_CONTAINER","dismissCallout","getElementById","renderImportCallout","popoverId","_ref$hasCloseButton","hasCloseButton","BackboneInstanceWrapper","instance","closeButton","focusLockContent","placement","calloutCloseButton","calloutCloseButtonIcon","calloutTargetContainer","onClose","closeButtonAriaLabel","shouldStopPropagation","renderImportSettingsCallout","optionsFormLoader","uetTagSelectorViewLoader","columnData","getColumnData","isAudienceTargetForFBImportOptionEnabled","facebookOptionBlackList","getFileImportOptionBlackList","TaskItem","_toConsumableArray","getFacebookImportOptionBlackList","getFacebookImportOptionFields","facebookImportOptionFieldHelpIds","amazonOptionBlackList","getAmazonImportOptionBlackList","getAmazonImportOptionFields","amazonImportOptionFieldHelpIds","pinterestOptionBlackList","getPinterestImportOptionBlackList","getPinterestImportOptionFields","pinterestImportOptionFieldHelpIds","ImportOptionsForm","UetTagSelectorView","parse","searchAndReplaceSchema","ImportSearchAndReplaceForStringProperty","findAndReplaceSuffixSchema","jsonFormatImportOptions","schema","ImportUpdateEntityPreference","ImportUserPreferences","LandingPageAppendPreference","ImportAppendDestUrlPreference","LandingPageReplacePreference","ImportSearchAndReplaceDestUrlPreference","AppendTrackingTemplatePreference","AppendPreferencesForTrackingTemplate","SearchAndReplacePreferencesForTrackingTemplate","ImportPrefixAndSuffixForStringProperty","SearchAndReplaceForCustomParameters","SearchAndReplaceForFinalURLSuffix","ImportAdjustmentForNumericProperty","isHideUrlDetailView","createDisabledUETSelectorClass","renderImportSummaryCallout","summaryTableLoader","instrumentation","logMessage","constants","LOGCATEGORY","TRACE","LOGLEVEL","INFO","currentTarget","getSummaryDetailsPopupViewPromise","findImportTaskItem","IMPORT_TYPE","importRecommendationListNameMap","importChannelNameMap","importRecommendationListName","importChannel","supportedRecommendationTypesList","GoogleImportTaskRecommendationList","FacebookImportTaskRecommendationList","RecommendationCallout","calloutConfig","shouldAdCustomizerRecommendationApplyDirectly","SelectAdCustomizerFeedToImportExpandedTextAd","buttonText","click","applyAdCustomizerFeedRecommendation","goToGoogleImportWizard","ProvideStoreToImportShoppingCampaign","EnableCurrencyConversion","applyCurrencyConversionRecommendation","EnableAutoFrequency","applyAutoFrequencyRecommendation","AdjustAdGroupBidPrice","applySetMinBidValueAdjustRecommendation","GetGoogleAdsPermission","applyGetGoogleAdsPermissionRecommendation","AccessTokenExpiring","applyAccessTokenExpiringRecommendation","getCalloutConfig","recommendationArr","popupTypeIndex","setPopupTypeIndex","submitEvent","isKeyboardEvent","Glyphicon","glyph","RecommendationCalloutMemo","renderImportRecommondationCallout","PinterestCampaignStep","PinterestImportRepository","getPinterestSessionIdFromCookie","PinterestSessionId","PinterestUsername","setPinterestImportAccountInfoInCookie","origin","startPinterestSessionInternal","getPinterestLoginAccountFromCookie","pinterestAccountId","filterAndLocalizePinterestCampaignsUtil","pinterestCampaigns","getPinterestCampaigns","pinterestAccountName","pinterestCustomerId","initialPinterestAccount","pinterestEntitiesSelectionData","getPinterestImportInfoFromCookie","getPinterestAccountName","pinterestImportContext","PinterestSessionUserId","serializePinterestEntitiesSelectionDataToStringPayload","PinterestEntitiesBlobName","preparePinterestImportContext","PinterestImportContext","showPopup","w","h","errorhandle","windowWidth","windowHeight","documentElement","screen","dualScreenLeft","screenLeft","dualScreenTop","screenTop","innerWidth","innerHeight","clientHeight","newWindow","open","focus","timer","setInterval","closed","clearInterval","windowObj","getParameter","getCode","close","PinterestLoginRepository","encodeURIComponent","REDIRECTURI","handlePinterestLoginError","loginErrorMessage","getPinterestAccounts","pinterestAccounts","withPinterestImportAccountSelectionStepPrefetch","loginToPinterest","startPinterestSessionWithToken","startPinterestSession","PinterestLoginStepWithoutPrefetch","PinterestLoginStep","existingPinterestAccount","_taskItem$PinterestIm","PinterestImportAccountSelector","PinterestAccountStepInternal","PinterestAccountStep","getPinterestImportUserPreferences","alreadySelectedPinterestAccounts","pinterestCampaingsForCustomerId","FAC_STATUS_PICKEDUP","PickedUp","PinterestSyncApiInternalError","PinterestSyncThrottlingLimitReached","PinterestSyncAccessDenied","adoptResumeImportCalloutCardRecommendation","defaultLogActivity","adoptResumeImportRecommendation","loggerApi","preparePinterestImportTaskItem","calloutcardCoupon","updateCouponStatus","PinterestImportOptionsStep","onSavePinterestImportScheduleInfo","getPinterestImportDetailsView","PinterestImportSummaryStep","getPinterestLoginStep","PinterestImportPage","pinterestLoginRepository","getPinterestAccountStep","getPinterestCampaignStep","getPinterestImportOptionsStep","pug","exports","locals","pug_interp","pug_html","locals_for_with","escape","call","$$obj","pug_index0","$$l","columnTitle","columnEnum","columnValue","LocalizedText","pug_mixins","block","popupId","ariaLabelContext","arialLabelText"],"sourceRoot":""}