Skip to content

Commit

Permalink
Ywang/revert/dght 287 (#5472)
Browse files Browse the repository at this point in the history
* Revert "chore: prepare release (#5471)"

This reverts commit 93202cb.

* Revert "chore(DGHT-287): Fix dependabot alerts (2) (#5469)"

This reverts commit fc2e30f.
  • Loading branch information
yyanwang authored Dec 10, 2024
1 parent 93202cb commit d161cab
Show file tree
Hide file tree
Showing 23 changed files with 412 additions and 338 deletions.
6 changes: 0 additions & 6 deletions fork/json-schema-form-core/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,5 @@
# @talend/json-schema-form-core

## 1.4.2

### Patch Changes

- fc2e30f: Fix remaining dependabot alerts

## 1.4.1

### Patch Changes
Expand Down
4 changes: 2 additions & 2 deletions fork/json-schema-form-core/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@talend/json-schema-form-core",
"version": "1.4.2",
"version": "1.4.1",
"description": "JSON-Schema and JSON-UI-Schema utilities for form generation.",
"main": "dist/index.js",
"module": "./lib-esm/index.js",
Expand Down Expand Up @@ -50,7 +50,7 @@
"@talend/babel-plugin-import-from-index": "^1.8.0",
"@talend/eslint-config": "^13.2.1",
"@talend/eslint-plugin": "^1.3.1",
"@talend/scripts-config-react-webpack": "^16.8.2",
"@talend/scripts-config-react-webpack": "^16.8.1",
"@talend/scripts-config-typescript": "^11.3.0",
"@talend/scripts-core": "^16.5.1",
"@types/chai": "^3.5.2",
Expand Down
3 changes: 0 additions & 3 deletions fork/json-schema-form-core/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,5 @@ module.exports = {
fallback: {
path: false,
},
alias: {
'json-refs': require.resolve('json-refs/dist/json-refs.js'),
},
},
};
6 changes: 0 additions & 6 deletions packages/design-system/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,5 @@
# @talend/design-system

## 11.5.0

### Minor Changes

- fc2e30f: Fix remaining dependabot alerts

## 11.4.0

### Minor Changes
Expand Down
8 changes: 4 additions & 4 deletions packages/design-system/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@talend/design-system",
"version": "11.5.0",
"version": "11.4.0",
"description": "Talend Design System",
"main": "lib/index.js",
"types": "lib/index.d.ts",
Expand Down Expand Up @@ -73,14 +73,14 @@
"@storybook/react": "^7.6.20",
"@storybook/testing-library": "^0.2.2",
"@storybook/theming": "^7.6.20",
"@svgr/webpack": "^8.1.0",
"@svgr/webpack": "^5.5.0",
"@talend/eslint-config": "^13.2.1",
"@talend/eslint-plugin": "^1.3.1",
"@talend/icons": "^7.11.0",
"@talend/icons": "^7.10.3",
"@talend/locales-design-system": "^7.15.1",
"@talend/scripts-core": "^16.5.1",
"@talend/scripts-config-babel": "^13.5.0",
"@talend/scripts-config-react-webpack": "^16.8.2",
"@talend/scripts-config-react-webpack": "^16.8.1",
"@talend/scripts-config-storybook-lib": "^5.5.0",
"@talend/scripts-config-typescript": "^11.3.0",
"@talend/storybook-docs": "^2.5.1",
Expand Down
6 changes: 0 additions & 6 deletions packages/http/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,5 @@
# @talend/http

## 3.3.0

### Minor Changes

- fc2e30f: Fix remaining dependabot alerts

## 3.2.0

