Comments (13)
For me this is breaking whether or not a file is selected. I think it's because there is no Route
attribute specified, but there are also some other issues, like typos in some of the IDs in the <form>
element.
I'll take a look at this, unless it isn't needed for the November MVP and other things should be prioritized?
from allready.
This upload form is using RedirectToRoute
(to the Activity edit page) on both success and failure of image upload. Ignoring a couple of typos which are currently breaking the form (it doesn't use Html.BeginForm
but is hand generated), this means that ModelState
will be lost upon failure, such that no error appears. In actual fact, because the Edit
page is using the Activity
class as its model, and not it's own ViewModel, the <input type='file'>
upload element isn't part of the model anyway, so no validation would be happening in any case.
Rather than use TempData
to persist validation messages concerning the <input type='file'>
element back to the Edit
action, it seems like this would be an opportune moment to alter the Create
and Edit
activity pages (both of which use the Edit.cshtml
view) to have their own ViewModel.
This will allow the <input type='file'>
element to be added to the model and will then allow full flexibility for validation (e.g. we could (in due course) derive from RequiredAttrbute
and check it is indeed an image file that is uploaded).
Let me know if you think this is the wrong approach; if it sounds sensible I'll start working on it.
from allready.
I think I have this basically working now, having converted the create/edit/activity image upload page to use two different ViewModels rather than the simply the Activity
object as its model. This enables each of the forms to be separately validated.
It's successfully uploading images to Azure.
I'll test everything more thoroughly tomorrow morning and push it for review.
from allready.
This problem also exists for the Campaign Admin Edit page: it too crashes when no file is selected.
The issue is as described above.
@dpaquette, what would you suggest as the best way for fixing this? If your refactorings of all the admin pages is now complete, the solution I committed last week could perhaps be reimplemented on top of those modifications (i.e., we could have two models, one for each form, which would allow validation on the image form).
Alternatively, the PostActivityFile
and PostCampaignFile
actions could be modified to check for a null value, and then redirect back to the appropriate edit form. The redirection would need to include something to indicate the error so that a message could be displayed. The latter would certainly be a simpler solution - would it be too hacky, putting something on the query string (say) to indicate the error?
from allready.
Touch base with @joelhulen. I think he was doing something related to images. Just want to make sure you 2 are not overlapping on tasks.
from allready.
Yes, that's true. I wasn't finished with the changes since I was rushing to
get it up for testing toward the end of the hackathon. Feel free to make
any necessary adjustments, however.
On Monday, November 9, 2015, David Paquette [email protected]
wrote:
Touch base with @joelhulen https://github.com/joelhulen. I think he was
doing something related to images. Just want to make sure you 2 are not
overlapping on tasks.โ
Reply to this email directly or view it on GitHub
#48 (comment).
from allready.
Ah okay, I'll leave it for now if you're doing stuff on this @joelhulen. I hope my PR #301 didn't overlap with anything image-related you were doing.
My main question for the above, which maybe of interest for whoever ends up working on it, concerns the design decision of whether to split the viewmodel so that the file upload form can be validated in the normal way, or whether to simply do the error checking on the post action and then redirect to the original edit page indicating some kind of error via the querystring.
from allready.
@joelhulen are your changes with respect to images complete now? Shall I go ahead and fix up the activity edit page in a manner similar to how you simplified the campaign one, or are you handling this one too?
from allready.
@ksk100 yes, my changes with respect to images on the campaign edit page are complete. Please go ahead and follow a similar pattern for the activity edit page. I wouldn't be able to get to it until late tonight.
One thing to look for is the issue you brought up about the image being required. If you fix that for activities, please also apply the fix to campaigns.
from allready.
Okay no problem.
On 12 Nov 2015 17:27, "Joel Hulen" [email protected] wrote:
@ksk100 https://github.com/ksk100 yes, my changes with respect to
images on the campaign edit page are complete. Please go ahead and follow a
similar pattern for the activity edit page. I wouldn't be able to get to it
until late tonight.One thing to look for is the issue you brought up about the image being
required. If you fix that for activities, please also apply the fix to
campaigns.โ
Reply to this email directly or view it on GitHub
#48 (comment).
from allready.
One question: as it stands the Create Activity page doesn't show the image upload form; that only becomes accessible via the Edit page once the activity has been created. Was there a reason for that behaviour and should it be retained?
(Incidentally, as it's already getting late here I probably won't get this finished and tested tonight; but it'll be finished off first thing tomorrow, with the fix for the campaign page too; if that will be too late do take over).
from allready.
I don't know why it was set up that way, to be honest. If you mimic the image behavior I've set up in the Campaign edit form, then you'll be able to upload the image on create as well as edit.
from allready.
Okay will do.
On 12 Nov 2015 18:38, "Joel Hulen" [email protected] wrote:
I don't know why it was set up that way, to be honest. If you mimic the
image behavior I've set up in the Campaign edit form, then you'll be able
to upload the image on create as well as edit.โ
Reply to this email directly or view it on GitHub
#48 (comment).
from allready.
Related Issues (20)
- Virtual - registration phone number Check not given for 5 digit number
- Virtual- Home/Assign page Location Needs Data Validation HOT 1
- Virtual-Remove Button on Volunteer Page
- Virtual-Volunteer Home-Description Text
- Virtual-Change Contact Info
- Virtual-My Organization page - Location Field
- Virtual-Register A New organization
- Virtual - Server Error in '/' Application - A person cannot belong to more than one organization. - happens when Register New Organization with 'test' in Organization Name and all the other fields empty HOT 1
- Virtual - Server Error in '/' Application - Logged-in person not found or is an administrator - happens when Register New Organization with ยด in Organization Name and all the other fields empty HOT 1
- Virtual - CheckinResource - Many chars in Quantity gives an error messages that stretches the webpage a long way to the right HOT 1
- Build Issues with 37833fcf2ea4d1f54d0e846c78ff79b307509809 HOT 1
- NETSDK1059 warning HOT 1
- AllReady.ScenarioTest Issues HOT 13
- Gulp 3.9.1 Issues with Node 10 HOT 4
- Campaign Start/End Date does not appear correctly on Admin/Event/Create page HOT 2
- Error when signing up to the mail list HOT 3
- Is This Repository still maintained?? HOT 7
- Visual studio problems to run C/C++
- Is this repo maintain so far? HOT 1
- Idempotency Issue with SMS sending function: Add duplicate message detection
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. ๐๐๐
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google โค๏ธ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from allready.