Skip to content

Commit 817a960

Browse files
Merge pull request #65 from mollie/feature/MOL-437/PICT-251
MOL-437/MOL-251: implement custom app list payment view
2 parents e04a41d + ece9f37 commit 817a960

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+7407
-6276
lines changed

CHANGELOG.md

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,31 @@ All notable changes to this project will be documented in this file.
44

55
The format is based on [Keep a Changelog](http://keepachangelog.com/) and this project adheres to [Semantic Versioning](http://semver.org/).
66

7-
## v2.0.0-alpha
7+
## v1.2.0-alpha
88

99
Added
1010

1111
- Mollie custom application initialization
1212

13+
## v1.1.1
14+
15+
Fixes
16+
17+
- Type converting issue in payment method listing endpoint
18+
19+
## v1.1.0
20+
21+
Added
22+
23+
- DockerImage for self hosting on AWS
24+
- Installation endpoint for required configurations
25+
26+
## v1.0.3
27+
28+
Added
29+
30+
- Endpoints for checking connector statuses
31+
1332
## v1.0.2
1433

1534
Fixes

application/@types-extensions/graphql-ctp/index.d.ts

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,3 +32,31 @@ declare module '*/fetch-custom-objects.ctp.graphql' {
3232

3333
export default defaultDocument;
3434
}
35+
36+
declare module '*/fetch-custom-object-details.ctp.graphql' {
37+
import { DocumentNode } from 'graphql';
38+
const defaultDocument: DocumentNode;
39+
export const UpdateCustomObjects: DocumentNode;
40+
export default defaultDocument;
41+
}
42+
43+
declare module '*/update-custom-object-details.ctp.graphql' {
44+
import { DocumentNode } from 'graphql';
45+
const defaultDocument: DocumentNode;
46+
export const UpdateCustomObjectDetails: DocumentNode;
47+
export default defaultDocument;
48+
}
49+
50+
declare module '*/remove-custom-object-details.ctp.graphql' {
51+
import { DocumentNode } from 'graphql';
52+
const defaultDocument: DocumentNode;
53+
export const RemoveCustomObjectDetails: DocumentNode;
54+
export default defaultDocument;
55+
}
56+
57+
declare module '*/fetch-extension-destination.ctp.graphql' {
58+
import { DocumentNode } from 'graphql';
59+
const defaultDocument: DocumentNode;
60+
export const FetchExtensionDestination: DocumentNode;
61+
export default defaultDocument;
62+
}

application/@types/commercetools__sync-actions/index.d.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,4 @@ declare module '@commercetools/sync-actions' {
88
buildActions: typeof buildActions;
99
};
1010
export function createSyncChannels(): Syncer;
11-
export function createSyncCustomObjects(): Syncer;
1211
}

application/custom-application-config.ts

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
import {
22
PERMISSIONS,
33
entryPointUriPath,
4-
cloudIdentifier,
5-
applicationId,
6-
applicationBaseUrl,
4+
CLOUD_IDENTIFIER,
5+
CUSTOM_APPLICATION_ID,
6+
APPLICATION_URL,
77
} from './src/constants';
88