### Minor Changes
Expand Down
5 changes: 3 additions & 2 deletions packages/http/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@talend/http",
"version": "3.3.0",
"version": "3.2.0",
"description": "HTTP helper",
"license": "Apache-2.0",
"repository": {
Expand Down Expand Up @@ -31,10 +31,11 @@
"@talend/eslint-plugin": "^1.3.1",
"@talend/scripts-core": "^16.5.1",
"@talend/scripts-config-babel": "^13.5.0",
"@talend/scripts-config-react-webpack": "^16.8.2",
"@talend/scripts-config-react-webpack": "^16.8.1",
"@talend/scripts-config-typescript": "^11.3.0",
"@types/jest": "^29.5.14",
"@types/node-fetch": "^2.6.11",
"fetch-mock": "^9.11.0",
"node-fetch": "^2.7.0",
"react-dom": "^18.3.1",
"react": "^18.3.1"
Expand Down
92 changes: 29 additions & 63 deletions packages/http/src/http.common.test.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
import { Headers, Response } from 'node-fetch';
import fetchMock from 'fetch-mock';
import { Response, Headers } from 'node-fetch';

import {
addHttpResponseInterceptor,
getDefaultConfig,
HTTP,
HTTP_RESPONSE_INTERCEPTORS,
getDefaultConfig,
setDefaultConfig,
HTTP_RESPONSE_INTERCEPTORS,
addHttpResponseInterceptor,
} from './config';
import { encodePayload, handleBody, handleHttpResponse, httpFetch } from './http.common';
import { httpFetch, handleBody, encodePayload, handleHttpResponse } from './http.common';
import { HTTP_METHODS, HTTP_STATUS } from './http.constants';
import { TalendHttpError } from './http.types';

Expand All @@ -17,10 +18,6 @@ const defaultPayload = {
bar: 42,
};

interface FetchMock extends jest.Mock {
mockResponse?: Response;
}

beforeEach(() => {
jest.clearAllMocks();
});
Expand Down Expand Up @@ -202,24 +199,19 @@ describe('#httpFetch with `CSRF` token', () => {
});

afterAll(() => {
fetchMock.restore();
document.cookie = `csrfToken=${CSRFToken}; dwf_section_edit=True; Max-Age=0`;
});
it('should get the CRFS token', async () => {
const url = '/foo';
const headers = new Headers();
headers.append('Content-Type', 'application/json');

(global.self.fetch as FetchMock).mockResponse = new Response(JSON.stringify(defaultBody), {
status: 200,
headers: {
'Content-Type': 'application/json',
},
});

fetchMock.mock(url, { body: defaultBody, status: 200 });
const result = await httpFetch(url, {}, HTTP_METHODS.GET, defaultPayload);

expect(result.data).toEqual(defaultBody);
expect(global.self.fetch).toHaveBeenCalledWith(url, {
expect(fetchMock.calls()[0][1]).toEqual({
body: JSON.stringify(defaultPayload),
credentials: 'same-origin',
headers: {
Expand Down Expand Up @@ -247,6 +239,7 @@ describe('#httpFetch with CSRF handling configuration', () => {

afterAll(() => {
HTTP.defaultConfig = null;
fetchMock.restore();
document.cookie = `${defaultHttpConfiguration.security.CSRFTokenCookieKey}=${CSRFToken}; dwf_section_edit=True; Max-Age=0`;
});

Expand All @@ -258,17 +251,12 @@ describe('#httpFetch with CSRF handling configuration', () => {
const headers = new Headers();
headers.append('Content-Type', 'application/json');

(global.self.fetch as FetchMock).mockResponse = new Response(JSON.stringify(defaultBody), {
status: 200,
headers: {
'Content-Type': 'application/json',
},
});
fetchMock.mock(url, { body: defaultBody, status: 200 });

const result = await httpFetch(url, {}, HTTP_METHODS.GET, defaultPayload);

expect(result.data).toEqual(defaultBody);
expect(global.self.fetch).toHaveBeenCalledWith(url, {
expect(fetchMock.calls()[0][1]).toEqual({
body: JSON.stringify(defaultPayload),
credentials: 'same-origin',
headers: {
Expand All @@ -288,23 +276,19 @@ describe('#httpFetch with CSRF handling configuration', () => {
describe('#httpFetch', () => {
afterEach(() => {
HTTP.defaultConfig = null;
fetchMock.restore();
});

it('should fetch the request', async () => {
const url = '/foo';
const headers = new Headers();
headers.append('Content-Type', 'application/json');
(global.self.fetch as FetchMock).mockResponse = new Response(JSON.stringify(defaultBody), {
status: 200,
headers: {
'Content-Type': 'application/json',
},
});
fetchMock.mock(url, { body: defaultBody, status: 200 });

const result = await httpFetch(url, {}, HTTP_METHODS.GET, defaultPayload);

expect(result.data).toEqual(defaultBody);
expect(global.self.fetch).toHaveBeenCalledWith(url, {
expect(fetchMock.calls()[0][1]).toEqual({
body: JSON.stringify(defaultPayload),
credentials: 'same-origin',
headers: {
Expand All @@ -326,17 +310,12 @@ describe('#httpFetch', () => {
},
});

(global.self.fetch as FetchMock).mockResponse = new Response(JSON.stringify(defaultBody), {
status: 200,
headers: {
'Content-Type': 'application/json',
},
});
fetchMock.mock(url, { body: defaultBody, status: 200 });

const result = await httpFetch(url, {}, HTTP_METHODS.GET, defaultPayload);

expect(result.data).toEqual(defaultBody);
expect(global.self.fetch).toHaveBeenCalledWith(url, {
expect(fetchMock.calls()[0][1]).toEqual({
body: JSON.stringify(defaultPayload),
credentials: 'same-origin',
headers: {
Expand All @@ -354,22 +333,14 @@ describe('#httpFetch', () => {
headers.append('Content-Type', 'application/json');
const payload = new FormData();

(global.self.fetch as FetchMock).mockResponse = new Response(JSON.stringify({ foo: 42 }), {
status: 200,
headers: {
'Content-Type': 'application/json',
},
});
fetchMock.mock(url, { body: '{"foo": 42}', status: 200 });

const result = await httpFetch(url, {}, HTTP_METHODS.GET, payload);
expect(result.data).toEqual({ foo: 42 });
expect(result.data).toEqual('{"foo": 42}');

expect(global.self.fetch).toHaveBeenCalledWith(url, {
body: payload,
credentials: 'same-origin',
headers: { Accept: 'application/json' },
method: 'GET',
});
const mockCalls = fetchMock.calls();
expect(mockCalls[0][1]?.credentials).toEqual('same-origin');
expect(mockCalls[0][1]?.headers).toEqual({ Accept: 'application/json' });
});
});

Expand All @@ -382,17 +353,16 @@ describe('#httpFetch with interceptors', () => {
}
});

afterEach(() => {
fetchMock.restore();
});

it('should call interceptor', async () => {
const interceptor = jest.fn().mockImplementation((res, _) => res);
addHttpResponseInterceptor('interceptor', interceptor);

const url = '/foo';
(global.self.fetch as FetchMock).mockResponse = new Response(JSON.stringify(defaultBody), {
status: 200,
headers: {
'Content-Type': 'application/json',
},
});
fetchMock.mock(url, { body: defaultBody, status: 200 });

await httpFetch(url, {}, HTTP_METHODS.GET, {});
expect(interceptor).toHaveBeenCalled();
Expand All @@ -404,12 +374,8 @@ describe('#httpFetch with interceptors', () => {

const url = '/foo';
const context = { async: true };
(global.self.fetch as FetchMock).mockResponse = new Response(JSON.stringify(defaultBody), {
status: 200,
headers: {
'Content-Type': 'application/json',
},
});
const response = { body: defaultBody, status: 200 };
fetchMock.mock(url, response);

await httpFetch(url, { context }, HTTP_METHODS.GET, {});
expect(interceptor).toHaveBeenCalledWith(
Expand Down
45 changes: 45 additions & 0 deletions packages/icons/.svgo-filters.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
multipass: true
full: true
js2svg:
pretty: true
indent: ' '

plugins:
- removeDoctype
- removeXMLProcInst
- removeComments
- removeMetadata
- removeEditorsNSData
- cleanupAttrs
- minifyStyles
- convertStyleToAttrs
- removeRasterImages
- cleanupNumericValues
- cleanupListOfValues
- convertColors
- removeUnknownsAndDefaults
- removeNonInheritableGroupAttrs
- removeUselessStrokeAndFill
- removeViewBox
- cleanupEnableBackground
- removeHiddenElems
- removeEmptyText
- convertShapeToPath
- moveElemsAttrsToGroup
- moveGroupAttrsToElems
- collapseGroups
- convertTransform
- removeEmptyAttrs
- removeEmptyContainers
- mergePaths
- removeUnusedNS
- transformsWithOnePath
- sortAttrs
- removeTitle
- removeDesc
- removeDimensions: true
- removeAttrs
- removeElementsByAttr
- addClassesToSVGElement
- removeStyleElement
- addAttributesToSVGElement
Loading

0 comments on commit d161cab

Please sign in to comment.