diff --git a/packages/admin-portal/src/actions/__tests__/app-categories.ts b/packages/admin-portal/src/actions/__tests__/app-categories.ts deleted file mode 100644 index 2e8db13a04..0000000000 --- a/packages/admin-portal/src/actions/__tests__/app-categories.ts +++ /dev/null @@ -1,8 +0,0 @@ -import { categoriesReceiveData } from '../app-categories' -import ActionTypes from '@/constants/action-types' - -describe('app categories actions', () => { - it('should create a categoriesReceiveData action', () => { - expect(categoriesReceiveData.type).toEqual(ActionTypes.CATEGORIES_RECEIVE_DATA) - }) -}) diff --git a/packages/admin-portal/src/actions/__tests__/app-detail-modal.ts b/packages/admin-portal/src/actions/__tests__/app-detail-modal.ts deleted file mode 100644 index 362b937190..0000000000 --- a/packages/admin-portal/src/actions/__tests__/app-detail-modal.ts +++ /dev/null @@ -1,21 +0,0 @@ -import { - setAppDetailModalStateBrowse, - setAppDetailModalStateInstall, - setAppDetailModalStateSuccess, -} from '../app-detail-modal' - -import ActionTypes from '../../constants/action-types' - -describe('app permission actions', () => { - it('should create a setAppDetailModalStateBrowse action', () => { - expect(setAppDetailModalStateBrowse.type).toEqual(ActionTypes.SET_APP_DETAIL_MODAL_STATE_BROWSE) - }) - - it('should create a setAppDetailModalStateInstall action', () => { - expect(setAppDetailModalStateInstall.type).toEqual(ActionTypes.SET_APP_DETAIL_MODAL_STATE_INSTALL) - }) - - it('should create a setAppDetailModalStateSuccess action', () => { - expect(setAppDetailModalStateSuccess.type).toEqual(ActionTypes.SET_APP_DETAIL_MODAL_STATE_SUCCESS) - }) -}) diff --git a/packages/admin-portal/src/actions/__tests__/app-http-traffic-event.ts b/packages/admin-portal/src/actions/__tests__/app-http-traffic-event.ts deleted file mode 100644 index 873549e9e5..0000000000 --- a/packages/admin-portal/src/actions/__tests__/app-http-traffic-event.ts +++ /dev/null @@ -1,31 +0,0 @@ -import { - httpTrafficPerDayRequestData, - httpTrafficPerDayReceiveData, - httpTrafficPerDayRequestDataFailure, -} from '../app-http-traffic-event' -import ActionTypes from '@/constants/action-types' -import { httpTrafficPerDayStub } from '@/sagas/__stubs__/app-http-traffic-event' - -describe('app-http-traffic-per-day actions', () => { - it('should create a httpTrafficPerDayRequestData action', () => { - expect(httpTrafficPerDayRequestData.type).toEqual(ActionTypes.HTTP_TRAFFIC_PER_DAY_REQUEST_DATA) - expect( - httpTrafficPerDayRequestData({ - applicationId: ['1'], - dateFrom: '2020-02-17', - dateTo: '2020-04-05', - }).data, - ).toEqual({ - applicationId: ['1'], - dateFrom: '2020-02-17', - dateTo: '2020-04-05', - }) - }) - it('should create a httpTrafficPerDayReceiveData action', () => { - expect(httpTrafficPerDayReceiveData.type).toEqual(ActionTypes.HTTP_TRAFFIC_PER_DAY_RECEIVE_DATA) - expect(httpTrafficPerDayReceiveData(httpTrafficPerDayStub).data).toEqual(httpTrafficPerDayStub) - }) - it('should create a httpTrafficPerDayRequestDataFailure action', () => { - expect(httpTrafficPerDayRequestDataFailure.type).toEqual(ActionTypes.HTTP_TRAFFIC_PER_DAY_REQUEST_FAILURE) - }) -}) diff --git a/packages/admin-portal/src/actions/__tests__/app-installations.ts b/packages/admin-portal/src/actions/__tests__/app-installations.ts deleted file mode 100644 index f9da5ad1b3..0000000000 --- a/packages/admin-portal/src/actions/__tests__/app-installations.ts +++ /dev/null @@ -1,57 +0,0 @@ -import { - appInstallationsReceiveData, - appInstallationsRequestData, - appInstallationsRequestDataFailure, - appInstallationsFilterReceiveData, - appInstallationsFilterRequestData, - appInstallationsFilterRequestDataFailure, - appInstallationsRequestInstall, - appInstallationsRequestUninstall, - appInstallationsSetFormState, -} from '../app-installations' -import ActionTypes from '@/constants/action-types' -import { installationsStub } from '@/sagas/__stubs__/installations' - -describe('app install actions', () => { - it('should create a appInstallationsReceiveData action', () => { - expect(appInstallationsReceiveData.type).toEqual(ActionTypes.APP_INSTALLATIONS_RECEIVE_DATA) - expect(appInstallationsReceiveData(installationsStub).data).toEqual(installationsStub) - }) - it('should create a appInstallationsRequestData action', () => { - expect(appInstallationsRequestData.type).toEqual(ActionTypes.APP_INSTALLATIONS_REQUEST_DATA) - expect(appInstallationsRequestData({ appId: ['1'] }).data).toEqual({ appId: ['1'] }) - }) - it('should create a appInstallationsRequestDataFailure action', () => { - expect(appInstallationsRequestDataFailure.type).toEqual(ActionTypes.APP_INSTALLATIONS_REQUEST_DATA_FAILURE) - }) - - it('should create a appInstallationsFilterReceiveData action', () => { - expect(appInstallationsFilterReceiveData.type).toEqual(ActionTypes.APP_INSTALLATIONS_FILTER_RECEIVE_DATA) - expect(appInstallationsFilterReceiveData(installationsStub).data).toEqual(installationsStub) - }) - it('should create a appInstallationsFilterRequestData action', () => { - expect(appInstallationsFilterRequestData.type).toEqual(ActionTypes.APP_INSTALLATIONS_FILTER_REQUEST_DATA) - expect(appInstallationsFilterRequestData({ appId: ['1'] }).data).toEqual({ appId: ['1'] }) - }) - it('should create a appInstallationsFilterRequestDataFailure action', () => { - expect(appInstallationsFilterRequestDataFailure.type).toEqual( - ActionTypes.APP_INSTALLATIONS_FILTER_REQUEST_DATA_FAILURE, - ) - }) - - it('should create a appInstallationsRequestInstall action', () => { - expect(appInstallationsRequestInstall.type).toEqual(ActionTypes.APP_INSTALLATIONS_REQUEST_INSTALL) - expect(appInstallationsRequestInstall({ appId: '1' }).data).toEqual({ appId: '1' }) - }) - it('should create a appInstallationsRequestUninstall action', () => { - expect(appInstallationsRequestUninstall.type).toEqual(ActionTypes.APP_INSTALLATIONS_REQUEST_UNINSTALL) - expect(appInstallationsRequestUninstall({ appId: '1', installationId: '1' }).data).toEqual({ - appId: '1', - installationId: '1', - }) - }) - it('should create a appInstallationsSetFormState action', () => { - expect(appInstallationsSetFormState.type).toEqual(ActionTypes.APP_INSTALLATIONS_SET_FORM_STATE) - expect(appInstallationsSetFormState('PENDING').data).toEqual('PENDING') - }) -}) diff --git a/packages/admin-portal/src/actions/__tests__/app-integration-types.ts b/packages/admin-portal/src/actions/__tests__/app-integration-types.ts deleted file mode 100644 index d3f18ff0e7..0000000000 --- a/packages/admin-portal/src/actions/__tests__/app-integration-types.ts +++ /dev/null @@ -1,8 +0,0 @@ -import { integrationTypesReceiveData } from '../app-integration-types' -import ActionTypes from '@/constants/action-types' - -describe('app integration types actions', () => { - it('should create a integrationTypesReceiveData action', () => { - expect(integrationTypesReceiveData.type).toEqual(ActionTypes.INTEGRATION_TYPES_RECEIVE_DATA) - }) -}) diff --git a/packages/admin-portal/src/actions/__tests__/app-usage-stats.ts b/packages/admin-portal/src/actions/__tests__/app-usage-stats.ts deleted file mode 100644 index e2cb9209e5..0000000000 --- a/packages/admin-portal/src/actions/__tests__/app-usage-stats.ts +++ /dev/null @@ -1,17 +0,0 @@ -import { appUsageStatsReceiveData, appUsageStatsRequestData, appUsageStatsRequestDataFailure } from '../app-usage-stats' -import ActionTypes from '@/constants/action-types' -import { usageStatsDataStub } from '@/sagas/__stubs__/app-usage-stats' - -describe('app-usage-stats actions', () => { - it('should create a appUsageStatsRequestData action', () => { - expect(appUsageStatsRequestData.type).toEqual(ActionTypes.APP_USAGE_STATS_REQUEST_DATA) - expect(appUsageStatsRequestData({ appId: ['1'] }).data).toEqual({ appId: ['1'] }) - }) - it('should create a appUsageStatsReceiveData action', () => { - expect(appUsageStatsReceiveData.type).toEqual(ActionTypes.APP_USAGE_STATS_RECEIVE_DATA) - expect(appUsageStatsReceiveData(usageStatsDataStub).data).toEqual(usageStatsDataStub) - }) - it('should create a appUsageStatsRequestDataFailure action', () => { - expect(appUsageStatsRequestDataFailure.type).toEqual(ActionTypes.APP_USAGE_STATS_REQUEST_DATA_FAILURE) - }) -}) diff --git a/packages/admin-portal/src/actions/__tests__/client.ts b/packages/admin-portal/src/actions/__tests__/client.ts deleted file mode 100644 index 02fefa10e6..0000000000 --- a/packages/admin-portal/src/actions/__tests__/client.ts +++ /dev/null @@ -1,55 +0,0 @@ -import { - clientFetchAppSummary, - clientFetchAppSummarySuccess, - clientFetchAppSummaryFailed, - clientClearAppSummary, - clientFetchWebComponentConfig, - clientFetchWebComponentConfigSuccess, - clientUpdateWebComponentConfig, - clientFetchNegotiatorsSuccess, -} from '../client' -import ActionTypes from '../../constants/action-types' -import { appsDataStub } from '../../sagas/__stubs__/apps' -import { appDetailDataStub } from '@/sagas/__stubs__/app-detail' -import { AppDetailModel } from '@reapit/foundations-ts-definitions' - -describe('client actions', () => { - it('should create a clientFetchAppSummary action', () => { - expect(clientFetchAppSummary.type).toEqual(ActionTypes.CLIENT_FETCH_APP_SUMMARY) - expect(clientFetchAppSummary({ page: 1 }).data).toEqual({ page: 1 }) - }) - it('should create a clientFetchAppSummarySuccess action', () => { - expect(clientFetchAppSummarySuccess.type).toEqual(ActionTypes.CLIENT_FETCH_APP_SUMMARY_SUCCESS) - expect( - clientFetchAppSummarySuccess({ featuredApps: [appDetailDataStub as AppDetailModel], apps: appsDataStub.data }) - .data, - ).toEqual({ - featuredApps: [appDetailDataStub as AppDetailModel], - apps: appsDataStub.data, - }) - }) - it('should create a clientFetchAppSummaryFailed action', () => { - expect(clientFetchAppSummaryFailed.type).toEqual(ActionTypes.CLIENT_FETCH_APP_SUMMARY_FAILED) - expect(clientFetchAppSummaryFailed('error').data).toEqual('error') - }) - it('should create a clientClearData action', () => { - expect(clientClearAppSummary.type).toEqual(ActionTypes.CLIENT_CLEAR_APP_SUMMARY) - expect(clientClearAppSummary(null).data).toEqual(null) - }) - it('should create a clientFetchWebComponentConfig action', () => { - expect(clientFetchWebComponentConfig.type).toEqual(ActionTypes.CLIENT_FETCH_WEB_COMPONENT_CONFIG) - expect(clientFetchWebComponentConfig({ customerId: 'DXX', applicationId: 'applicationId' }).data).toEqual({ - customerId: 'DXX', - applicationId: 'applicationId', - }) - }) - it('should create a clientFetchWebComponentConfigSuccess action', () => { - expect(clientFetchWebComponentConfigSuccess.type).toEqual(ActionTypes.CLIENT_FETCH_WEB_COMPONENT_CONFIG_SUCCESS) - }) - it('should create a clientPutWebComponentConfig action', () => { - expect(clientUpdateWebComponentConfig.type).toEqual(ActionTypes.CLIENT_UPDATE_WEB_COMPONENT_CONFIG) - }) - it('should create a clientPutWebComponentConfig action', () => { - expect(clientFetchNegotiatorsSuccess.type).toEqual(ActionTypes.CLIENT_FETCH_NEGOTIATORS_SUCCESS) - }) -}) diff --git a/packages/admin-portal/src/actions/__tests__/developer-app-modal.ts b/packages/admin-portal/src/actions/__tests__/developer-app-modal.ts deleted file mode 100644 index f63a77f223..0000000000 --- a/packages/admin-portal/src/actions/__tests__/developer-app-modal.ts +++ /dev/null @@ -1,25 +0,0 @@ -import { - setDeveloperAppModalStateViewDetail, - setDeveloperAppModalStateEditDetail, - setDeveloperAppModalStateDelete, - developerAppShowModal, -} from '../developer-app-modal' -import ActionTypes from '@/constants/action-types' - -describe('developer app modal actions', () => { - it('should create a setDeveloperAppModalStateViewDetail action', () => { - expect(setDeveloperAppModalStateViewDetail.type).toEqual(ActionTypes.SET_DEVELOPER_APP_MODAL_STATE_VIEW_DETAIL) - }) - - it('should create a setDeveloperAppModalStateEditDetail action', () => { - expect(setDeveloperAppModalStateEditDetail.type).toEqual(ActionTypes.SET_DEVELOPER_APP_MODAL_STATE_EDIT_DETAIL) - }) - - it('should create a setDeveloperAppModalStateDelete action', () => { - expect(setDeveloperAppModalStateDelete.type).toEqual(ActionTypes.SET_DEVELOPER_APP_MODAL_STATE_DELETE) - }) - - it('should create a developerAppShowModal action', () => { - expect(developerAppShowModal.type).toEqual(ActionTypes.DEVELOPER_SHOW_MODAL) - }) -}) diff --git a/packages/admin-portal/src/actions/__tests__/developer-subscriptions.ts b/packages/admin-portal/src/actions/__tests__/developer-subscriptions.ts deleted file mode 100644 index a8e2b53da1..0000000000 --- a/packages/admin-portal/src/actions/__tests__/developer-subscriptions.ts +++ /dev/null @@ -1,60 +0,0 @@ -import { - developerFetchSubscriptions, - developerFetchSubscriptionsSuccess, - developerDeleteSubscription, - developerCreateSubscription, - developerCreateSubscriptionFalure, - developerCreateSubscriptionSuccess, - developerCreateSubscriptionClearError, - CreateSubscriptionParams, -} from '../developer-subscriptions' -import ActionTypes from '../../constants/action-types' -import { FetchSubscriptionsListParams } from '@/services/developer-subscriptions' -import { subscriptionModelStub, listSubscriptionsStub } from '../../sagas/__stubs__/developer-subscriptions' - -describe('DeveloperSubscriptions actions', () => { - it('should create a developerFetchSubscriptions action', () => { - const params: FetchSubscriptionsListParams = { - developerId: '123', - subscriptionType: 'developerEdition', - } - expect(developerFetchSubscriptions.type).toEqual(ActionTypes.DEVELOPER_FETCH_SUBSCRIPTIONS) - expect(developerFetchSubscriptions(params).data).toEqual(params) - }) - - it('should create a developerFetchSubscriptionsSuccess action', () => { - expect(developerFetchSubscriptionsSuccess.type).toEqual(ActionTypes.DEVELOPER_FETCH_SUBSCRIPTIONS_SUCCESS) - expect(developerFetchSubscriptionsSuccess(listSubscriptionsStub).data).toEqual(listSubscriptionsStub) - }) - - it('should create a developerCreateSubscription action', () => { - const params: CreateSubscriptionParams = { - params: { - developerId: '123', - applicationId: '123', - user: 'tester@reapit.com', - type: 'developerEdition', - }, - onCreated: jest.fn(), - } - expect(developerCreateSubscription.type).toEqual(ActionTypes.DEVELOPER_SUBSCRIPTION_CREATE) - expect(developerCreateSubscription(params).data).toEqual(params) - }) - - it('should create a developerCreateSubscriptionSuccess action', () => { - expect(developerCreateSubscriptionSuccess.type).toEqual(ActionTypes.DEVELOPER_SUBSCRIPTION_CREATE_SUCCESS) - expect(developerCreateSubscriptionSuccess(subscriptionModelStub).data).toEqual(subscriptionModelStub) - }) - - it('should create a developerCreateSubscriptionFalure action', () => { - expect(developerCreateSubscriptionFalure.type).toEqual(ActionTypes.DEVELOPER_SUBSCRIPTION_CREATE_FAILURE) - }) - - it('should create a developerCreateSubscriptionClearError action', () => { - expect(developerCreateSubscriptionClearError.type).toEqual(ActionTypes.DEVELOPER_SUBSCRIPTION_CLEAR_CREATE_ERROR) - }) - - it('should create a developerDeleteSubscription action', () => { - expect(developerDeleteSubscription.type).toEqual(ActionTypes.DEVELOPER_DELETE_SUBSCRIPTION) - }) -}) diff --git a/packages/admin-portal/src/actions/__tests__/developer.ts b/packages/admin-portal/src/actions/__tests__/developer.ts deleted file mode 100644 index c88c42f16a..0000000000 --- a/packages/admin-portal/src/actions/__tests__/developer.ts +++ /dev/null @@ -1,120 +0,0 @@ -import { - developerLoading, - developerReceiveData, - developerRequestData, - developerClearData, - developerCreate, - developerSetFormState, - fetchBilling, - fetchBillingSuccess, - fetchBillingFailure, - fetchMonthlyBilling, - fetchMonthlyBillingSuccess, - fetchMonthlyBillingFailure, - developerWebhookPing, - developerSetWebhookPingStatus, - developerApplyAppDetails, -} from '../developer' -import ActionTypes from '../../constants/action-types' -import { appsDataStub } from '../../sagas/__stubs__/apps' -import { CreateDeveloperModel } from '@reapit/foundations-ts-definitions' -import { appPermissionStub } from '@/sagas/__stubs__/app-permission' -import { billing } from '@/sagas/__stubs__/billing' -import { monthlyBillingData } from '@/sagas/__stubs__/monthly-billing' -import { PingWebhooksByIdParams } from '@/services/webhooks' - -describe('developer actions', () => { - it('should create a developerLoading action', () => { - expect(developerLoading.type).toEqual(ActionTypes.DEVELOPER_LOADING) - expect(developerLoading(true).data).toEqual(true) - }) - - it('should create a developerReceiveData action', () => { - expect(developerReceiveData.type).toEqual(ActionTypes.DEVELOPER_RECEIVE_DATA) - expect(developerReceiveData({ ...appsDataStub, scopes: appPermissionStub }).data).toEqual({ - ...appsDataStub, - scopes: appPermissionStub, - }) - }) - - it('should create a developerRequestData action', () => { - expect(developerRequestData.type).toEqual(ActionTypes.DEVELOPER_REQUEST_DATA) - expect(developerRequestData({ page: 1 }).data).toEqual({ page: 1 }) - }) - - it('should create a developerClearData action', () => { - expect(developerClearData.type).toEqual(ActionTypes.DEVELOPER_CLEAR_DATA) - expect(developerClearData(null).data).toEqual(null) - }) - - it('should create a developerCreate action', () => { - const newDeveloper: CreateDeveloperModel = { - name: 'Bob', - companyName: 'Acme', - email: 'bob@acme.com', - telephone: '0123456789', - } - expect(developerCreate.type).toEqual(ActionTypes.DEVELOPER_CREATE) - expect(developerCreate(newDeveloper).data).toEqual(newDeveloper) - }) - - it('should create a developerSetFormState action', () => { - expect(developerSetFormState.type).toEqual(ActionTypes.DEVELOPER_SET_FORM_STATE) - expect(developerSetFormState('DONE').data).toEqual('DONE') - }) - - it('should create a fetchBilling action', () => { - expect(fetchBilling.type).toEqual(ActionTypes.DEVELOPER_FETCH_BILLING) - expect(fetchBilling({ dateFrom: '2020-01', dateTo: '2020-05', developerId: 'developerId' }).data).toEqual({ - dateFrom: '2020-01', - dateTo: '2020-05', - developerId: 'developerId', - }) - }) - - it('should create a fetchBillingFailure action', () => { - expect(fetchBillingSuccess.type).toEqual(ActionTypes.DEVELOPER_FETCH_BILLING_SUCCESS) - expect(fetchBillingSuccess(billing).data).toEqual(billing) - }) - - it('should create a fetchBillingFailure action', () => { - expect(fetchBillingFailure.type).toEqual(ActionTypes.DEVELOPER_FETCH_BILLING_FAILED) - expect(fetchBillingFailure('error').data).toEqual('error') - }) - - it('should create a fetchMonthlyBilling action', () => { - const params = { - applicationId: ['applicationId'], - month: 'month', - } - expect(fetchMonthlyBilling.type).toEqual(ActionTypes.DEVELOPER_FETCH_MONTHLY_BILLING) - expect(fetchMonthlyBilling(params).data).toEqual(params) - }) - - it('should create a fetchMonthlyBillingSuccess action', () => { - expect(fetchMonthlyBillingSuccess.type).toEqual(ActionTypes.DEVELOPER_FETCH_MONTHLY_BILLING_SUCCESS) - expect(fetchMonthlyBillingSuccess(monthlyBillingData).data).toEqual(monthlyBillingData) - }) - - it('should create a fetchMonthlyBillingFailure action', () => { - expect(fetchMonthlyBillingFailure.type).toEqual(ActionTypes.DEVELOPER_FETCH_MONTHLY_BILLING_FAILED) - expect(fetchMonthlyBillingFailure('error').data).toEqual('error') - }) - - it('should create a developerWebhookPing action', () => { - const params: PingWebhooksByIdParams = { - id: 'id', - topicId: 'topicId', - } - expect(developerWebhookPing.type).toEqual(ActionTypes.DEVELOPER_PING_WEBHOOK) - expect(developerWebhookPing(params).data).toEqual(params) - }) - it('should create a developerSetWebhookPingStatus action', () => { - expect(developerSetWebhookPingStatus.type).toEqual(ActionTypes.DEVELOPER_SET_PING_WEBHOOK_STATUS) - expect(developerSetWebhookPingStatus('SUCCESS').data).toEqual('SUCCESS') - }) - it('should create a developerApplyAppDetails action', () => { - expect(developerApplyAppDetails.type).toEqual(ActionTypes.DEVELOPER_APPLY_APP_DETAIL) - expect(developerApplyAppDetails({}).data).toEqual({}) - }) -}) diff --git a/packages/admin-portal/src/actions/__tests__/installed-apps.ts b/packages/admin-portal/src/actions/__tests__/installed-apps.ts deleted file mode 100644 index 55c1409c15..0000000000 --- a/packages/admin-portal/src/actions/__tests__/installed-apps.ts +++ /dev/null @@ -1,30 +0,0 @@ -import { - installedAppsLoading, - installedAppsReceiveData, - installedAppsRequestData, - installedAppsClearData, -} from '../installed-apps' -import ActionTypes from '../../constants/action-types' -import { appsDataStub } from '../../sagas/__stubs__/apps' - -describe('installedApps actions', () => { - it('should create a installedAppsLoading action', () => { - expect(installedAppsLoading.type).toEqual(ActionTypes.INSTALLED_APPS_LOADING) - expect(installedAppsLoading(true).data).toEqual(true) - }) - - it('should create a installedAppsReceiveData action', () => { - expect(installedAppsReceiveData.type).toEqual(ActionTypes.INSTALLED_APPS_RECEIVE_DATA) - expect(installedAppsReceiveData(appsDataStub).data).toEqual(appsDataStub) - }) - - it('should create a installedAppsRequestData action', () => { - expect(installedAppsRequestData.type).toEqual(ActionTypes.INSTALLED_APPS_REQUEST_DATA) - expect(installedAppsRequestData(1).data).toEqual(1) - }) - - it('should create a installedAppsClearData action', () => { - expect(installedAppsClearData.type).toEqual(ActionTypes.INSTALLED_APPS_CLEAR_DATA) - expect(installedAppsClearData(null).data).toEqual(null) - }) -}) diff --git a/packages/admin-portal/src/actions/__tests__/my-apps.ts b/packages/admin-portal/src/actions/__tests__/my-apps.ts deleted file mode 100644 index 26a7d7cb3f..0000000000 --- a/packages/admin-portal/src/actions/__tests__/my-apps.ts +++ /dev/null @@ -1,25 +0,0 @@ -import { myAppsLoading, myAppsReceiveData, myAppsRequestData, myAppsClearData } from '../my-apps' -import ActionTypes from '../../constants/action-types' -import { appsDataStub } from '../../sagas/__stubs__/apps' - -describe('myApps actions', () => { - it('should create a myAppsLoading action', () => { - expect(myAppsLoading.type).toEqual(ActionTypes.MY_APPS_LOADING) - expect(myAppsLoading(true).data).toEqual(true) - }) - - it('should create a myAppsReceiveData action', () => { - expect(myAppsReceiveData.type).toEqual(ActionTypes.MY_APPS_RECEIVE_DATA) - expect(myAppsReceiveData(appsDataStub).data).toEqual(appsDataStub) - }) - - it('should create a myAppsRequestData action', () => { - expect(myAppsRequestData.type).toEqual(ActionTypes.MY_APPS_REQUEST_DATA) - expect(myAppsRequestData(1).data).toEqual(1) - }) - - it('should create a myAppsClearData action', () => { - expect(myAppsClearData.type).toEqual(ActionTypes.MY_APPS_CLEAR_DATA) - expect(myAppsClearData(null).data).toEqual(null) - }) -}) diff --git a/packages/admin-portal/src/actions/__tests__/settings.ts b/packages/admin-portal/src/actions/__tests__/settings.ts deleted file mode 100644 index 02c1753ed2..0000000000 --- a/packages/admin-portal/src/actions/__tests__/settings.ts +++ /dev/null @@ -1,35 +0,0 @@ -import { - requestDeveloperData, - requestDeveloperDataSuccess, - settingShowLoading, - updateDeveloperData, - changePassword, -} from '../settings' -import ActionTypes from '../../constants/action-types' -import { developerStub } from '../../sagas/__stubs__/developer' - -describe('settings actions', () => { - it('should create a requestDeveloperData action', () => { - expect(requestDeveloperData.type).toEqual(ActionTypes.SETTING_FETCH_DEVELOPER_INFO) - expect(requestDeveloperData().data).toEqual(undefined) - }) - - it('should create a requestDeveloperDataSuccess action', () => { - expect(requestDeveloperDataSuccess.type).toEqual(ActionTypes.SETTING_FETCH_DEVELOPER_INFO_SUCCESS) - expect(requestDeveloperDataSuccess(developerStub).data).toEqual(developerStub) - }) - - it('should create a settingShowLoading action', () => { - expect(settingShowLoading.type).toEqual(ActionTypes.SETTING_SHOW_HIDE_LOADING) - expect(settingShowLoading(true).data).toEqual(true) - }) - it('should create a updateDeveloperData action', () => { - expect(updateDeveloperData.type).toEqual(ActionTypes.SETTING_UPDATE_DEVELOPER) - expect(updateDeveloperData(developerStub).data).toEqual(developerStub) - }) - it('should create a changePassword action', () => { - expect(changePassword.type).toEqual(ActionTypes.CHANGE_PASSWORD) - const mockPassword = { currentPassword: '', password: '', confirmPassword: '' } - expect(changePassword(mockPassword).data).toEqual(mockPassword) - }) -}) diff --git a/packages/admin-portal/src/actions/__tests__/submit-app.ts b/packages/admin-portal/src/actions/__tests__/submit-app.ts deleted file mode 100644 index a291c2888a..0000000000 --- a/packages/admin-portal/src/actions/__tests__/submit-app.ts +++ /dev/null @@ -1,30 +0,0 @@ -import { - submitAppSetFormState, - submitApp, - submitAppLoading, - submitAppRequestData, - submitAppReceiveData, -} from '../submit-app' -import ActionTypes from '../../constants/action-types' - -describe('submitApp actions', () => { - it('should create a submitApp action', () => { - expect(submitApp.type).toEqual(ActionTypes.DEVELOPER_SUBMIT_APP) - }) - - it('should create a submitAppSetFormState action', () => { - expect(submitAppSetFormState.type).toEqual(ActionTypes.DEVELOPER_SUBMIT_APP_SET_FORM_STATE) - }) - - it('should create a submitAppLoading action', () => { - expect(submitAppLoading.type).toEqual(ActionTypes.DEVELOPER_SUBMIT_APP_LOADING) - }) - - it('should create a submitAppRequestData action', () => { - expect(submitAppRequestData.type).toEqual(ActionTypes.DEVELOPER_SUBMIT_APP_REQUEST_DATA) - }) - - it('should create a submitAppReceiveData action', () => { - expect(submitAppReceiveData.type).toEqual(ActionTypes.DEVELOPER_SUBMIT_APP_RECEIVE_DATA) - }) -}) diff --git a/packages/admin-portal/src/actions/__tests__/submit-revision.ts b/packages/admin-portal/src/actions/__tests__/submit-revision.ts deleted file mode 100644 index 669ee33102..0000000000 --- a/packages/admin-portal/src/actions/__tests__/submit-revision.ts +++ /dev/null @@ -1,12 +0,0 @@ -import { submitRevision, submitRevisionSetFormState } from '../submit-revision' -import ActionTypes from '../../constants/action-types' - -describe('submitRevision actions', () => { - it('should create a submitRevision action', () => { - expect(submitRevision.type).toEqual(ActionTypes.DEVELOPER_SUBMIT_REVISION) - }) - - it('should create a submitRevisionSetFormState action', () => { - expect(submitRevisionSetFormState.type).toEqual(ActionTypes.DEVELOPER_SUBMIT_REVISION_SET_FORM_STATE) - }) -}) diff --git a/packages/admin-portal/src/actions/__tests__/webhook-edit-modal.ts b/packages/admin-portal/src/actions/__tests__/webhook-edit-modal.ts deleted file mode 100644 index 73d09bcf1b..0000000000 --- a/packages/admin-portal/src/actions/__tests__/webhook-edit-modal.ts +++ /dev/null @@ -1,41 +0,0 @@ -import { - requestWebhookSubcriptionData, - requestWebhookSubcriptionReceiveData, - createWebhook, - CreateWebhookParams, - requestWebhookData, - deleteWebhook, -} from '../webhook-edit-modal' -import ActionTypes from '../../constants/action-types' -import { webhookDataStub } from '@/sagas/__stubs__/webhook-edit' - -describe('developer webhook actions', () => { - it('should create a requestDeveloperWebhookData action', () => { - expect(requestWebhookSubcriptionData.type).toEqual(ActionTypes.WEBHOOK_EDIT_SUBCRIPTION_REQUEST_DATA) - }) - - it('should create a developerReceiveData action', () => { - expect(requestWebhookSubcriptionReceiveData.type).toEqual(ActionTypes.WEBHOOK_EDIT_SUBCRIPTION_RECEIVE_DATA) - expect(requestWebhookSubcriptionReceiveData(webhookDataStub).data).toEqual(webhookDataStub) - }) - - it('should create a developerCreate action', () => { - const newWebhook: CreateWebhookParams = { - applicationId: '1161242a-f650-4d1d-aed7-909853fe7ee1', - url: 'https://github.com/', - description: '', - topicIds: ['0a795809-8a41-449f-9865-ae0a536db6b7'], - customerIds: ['0a795809-8a41-449f-9865-ae0a536db6b7'], - active: true, - } - expect(createWebhook.type).toEqual(ActionTypes.WEBHOOK_CREATE) - expect(createWebhook(newWebhook).data).toEqual(newWebhook) - }) - - it('should create a requestWebhookData action', () => { - expect(requestWebhookData.type).toEqual(ActionTypes.WEBHOOK_REQUEST_DATA) - }) - it('should create a requestWebhookData action', () => { - expect(deleteWebhook.type).toEqual(ActionTypes.WEBHOOK_DELETE) - }) -}) diff --git a/packages/admin-portal/src/actions/__tests__/webhook-subscriptions.ts b/packages/admin-portal/src/actions/__tests__/webhook-subscriptions.ts deleted file mode 100644 index cd69507207..0000000000 --- a/packages/admin-portal/src/actions/__tests__/webhook-subscriptions.ts +++ /dev/null @@ -1,25 +0,0 @@ -import { - webhookSubscriptionsRequestData, - webhookSubscriptionsReceiveData, - webhookTopicsRequestData, - webhookTopicsReceiveData, -} from '../webhook-subscriptions' -import ActionTypes from '../../constants/action-types' - -describe('webhookSubscriptions actions', () => { - it('should create a webhookSubscriptionsRequestData action', () => { - expect(webhookSubscriptionsRequestData.type).toEqual(ActionTypes.WEBHOOK_SUBSCRIPTION_REQUEST_DATA) - }) - - it('should create a webhookSubscriptionsReceiveData action', () => { - expect(webhookSubscriptionsReceiveData.type).toEqual(ActionTypes.WEBHOOK_SUBSCRIPTION_RECEIVE_DATA) - }) - - it('should create a webhookTopicsRequestData action', () => { - expect(webhookTopicsRequestData.type).toEqual(ActionTypes.WEBHOOK_TOPICS_REQUEST_DATA) - }) - - it('should create a webhookTopicsReceiveData action', () => { - expect(webhookTopicsReceiveData.type).toEqual(ActionTypes.WEBHOOK_TOPICS_RECEIVE_DATA) - }) -}) diff --git a/packages/admin-portal/src/actions/app-categories.ts b/packages/admin-portal/src/actions/app-categories.ts deleted file mode 100644 index 976367676a..0000000000 --- a/packages/admin-portal/src/actions/app-categories.ts +++ /dev/null @@ -1,7 +0,0 @@ -import { actionCreator } from '../utils/actions' -import ActionTypes from '../constants/action-types' -import { PagedResultCategoryModel_ } from '@reapit/foundations-ts-definitions' - -export const categoriesReceiveData = actionCreator( - ActionTypes.CATEGORIES_RECEIVE_DATA, -) diff --git a/packages/admin-portal/src/actions/app-detail-modal.ts b/packages/admin-portal/src/actions/app-detail-modal.ts deleted file mode 100644 index b60dd40f1a..0000000000 --- a/packages/admin-portal/src/actions/app-detail-modal.ts +++ /dev/null @@ -1,8 +0,0 @@ -import { actionCreator } from '../utils/actions' -import ActionTypes from '../constants/action-types' - -export const setAppDetailModalStateBrowse = actionCreator(ActionTypes.SET_APP_DETAIL_MODAL_STATE_BROWSE) -export const setAppDetailModalStateInstall = actionCreator(ActionTypes.SET_APP_DETAIL_MODAL_STATE_INSTALL) -export const setAppDetailModalStateUninstall = actionCreator(ActionTypes.SET_APP_DETAIL_MODAL_STATE_UNINSTALL) -export const setAppDetailModalStateSuccess = actionCreator(ActionTypes.SET_APP_DETAIL_MODAL_STATE_SUCCESS) -export const setAppDetailModalStateManage = actionCreator(ActionTypes.SET_APP_DETAIL_MODAL_STATE_MANAGE) diff --git a/packages/admin-portal/src/actions/app-http-traffic-event.ts b/packages/admin-portal/src/actions/app-http-traffic-event.ts deleted file mode 100644 index 2fda9d380b..0000000000 --- a/packages/admin-portal/src/actions/app-http-traffic-event.ts +++ /dev/null @@ -1,19 +0,0 @@ -import { actionCreator } from '../utils/actions' -import ActionTypes from '../constants/action-types' - -const { - HTTP_TRAFFIC_PER_DAY_REQUEST_DATA, - HTTP_TRAFFIC_PER_DAY_RECEIVE_DATA, - HTTP_TRAFFIC_PER_DAY_REQUEST_FAILURE, -} = ActionTypes - -export interface HttpTrafficPerDayParams { - applicationId?: string[] - customerId?: string[] - dateFrom?: string - dateTo?: string -} - -export const httpTrafficPerDayRequestData = actionCreator(HTTP_TRAFFIC_PER_DAY_REQUEST_DATA) -export const httpTrafficPerDayReceiveData = actionCreator(HTTP_TRAFFIC_PER_DAY_RECEIVE_DATA) -export const httpTrafficPerDayRequestDataFailure = actionCreator(HTTP_TRAFFIC_PER_DAY_REQUEST_FAILURE) diff --git a/packages/admin-portal/src/actions/app-installations.ts b/packages/admin-portal/src/actions/app-installations.ts deleted file mode 100644 index 3724af3537..0000000000 --- a/packages/admin-portal/src/actions/app-installations.ts +++ /dev/null @@ -1,53 +0,0 @@ -import { actionCreator } from '../utils/actions' -import ActionTypes from '../constants/action-types' -import { FormState } from '../types/core' -import { - PagedResultInstallationModel_, - TerminateInstallationModel, - CreateInstallationModel, -} from '@reapit/foundations-ts-definitions' - -export interface InstallationParams { - appId?: string[] - developerId?: string[] - clientId?: string[] - externalAppId?: string[] - showTerminated?: boolean - isInstalled?: boolean - installedDateFrom?: string - installedDateTo?: string - pageSize?: number - pageNumber?: number -} - -export type InstallParams = CreateInstallationModel & { callback?: () => void } - -export type UninstallParams = { - installationId: string - callback?: () => void -} & TerminateInstallationModel - -export const appInstallationsRequestData = actionCreator(ActionTypes.APP_INSTALLATIONS_REQUEST_DATA) -export const appInstallationsReceiveData = actionCreator( - ActionTypes.APP_INSTALLATIONS_RECEIVE_DATA, -) -export const appInstallationsRequestDataFailure = actionCreator( - ActionTypes.APP_INSTALLATIONS_REQUEST_DATA_FAILURE, -) -export const appInstallationsFilterRequestData = actionCreator( - ActionTypes.APP_INSTALLATIONS_FILTER_REQUEST_DATA, -) -export const appInstallationsFilterReceiveData = actionCreator( - ActionTypes.APP_INSTALLATIONS_FILTER_RECEIVE_DATA, -) -export const appInstallationsFilterRequestDataFailure = actionCreator( - ActionTypes.APP_INSTALLATIONS_FILTER_REQUEST_DATA_FAILURE, -) - -export const appInstallationsRequestInstall = actionCreator( - ActionTypes.APP_INSTALLATIONS_REQUEST_INSTALL, -) -export const appInstallationsRequestUninstall = actionCreator( - ActionTypes.APP_INSTALLATIONS_REQUEST_UNINSTALL, -) -export const appInstallationsSetFormState = actionCreator(ActionTypes.APP_INSTALLATIONS_SET_FORM_STATE) diff --git a/packages/admin-portal/src/actions/app-usage-stats.ts b/packages/admin-portal/src/actions/app-usage-stats.ts deleted file mode 100644 index 7b2b8b727e..0000000000 --- a/packages/admin-portal/src/actions/app-usage-stats.ts +++ /dev/null @@ -1,14 +0,0 @@ -import { actionCreator } from '../utils/actions' -import ActionTypes from '../constants/action-types' - -const { APP_USAGE_STATS_REQUEST_DATA, APP_USAGE_STATS_RECEIVE_DATA, APP_USAGE_STATS_REQUEST_DATA_FAILURE } = ActionTypes - -export interface AppUsageStatsParams { - appId?: string[] - dateFrom?: string - dateTo?: string -} - -export const appUsageStatsRequestData = actionCreator(APP_USAGE_STATS_REQUEST_DATA) -export const appUsageStatsReceiveData = actionCreator(APP_USAGE_STATS_RECEIVE_DATA) -export const appUsageStatsRequestDataFailure = actionCreator(APP_USAGE_STATS_REQUEST_DATA_FAILURE) diff --git a/packages/admin-portal/src/actions/client.ts b/packages/admin-portal/src/actions/client.ts deleted file mode 100644 index 26cbdbc2c1..0000000000 --- a/packages/admin-portal/src/actions/client.ts +++ /dev/null @@ -1,43 +0,0 @@ -import { actionCreator } from '@/utils/actions' -import ActionTypes from '@/constants/action-types' -import { ClientAppSummary, ClientAppSummaryParams } from '@/reducers/client/app-summary' -import { AppDetailData } from '@/reducers/client/app-detail' -import { FetchAppByIdParams } from '@/services/apps' -import { - UpdateWebComponentConfigParams, - FetchWebComponentConfigParams, - WebComponentConfigResult, -} from '@/services/web-component' -import { NegotiatorsResult } from '@/services/negotiators' - -export const clientFetchAppSummary = actionCreator(ActionTypes.CLIENT_FETCH_APP_SUMMARY) -export const clientFetchAppSummarySuccess = actionCreator( - ActionTypes.CLIENT_FETCH_APP_SUMMARY_SUCCESS, -) -export const clientFetchAppSummaryFailed = actionCreator(ActionTypes.CLIENT_FETCH_APP_SUMMARY_FAILED) -export const clientClearAppSummary = actionCreator(ActionTypes.CLIENT_CLEAR_APP_SUMMARY) - -// Client App Detail -export const clientFetchAppDetail = actionCreator(ActionTypes.CLIENT_FETCH_APP_DETAIL) -export const clientFetchAppDetailSuccess = actionCreator(ActionTypes.CLIENT_FETCH_APP_DETAIL_SUCCESS) -export const clientFetchAppDetailFailed = actionCreator(ActionTypes.CLIENT_FETCH_APP_DETAIL_FAILED) - -export const clientFetchWebComponentConfig = actionCreator( - ActionTypes.CLIENT_FETCH_WEB_COMPONENT_CONFIG, -) -export const clientFetchWebComponentConfigSuccess = actionCreator( - ActionTypes.CLIENT_FETCH_WEB_COMPONENT_CONFIG_SUCCESS, -) -export const clientFetchWebComponentConfigFailed = actionCreator( - ActionTypes.CLIENT_FETCH_WEB_COMPONENT_CONFIG_FAILED, -) -export const clientUpdateWebComponentConfig = actionCreator( - ActionTypes.CLIENT_UPDATE_WEB_COMPONENT_CONFIG, -) -export const clientUpdateWebComponentConfigFailed = actionCreator( - ActionTypes.CLIENT_UPDATE_WEB_COMPONENT_CONFIG_FAILED, -) - -export const clientFetchNegotiatorsSuccess = actionCreator( - ActionTypes.CLIENT_FETCH_NEGOTIATORS_SUCCESS, -) diff --git a/packages/admin-portal/src/actions/developer-app-modal.ts b/packages/admin-portal/src/actions/developer-app-modal.ts deleted file mode 100644 index 3e88533c1b..0000000000 --- a/packages/admin-portal/src/actions/developer-app-modal.ts +++ /dev/null @@ -1,11 +0,0 @@ -import { actionCreator } from '../utils/actions' -import ActionTypes from '../constants/action-types' - -export const setDeveloperAppModalStateEditDetail = actionCreator( - ActionTypes.SET_DEVELOPER_APP_MODAL_STATE_EDIT_DETAIL, -) -export const setDeveloperAppModalStateDelete = actionCreator(ActionTypes.SET_DEVELOPER_APP_MODAL_STATE_DELETE) -export const setDeveloperAppModalStateViewDetail = actionCreator( - ActionTypes.SET_DEVELOPER_APP_MODAL_STATE_VIEW_DETAIL, -) -export const developerAppShowModal = actionCreator(ActionTypes.DEVELOPER_SHOW_MODAL) diff --git a/packages/admin-portal/src/actions/developer-subscriptions.ts b/packages/admin-portal/src/actions/developer-subscriptions.ts deleted file mode 100644 index 012ad9c4ca..0000000000 --- a/packages/admin-portal/src/actions/developer-subscriptions.ts +++ /dev/null @@ -1,32 +0,0 @@ -import { actionCreator } from '../utils/actions' -import ActionTypes from '../constants/action-types' -import { FetchSubscriptionsListParams } from '@/services/developer-subscriptions' -import { - SubscriptionModel, - CreateSubscriptionModel, - PagedResultSubscriptionModel_, -} from '@reapit/foundations-ts-definitions' - -export const developerFetchSubscriptions = actionCreator( - ActionTypes.DEVELOPER_FETCH_SUBSCRIPTIONS, -) -export const developerFetchSubscriptionsSuccess = actionCreator( - ActionTypes.DEVELOPER_FETCH_SUBSCRIPTIONS_SUCCESS, -) -export const developerDeleteSubscription = actionCreator(ActionTypes.DEVELOPER_DELETE_SUBSCRIPTION) - -export interface CreateSubscriptionParams { - params: CreateSubscriptionModel - onCreated: () => void -} - -export const developerCreateSubscription = actionCreator( - ActionTypes.DEVELOPER_SUBSCRIPTION_CREATE, -) -export const developerCreateSubscriptionSuccess = actionCreator( - ActionTypes.DEVELOPER_SUBSCRIPTION_CREATE_SUCCESS, -) -export const developerCreateSubscriptionFalure = actionCreator(ActionTypes.DEVELOPER_SUBSCRIPTION_CREATE_FAILURE) -export const developerCreateSubscriptionClearError = actionCreator( - ActionTypes.DEVELOPER_SUBSCRIPTION_CLEAR_CREATE_ERROR, -) diff --git a/packages/admin-portal/src/actions/developer.ts b/packages/admin-portal/src/actions/developer.ts deleted file mode 100644 index f1dd6add44..0000000000 --- a/packages/admin-portal/src/actions/developer.ts +++ /dev/null @@ -1,48 +0,0 @@ -// TODO: WILL MOVE ALL DEVELOPER ACTIONS TO HERE -import { actionCreator } from '../utils/actions' -import ActionTypes from '../constants/action-types' -import { AppDetailData, DeveloperItem, DeveloperRequestParams, WebhookPingTestStatus } from '@/reducers/developer' -import { - CreateDeveloperModel, - DeveloperModel, - BillingBreakdownForMonthV2Model, - BillingOverviewForPeriodV2Model, -} from '@reapit/foundations-ts-definitions' -import { FormState } from '@/types/core' -import { FetchBillingsParams, FetchBillingsByMonthParams } from '@/services/traffic-events' -import { PingWebhooksByIdParams } from '@/services/webhooks' -import { FetchAppByIdParams } from '@/services/apps' - -// Developer App Detail -export const developerFetchAppDetail = actionCreator(ActionTypes.DEVELOPER_FETCH_APP_DETAIL) -export const developerFetchAppDetailSuccess = actionCreator( - ActionTypes.DEVELOPER_FETCH_APP_DETAIL_SUCCESS, -) -export const developerFetchAppDetailFailed = actionCreator(ActionTypes.DEVELOPER_FETCH_APP_DETAIL_FAILED) - -export const developerRequestData = actionCreator(ActionTypes.DEVELOPER_REQUEST_DATA) -export const developerRequestDataFailure = actionCreator(ActionTypes.DEVELOPER_REQUEST_DATA_FAILURE) -export const developerLoading = actionCreator(ActionTypes.DEVELOPER_LOADING) -export const developerReceiveData = actionCreator(ActionTypes.DEVELOPER_RECEIVE_DATA) -export const developerClearData = actionCreator(ActionTypes.DEVELOPER_CLEAR_DATA) -export const developerCreate = actionCreator(ActionTypes.DEVELOPER_CREATE) -export const developerSetFormState = actionCreator(ActionTypes.DEVELOPER_SET_FORM_STATE) -export const fetchMyIdentity = actionCreator(ActionTypes.DEVELOPER_FETCH_MY_IDENTITY) -export const setMyIdentity = actionCreator(ActionTypes.DEVELOPER_SET_MY_IDENTITY) -export const fetchBilling = actionCreator(ActionTypes.DEVELOPER_FETCH_BILLING) -export const fetchBillingSuccess = actionCreator( - ActionTypes.DEVELOPER_FETCH_BILLING_SUCCESS, -) -export const fetchBillingFailure = actionCreator(ActionTypes.DEVELOPER_FETCH_BILLING_FAILED) -export const fetchMonthlyBilling = actionCreator( - ActionTypes.DEVELOPER_FETCH_MONTHLY_BILLING, -) -export const fetchMonthlyBillingSuccess = actionCreator( - ActionTypes.DEVELOPER_FETCH_MONTHLY_BILLING_SUCCESS, -) -export const fetchMonthlyBillingFailure = actionCreator(ActionTypes.DEVELOPER_FETCH_MONTHLY_BILLING_FAILED) -export const developerWebhookPing = actionCreator(ActionTypes.DEVELOPER_PING_WEBHOOK) -export const developerSetWebhookPingStatus = actionCreator( - ActionTypes.DEVELOPER_SET_PING_WEBHOOK_STATUS, -) -export const developerApplyAppDetails = actionCreator(ActionTypes.DEVELOPER_APPLY_APP_DETAIL) diff --git a/packages/admin-portal/src/actions/installed-apps.ts b/packages/admin-portal/src/actions/installed-apps.ts deleted file mode 100644 index e0cf41bdd1..0000000000 --- a/packages/admin-portal/src/actions/installed-apps.ts +++ /dev/null @@ -1,11 +0,0 @@ -import { actionCreator } from '../utils/actions' -import ActionTypes from '../constants/action-types' -import { InstalledAppsItem } from '../reducers/installed-apps' - -export const installedAppsRequestData = actionCreator(ActionTypes.INSTALLED_APPS_REQUEST_DATA) -export const installedAppsRequestDataFailure = actionCreator(ActionTypes.INSTALLED_APPS_REQUEST_DATA_FAILURE) -export const installedAppsLoading = actionCreator(ActionTypes.INSTALLED_APPS_LOADING) -export const installedAppsReceiveData = actionCreator( - ActionTypes.INSTALLED_APPS_RECEIVE_DATA, -) -export const installedAppsClearData = actionCreator(ActionTypes.INSTALLED_APPS_CLEAR_DATA) diff --git a/packages/admin-portal/src/actions/my-apps.ts b/packages/admin-portal/src/actions/my-apps.ts deleted file mode 100644 index f5cb60a4eb..0000000000 --- a/packages/admin-portal/src/actions/my-apps.ts +++ /dev/null @@ -1,9 +0,0 @@ -import { actionCreator } from '../utils/actions' -import ActionTypes from '../constants/action-types' -import { MyAppsItem } from '../reducers/my-apps' - -export const myAppsRequestData = actionCreator(ActionTypes.MY_APPS_REQUEST_DATA) -export const myAppsRequestDataFailure = actionCreator(ActionTypes.MY_APPS_REQUEST_DATA_FAILURE) -export const myAppsLoading = actionCreator(ActionTypes.MY_APPS_LOADING) -export const myAppsReceiveData = actionCreator(ActionTypes.MY_APPS_RECEIVE_DATA) -export const myAppsClearData = actionCreator(ActionTypes.MY_APPS_CLEAR_DATA) diff --git a/packages/admin-portal/src/actions/settings.ts b/packages/admin-portal/src/actions/settings.ts deleted file mode 100644 index 590d1fee49..0000000000 --- a/packages/admin-portal/src/actions/settings.ts +++ /dev/null @@ -1,17 +0,0 @@ -import { actionCreator } from '../utils/actions' -import ActionTypes from '../constants/action-types' -import { DeveloperModel } from '@reapit/foundations-ts-definitions' - -export const requestDeveloperData = actionCreator(ActionTypes.SETTING_FETCH_DEVELOPER_INFO) -export const requestDeveloperDataSuccess = actionCreator( - ActionTypes.SETTING_FETCH_DEVELOPER_INFO_SUCCESS, -) -export const settingShowLoading = actionCreator(ActionTypes.SETTING_SHOW_HIDE_LOADING) -export const updateDeveloperData = actionCreator(ActionTypes.SETTING_UPDATE_DEVELOPER) - -export type ChangePasswordParams = { - currentPassword: string - password: string - confirmPassword: string -} -export const changePassword = actionCreator(ActionTypes.CHANGE_PASSWORD) diff --git a/packages/admin-portal/src/actions/submit-app.ts b/packages/admin-portal/src/actions/submit-app.ts deleted file mode 100644 index 758501e550..0000000000 --- a/packages/admin-portal/src/actions/submit-app.ts +++ /dev/null @@ -1,43 +0,0 @@ -import { FormikHelpers } from '@reapit/elements' -import { Dispatch } from 'redux' -import { actionCreator } from '../utils/actions' -import ActionTypes from '../constants/action-types' -import { CreateAppModel, ScopeModel } from '@reapit/foundations-ts-definitions' -import { FormState } from '@/types/core' -import { FormStep } from '@/reducers/submit-app' - -export type WizardStep = - | 'BEFORE_YOU_START' - | 'INPUT_APP_NAME' - | 'CREATE_NEW_APP' - | 'INPUT_AUTHENTICATION_URIS' - | 'GRANT_PERMISSION' - | 'SUBMIT_APP_SUCCESS' - | 'INPUT_ATHENTICATION_TYPE' - -export type SetWizardStep = React.Dispatch> - -export type HandleSubmitParams = { - dispatch: Dispatch - setWizardStep: SetWizardStep -} - -export type SubmitAppFormikActions = FormikHelpers - -export type CustomCreateAppModel = Pick & { - redirectUris?: string - signoutUris?: string -} -export type SubmitAppArgs = CreateAppModel & - Pick & - Pick, 'setErrors' | 'setFieldValue'> - -export type WizardChangeStepModel = { - formStep: FormStep -} - -export const submitApp = actionCreator(ActionTypes.DEVELOPER_SUBMIT_APP) -export const submitAppSetFormState = actionCreator(ActionTypes.DEVELOPER_SUBMIT_APP_SET_FORM_STATE) -export const submitAppLoading = actionCreator(ActionTypes.DEVELOPER_SUBMIT_APP_LOADING) -export const submitAppRequestData = actionCreator(ActionTypes.DEVELOPER_SUBMIT_APP_REQUEST_DATA) -export const submitAppReceiveData = actionCreator(ActionTypes.DEVELOPER_SUBMIT_APP_RECEIVE_DATA) diff --git a/packages/admin-portal/src/actions/submit-revision.ts b/packages/admin-portal/src/actions/submit-revision.ts deleted file mode 100644 index 24269323fe..0000000000 --- a/packages/admin-portal/src/actions/submit-revision.ts +++ /dev/null @@ -1,12 +0,0 @@ -import { actionCreator } from '../utils/actions' -import ActionTypes from '../constants/action-types' -import { CreateAppRevisionModel } from '@reapit/foundations-ts-definitions' - -export type SubmitRevisionParams = { - params: CreateAppRevisionModel & { id: string } - onSuccess: () => void - onError: () => void -} - -export const submitRevision = actionCreator(ActionTypes.DEVELOPER_SUBMIT_REVISION) -export const submitRevisionSetFormState = actionCreator(ActionTypes.DEVELOPER_SUBMIT_REVISION_SET_FORM_STATE) diff --git a/packages/admin-portal/src/actions/webhook-edit-modal.ts b/packages/admin-portal/src/actions/webhook-edit-modal.ts deleted file mode 100644 index 703ef8999e..0000000000 --- a/packages/admin-portal/src/actions/webhook-edit-modal.ts +++ /dev/null @@ -1,65 +0,0 @@ -import { actionCreator } from '../utils/actions' -import ActionTypes from '../constants/action-types' -import { WebhookModal, WebhookSubscription } from '@/reducers/webhook-edit-modal' - -export interface SubscriptionCustomersRequestParams { - AppId: string -} -export interface SubscriptionTopicsRequestParams { - applicationId: string -} - -export interface FetchWebhookRequestParams { - webhookId: string -} - -export interface DeleteWebhookRequestParams { - webhookId: string -} - -export interface WebhookDataRequestParams { - webhookId: string -} - -export interface WebhookSubcriptionDataRequest { - appId: string -} - -export interface DeleteWebhookParams { - applicationId: string - webhookId: string -} -export interface CreateWebhookParams { - applicationId: string - url: string - description?: string - topicIds: string[] - customerIds: string[] - active: boolean -} - -export interface EditWebhookParams { - applicationId: string - webhookId: string - url: string - description?: string - topicIds: string[] - customerIds: string[] - active: boolean -} - -export const requestWebhookSubcriptionData = actionCreator(ActionTypes.WEBHOOK_EDIT_SUBCRIPTION_REQUEST_DATA) -export const requestWebhookSubcriptionReceiveData = actionCreator( - ActionTypes.WEBHOOK_EDIT_SUBCRIPTION_RECEIVE_DATA, -) -export const requestWebhookSubcriptionReceiveFailure = actionCreator( - ActionTypes.WEBHOOK_EDIT_SUBCRIPTION_REQUEST_DATA_FAILURE, -) -export const createWebhook = actionCreator(ActionTypes.WEBHOOK_CREATE) -export const editWebhook = actionCreator(ActionTypes.WEBHOOK_EDIT) -export const deleteWebhook = actionCreator(ActionTypes.WEBHOOK_DELETE) -export const requestWebhookData = actionCreator(ActionTypes.WEBHOOK_REQUEST_DATA) -export const requestWebhookReceiveData = actionCreator(ActionTypes.WEBHOOK_RECEIVE_DATA) -export const requestWebhookReceiveDataFailure = actionCreator(ActionTypes.WEBHOOK_RECEIVE_DATA_FAILURE) -export const webhookDataClear = actionCreator(ActionTypes.WEBHOOK_DATA_CLEAR) -export const webhookSetOpenModal = actionCreator(ActionTypes.WEBHOOK_SET_OPEN_MODAL) diff --git a/packages/admin-portal/src/actions/webhook-subscriptions.ts b/packages/admin-portal/src/actions/webhook-subscriptions.ts deleted file mode 100644 index 004ae16f0e..0000000000 --- a/packages/admin-portal/src/actions/webhook-subscriptions.ts +++ /dev/null @@ -1,11 +0,0 @@ -import { actionCreator } from '@/utils/actions' -import ActionTypes from '@/constants/action-types' -import { PagedResultWebhookModel_, PagedResultTopicModel_ } from '@/reducers/webhook-subscriptions' - -export const webhookSubscriptionsRequestData = actionCreator(ActionTypes.WEBHOOK_SUBSCRIPTION_REQUEST_DATA) -export const webhookSubscriptionsReceiveData = actionCreator( - ActionTypes.WEBHOOK_SUBSCRIPTION_RECEIVE_DATA, -) -export const webhookTopicsRequestData = actionCreator(ActionTypes.WEBHOOK_TOPICS_REQUEST_DATA) -export const webhookTopicsReceiveData = actionCreator(ActionTypes.WEBHOOK_TOPICS_RECEIVE_DATA) -export const setApplicationId = actionCreator(ActionTypes.WEBHOOK_SET_APPLICATION_ID) diff --git a/packages/admin-portal/src/components/ui/app-installations/__tests__/__snapshots__/app-installations-modal.tsx.snap b/packages/admin-portal/src/components/ui/app-installations/__tests__/__snapshots__/app-installations-modal.tsx.snap deleted file mode 100644 index 7c2efa8d17..0000000000 --- a/packages/admin-portal/src/components/ui/app-installations/__tests__/__snapshots__/app-installations-modal.tsx.snap +++ /dev/null @@ -1,9 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[`AppInstallationsModal should match a snapshot 1`] = ` - -`; diff --git a/packages/admin-portal/src/components/ui/app-installations/__tests__/app-installations-modal.tsx b/packages/admin-portal/src/components/ui/app-installations/__tests__/app-installations-modal.tsx deleted file mode 100644 index 743a720e0d..0000000000 --- a/packages/admin-portal/src/components/ui/app-installations/__tests__/app-installations-modal.tsx +++ /dev/null @@ -1,40 +0,0 @@ -import * as React from 'react' -import { shallow } from 'enzyme' - -import { - AppInstallationsModal, - handleAfterClose, - handleUninstall, - AppInstallationsModalProps, -} from '../app-installations-modal' -import { installationStub } from '@/sagas/__stubs__/installation' - -const props: AppInstallationsModalProps = { - appId: '1', - appName: '1', - visible: true, - afterClose: jest.fn(), - onUninstallSuccess: jest.fn(), -} - -describe('AppInstallationsModal', () => { - it('should match a snapshot', () => { - expect(shallow()).toMatchSnapshot() - }) - describe('handleAfterClose have afterClose', () => { - it('should run correctly', () => { - const afterClose = jest.fn() - const setUninstallApp = jest.fn() - handleAfterClose({ setUninstallApp, afterClose })() - expect(afterClose).toBeCalled() - expect(setUninstallApp).toBeCalled() - }) - }) - describe('handleUninstall', () => { - it('should run correctly', () => { - const setUninstallApp = jest.fn() - handleUninstall(setUninstallApp(installationStub))(installationStub) - expect(setUninstallApp).toBeCalled() - }) - }) -}) diff --git a/packages/admin-portal/src/components/ui/app-installations/app-installations-modal.tsx b/packages/admin-portal/src/components/ui/app-installations/app-installations-modal.tsx deleted file mode 100644 index 38c5a99aee..0000000000 --- a/packages/admin-portal/src/components/ui/app-installations/app-installations-modal.tsx +++ /dev/null @@ -1,55 +0,0 @@ -import * as React from 'react' -import { ModalProps, Modal } from '@reapit/elements' -import { InstallationModel } from '@reapit/foundations-ts-definitions' -import ConfirmUninstall from './confirm-uninstall' - -interface AppInstallationsModalInnerProps { - appId: string - appName: string - onUninstallSuccess: () => void -} - -export type AppInstallationsModalProps = Pick & AppInstallationsModalInnerProps - -interface HandleAfterClose { - setUninstallApp: any - afterClose?: any -} -export const handleAfterClose = ({ setUninstallApp, afterClose }: HandleAfterClose) => () => { - setUninstallApp(undefined) - if (afterClose) { - afterClose() - } -} - -export const handleUninstall = (setUninstallApp: (app: InstallationModel) => void) => ( - app: InstallationModel, -) => () => { - setUninstallApp(app) -} - -export const AppInstallationsModal: React.FC = ({ - appName, - visible, - afterClose, - onUninstallSuccess, -}) => { - const [uninstallApp, setUninstallApp] = React.useState() - - return ( - - <> - {uninstallApp && ( - - )} - - - ) -} - -export default AppInstallationsModal diff --git a/packages/admin-portal/src/components/ui/app-installations/confirm-uninstall/__tests__/__snapshots__/confirm-uninstall.test.tsx.snap b/packages/admin-portal/src/components/ui/app-installations/confirm-uninstall/__tests__/__snapshots__/confirm-uninstall.test.tsx.snap deleted file mode 100644 index 610ca0297e..0000000000 --- a/packages/admin-portal/src/components/ui/app-installations/confirm-uninstall/__tests__/__snapshots__/confirm-uninstall.test.tsx.snap +++ /dev/null @@ -1,287 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[`ConfirmUninstall should match a snapshot 1`] = ` - - - -
- - -
-

- Confirm Uninstall -

-
-
- - - Are you sure you wish to uninstall ‘ - 1 - ’ from ‘ - DXX - ’? - - - *Please confirm reason for uninstalling - - - - } - > -
- -
- Are you sure you wish to uninstall ‘ - 1 - ’ from ‘ - DXX - ’? -
-
- -
- *Please confirm reason for uninstalling -
-
- - -
-
-