Skip to content
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

added Validation to Get File List activity #578

Open
wants to merge 3 commits into
base: dev
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
using Fr8.Infrastructure.Data.Managers;
using Fr8.Infrastructure.Data.Manifests;
using terminalDropboxTests.Fixtures;
using Fr8.Infrastructure.Data.Control;

namespace terminalDropboxTests.Integration
{
Expand Down Expand Up @@ -50,6 +51,7 @@ public async Task Activate_Returns_ActivityDTO()
using (var crateStorage = Crate.GetUpdatableStorage(dataDto.ActivityDTO))
{
crateStorage.Add("Configuration_Controls", new StandardConfigurationControlsCM());
crateStorage.FirstCrateOrDefault<StandardConfigurationControlsCM>().Content.Controls.Add(new DropDownList() { Name = "Test_Name", Label = "Test Label", Value = "test" });
}

//Act
Expand All @@ -75,6 +77,7 @@ public async Task Run_Returns_ActivityDTO()
using (var crateStorage = Crate.GetUpdatableStorage(dataDto.ActivityDTO))
{
crateStorage.Add("Configuration_Controls", new StandardConfigurationControlsCM());
crateStorage.FirstCrateOrDefault<StandardConfigurationControlsCM>().Content.Controls.Add(new DropDownList() { Name = "Test_Name", Label = "Test Label", Value = "test" });
}
// Add operational state crate
AddOperationalStateCrate(dataDto, new OperationalStateCM());
Expand Down
12 changes: 11 additions & 1 deletion terminalDropbox/Activities/Get_File_List_v1.cs
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,17 @@ public override async Task FollowUp()
Storage.ReplaceByLabel(PackDropboxFileListCrate(fileList));
}


protected override Task Validate()
{
if (string.IsNullOrEmpty(ActivityPayload.CrateStorage.FirstCrate<StandardConfigurationControlsCM>().Content.Controls.FirstOrDefault().Value))
{
ValidationManager.SetError("File must be selected", ActivityUI.FileList);
}

return Task.FromResult(0);
}



public override async Task Run()
{
Expand Down