Skip to content

Commit

Permalink
0.53.0
Browse files Browse the repository at this point in the history
This solves #60
  • Loading branch information
coni2k committed Jun 6, 2016
1 parent a9c1943 commit e1745e2
Show file tree
Hide file tree
Showing 38 changed files with 267 additions and 398 deletions.
11 changes: 11 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,16 @@
### Changelog

**0.53.0**
* Navigate away confirmation in 'Unsaved changes' case
https://github.com/forCrowd/WealthEconomy/issues/60
* isEditing property was removed
* ResourcePool.isTemp property was removed
* dataContext - _createEntitySuppressAuthValidation variable was removed
* UPO & Basics CMRPs were moved from client-side to server-side (again)
* 'Register / login modal is not displayed when a new anonymous user interacts after logout' bug fix
* Logo update
* appSettings minor update

**0.52.0**

* Send an exception to server in 404 case
Expand Down
21 changes: 15 additions & 6 deletions DataObjects/Migrations/DbMigrationsConfiguration.cs
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,9 @@ static void CreateSampleUser(WealthEconomyContext context)

// Sample resource pools
var billionDollarQuestion = resourcePoolRepository.CreateBillionDollarQuestion(sampleUser);
var upoSample = resourcePoolRepository.CreateUPOSample(sampleUser);
var basicsExistingSystemSample = resourcePoolRepository.CreateBasicsExistingSystemSample(sampleUser);
var basicsNewSystemSample = resourcePoolRepository.CreateBasicsNewSystemSample(sampleUser);
var priorityIndexSample = resourcePoolRepository.CreatePriorityIndexSample(sampleUser);
var knowledgeIndexSample = resourcePoolRepository.CreateKnowledgeIndexSample(sampleUser);
var knowledgeIndexPopularSoftwareLicenseSample = resourcePoolRepository.CreateKnowledgeIndexPopularSoftwareLicenseSample(sampleUser);
Expand All @@ -122,15 +125,21 @@ static void CreateSampleUser(WealthEconomyContext context)
// Set Id fields explicitly, since strangely EF doesn't save them in the order that they've been added to ResourcePoolSet.
// And they're referred with these Ids on front-end samples
billionDollarQuestion.Id = 1;
priorityIndexSample.Id = 2;
knowledgeIndexSample.Id = 3;
knowledgeIndexPopularSoftwareLicenseSample.Id = 4;
totalCostIndexExistingSystemSample.Id = 5;
totalCostIndexNewSystemSample.Id = 6;
allInOneSample.Id = 7;
upoSample.Id = 2;
basicsExistingSystemSample.Id = 3;
basicsNewSystemSample.Id = 4;
priorityIndexSample.Id = 5;
knowledgeIndexSample.Id = 6;
knowledgeIndexPopularSoftwareLicenseSample.Id = 7;
totalCostIndexExistingSystemSample.Id = 8;
totalCostIndexNewSystemSample.Id = 9;
allInOneSample.Id = 10;

// Insert
resourcePoolRepository.Insert(billionDollarQuestion);
resourcePoolRepository.Insert(upoSample);
resourcePoolRepository.Insert(basicsExistingSystemSample);
resourcePoolRepository.Insert(basicsNewSystemSample);
resourcePoolRepository.Insert(priorityIndexSample);
resourcePoolRepository.Insert(knowledgeIndexSample);
resourcePoolRepository.Insert(knowledgeIndexPopularSoftwareLicenseSample);
Expand Down
93 changes: 93 additions & 0 deletions DataObjects/ResourcePoolRepository.cs
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,99 @@ public ResourcePool CreateBillionDollarQuestion(User user)
return resourcePool;
}

public ResourcePool CreateUPOSample(User user)
{
const int numberOfItems = 1;

// Resource pool
var resourcePool = CreateDefaultResourcePool(user: user,
resourcePoolName: "UPO",
useFixedResourcePoolRate: true,
mainElementName: "Organization",
addDirectIncomeField: true,
addMultiplierField: true,
addImportanceIndex: false,
numberOfItems: numberOfItems);

// Main element
var mainElement = resourcePool.ElementSet.First();
mainElement.DirectIncomeField.Name = "Sales Price"; // TODO It does not fit! Update this after having Initial Amount on RP!
mainElement.MultiplierField.Name = "Number of Sales";

// Items, cell, user cells
// TODO How about ToList()[0]?
mainElement.ElementItemSet.First().Name = "UPO";

// Return
return resourcePool;
}

