-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #72 from NicoLaval/master
Fix multiple issues
- Loading branch information
Showing
15 changed files
with
54 additions
and
965 deletions.
There are no files selected for viewing
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import _ from 'lodash'; | ||
|
||
export const filterKeyDeburr = keys => rawStr => { | ||
const str = _.deburr(rawStr).toLocaleLowerCase(); | ||
return item => { | ||
let isIn = false; | ||
for (var i = 0; i < keys.length; i++) { | ||
if (_.deburr((item[keys[i]] || '').toLocaleLowerCase()).includes(str)) { | ||
isIn = true; | ||
break; | ||
} | ||
} | ||
return isIn; | ||
}; | ||
}; | ||
|
||
export const nbResults = (array, dictionnary) => { | ||
const { result, results } = dictionnary; | ||
return `${array.length} ${array.length > 1 ? results : result}`; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
import * as A from './array-utils'; | ||
|
||
const D = { result: 'result', results: 'results' }; | ||
|
||
describe('array utils', () => { | ||
describe('nbResults', () => { | ||
it('should return string ends with any letter', () => { | ||
expect(A.nbResults([], D)).toMatch(/[A-Za-z]{1}$/); | ||
expect(A.nbResults(['A'], D)).toMatch(/[A-Za-z]{1}$/); | ||
}); | ||
|
||
it("should return string ends with 's'", () => { | ||
expect(A.nbResults(['a', 'b'], D).endsWith('s')).toBeTruthy(); | ||
}); | ||
}); | ||
}); |
38 changes: 0 additions & 38 deletions
38
src/js/actions/classifications/correspondences/association.spec.js
This file was deleted.
Oops, something went wrong.
38 changes: 0 additions & 38 deletions
38
src/js/actions/classifications/correspondences/associations.spec.js
This file was deleted.
Oops, something went wrong.
36 changes: 0 additions & 36 deletions
36
src/js/components/operations/families/edition/validation.spec.js
This file was deleted.
Oops, something went wrong.
56 changes: 0 additions & 56 deletions
56
src/js/components/operations/operations/edition/validation.spec.js
This file was deleted.
Oops, something went wrong.
56 changes: 0 additions & 56 deletions
56
src/js/components/operations/series/edition/validation.spec.js
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.