-
Notifications
You must be signed in to change notification settings - Fork 781
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Enhancement] Upgrade changes in search functionality #4362
Open
Harshit28j
wants to merge
26
commits into
Cloud-CV:master
Choose a base branch
from
Harshit28j:update_changes_regex
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
26 commits
Select commit
Hold shift + click to select a range
ae85514
[Frontend] Add cache busting to frontend (#4037)
Suryansh5545 dc1becf
Merge branch 'master' of https://github.com/Suryansh5545/EvalAI
Suryansh5545 5291c3a
add forntend control for search and filter
Suryansh5545 4338624
Fix test case
Suryansh5545 f7f4e1d
Merge branch 'master' into SearchandFilter
Suryansh5545 929effe
Merge branch 'master' into SearchandFilter
gchhablani b6cf637
removed junk folder
Suryansh5545 7d56df2
improved filter appearance
Suryansh5545 1e3a773
Merge branch 'master' into SearchandFilter
Suryansh5545 0be52e4
remove useless css changes
Suryansh5545 a02ce27
Merge branch 'master' into SearchandFilter
gchhablani bc5fadf
Merge branch 'master' into SearchandFilter
gchhablani 2b9d0e8
Fix domain not being clear
Suryansh5545 8fd302b
Fix search being exact
Suryansh5545 3ade03c
Add "all" and "none" category
Suryansh5545 87a8c6f
Merge branch 'master' into SearchandFilter
Suryansh5545 bf5c3c8
Merge branch 'master' of https://github.com/Cloud-CV/EvalAI into Sear…
Suryansh5545 1d1a3bd
Merge branch 'SearchandFilter' of https://github.com/Suryansh5545/Eva…
Suryansh5545 e2b0a7b
Fix test case
Suryansh5545 7429533
Merge branch 'master' into SearchandFilter
Suryansh5545 833d59f
Resolved conflicts from previous merge attempt
Harshit28j 84f6451
update: search word by word functionality
Harshit28j 69eb2fc
Add tests for search filter feature
Harshit28j bbafcb7
Fix all selection to show all challenges
Harshit28j 397cbc9
Fix drop down screen
Harshit28j 186c6b1
Update challengeCtrl.test.js
Harshit28j File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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 |
---|---|---|
|
@@ -2715,3 +2715,67 @@ describe('Unit tests for challenge controller', function () { | |
}); | ||
}); | ||
}); | ||
|
||
describe('Filters', function() { | ||
beforeEach(angular.mock.module('evalai')); | ||
|
||
var ceilFilter, formatExecutionTimeFilter, customTitleFilter, customDomainFilter; | ||
|
||
beforeEach(inject(function ($injector) { | ||
ceilFilter = $injector.get('$filter')('ceil'); | ||
formatExecutionTimeFilter = $injector.get('$filter')('format_execution_time'); | ||
customTitleFilter = $injector.get('$filter')('customTitleFilter'); | ||
customDomainFilter = $injector.get('$filter')('customDomainFilter'); | ||
})); | ||
|
||
describe('ceil filter', function() { | ||
it('should round up input numbers', function() { | ||
expect(ceilFilter(1.23)).toEqual(2); | ||
expect(ceilFilter(-1.23)).toEqual(-1); | ||
expect(ceilFilter(0)).toEqual(0); | ||
}); | ||
}); | ||
|
||
describe('format_execution_time filter', function() { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same here There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. To check if time is formatted properly or not |
||
it('should format execution times correctly', function() { | ||
expect(formatExecutionTimeFilter(0)).toEqual('00 sec'); | ||
expect(formatExecutionTimeFilter(60)).toEqual('01 min '); | ||
expect(formatExecutionTimeFilter(3661)).toEqual('01 hr 01 min 01 sec'); | ||
expect(formatExecutionTimeFilter(86461)).toEqual('01 day 01 min 01 sec'); | ||
}); | ||
|
||
}); | ||
|
||
describe('customTitleFilter', function() { | ||
it('should filter challenges based on title search text', function() { | ||
var challenges = [ | ||
{title: 'AngularJS', domain_name: 'web', list_tags: ['js', 'tag2']}, | ||
{title: 'React', domain_name: 'web', list_tags: ['tag3', 'tag4']}, | ||
{title: 'Nodejs', domain_name: 'server', list_tags: ['js', 'tag6']}, | ||
{title: 'ebay facebook', domain_name: 'web', list_tags: ['tag7', 'tag8']}, | ||
|
||
]; | ||
expect(customTitleFilter(challenges, 'A')).toEqual([challenges[0]]); | ||
expect(customTitleFilter(challenges, 'e f')).toEqual([challenges[3]]); | ||
expect(customTitleFilter(challenges, 'ebay face')).toEqual([challenges[3]]); | ||
expect(customTitleFilter(challenges, 'React')).toEqual([challenges[1]]); | ||
expect(customTitleFilter(challenges, 'Ang rea')).toEqual([challenges[0],challenges[1]]); | ||
expect(customTitleFilter(challenges, 'js')).toEqual([challenges[0],challenges[2]]); | ||
|
||
}); | ||
}); | ||
|
||
describe('customDomainFilter', function() { | ||
it('should filter challenges based on domain', function() { | ||
var challenges = [ | ||
{title: 'AngularJS', domain_name: 'webdev'}, | ||
{title: 'React', domain_name: 'web'}, | ||
{title: 'Node.js', domain_name: null} | ||
]; | ||
expect(customDomainFilter(challenges, 'none')).toEqual([challenges[2]]); | ||
expect(customDomainFilter(challenges, 'web')).toEqual([challenges[0], challenges[1]]); | ||
expect(customDomainFilter(challenges, 'webdev')).toEqual([challenges[0]]); | ||
expect(customDomainFilter(challenges, '')).toEqual([challenges[0], challenges[1], challenges[2]]); | ||
}); | ||
}); | ||
}); |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Harshit28j What is this change for ?