public ResourcePool CreateBasicsExistingSystemSample(User user)
{
const int numberOfItems = 4;

// Resource pool
var resourcePool = CreateDefaultResourcePool(user: user,
resourcePoolName: "Basics - Existing Model",
useFixedResourcePoolRate: true,
mainElementName: "Organization",
addDirectIncomeField: true,
addMultiplierField: true,
addImportanceIndex: false,
numberOfItems: numberOfItems);

resourcePool.Key = "Basics Existing Model";

// Main element
var mainElement = resourcePool.ElementSet.First();
mainElement.DirectIncomeField.Name = "Sales Price";
mainElement.MultiplierField.Name = "Number of Sales";

// Items, cell, user cells
mainElement.ElementItemSet.Skip(0).First().Name = "Alpha";
mainElement.ElementItemSet.Skip(1).First().Name = "Beta";
mainElement.ElementItemSet.Skip(2).First().Name = "Charlie";
mainElement.ElementItemSet.Skip(3).First().Name = "Delta";

// Return
return resourcePool;
}

public ResourcePool CreateBasicsNewSystemSample(User user)
{
const int numberOfItems = 4;

// Resource pool
var resourcePool = CreateDefaultResourcePool(user: user,
resourcePoolName: "Basics - New Model",
useFixedResourcePoolRate: true,
mainElementName: "Organization",
addDirectIncomeField: true,
addMultiplierField: true,
addImportanceIndex: true,
numberOfItems: numberOfItems);

resourcePool.Key = "Basics New Model";

// Main element
var mainElement = resourcePool.ElementSet.First();

// Fields
mainElement.DirectIncomeField.Name = "Sales Price";
mainElement.MultiplierField.Name = "Number of Sales";

mainElement.ElementFieldSet.Single(item => item.IndexEnabled).Name = "Employee Satisfaction";

// Items, cell, user cells
mainElement.ElementItemSet.Skip(0).First().Name = "Alpha";
mainElement.ElementItemSet.Skip(1).First().Name = "Beta";
mainElement.ElementItemSet.Skip(2).First().Name = "Charlie";
mainElement.ElementItemSet.Skip(3).First().Name = "Delta";

// Return
return resourcePool;
}

