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

@f.PartialFor, @f.Partial, @s.PartialFor, @s.Partial #132

Merged
merged 9 commits into from
Dec 6, 2015
Merged

Conversation

robdmoore
Copy link
Member

Alternative implementation to #113

I wanted to try and understand some of the complexity in #113 and why it's there. There were a few things I had to make simpler, but all in all most of the structure from #113 has been retained.

Would be good to get a fresh pair of eyes on this @MattDavies @Royce

cc @zabulus

@robdmoore robdmoore changed the title PartialFor implementation [WIP] PartialFor implementation Oct 3, 2015

@using (var f = Html.BeginChameleonForm())
{
@f.Partial("_ParentPartial")
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This view shows all the usages:

@f.Partial(...) / @f.PartialFor(m => m, ...)
@f.PartialFor(m => m.Child, ...)
@s.Partial(...) / @s.PartialFor(m => m, ...)
@s.PartialFor(m => m.Child, ...)

@zabulus
Copy link
Contributor

zabulus commented Oct 4, 2015

You thrown away all that stuff with expression rewriting. Good. It was really overcomplicated.
Looks like I'm not very familiar with the expression API.

@robdmoore
Copy link
Member Author

I still needed the Combine method you wrote though.

Did you write that from scratch or pull from stack overflow by the way? I'd like to attribute of if the latter so we can find the original source.

On 5 Oct 2015, at 1:30 am, zabulus [email protected] wrote:

You thrown away all that stuff with expression rewriting. Good. It was really overcomplicated.
Looks like I'm not very familiar with the expression API.


Reply to this email directly or view it on GitHub.

@robdmoore
Copy link
Member Author

I've added test coverage now.

Had to do it in the Acceptance Tests project.

Only thing I haven't put in is the PartialForList command that @zabulus implemented.

I'm inclined to get this in and leave that as an exercise for someone else (@zabulus or otherwise) since I don't think it's essential.

@MattDavies can you cast your eye over and merge if happy?

@robdmoore
Copy link
Member Author

FYI This drops the code coverage stats heaps, but the code is actually covered due to the Acceptance Test

@@ -4,6 +4,19 @@ ChameleonForms Breaking Changes
Version 2.0.0
=============

Deprecated `WithoutLabel` method on `IFieldConfiguration`. It still works (for now), but the method has been marked with the `[Obsolete]` attribute.
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is from a previous PR, but I noticed that it was missing so added in.

I suspect we can release v2 after this PR is merged in. Thoughts @MattDavies?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would be nice to get my other WIP PR merged as well, but not sure when I'll have time to finish it.

@robdmoore robdmoore changed the title [WIP] PartialFor implementation @f.PartialFor, @f.Partial, @s.PartialFor, @s.Partial Oct 10, 2015
@robdmoore
Copy link
Member Author

I've added a bunch of tweaks I called out.

Only thing left is to add some doco to the wiki after it's merged

@robdmoore
Copy link
Member Author

wiki entry done

/// Loading partial views is very difficult to test by unit testing.
/// </summary>
[UseReporter(typeof(DiffReporter))]
public class PartialForTests
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think also need to add submit test, and check that POST binding works as expected.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Makes sense.

Let's do it in a separate PR though. I'm happy enough that it will postback ok in reviewing the approval test.

On 12 Oct 2015, at 5:28 pm, zabulus [email protected] wrote:

In ChameleonForms.AcceptanceTests/PartialForTests.cs:

+using System.IO;
+using System.Net.Http;
+using System.Text.RegularExpressions;
+using ApprovalTests.Html;
+using ApprovalTests.Reporters;
+using NUnit.Framework;
+using OpenQA.Selenium;
+using OpenQA.Selenium.Support.UI;
+
+namespace ChameleonForms.AcceptanceTests
+{

  • ///

  • /// Loading partial views is very difficult to test by unit testing.

  • ///

  • [UseReporter(typeof(DiffReporter))]

  • public class PartialForTests
    I think also need to add submit test, and check that POST binding works as expected.


Reply to this email directly or view it on GitHub.

MattDavies added a commit that referenced this pull request Dec 6, 2015
@f.PartialFor, @f.Partial, @s.PartialFor, @s.Partial
@MattDavies MattDavies merged commit 0184724 into master Dec 6, 2015
@MattDavies MattDavies deleted the partialfor branch December 6, 2015 10:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants