Skip to content

Commit

Permalink
Merge pull request #366 from shesha-io/fix/alex_stephens
Browse files Browse the repository at this point in the history
Monir fix and add test
  • Loading branch information
AlexStepantsov committed Jul 12, 2023
2 parents e7001e1 + 7ab5cbc commit f179307
Show file tree
Hide file tree
Showing 4 changed files with 41 additions and 102 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,29 @@ private async Task DoProcess()
await _moduleRepo.UpdateAsync(dbModule);

}

await _unitOfWorkManager.Current.SaveChangesAsync();

// initialize main module
var mainModuleInitialized = await codeModule.Instance.InitializeConfigurationAsync();

// initialize submodules
var submodules = allSubModules.Where(m => m.ModuleType == codeModule.ModuleType).OfType<IHasDataDrivenConfiguration>().ToList();
var submodulesInitialized = false;
foreach (var submodule in submodules)
{
submodulesInitialized = submodulesInitialized || await submodule.InitializeConfigurationAsync();
}

if (mainModuleInitialized || submodulesInitialized)
{
if (isNewModule)
dbModule.FirstInitializedDate = Clock.Now;
else
dbModule.LastInitializedDate = Clock.Now;

await _moduleRepo.UpdateAsync(dbModule);
}
}
}
}
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,8 @@ public async Task CheckUow()
};
await _moduleRepo.InsertAsync(dbModule);

await _unitOfWorkManager.Current.SaveChangesAsync();

var dbModules2 = await _moduleRepo.GetAllListAsync();

await uow.CompleteAsync();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -548,12 +548,27 @@ public async Task BooleanField_NotEquals_Fetch()
]
}";

private readonly string _nestedColumnResolver_expression2 = @"{
""and"": [
{
""=="": [
{
""var"": ""PrimaryOrganisation.PrimaryAddress""
},
""D80526AB-BB64-41FA-BFB8-F74A9332C0CA""
]
}
]
}";

[Fact]
public void NestedColumnResolver_Convert()
{
var expression = ConvertToExpression<Person>(_nestedColumnResolver_expression);

Assert.Equal(@"ent => (ent.User.UserName == ""admin"")", expression.ToString());

var expression2 = ConvertToExpression<Person>(_nestedColumnResolver_expression2);
Assert.Equal(@"ent => (ent.PrimaryOrganisation.PrimaryAddress.Id == ""D80526AB-BB64-41FA-BFB8-F74A9332C0CA"".ToGuid())", expression2.ToString());
}

[Fact]
Expand Down

0 comments on commit f179307

Please sign in to comment.