diff --git a/CHANGELOG.md b/CHANGELOG.md index fa9638ee3..7498485d4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,11 +1,21 @@ ### Changelog +**0.57.0** + +* Search page instead of list +https://github.com/forCrowd/WealthEconomy/issues/65 +* Fix mobile navigation menu +https://github.com/forCrowd/WealthEconomy/issues/66 +* glyphicon icons were replaced with font awesome + **0.56.0** * resourcePoolManage - Field rating edit https://github.com/forCrowd/WealthEconomy/issues/64 * Find keep alive service https://github.com/forCrowd/WealthEconomy/issues/63 +* Async action was removed from dataContext.js currentUser(): it was already keeping it as a local variable, now its returns that, which makes this function much easier to use. +* resourcePool and its child entities related functions were moved from dataContext.js to resourcePoolFactory.js **0.55.1** diff --git a/SolutionItems/Documents/Social.txt b/SolutionItems/Documents/Social.txt index a92c3ad90..c1c0a9126 100644 --- a/SolutionItems/Documents/Social.txt +++ b/SolutionItems/Documents/Social.txt @@ -2,9 +2,11 @@ gitter personal dev network https://www.facebook.com/lists/10151319136553665 social network - Emin Pamucak -freenode? stackoverflow? +stackoverflow? yourfirstpr (pull request) -hackernews - https://news.ycombinator.com/ +https://webchat.freenode.net/ +https://news.ycombinator.com/ +https://www.reddit.com/ reply to twitter https://twitter.com/sethjuarez/status/692784256670498816 https://twitter.com/martinwoodward/status/692832558447353857 @@ -14,6 +16,8 @@ https://opensource.com/how-submit-article https://opensource.com/participate?sc_cid=701600000011jJVAAY https://appear.in/ +opensourceway, freecodecamp, nadia eghbal. microsoft open source. + upforgrabs - first timer only http://up-for-grabs.net/#/ contributing diff --git a/SolutionItems/Documents/Todo.md b/SolutionItems/Documents/Todo.md index 03d985381..02e5c989e 100644 --- a/SolutionItems/Documents/Todo.md +++ b/SolutionItems/Documents/Todo.md @@ -1,6 +1,6 @@ *** HOT *** -* cmrp list? -> search page +* short description for cmrp * content for editor? new content or new resourcepool - content in a content? or page as a new entity? * route update (_system/) * application manager - allows admin to update appSettings & restarts the app? diff --git a/SolutionItems/Properties/AssemblyInfo.cs b/SolutionItems/Properties/AssemblyInfo.cs index 28ea00a40..f9dbfdafc 100644 --- a/SolutionItems/Properties/AssemblyInfo.cs +++ b/SolutionItems/Properties/AssemblyInfo.cs @@ -30,5 +30,5 @@ // // AssemblyFileVersion is not in use for the moment // -[assembly: AssemblyVersion("0.56.0")] +[assembly: AssemblyVersion("0.57.0")] [assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/WebApi/App_Start/ODataConfig.cs b/WebApi/App_Start/ODataConfig.cs index 2ec336d61..99bb0087e 100644 --- a/WebApi/App_Start/ODataConfig.cs +++ b/WebApi/App_Start/ODataConfig.cs @@ -17,7 +17,7 @@ public static void RegisterOData(HttpConfiguration config) // Query support var odataFilter = new EnableQueryAttribute() { AllowedArithmeticOperators = AllowedArithmeticOperators.None, - AllowedFunctions = AllowedFunctions.None, + AllowedFunctions = AllowedFunctions.SubstringOf, AllowedLogicalOperators = AllowedLogicalOperators.And | AllowedLogicalOperators.Equal | AllowedLogicalOperators.Or, diff --git a/ngClient/_system/css/main.css b/ngClient/_system/css/main.css index 90e88d78e..54c4379df 100644 --- a/ngClient/_system/css/main.css +++ b/ngClient/_system/css/main.css @@ -616,3 +616,96 @@ input[type="checkbox"].input-validation-error { vertical-align: middle; float: none; } + +/*Table Search +------------------------------------*/ +.table-search { + border-left: none; +} + +.table-search .btn-group .btn-u { + top: 4px; + padding: 0 6px; + position: relative; +} + +.table-search .btn-u.dropdown-toggle { + border-left: none; +} + +.table-search thead { + border-bottom: solid 1px #ddd; +} + +.table-search td { + vertical-align: middle !important; +} + +.table-search td img { + width: 70px; + height: 70px; + margin: 0 auto; + display: block; +} + +.table-search .user-names span, +.table-search .user-names small { + display: block; + text-align: center; +} + +.table-search .user-names span { + color: #555; + font-size: 16px; + position: relative; +} + +.table-search .user-names small { + color: #999; + font-size: 13px; +} + +.table-search td h3 { + font-size: 16px; + margin: 0 0 2px; +} + +.table-search td a { + color: #555; +} + +.table-search td p { + margin-bottom: 0; +} + +.table-search td span { + display: block; +} + +.table-search td small { + font-style: italic; +} + +.table-search .s-icons { + margin-bottom: 0; +} + +.table-search .s-icons li { + padding: 2px; +} + +.table-search .table-buttons { + margin: 0; +} + +.table-search .table-buttons li { + padding: 0; +} + +.table-search .table-buttons .btn-u-sm { + padding: 3px 6px; +} + +.table-search .td-width { + width: 55%; +} diff --git a/ngClient/_system/js/app/config/route.js b/ngClient/_system/js/app/config/route.js index 09786791b..d091399c1 100644 --- a/ngClient/_system/js/app/config/route.js +++ b/ngClient/_system/js/app/config/route.js @@ -28,9 +28,6 @@ .when('/_system/content/reason', { title: 'Reason', templateUrl: '/_system/views/content/reason.html?v=0.49.0', enableDisqus: true, resolve: { validateAccess: ['dataContext', 'locationHistory', 'logger', '$location', '$q', '$route', validateAccess] } }) .when('/_system/content/totalCostIndex', { title: 'Total Cost Index', templateUrl: '/_system/views/content/totalCostIndex.html?v=0.49.0', enableDisqus: true, resolve: { validateAccess: ['dataContext', 'locationHistory', 'logger', '$location', '$q', '$route', validateAccess] } }) - /* CMRP List */ - .when('/_system/resourcePool', { title: 'CMRP List', templateUrl: '/_system/views/resourcePool/resourcePoolList.html?v=0.55.0', resolve: { validateAccess: ['dataContext', 'locationHistory', 'logger', '$location', '$q', '$route', validateAccess] } }) - /* Account */ .when('/_system/account', { title: 'Account', templateUrl: '/_system/views/account/account.html?v=0.55.0', accessType: 'authenticatedRequired', resolve: { validateAccess: ['dataContext', 'locationHistory', 'logger', '$location', '$q', '$route', validateAccess] } }) .when('/_system/account/accountEdit', { title: 'Account Edit', templateUrl: '/_system/views/account/accountEdit.html?v=0.55.0', accessType: 'authenticatedRequired', resolve: { validateAccess: ['dataContext', 'locationHistory', 'logger', '$location', '$q', '$route', validateAccess] } }) @@ -43,11 +40,14 @@ .when('/_system/account/register', { title: 'Register', templateUrl: '/_system/views/account/register.html?v=0.55.0', accessType: 'unauthenticatedRequired', resolve: { validateAccess: ['dataContext', 'locationHistory', 'logger', '$location', '$q', '$route', validateAccess] } }) .when('/_system/account/resetPassword', { title: 'Reset Password', templateUrl: '/_system/views/account/resetPassword.html?v=0.55.0', accessType: 'unauthenticatedRequired', resolve: { validateAccess: ['dataContext', 'locationHistory', 'logger', '$location', '$q', '$route', validateAccess] } }) + /* CMRP Search */ + .when('/_system/resourcePool/search', { title: 'CMRP Search', templateUrl: '/_system/views/resourcePool/resourcePoolSearch.html?v=0.57.0', resolve: { validateAccess: ['dataContext', 'locationHistory', 'logger', '$location', '$q', '$route', validateAccess] } }) + /* User */ - .when('/:userName', { title: 'Profile', templateUrl: '/_system/views/account/profile.html?v=0.51.0', resolve: { validateAccess: ['dataContext', 'locationHistory', 'logger', '$location', '$q', '$route', validateAccess] } }) - .when('/:userName/new', { title: 'New CMRP', templateUrl: '/_system/views/resourcePool/resourcePoolManage.html?v=0.56.0', resolve: { validateAccess: ['dataContext', 'locationHistory', 'logger', '$location', '$q', '$route', validateAccess] } }) - .when('/:userName/:resourcePoolKey/edit', { title: 'Edit CMRP', templateUrl: '/_system/views/resourcePool/resourcePoolManage.html?v=0.56.0', resolve: { validateAccess: ['dataContext', 'locationHistory', 'logger', '$location', '$q', '$route', validateAccess] } }) - .when('/:userName/:resourcePoolKey', { title: 'View CMRP', templateUrl: '/_system/views/resourcePool/resourcePoolView.html?v=0.49.0', enableDisqus: true, resolve: { validateAccess: ['dataContext', 'locationHistory', 'logger', '$location', '$q', '$route', validateAccess] } }) + .when('/:userName', { title: 'Profile', templateUrl: '/_system/views/account/profile.html?v=0.57.0', resolve: { validateAccess: ['dataContext', 'locationHistory', 'logger', '$location', '$q', '$route', validateAccess] } }) + .when('/:userName/new', { title: 'New CMRP', templateUrl: '/_system/views/resourcePool/resourcePoolManage.html?v=0.57.0', resolve: { validateAccess: ['dataContext', 'locationHistory', 'logger', '$location', '$q', '$route', validateAccess] } }) + .when('/:userName/:resourcePoolKey/edit', { title: 'Edit CMRP', templateUrl: '/_system/views/resourcePool/resourcePoolManage.html?v=0.57.0', resolve: { validateAccess: ['dataContext', 'locationHistory', 'logger', '$location', '$q', '$route', validateAccess] } }) + .when('/:userName/:resourcePoolKey', { title: 'View CMRP', templateUrl: '/_system/views/resourcePool/resourcePoolView.html?v=0.57.0', enableDisqus: true, resolve: { validateAccess: ['dataContext', 'locationHistory', 'logger', '$location', '$q', '$route', validateAccess] } }) /* Otherwise */ .otherwise({ redirectTo: getNotFound }) diff --git a/ngClient/_system/js/app/controllers/content/DefaultController.js b/ngClient/_system/js/app/controllers/content/DefaultController.js index 4e580ecf8..40d028da2 100644 --- a/ngClient/_system/js/app/controllers/content/DefaultController.js +++ b/ngClient/_system/js/app/controllers/content/DefaultController.js @@ -133,7 +133,7 @@ } }], controllerAs: 'vm', - templateUrl: '/_system/views/account/guestAccountInfo.html?v=0.55.0' + templateUrl: '/_system/views/account/guestAccountInfo.html?v=0.57.0' }); } diff --git a/ngClient/_system/js/app/controllers/resourcePool/ResourcePoolListController.js b/ngClient/_system/js/app/controllers/resourcePool/ResourcePoolListController.js deleted file mode 100644 index de78f2f8c..000000000 --- a/ngClient/_system/js/app/controllers/resourcePool/ResourcePoolListController.js +++ /dev/null @@ -1,36 +0,0 @@ -(function () { - 'use strict'; - - var controllerId = 'ResourcePoolListController'; - angular.module('main') - .controller(controllerId, ['dataContext', 'logger', 'resourcePoolFactory', '$location', '$rootScope', '$scope', ResourcePoolListController]); - - function ResourcePoolListController(dataContext, logger, resourcePoolFactory, $location, $rootScope, $scope) { - - // Logger - logger = logger.forSource(controllerId); - - var vm = this; - vm.currentUser = { Id: 0 }; - vm.resourcePoolSet = []; - - // Events - $scope.$on('dataContext_currentUserChanged', currentUserChanged); - - _init(); - - function _init() { - - vm.currentUser = dataContext.getCurrentUser(); - - resourcePoolFactory.getResourcePoolSet() - .then(function (data) { - vm.resourcePoolSet = data; - }); - } - - function currentUserChanged(event, newUser) { - vm.currentUser = newUser; - } - } -})(); diff --git a/ngClient/_system/js/app/controllers/resourcePool/ResourcePoolSearchController.js b/ngClient/_system/js/app/controllers/resourcePool/ResourcePoolSearchController.js new file mode 100644 index 000000000..50c8bfef3 --- /dev/null +++ b/ngClient/_system/js/app/controllers/resourcePool/ResourcePoolSearchController.js @@ -0,0 +1,38 @@ +(function () { + 'use strict'; + + var controllerId = 'ResourcePoolSearchController'; + angular.module('main') + .controller(controllerId, ['dataContext', 'logger', 'resourcePoolFactory', '$location', '$rootScope', '$scope', ResourcePoolSearchController]); + + function ResourcePoolSearchController(dataContext, logger, resourcePoolFactory, $location, $rootScope, $scope) { + + // Logger + logger = logger.forSource(controllerId); + + var vm = this; + vm.resourcePoolSet = []; + vm.searchKey = ''; + vm.searchKeyChanged = searchKeyChanged; + vm.showResults = false; + + _init(); + + function _init() { + } + + function searchKeyChanged() { + + if (vm.searchKey.length <= 2) { + vm.showResults = false; + return; + } + + resourcePoolFactory.getResourcePoolSet(vm.searchKey) + .then(function (data) { + vm.resourcePoolSet = data; + vm.showResults = true; + }); + } + } +})(); diff --git a/ngClient/_system/js/app/controllers/resourcePool/ResourcePoolViewController.js b/ngClient/_system/js/app/controllers/resourcePool/ResourcePoolViewController.js index 773ac9504..081754b4a 100644 --- a/ngClient/_system/js/app/controllers/resourcePool/ResourcePoolViewController.js +++ b/ngClient/_system/js/app/controllers/resourcePool/ResourcePoolViewController.js @@ -31,7 +31,7 @@ } // TODO viewTitle was also set in route.js? - $rootScope.viewTitle = resourcePool.name(); + $rootScope.viewTitle = resourcePool.Name; }); } } diff --git a/ngClient/_system/js/app/entities/ResourcePool.js b/ngClient/_system/js/app/entities/ResourcePool.js index 381511a92..a1f93a1d5 100644 --- a/ngClient/_system/js/app/entities/ResourcePool.js +++ b/ngClient/_system/js/app/entities/ResourcePool.js @@ -308,11 +308,6 @@ return result.length > 0 ? result[0] : null; } - function name() { - var name = self.Name; - return name; - } - // TODO Since this is a fixed value based on ResourcePoolRateCount & current user's rate, // it could be calculated on server, check it later again / SH - 03 Aug. '15 function otherUsersResourcePoolRateCount() { diff --git a/ngClient/_system/js/app/factories/resourcePoolFactory.js b/ngClient/_system/js/app/factories/resourcePoolFactory.js index b51ac3b39..9a8b49e1c 100644 --- a/ngClient/_system/js/app/factories/resourcePoolFactory.js +++ b/ngClient/_system/js/app/factories/resourcePoolFactory.js @@ -459,20 +459,27 @@ } } - function getResourcePoolSet() { + function getResourcePoolSet(searchKey) { + searchKey = typeof searchKey !== 'undefined' ? searchKey : ''; var query = breeze.EntityQuery .from('ResourcePool') .expand(['User']); + if (searchKey !== '') { + var resourcePoolNamePredicate = new breeze.Predicate('Name', 'contains', searchKey); + var userNamePredicate = new breeze.Predicate('User.UserName', 'contains', searchKey); + query = query.where(resourcePoolNamePredicate.or(userNamePredicate)); + } + // Prepare the query - if (fetchFromServer) { // From remote + //if (fetchFromServer) { // From remote query = query.using(breeze.FetchStrategy.FromServer); - fetchFromServer = false; // Do it only once per user - } - else { // From local - query = query.using(breeze.FetchStrategy.FromLocalCache); - } + // fetchFromServer = false; // Do it only once per user + //} + //else { // From local + //query = query.using(breeze.FetchStrategy.FromLocalCache); + //} return dataContext.executeQuery(query) .then(success).catch(failed); diff --git a/ngClient/_system/views/account/guestAccountInfo.html b/ngClient/_system/views/account/guestAccountInfo.html index 20b70f8fc..865d9fdf8 100644 --- a/ngClient/_system/views/account/guestAccountInfo.html +++ b/ngClient/_system/views/account/guestAccountInfo.html @@ -10,16 +10,18 @@
- If you would like to keep this account, please update your email address. +
+ Would like to keep this account?
+ Please update your email address.
- If you have an existing account, please login. +
+ Do you have an existing account?
+ Please login with your credentials.
Login diff --git a/ngClient/_system/views/account/profile.html b/ngClient/_system/views/account/profile.html index e06ede942..cfc52a932 100644 --- a/ngClient/_system/views/account/profile.html +++ b/ngClient/_system/views/account/profile.html @@ -1,33 +1,39 @@
- Create New -
-- Resource Pool - | -- Created - | -
---|---|
- Nothing to display - | -|
- - - - Edit - - | -- - | -
+ Create New +
+- Create New -
-- Resource Pool - | -- User - | -- Created - | -
---|---|---|
- Nothing to display - | -||
- - - - Edit - - | -- - | -- - | -