public ResourcePool CreatePriorityIndexSample(User user)
{
const int numberOfItems = 4;
Expand Down
13 changes: 9 additions & 4 deletions Facade/EmailService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,11 @@ public async Task SendAsync(IdentityMessage message)
case EnvironmentType.Test:
{
// In local & test, always send to notification address
if (hasNotificationAddress)
mailMessage.To.Add(new MailAddress(AppSettings.NotificationEmailAddress));
if (!hasNotificationAddress)
return;

mailMessage.To.Add(new MailAddress(AppSettings.NotificationEmailAddress));

break;
}
case EnvironmentType.Live:
Expand All @@ -72,8 +75,10 @@ public async Task SendAsync(IdentityMessage message)
else
{
// Login emails will only be send to notification address
if (hasNotificationAddress)
mailMessage.To.Add(new MailAddress(AppSettings.NotificationEmailAddress));
if (!hasNotificationAddress)
return;

mailMessage.To.Add(new MailAddress(AppSettings.NotificationEmailAddress));
}

break;
Expand Down
1 change: 1 addition & 0 deletions SolutionItems/Documents/Social.txt
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ https://github.com/formly-js/angular-formly/blob/master/CONTRIBUTING.md
https://github.com/nayafia/contributing-template/blob/master/CONTRIBUTING-template.md
https://github.com/blog/1184-contributing-guidelines
http://www.defmacro.org/2013/04/03/issue-etiquette.html
https://github.com/mdn/webextensions-examples/commit/ab55344cfca2334c40c89f08b01447f23a8ed467

code of conduct
http://contributor-covenant.org/
Expand Down
7 changes: 0 additions & 7 deletions SolutionItems/Documents/Todo.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,9 @@
*** HOT ***

wealth appsettings leave blank?

* dataContext.create new cmrp - always check existing ones and don't create duplicate; New-CMRP
Save failed!<br />Key 'New-CMRP' already exists Error: Conflict
* field - rating edit in manage.html?
* warmup script for live?!
* content for forcrowd - story + team
* content for wealth - articles
* cmrp list? -> search page
* content for editor? new content or new resourcepool - content in a content? or page as a new entity?
* route update (_system/)
Expand Down Expand Up @@ -51,8 +47,6 @@ Currently direct income & multiplier field types can only be added once per elem
seems nice, and it could be used in other cases.
however it doesn't return the newly created entity to the caller, which probably is not suitable for most cases?
how about using $injector.get('dataContext') in these cases, instead of broadcast?
* try to use pure entities, instead of breeze versions? then demo resource pools wouldn't need isTemp?
resourcePoolFactory.js - // Locally created CMRPs (isTemp) - TODO !
* use createEntity in addX cases!
* // TODO Most of these functions are related with userService.js - updateX functions
// Try to merge these two - Actually try to handle these actions within the related entity / SH - 27 Nov. '15
Expand Down Expand Up @@ -143,7 +137,6 @@ With UserAware, should we also mention which actions are allowed?

* ngClient - UI
* my ratings / show all users' ratings should be applied each section separately (cmrp rate, field rating, element cell value)
* Navigate away confirmation in isEditing
* angular material - https://material.angularjs.org/latest/
* blur admin https://github.com/akveo/blur-admin?utm_content=buffera7574&utm_medium=twitter&utm_source=changelog&utm_campaign=buffer
* Better ratings UI https://angular-ui.github.io/bootstrap/#/getting_started
Expand Down
2 changes: 1 addition & 1 deletion SolutionItems/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -30,5 +30,5 @@
//
// AssemblyFileVersion is not in use for the moment
//
[assembly: AssemblyVersion("0.52.0")]
[assembly: AssemblyVersion("0.53.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
2 changes: 1 addition & 1 deletion WebApi/Configs/Setup/appSettings.config
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
<!-- Determines whether SSL connection required for api & odata calls & email service -->
<add key="EnableSsl" value="false" />

<!-- Registration emails will be send from this address -->
<!-- Registration emails will be send from this address (leave it blank in case you don't want to send registration emails) -->
<add key="RegistrationEmailAddress" value="" />

<!-- Notification emails will be send to this address (leave it blank in case you don't want to get notifications) -->
Expand Down
35 changes: 21 additions & 14 deletions ngClient/_system/css/main.css
Original file line number Diff line number Diff line change
@@ -1,4 +1,24 @@
/* Brand styling - Probably css class names can be better, parent child structure? */
body {
font-size: 15px;
padding-top: 50px;
padding-bottom: 20px;
}

/* Set width on the form input elements since they're 100% wide by default */
input,
select,
textarea {
max-width: 280px;
}

.versionText {
border-top: 1px solid #333;
font-size: 90%;
margin-top: 20px;
padding: 20px 0;
}

/* Brand styling - Probably css class names can be better, parent child structure? */
.brandLink,
.brandLink > a,
.brandLink > a:focus,
Expand Down Expand Up @@ -28,25 +48,12 @@
font-size: 11px;
}

body {
font-size: 15px;
padding-top: 50px;
padding-bottom: 20px;
}

/* Set padding to keep content from hitting the edges */
.body-content {
padding-left: 15px;
padding-right: 15px;
}

/* Set width on the form input elements since they're 100% wide by default */
input,
select,
textarea {
max-width: 280px;
}

.bg-info {
padding: 15px;
}
Expand Down
Binary file added ngClient/_system/images/forCrowd_Logo_189x40.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed ngClient/_system/images/forCrowd_logo_34x34.jpg
Binary file not shown.
16 changes: 8 additions & 8 deletions ngClient/_system/js/app/config/route.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,15 @@
$routeProvider

/* Content */
.when('/', { title: 'Home', templateUrl: '/_system/views/content/home.html?v=0.51.0', enableDisqus: true, resolve: { validateAccess: ['dataContext', 'locationHistory', 'logger', '$location', '$q', '$route', validateAccess] } })
.when('/default.aspx', { title: 'Home', templateUrl: '/_system/views/content/home.html?v=0.51.0', enableDisqus: true, resolve: { validateAccess: ['dataContext', 'locationHistory', 'logger', '$location', '$q', '$route', validateAccess] } })
.when('/', { title: 'Home', templateUrl: '/_system/views/content/home.html?v=0.53.0', enableDisqus: true, resolve: { validateAccess: ['dataContext', 'locationHistory', 'logger', '$location', '$q', '$route', validateAccess] } })
.when('/default.aspx', { title: 'Home', templateUrl: '/_system/views/content/home.html?v=0.53.0', enableDisqus: true, resolve: { validateAccess: ['dataContext', 'locationHistory', 'logger', '$location', '$q', '$route', validateAccess] } })
// Different than other content pages, enableDisqus: false
.when('/_system/content/notFound', { title: 'Not Found', templateUrl: '/_system/views/content/notFound.html?v=0.52.0', resolve: { validateAccess: ['dataContext', 'locationHistory', 'logger', '$location', '$q', '$route', validateAccess] } })
.when('/_system/content/allInOne', { title: 'All in One', templateUrl: '/_system/views/content/allInOne.html?v=0.49.0', enableDisqus: true, resolve: { validateAccess: ['dataContext', 'locationHistory', 'logger', '$location', '$q', '$route', validateAccess] } })
.when('/_system/content/basics', { title: 'Basics', templateUrl: '/_system/views/content/basics.html?v=0.51.0', enableDisqus: true, resolve: { validateAccess: ['dataContext', 'locationHistory', 'logger', '$location', '$q', '$route', validateAccess] } })
.when('/_system/content/home', { title: 'Home', templateUrl: '/_system/views/content/home.html?v=0.51.0', enableDisqus: true, resolve: { validateAccess: ['dataContext', 'locationHistory', 'logger', '$location', '$q', '$route', validateAccess] } })
.when('/_system/content/basics', { title: 'Basics', templateUrl: '/_system/views/content/basics.html?v=0.53.0', enableDisqus: true, resolve: { validateAccess: ['dataContext', 'locationHistory', 'logger', '$location', '$q', '$route', validateAccess] } })
.when('/_system/content/home', { title: 'Home', templateUrl: '/_system/views/content/home.html?v=0.53.0', enableDisqus: true, resolve: { validateAccess: ['dataContext', 'locationHistory', 'logger', '$location', '$q', '$route', validateAccess] } })
.when('/_system/content/implementation', { title: 'Implementation', templateUrl: '/_system/views/content/implementation.html?v=0.49.0', enableDisqus: true, resolve: { validateAccess: ['dataContext', 'locationHistory', 'logger', '$location', '$q', '$route', validateAccess] } })
.when('/_system/content/introduction', { title: 'Introduction', templateUrl: '/_system/views/content/introduction.html?v=0.49.0', enableDisqus: true, resolve: { validateAccess: ['dataContext', 'locationHistory', 'logger', '$location', '$q', '$route', validateAccess] } })
.when('/_system/content/introduction', { title: 'Introduction', templateUrl: '/_system/views/content/introduction.html?v=0.53.0', enableDisqus: true, resolve: { validateAccess: ['dataContext', 'locationHistory', 'logger', '$location', '$q', '$route', validateAccess] } })
.when('/_system/content/knowledgeIndex', { title: 'Knowledge Index', templateUrl: '/_system/views/content/knowledgeIndex.html?v=0.51.0', enableDisqus: true, resolve: { validateAccess: ['dataContext', 'locationHistory', 'logger', '$location', '$q', '$route', validateAccess] } })
.when('/_system/content/priorityIndex', { title: 'Priority Index', templateUrl: '/_system/views/content/priorityIndex.html?v=0.49.0', enableDisqus: true, resolve: { validateAccess: ['dataContext', 'locationHistory', 'logger', '$location', '$q', '$route', validateAccess] } })
.when('/_system/content/prologue', { title: 'Prologue', templateUrl: '/_system/views/content/prologue.html?v=0.51.0', enableDisqus: true, resolve: { validateAccess: ['dataContext', 'locationHistory', 'logger', '$location', '$q', '$route', validateAccess] } })
Expand All @@ -45,8 +45,8 @@

/* 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.52.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.52.0', resolve: { validateAccess: ['dataContext', 'locationHistory', 'logger', '$location', '$q', '$route', validateAccess] } })
.when('/:userName/new', { title: 'New CMRP', templateUrl: '/_system/views/resourcePool/resourcePoolManage.html?v=0.53.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.53.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] } })

/* Otherwise */
Expand Down Expand Up @@ -104,8 +104,8 @@
// Logger
logger = logger.forSource('routeRun');

$rootScope.$on('$routeChangeSuccess', routeChangeSuccess);
$rootScope.$on('$routeChangeError', routeChangeError);
$rootScope.$on('$routeChangeSuccess', routeChangeSuccess);

// Navigate to correct page in 'Invalid access' cases
function routeChangeError(event, current, previous, eventObj) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,12 @@
dataContext.getCurrentUser()
.then(function (currentUser) {
vm.currentUser = currentUser;
vm.currentUser.isEditing = true;
});

/*** Implementations ***/

function cancel() {
vm.currentUser.entityAspect.rejectChanges();
vm.currentUser.isEditing = false;
$location.url('/_system/account');
}

Expand All @@ -40,7 +38,6 @@
function saveChanges() {

isSaving = true;
vm.currentUser.isEditing = false; // TODO What happens in fail case?
dataContext.saveChanges()
.then(function (result) {
logger.logSuccess('Your changes have been saved!', null, true);
Expand Down
Loading

0 comments on commit e1745e2

Please sign in to comment.