99
/**
@@ -12,19 +12,19 @@ import {
1212
const config = {
1313
name: 'Mollie',
1414
entryPointUriPath,
15-
cloudIdentifier: cloudIdentifier,
15+
cloudIdentifier: CLOUD_IDENTIFIER,
1616
env: {
1717
development: {
1818
initialProjectKey: 'shopm-adv-dev',
1919
},
2020
production: {
21-
applicationId: applicationId,
22-
url: applicationBaseUrl,
21+
applicationId: CUSTOM_APPLICATION_ID,
22+
url: APPLICATION_URL,
2323
},
2424
},
2525
oAuthScopes: {
2626
view: ['view_key_value_documents'],
27-
manage: ['manage_key_value_documents'],
27+
manage: ['manage_key_value_documents', 'manage_extensions'],
2828
},
2929
icon: '${path:./assets/mollie.svg}',
3030
mainMenuLink: {
@@ -34,7 +34,9 @@ const config = {
3434
},
3535
headers: {
3636
csp: {
37-
'connect-src': ['api.mollie.com'],
37+
'connect-src': [
38+
'*.europe-west1.gcp.commercetools.app',
39+
],
3840
},
3941
},
4042
};

application/cypress/e2e/welcome.cy.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,13 @@
1-
import { entryPointUriPath, applicationBaseRoute } from '../support/constants';
1+
import {
2+
entryPointUriPath,
3+
APPLICATION_BASE_ROUTE,
4+
} from '../support/constants';
25

36
describe('Test welcome.cy.', () => {
47
beforeEach(() => {
58
cy.loginToMerchantCenter({
69
entryPointUriPath,
7-
initialRoute: applicationBaseRoute,
10+
initialRoute: APPLICATION_BASE_ROUTE,
811
});
912
});
1013
it('should render page', () => {

application/cypress/support/constants.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@ export const projectKey = Cypress.env('PROJECT_KEY');
22

33
export const entryPointUriPath = 'mollie';
44

5-
export const applicationBaseRoute = `/${projectKey}/${entryPointUriPath}`;
5+
export const APPLICATION_BASE_ROUTE = `/${projectKey}/${entryPointUriPath}`;

application/package.json

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,8 @@
1919
"versions:appkit": "manypkg upgrade @commercetools-frontend",
2020
"versions:uikit": "manypkg upgrade @commercetools-uikit",
2121
"cypress:open": "cypress open",
22-
"cypress:run": "cypress run"
22+
"cypress:run": "cypress run",
23+
"sync": "mc-scripts login && mc-scripts config:sync"
2324
},
2425
"dependencies": {
2526
"@apollo/client": "3.7.14",
@@ -44,6 +45,8 @@
4445
"@commercetools-test-data/channel": "8.5.0",
4546
"@commercetools-test-data/commons": "8.5.0",
4647
"@commercetools-test-data/core": "8.5.0",
48+
"@commercetools-test-data/custom-object": "^10.7.1",
49+
"@commercetools-uikit/checkbox-input": "^19.11.0",
4750
"@commercetools-uikit/constraints": "^19.9.0",
4851
"@commercetools-uikit/data-table": "^19.9.0",
4952
"@commercetools-uikit/flat-button": "^19.9.0",
@@ -61,6 +64,7 @@
6164
"@commercetools-uikit/text": "^19.9.0",
6265
"@commercetools-uikit/text-field": "^19.9.0",
6366
"@commercetools-uikit/text-input": "^19.9.0",
67+
"@commercetools-uikit/toggle-input": "^19.11.0",
6468
"@commercetools/sync-actions": "^5.14.0",
6569
"@emotion/react": "^11.11.4",
6670
"@formatjs/cli": "6.2.12",

application/src/components/welcome/messages.ts

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { defineMessages } from 'react-intl';
33
export default defineMessages({
44
title: {
55
id: 'Welcome.title',
6-
defaultMessage: 'Mollie',
6+
defaultMessage: 'Mollie payment methods',
77
},
88
subtitle: {
99
id: 'Welcome.subtitle',
@@ -14,4 +14,14 @@ export default defineMessages({
1414
id: 'Welcome.notice',
1515
defaultMessage: 'Content will follow...',
1616
},
17+
noData: {
18+
id: 'Welcome.noData',
19+
defaultMessage:
20+
'There are no active payment methods available. Please activate them in your mollie dashboard first.',
21+
},
22+
activeHeader: {
23+
id: 'Welcome.activeHeader',
24+
defaultMessage:
25+
'Payment method is only available for checkout if the status is set to “Active”. Please make sure that the payment method is also enabled in the Mollie Dashboard.',
26+
},
1727
});

application/src/components/welcome/welcome.spec.tsx

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,16 @@ import {
44
type TRenderAppWithReduxOptions,
55
} from '@commercetools-frontend/application-shell/test-utils';
66
import { renderApplicationWithRedux } from '../../test-utils';
7-
import { entryPointUriPath, PERMISSIONS, projectKey } from '../../constants';
7+
import { entryPointUriPath, PERMISSIONS } from '../../constants';
88
import ApplicationRoutes from '../../routes';
9+
import messages from './messages';
10+
import { setupServer } from 'msw/node';
11+
12+
const mockServer = setupServer();
13+
afterEach(() => mockServer.resetHandlers());
14+
afterAll(() => {
15+
mockServer.close();
16+
});
917

1018
const renderApp = (options: Partial<TRenderAppWithReduxOptions> = {}) => {
1119
const route = options.route || `/shopm-adv-dev/${entryPointUriPath}`;
@@ -22,11 +30,9 @@ const renderApp = (options: Partial<TRenderAppWithReduxOptions> = {}) => {
2230
return { history };
2331
};
2432

25-
it('should render welcome page', async () => {
26-
const logSpy = jest.spyOn(console, 'log').mockImplementation();
27-
28-
renderApp();
29-
await screen.findByText('Mollie');
30-
31-
logSpy.mockRestore();
33+
describe('Test welcome.tsx', () => {
34+
it('should render welcome page', async () => {
35+
renderApp();
36+
await screen.findByText(messages.title.defaultMessage);
37+
});
3238
});

0 commit comments

Comments
 (0)