@thecb/components 5.0.0-beta.8 → 5.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs.js +595 -397
- package/dist/index.cjs.js.map +1 -0
- package/dist/index.esm.js +41626 -0
- package/dist/index.esm.js.map +1 -0
- package/package.json +7 -3
- package/src/.DS_Store +0 -0
- package/src/components/.DS_Store +0 -0
- package/src/components/atoms/icons/CashIcon.js +21 -0
- package/src/components/atoms/icons/index.js +3 -1
- package/src/components/molecules/.DS_Store +0 -0
- package/src/components/molecules/modal/Modal.js +1 -1
- package/src/components/molecules/payment-form-card/PaymentFormCard.js +1 -0
- package/src/components/molecules/payment-form-card/PaymentFormCard.state.js +4 -2
- package/src/deprecated/.DS_Store +0 -0
- package/src/deprecated/utility/__tests__/safeConcat.spec.js +30 -28
- package/src/deprecated/utility/__tests__/validateKeyType.spec.js +65 -49
- package/src/deprecated/utility/index.js +2 -2
- package/src/deprecated/utility/safeConcat.js +3 -3
- package/src/deprecated/utility/validateKeyType.js +4 -6
- package/.eslintrc.json +0 -34
- package/.github/PULL_REQUEST_TEMPLATE.md +0 -18
- package/.github/stale.yml +0 -17
- package/.github/workflows/bump-version.yml +0 -30
- package/.github/workflows/create-release/build-body.sh +0 -35
- package/.github/workflows/create-release.yml +0 -52
- package/.github/workflows/disabled-workflows/publish-update.yml +0 -73
- package/.prettierignore +0 -3
- package/.storybook/main.js +0 -4
- package/.storybook/page.js +0 -64
- package/.storybook/themes/apc.theme.js +0 -1
- package/.storybook/themes/index.js +0 -2
- package/.storybook/themes/sf.theme.js +0 -1
- package/.tool-versions +0 -1
- package/rollup.config.js +0 -53
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@thecb/components",
|
|
3
|
-
"version": "5.
|
|
3
|
+
"version": "5.2.0",
|
|
4
4
|
"description": "Common lib for CityBase react components",
|
|
5
5
|
"main": "dist/index.cjs.js",
|
|
6
6
|
"module": "dist/index.esm.js",
|
|
@@ -18,6 +18,10 @@
|
|
|
18
18
|
"bugs": {
|
|
19
19
|
"url": "https://github.com/CityBaseInc/cb-components/issues"
|
|
20
20
|
},
|
|
21
|
+
"files": [
|
|
22
|
+
"dist",
|
|
23
|
+
"src"
|
|
24
|
+
],
|
|
21
25
|
"homepage": "https://github.com/CityBaseInc/cb-components#readme",
|
|
22
26
|
"devDependencies": {
|
|
23
27
|
"@babel/core": "^7.0.0-0",
|
|
@@ -74,13 +78,13 @@
|
|
|
74
78
|
},
|
|
75
79
|
"dependencies": {
|
|
76
80
|
"@babel/runtime": "^7.15.4",
|
|
77
|
-
"formatted-input": "^0.
|
|
81
|
+
"formatted-input": "^1.0.0",
|
|
78
82
|
"framer-motion": "^1.11.0",
|
|
79
83
|
"numeral": "^2.0.6",
|
|
80
84
|
"polished": "^4.0.3",
|
|
81
85
|
"ramda": "^0.27.0",
|
|
82
86
|
"react-aria-modal": "^4.0.0",
|
|
83
87
|
"react-pose": "^4.0.10",
|
|
84
|
-
"redux-freeform": "^5.
|
|
88
|
+
"redux-freeform": "^5.2.0"
|
|
85
89
|
}
|
|
86
90
|
}
|
package/src/.DS_Store
ADDED
|
Binary file
|
|
Binary file
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
|
|
3
|
+
const CashIcon = () => {
|
|
4
|
+
return (
|
|
5
|
+
<svg
|
|
6
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
7
|
+
width="36"
|
|
8
|
+
height="24"
|
|
9
|
+
fill="none"
|
|
10
|
+
viewBox="0 0 36 24"
|
|
11
|
+
>
|
|
12
|
+
<rect width="36" height="24" fill="#E8FFEF" rx="1"></rect>
|
|
13
|
+
<path
|
|
14
|
+
fill="#317D4F"
|
|
15
|
+
d="M17.178 5.464v1.372c-1.799.294-3.115 1.407-3.094 3.08.021 1.645 1.05 2.597 2.611 2.884l1.617.308c.924.182 1.365.406 1.365 1.085 0 .609-.553 1.092-1.484 1.092-1.036 0-1.743-.455-1.932-1.267l-2.478.021c.175 1.834 1.414 2.8 3.374 3.038v1.197h2.023V17.07c1.876-.266 3.024-1.33 3.024-2.877 0-1.617-.798-2.751-2.702-3.178l-1.603-.357c-.994-.231-1.267-.497-1.267-1.029 0-.546.511-1.015 1.596-1.015 1.015 0 1.302.511 1.393 1.267l2.415-.014c.05-1.484-1.043-2.695-2.835-3.024V5.464h-2.023z"
|
|
16
|
+
></path>
|
|
17
|
+
</svg>
|
|
18
|
+
);
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
export default CashIcon;
|
|
@@ -54,6 +54,7 @@ import ResetPasswordIcon from "./ResetPasswordIcon";
|
|
|
54
54
|
import PeriscopeFailedIcon from "./PeriscopeFailedIcon";
|
|
55
55
|
import CheckIcon from "./CheckIcon";
|
|
56
56
|
import WarningIconXS from "./WarningIconXS";
|
|
57
|
+
import CashIcon from "./CashIcon";
|
|
57
58
|
|
|
58
59
|
export {
|
|
59
60
|
AccountsIcon,
|
|
@@ -111,5 +112,6 @@ export {
|
|
|
111
112
|
ResetPasswordIcon,
|
|
112
113
|
PeriscopeFailedIcon,
|
|
113
114
|
CheckIcon,
|
|
114
|
-
WarningIconXS
|
|
115
|
+
WarningIconXS,
|
|
116
|
+
CashIcon
|
|
115
117
|
};
|
|
Binary file
|
|
@@ -15,7 +15,7 @@ Styling accomplished with our atoms / layout primitives
|
|
|
15
15
|
|
|
16
16
|
Cancel button will (for now) always use hideModal as its action
|
|
17
17
|
Continue button takes an action, if you want to navigate to
|
|
18
|
-
a different route (as with a link) connect() and use "push" from connected-react-router
|
|
18
|
+
a different route (as with a link) connect() and use "push" from @thecb/connected-react-router
|
|
19
19
|
*/
|
|
20
20
|
|
|
21
21
|
const getApplicationNode = () => document.getElementById("root");
|
|
@@ -71,6 +71,7 @@ const PaymentFormCard = ({
|
|
|
71
71
|
const expirationDateErrors = {
|
|
72
72
|
[required.error]: "Expiration date is required",
|
|
73
73
|
[hasLength.error]: "Expiration date is invalid",
|
|
74
|
+
[isValidMonth.error]: "Expiration month is invalid",
|
|
74
75
|
[dateAfterToday.error]: "Expiration date is invalid"
|
|
75
76
|
};
|
|
76
77
|
const cvvErrors = {
|
|
@@ -5,7 +5,8 @@ import {
|
|
|
5
5
|
hasLength,
|
|
6
6
|
matchesRegex,
|
|
7
7
|
validateWhen,
|
|
8
|
-
dateAfterToday
|
|
8
|
+
dateAfterToday,
|
|
9
|
+
isValidMonth
|
|
9
10
|
} from "redux-freeform";
|
|
10
11
|
|
|
11
12
|
//TODO: Will make zip code able to have more than 5 digits once we add in the FormattedInput because it will have issues with format of 60606-1111.
|
|
@@ -26,7 +27,8 @@ const formConfig = {
|
|
|
26
27
|
validators: [
|
|
27
28
|
required(),
|
|
28
29
|
hasLength(4, 4),
|
|
29
|
-
|
|
30
|
+
isValidMonth(0),
|
|
31
|
+
dateAfterToday("MMYY", "month", true)
|
|
30
32
|
],
|
|
31
33
|
constraints: [onlyIntegers(), hasLength(0, 4)]
|
|
32
34
|
},
|
|
Binary file
|
|
@@ -1,59 +1,61 @@
|
|
|
1
|
-
//
|
|
1
|
+
//
|
|
2
2
|
|
|
3
|
-
import safeConcat from
|
|
3
|
+
import safeConcat from "../safeConcat";
|
|
4
4
|
|
|
5
|
-
describe(
|
|
5
|
+
describe("safeConcat", () => {
|
|
6
6
|
beforeEach(() => {
|
|
7
7
|
console.error = jest.fn();
|
|
8
8
|
});
|
|
9
9
|
|
|
10
|
-
describe(
|
|
11
|
-
describe(
|
|
12
|
-
it(
|
|
13
|
-
const result = safeConcat(
|
|
10
|
+
describe("arg validation", () => {
|
|
11
|
+
describe("when values not an array", () => {
|
|
12
|
+
it("throws console error", () => {
|
|
13
|
+
const result = safeConcat("a", "-");
|
|
14
14
|
|
|
15
15
|
const errors = console.error.mock.calls;
|
|
16
16
|
expect(errors.length).toEqual(1);
|
|
17
17
|
|
|
18
18
|
const firstError = errors[0][0];
|
|
19
|
-
expect(firstError).toEqual(
|
|
19
|
+
expect(firstError).toEqual(
|
|
20
|
+
"'values' needs to be an array. Recieved string"
|
|
21
|
+
);
|
|
20
22
|
|
|
21
23
|
expect(result).toEqual(undefined);
|
|
22
24
|
});
|
|
23
25
|
});
|
|
24
26
|
});
|
|
25
27
|
|
|
26
|
-
describe(
|
|
27
|
-
it(
|
|
28
|
-
const result = safeConcat([
|
|
29
|
-
expect(result).toEqual(
|
|
28
|
+
describe("with valid values", () => {
|
|
29
|
+
it("concatinates strings with concatinator", () => {
|
|
30
|
+
const result = safeConcat(["a", "b", "c"], "-");
|
|
31
|
+
expect(result).toEqual("a-b-c");
|
|
30
32
|
});
|
|
31
33
|
|
|
32
|
-
it(
|
|
33
|
-
const result = safeConcat([
|
|
34
|
-
expect(result).toEqual(
|
|
34
|
+
it("stringifies the concatinator", () => {
|
|
35
|
+
const result = safeConcat(["a", "b", "c"], 1);
|
|
36
|
+
expect(result).toEqual("a1b1c");
|
|
35
37
|
});
|
|
36
38
|
|
|
37
|
-
it(
|
|
38
|
-
const result = safeConcat([
|
|
39
|
-
expect(result).toEqual(
|
|
39
|
+
it("removes falsey string values from values array", () => {
|
|
40
|
+
const result = safeConcat(["a", undefined, "b", ""], "-");
|
|
41
|
+
expect(result).toEqual("a-b");
|
|
40
42
|
});
|
|
41
43
|
|
|
42
|
-
it(
|
|
43
|
-
const result = safeConcat([
|
|
44
|
-
expect(result).toEqual(
|
|
44
|
+
it("does not append concatinator single values arrays", () => {
|
|
45
|
+
const result = safeConcat(["a"], "-");
|
|
46
|
+
expect(result).toEqual("a");
|
|
45
47
|
});
|
|
46
48
|
|
|
47
|
-
it(
|
|
48
|
-
const result = safeConcat([
|
|
49
|
-
expect(result).toEqual(
|
|
49
|
+
it("does not append concatinator to single truthy values", () => {
|
|
50
|
+
const result = safeConcat(["a", undefined], "-");
|
|
51
|
+
expect(result).toEqual("a");
|
|
50
52
|
});
|
|
51
53
|
});
|
|
52
54
|
|
|
53
|
-
describe(
|
|
54
|
-
it(
|
|
55
|
-
const result = safeConcat([undefined],
|
|
56
|
-
expect(result).toEqual(
|
|
55
|
+
describe("with no valid values", () => {
|
|
56
|
+
it("returns empty string when no valid values", () => {
|
|
57
|
+
const result = safeConcat([undefined], "-");
|
|
58
|
+
expect(result).toEqual("");
|
|
57
59
|
});
|
|
58
60
|
});
|
|
59
61
|
});
|
|
@@ -1,112 +1,128 @@
|
|
|
1
|
-
//
|
|
1
|
+
//
|
|
2
2
|
|
|
3
|
-
import validateKeyType from
|
|
3
|
+
import validateKeyType from "../validateKeyType";
|
|
4
4
|
|
|
5
|
-
describe(
|
|
5
|
+
describe("validateKeyType", () => {
|
|
6
6
|
const objParam = {
|
|
7
7
|
aArray: [1],
|
|
8
8
|
aBoolean: true,
|
|
9
9
|
aFunction: jest.fn(),
|
|
10
10
|
aNumber: 1,
|
|
11
|
-
aObject: { foo:
|
|
12
|
-
aString:
|
|
11
|
+
aObject: { foo: "bar" },
|
|
12
|
+
aString: "bar"
|
|
13
13
|
};
|
|
14
14
|
|
|
15
|
-
describe(
|
|
16
|
-
it(
|
|
17
|
-
const result = validateKeyType(objParam,
|
|
15
|
+
describe("when obj param does not contain key param", () => {
|
|
16
|
+
it("returns false", () => {
|
|
17
|
+
const result = validateKeyType(objParam, "wrong-key", "string");
|
|
18
18
|
expect(result).toEqual(false);
|
|
19
19
|
});
|
|
20
20
|
});
|
|
21
21
|
|
|
22
|
-
describe(
|
|
23
|
-
describe(
|
|
24
|
-
describe(
|
|
25
|
-
describe(
|
|
26
|
-
it(
|
|
27
|
-
const arrayResult = validateKeyType(objParam,
|
|
22
|
+
describe("when obj param contains key param", () => {
|
|
23
|
+
describe("when obj[key] type", () => {
|
|
24
|
+
describe("matches type param", () => {
|
|
25
|
+
describe("of Array", () => {
|
|
26
|
+
it("returns true", () => {
|
|
27
|
+
const arrayResult = validateKeyType(objParam, "aArray", "array");
|
|
28
28
|
expect(arrayResult).toEqual(true);
|
|
29
29
|
});
|
|
30
30
|
});
|
|
31
31
|
|
|
32
|
-
describe(
|
|
33
|
-
it(
|
|
34
|
-
const arrayResult = validateKeyType(
|
|
32
|
+
describe("of Boolean", () => {
|
|
33
|
+
it("returns true", () => {
|
|
34
|
+
const arrayResult = validateKeyType(
|
|
35
|
+
objParam,
|
|
36
|
+
"aBoolean",
|
|
37
|
+
"boolean"
|
|
38
|
+
);
|
|
35
39
|
expect(arrayResult).toEqual(true);
|
|
36
40
|
});
|
|
37
41
|
});
|
|
38
42
|
|
|
39
|
-
describe(
|
|
40
|
-
it(
|
|
41
|
-
const arrayResult = validateKeyType(
|
|
43
|
+
describe("of Function", () => {
|
|
44
|
+
it("returns true", () => {
|
|
45
|
+
const arrayResult = validateKeyType(
|
|
46
|
+
objParam,
|
|
47
|
+
"aFunction",
|
|
48
|
+
"function"
|
|
49
|
+
);
|
|
42
50
|
expect(arrayResult).toEqual(true);
|
|
43
51
|
});
|
|
44
52
|
});
|
|
45
53
|
|
|
46
|
-
describe(
|
|
47
|
-
it(
|
|
48
|
-
const arrayResult = validateKeyType(objParam,
|
|
54
|
+
describe("of Number", () => {
|
|
55
|
+
it("returns true", () => {
|
|
56
|
+
const arrayResult = validateKeyType(objParam, "aNumber", "number");
|
|
49
57
|
expect(arrayResult).toEqual(true);
|
|
50
58
|
});
|
|
51
59
|
});
|
|
52
60
|
|
|
53
|
-
describe(
|
|
54
|
-
it(
|
|
55
|
-
const arrayResult = validateKeyType(objParam,
|
|
61
|
+
describe("of Object", () => {
|
|
62
|
+
it("returns true", () => {
|
|
63
|
+
const arrayResult = validateKeyType(objParam, "aObject", "object");
|
|
56
64
|
expect(arrayResult).toEqual(true);
|
|
57
65
|
});
|
|
58
66
|
});
|
|
59
67
|
|
|
60
|
-
describe(
|
|
61
|
-
it(
|
|
62
|
-
const arrayResult = validateKeyType(objParam,
|
|
68
|
+
describe("of String", () => {
|
|
69
|
+
it("returns true", () => {
|
|
70
|
+
const arrayResult = validateKeyType(objParam, "aString", "string");
|
|
63
71
|
expect(arrayResult).toEqual(true);
|
|
64
72
|
});
|
|
65
73
|
});
|
|
66
74
|
});
|
|
67
75
|
|
|
68
|
-
describe(
|
|
69
|
-
describe(
|
|
70
|
-
it(
|
|
71
|
-
const arrayResult = validateKeyType(objParam,
|
|
76
|
+
describe("does not match type param", () => {
|
|
77
|
+
describe("of Array", () => {
|
|
78
|
+
it("returns false", () => {
|
|
79
|
+
const arrayResult = validateKeyType(objParam, "aArray", "string");
|
|
72
80
|
expect(arrayResult).toEqual(false);
|
|
73
81
|
|
|
74
|
-
const arrayObjResult = validateKeyType(
|
|
82
|
+
const arrayObjResult = validateKeyType(
|
|
83
|
+
objParam,
|
|
84
|
+
"aArray",
|
|
85
|
+
"object"
|
|
86
|
+
);
|
|
75
87
|
expect(arrayObjResult).toEqual(false);
|
|
76
88
|
});
|
|
77
89
|
});
|
|
78
90
|
|
|
79
|
-
describe(
|
|
80
|
-
it(
|
|
81
|
-
const arrayResult = validateKeyType(objParam,
|
|
91
|
+
describe("of Boolean", () => {
|
|
92
|
+
it("returns false", () => {
|
|
93
|
+
const arrayResult = validateKeyType(objParam, "aBoolean", "string");
|
|
82
94
|
expect(arrayResult).toEqual(false);
|
|
83
95
|
});
|
|
84
96
|
});
|
|
85
97
|
|
|
86
|
-
describe(
|
|
87
|
-
it(
|
|
88
|
-
const arrayResult = validateKeyType(
|
|
98
|
+
describe("of Function", () => {
|
|
99
|
+
it("returns false", () => {
|
|
100
|
+
const arrayResult = validateKeyType(
|
|
101
|
+
objParam,
|
|
102
|
+
"aFunction",
|
|
103
|
+
"string"
|
|
104
|
+
);
|
|
89
105
|
expect(arrayResult).toEqual(false);
|
|
90
106
|
});
|
|
91
107
|
});
|
|
92
108
|
|
|
93
|
-
describe(
|
|
94
|
-
it(
|
|
95
|
-
const arrayResult = validateKeyType(objParam,
|
|
109
|
+
describe("of Number", () => {
|
|
110
|
+
it("returns false", () => {
|
|
111
|
+
const arrayResult = validateKeyType(objParam, "aNumber", "string");
|
|
96
112
|
expect(arrayResult).toEqual(false);
|
|
97
113
|
});
|
|
98
114
|
});
|
|
99
115
|
|
|
100
|
-
describe(
|
|
101
|
-
it(
|
|
102
|
-
const arrayResult = validateKeyType(objParam,
|
|
116
|
+
describe("of Object", () => {
|
|
117
|
+
it("returns false", () => {
|
|
118
|
+
const arrayResult = validateKeyType(objParam, "aObject", "string");
|
|
103
119
|
expect(arrayResult).toEqual(false);
|
|
104
120
|
});
|
|
105
121
|
});
|
|
106
122
|
|
|
107
|
-
describe(
|
|
108
|
-
it(
|
|
109
|
-
const arrayResult = validateKeyType(objParam,
|
|
123
|
+
describe("of String", () => {
|
|
124
|
+
it("returns false", () => {
|
|
125
|
+
const arrayResult = validateKeyType(objParam, "aString", "number");
|
|
110
126
|
expect(arrayResult).toEqual(false);
|
|
111
127
|
});
|
|
112
128
|
});
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { default as safeConcat } from
|
|
2
|
-
export { default as validateKeyType } from
|
|
1
|
+
export { default as safeConcat } from "./safeConcat";
|
|
2
|
+
export { default as validateKeyType } from "./validateKeyType";
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
//
|
|
1
|
+
//
|
|
2
2
|
|
|
3
|
-
export default function safeConcat(values
|
|
3
|
+
export default function safeConcat(values, concatinator) {
|
|
4
4
|
if (!Array.isArray(values)) {
|
|
5
5
|
console.error(`'values' needs to be an array. Recieved ${typeof values}`);
|
|
6
6
|
return;
|
|
7
7
|
}
|
|
8
8
|
|
|
9
|
-
return values.filter(
|
|
9
|
+
return values.filter(val => !!val).join(String(concatinator));
|
|
10
10
|
}
|
|
@@ -1,17 +1,15 @@
|
|
|
1
|
-
//
|
|
1
|
+
//
|
|
2
2
|
|
|
3
|
-
export default function validateKeyType(obj
|
|
4
|
-
expectedKey ,
|
|
5
|
-
expectedType ) {
|
|
3
|
+
export default function validateKeyType(obj, expectedKey, expectedType) {
|
|
6
4
|
if (!(expectedKey in obj)) {
|
|
7
5
|
return false;
|
|
8
6
|
}
|
|
9
7
|
|
|
10
|
-
if (expectedType ===
|
|
8
|
+
if (expectedType === "object" && Array.isArray(obj[expectedKey])) {
|
|
11
9
|
return false;
|
|
12
10
|
}
|
|
13
11
|
|
|
14
|
-
if (expectedType ===
|
|
12
|
+
if (expectedType === "array" && Array.isArray(obj[expectedKey])) {
|
|
15
13
|
return true;
|
|
16
14
|
}
|
|
17
15
|
|
package/.eslintrc.json
DELETED
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"extends": ["plugin:prettier/recommended", "plugin:react/recommended"],
|
|
3
|
-
"plugins": ["babel", "prettier"],
|
|
4
|
-
"settings": {
|
|
5
|
-
"react": {
|
|
6
|
-
"version": "detect"
|
|
7
|
-
}
|
|
8
|
-
},
|
|
9
|
-
"parser": "@babel/eslint-parser",
|
|
10
|
-
"rules": {
|
|
11
|
-
"react/jsx-filename-extension": 0,
|
|
12
|
-
"react/prop-types": 0,
|
|
13
|
-
"react/display-name": 0,
|
|
14
|
-
"prettier/prettier": "error",
|
|
15
|
-
"no-unused-vars": 2,
|
|
16
|
-
"babel/camelcase": 0,
|
|
17
|
-
"camelcase": ["off"]
|
|
18
|
-
},
|
|
19
|
-
"env": {
|
|
20
|
-
"browser": true
|
|
21
|
-
},
|
|
22
|
-
"parserOptions": {
|
|
23
|
-
"ecmaVersion": 11,
|
|
24
|
-
"sourceType": "module",
|
|
25
|
-
"ecmaFeatures": {
|
|
26
|
-
"jsx": true
|
|
27
|
-
},
|
|
28
|
-
"babelOptions": {
|
|
29
|
-
"presets": [
|
|
30
|
-
"@babel/preset-react"
|
|
31
|
-
]
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
|
-
}
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
## Description
|
|
2
|
-
A brief description of the changes and purpose of the PR.
|
|
3
|
-
|
|
4
|
-
## List of changes to be aware of:
|
|
5
|
-
- [x] ....
|
|
6
|
-
- [x] ....
|
|
7
|
-
|
|
8
|
-
## Dev Tasks
|
|
9
|
-
- [ ] specs
|
|
10
|
-
- [ ] storys
|
|
11
|
-
- [ ] lint
|
|
12
|
-
- [ ] export component in ~/src/index.js
|
|
13
|
-
|
|
14
|
-
## JIRA Task
|
|
15
|
-
[ABCD-123](https://citybase.atlassian.net/browse/ABCD-123)
|
|
16
|
-
|
|
17
|
-
## Screenshots
|
|
18
|
-
(optional)
|
package/.github/stale.yml
DELETED
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
# Number of days of inactivity before an issue becomes stale
|
|
2
|
-
daysUntilStale: 30
|
|
3
|
-
# Number of days of inactivity before a stale issue is closed
|
|
4
|
-
daysUntilClose: 7
|
|
5
|
-
# Issues with these labels will never be considered stale
|
|
6
|
-
exemptLabels:
|
|
7
|
-
- "Don't close"
|
|
8
|
-
# Label to use when marking an issue as stale
|
|
9
|
-
staleLabel: stale
|
|
10
|
-
# Comment to post when marking an issue as stale. Set to `false` to disable
|
|
11
|
-
markComment: >
|
|
12
|
-
This issue has been automatically marked as stale because it has not had
|
|
13
|
-
recent activity. It will be closed within seven days if no further activity
|
|
14
|
-
occurs. If it needs to remain open, add the "Don't close" label.
|
|
15
|
-
# Comment to post when closing a stale issue. Set to `false` to disable
|
|
16
|
-
closeComment: >
|
|
17
|
-
This issue has been automatically closed because it was stale.
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
name: Bump Package Version
|
|
2
|
-
on:
|
|
3
|
-
push:
|
|
4
|
-
branches:
|
|
5
|
-
- "master"
|
|
6
|
-
|
|
7
|
-
jobs:
|
|
8
|
-
bump-version:
|
|
9
|
-
name: Bump version on master
|
|
10
|
-
runs-on: ubuntu-latest
|
|
11
|
-
|
|
12
|
-
steps:
|
|
13
|
-
- name: Checkout source code
|
|
14
|
-
uses: actions/checkout@v2
|
|
15
|
-
with:
|
|
16
|
-
ref: ${{ github.ref }}
|
|
17
|
-
- name: "cat package.json"
|
|
18
|
-
run: cat ./package.json
|
|
19
|
-
- name: Setup Node.js
|
|
20
|
-
uses: actions/setup-node@v1
|
|
21
|
-
with:
|
|
22
|
-
node-version: 12
|
|
23
|
-
- name: Automated version bump
|
|
24
|
-
uses: phips28/gh-action-bump-version@master
|
|
25
|
-
with:
|
|
26
|
-
tag-prefix: ''
|
|
27
|
-
env:
|
|
28
|
-
GITHUB_TOKEN: ${{ secrets.REPO_ACCESS_TOKEN }}
|
|
29
|
-
- name: "cat package.json"
|
|
30
|
-
run: cat ./package.json
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env bash
|
|
2
|
-
|
|
3
|
-
# The output is a Markdown table with columns for the PR (with a link),
|
|
4
|
-
# a branch, and JIRA ticket with link (if available).
|
|
5
|
-
#
|
|
6
|
-
# If the branch name starts with an id for a JIRA ticket (e.g.,
|
|
7
|
-
# PLAT-123), then a link to the ticket is created. Otherwise this
|
|
8
|
-
# column is blank.
|
|
9
|
-
#
|
|
10
|
-
# A link to the branch isn't valuable because they are usually
|
|
11
|
-
# deleted after merging.
|
|
12
|
-
|
|
13
|
-
from_tag=${FROM_TAG}
|
|
14
|
-
to_tag=${TAG##*/}
|
|
15
|
-
|
|
16
|
-
echo "## Changes"
|
|
17
|
-
echo ""
|
|
18
|
-
echo "### PRs"
|
|
19
|
-
# all merge commits, only merge commits
|
|
20
|
-
git --no-pager log --merges --format='%s' ${from_tag}..${to_tag} | \
|
|
21
|
-
# only pull-request merges
|
|
22
|
-
grep "Merge pull request" | \
|
|
23
|
-
gawk 'BEGIN { print "| PR | Branch | Ticket |" ;
|
|
24
|
-
print "| -- | ------ | ------ |" }
|
|
25
|
-
{if (match($0,/(#[0-9]+).*CityBaseInc\/(([A-Z]+-[0-9]+)\S+)/,m))
|
|
26
|
-
printf "| %s | %s | [%s](https://citybase.atlassian.net/browse/%s) |\n", m[1], m[2], m[3], m[3] }
|
|
27
|
-
{if (match($0,/(#[0-9]+).*CityBaseInc\/([a-z]\S+)/,m))
|
|
28
|
-
print "|", m[1], "|", m[2], "|", "|"}'
|
|
29
|
-
|
|
30
|
-
echo ""
|
|
31
|
-
echo "### Code Diff"
|
|
32
|
-
echo "https://github.com/${REPO}/compare/${from_tag}..${to_tag}"
|
|
33
|
-
echo ""
|
|
34
|
-
|
|
35
|
-
git show ${to_tag} --format=short | grep Tagger
|
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
on:
|
|
2
|
-
push:
|
|
3
|
-
tags:
|
|
4
|
-
- '*'
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
name: Create Release
|
|
8
|
-
|
|
9
|
-
jobs:
|
|
10
|
-
build:
|
|
11
|
-
name: Create Release
|
|
12
|
-
runs-on: ubuntu-latest
|
|
13
|
-
env:
|
|
14
|
-
REPO: ${{ github.repository }}
|
|
15
|
-
TAG: ${{ github.ref }}
|
|
16
|
-
steps:
|
|
17
|
-
- uses: actions/checkout@v2
|
|
18
|
-
- name: Get latest release
|
|
19
|
-
id: get_latest
|
|
20
|
-
run: |
|
|
21
|
-
tag_name=$(curl --silent --request GET \
|
|
22
|
-
--url https://api.github.com/repos/${{ github.repository }}/releases/latest \
|
|
23
|
-
--header "authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" \
|
|
24
|
-
--header "content-type: applicatoin/json" | jq -r .tag_name)
|
|
25
|
-
echo "::set-output name=tag_name::$tag_name"
|
|
26
|
-
- name: Fetch branches
|
|
27
|
-
run: git fetch --all --prune --unshallow
|
|
28
|
-
- name: Fetch tags
|
|
29
|
-
run: git fetch --unshallow origin +refs/tags/*:refs/tags/*
|
|
30
|
-
- name: Checkout master
|
|
31
|
-
run: git checkout master
|
|
32
|
-
- name: Build body
|
|
33
|
-
id: build_body
|
|
34
|
-
env:
|
|
35
|
-
FROM_TAG: ${{ steps.get_latest.outpus.tag_name}}
|
|
36
|
-
run: |
|
|
37
|
-
body=$(sh ./.github/workflows/create-release/build-body.sh)
|
|
38
|
-
body="${body//'%'/'%25'}"
|
|
39
|
-
body="${body//$'\n'/'%0A'}"
|
|
40
|
-
body="${body//$'\r'/'%0D'}"
|
|
41
|
-
echo "::set-output name=body::$body"
|
|
42
|
-
- name: Create Release
|
|
43
|
-
id: create_release
|
|
44
|
-
uses: actions/create-release@4d1b6075ce7561b672b8552148edec2f27584fe9
|
|
45
|
-
env:
|
|
46
|
-
GITHUB_TOKEN: ${{ secrets.REPO_ACCESS_TOKEN }}
|
|
47
|
-
with:
|
|
48
|
-
tag_name: ${{ github.ref }}
|
|
49
|
-
release_name: Release ${{ github.ref }}
|
|
50
|
-
body: ${{ steps.build_body.outputs.body }}
|
|
51
|
-
draft: false
|
|
52
|
-
prerelease: false
|