Skip to content

Commit 271ad98

Browse files
authored
Merge pull request #353 from toggle-corp/fix-hacked-formatted-date
Add HackedFormattedDate.format
2 parents 64f439c + e9b0d22 commit 271ad98

File tree

5 files changed

+11
-6
lines changed

5 files changed

+11
-6
lines changed

components/General/Bundle.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ class Bundle extends React.Component {
4848

4949
handleLoad = (BundledComponent) => {
5050
if (!this.mounted) {
51-
console.error('Bundle unmounted while loading Component.');
51+
console.warn('Bundle unmounted while loading Component.');
5252
return;
5353
}
5454

@@ -64,11 +64,11 @@ class Bundle extends React.Component {
6464

6565
handleLoadError = (err) => {
6666
if (!this.mounted) {
67-
console.error('Bundle unmounted while loading Component.');
67+
console.warn('Bundle unmounted while loading Component.');
6868
return;
6969
}
7070
this.setState({ failed: true });
71-
console.error('Bundle load failed.', err);
71+
console.warn('Bundle load failed.', err);
7272
}
7373

7474
renderLoading = ({ text }) => (

components/Input/DateFilter/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ class DateFilter extends React.PureComponent {
150150
break;
151151
}
152152
default:
153-
console.error(`Invalid type: ${type}`);
153+
console.error(`Invalid date range type: ${type}`);
154154
}
155155

156156
return {

components/View/FormattedDate/index.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,4 +30,6 @@ HackedFormattedDate.defaultProps = {
3030
value: undefined,
3131
};
3232

33+
HackedFormattedDate.format = FormattedDate.format;
34+
3335
export default HackedFormattedDate;

utils/common.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -759,6 +759,7 @@ export const getRatingForContentInString = (content = '', str) => (
759759

760760
// MISC
761761

762+
// NOTE: used in debugger
762763
export const findDifferenceInObject = (o, n) => {
763764
const allKeys = new Set([
764765
...Object.keys(o),
@@ -774,6 +775,7 @@ export const findDifferenceInObject = (o, n) => {
774775
return changes;
775776
};
776777

778+
// NOTE: used in Faram:validator
777779
export const findDifferenceInList = (listA, listB, keySelector) => {
778780
const modified = [];
779781
const added = [];
@@ -815,6 +817,7 @@ export const checkVersion = (oldVersionId, newVersionId) => ({
815817
isValueOverriden: isTruthy(oldVersionId) && oldVersionId < newVersionId,
816818
});
817819

820+
// NOTE: only used in chord diagram; maybe on deep
818821
// save the svg node element
819822
export const saveSvg = (svgElement, name) => {
820823
svgElement.setAttribute('xmlns', 'http://www.w3.org/2000/svg');
@@ -830,7 +833,7 @@ export const saveSvg = (svgElement, name) => {
830833
document.body.removeChild(downloadLink);
831834
};
832835

833-
export const getClassNameListAndIndex = (el, className) => {
836+
const getClassNameListAndIndex = (el, className) => {
834837
const classNameList = (el.getAttribute('class')).split(' ');
835838
const index = classNameList.findIndex(d => d === className);
836839

utils/rest/RestRequest.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -236,7 +236,7 @@ export default class RestRequest {
236236
return;
237237
}
238238
// NOTE: a network problem may occur
239-
console.error(ex);
239+
console.warn(ex);
240240
const retrySuccessful = this.retry();
241241
if (!retrySuccessful) {
242242
this.fatal({ errorMessage: ex.message, errorCode: ex.statusCode });

0 commit comments

Comments
 (0)