ericberman / MyFlightbookWeb

The website and service for MyFlightbook
48 stars 18 forks source link

Add flight and add another #539

Closed KayRJay closed 4 years ago

KayRJay commented 4 years ago

Since there is a drop down menu on Add Flight, it would be convenient if it were possible to Add Flight and Add Another all in one step. Now, after I press Add Flight, I have to scroll back up to the top to press New Flight again.

ericberman commented 4 years ago

If you started with new flight, it already takes you back to new flight. Haven't we had this discussion?

Yep, Issue #413. If you start from Logbook->Add Flights, then adding another flight after this one is already the behavior.

KayRJay commented 4 years ago

You’re right. Sorry.

A somewhat related issue ... does it make sense to permit adding a flight with nothing but a date? Maybe you could flag that as an “issue”? Or, require some minimal set of attributes to be entered before Add flight is allowed?

I’m guessing you might choose the check option. Unless a flight is pending, it should have at least one of (landings, airports, flight times,...) etc.

Sent from my iPad

On Mar 21, 2020, at 10:59 PM, Eric Berman notifications@github.com wrote:

 If you started with new flight, it already takes you back to new flight. Haven't we had this discussion?

Yep, Issue #413. If you start from Logbook->Add Flights, then adding another flight after this one is already the behavior.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or unsubscribe.

ericberman commented 4 years ago

Not a bad warning idea...

KayRJay commented 4 years ago

Question ... does this apply to Pending flights?

And, another suggestion (perhaps you've implemented this?) check whether a new flight is an exact duplicate of another. It's a little harder to do this on a bulk check, but you can look at flights that share a date.

KayRJay commented 4 years ago

Perhaps you've not checked in these changes, but I don't see anything about an "empty" flight when I add a new flight or do the bulk check.

ericberman commented 4 years ago

Yes - you can do all of these checks on pending flights. Note that one of the key reasons to support pending flights is that it can hold flights that otherwise fail validation - both actual errors as well as check-flights warnings.

Duplicates is indeed harder; I do have a "dupesOnly" option (see https://myflightbook.com/logbook/public/FAQ.aspx?q=41#41) that will find dupes.

ericberman commented 4 years ago

And note that you'll see me close issues when I check in changes to the code, but you won't see them until I update the website. I batch up because updating the website is slow.

KayRJay commented 4 years ago

I was arguing that you probably DON'T want to check pending flights, because being incomplete is a good reason to make them pending. But surely it's ok to check pending flights too.

Is there a way to search for pending flights?

As to duplicates, I'm glad there is a feature to check for duplicates, but is hidden under the (mysterious to many people) ?dupesOnly=1 URL addition. Can you include this duplicate check under Logbook > Check flights? It could be in a check category of its own.

It shouldn't be hard to check whether a New flight (or one I'm updating) is a duplicate of an existing flight. You've already got all the code to compare two flights. As part of the "Check flight" option Screen Shot 2020-03-15 at 10 34 30 AM you just need to look at other flights on the same date, or am I wrong?

Still, see issue #519 re the location and icon for the "Check flight" option on adding or updating a flight.

ericberman commented 4 years ago

No, there's no problem checking pending flights, but they're not included when you use the bulk check-flights feature for precisely that reason. But when you go to edit a pending flight, you can check it to see if it has any issues before saving.

There is no way to search pending flights. Because pending flights can violate all sorts of rules (including things like database foreign key constraints - e.g., they may not have an aircraft!), they're stored as a blob. And they're excluded from everything - they're pending, they're not yet in your logbook.

I might have a cheaper way to add a dupe check. Will think about that.

Regarding #519 - I'm not thrilled with those icons, and I'm OK with the location. I fixed the flashing/scrolling.

KayRJay commented 4 years ago

If I can't easily find the pending flights how do I know which ones to complete? How about putting them in the Logbook, perhaps just with something like this:

dd/mm/yyyy Pending flight

That would make it easy for me to see such flights (perhaps after doing a date range search), even if I can't search for them specifically. Having such a placeholder "virtually" in the Logbook is useful, as I could then immediately Edit or Delete it. It's ok if you don't export or report on pending flights, as they are not really there as you say.

Thanks for thinking about the dup-check options. Duplicates may be one of the most "serious" issues you could check for.

Thanks too for fixing the flashing / scrolling. I will look for other icons. Still disagree re the location. Checking a flight is a natural thing to do before updating or adding it. There's room near the "Add flight" button. Right now, the icon seems to be related to "Sharing", a poor choice in my opinion.

KayRJay commented 4 years ago

How about a simple icon like these?

Screen Shot 2020-03-22 at 2 00 52 PM

You could change the red questioning icon to a green one if there were no issues.

KayRJay commented 4 years ago

The check for an empty (aka "incomplete") flight is not really strong enough. I could have a date and a comment, but no route or no landings. (What kind of flight is that?!).

The check for an incomplete flight should look for a set of minimal requirements that every flight MUST have: a route, landings and a flight time. Everything else could legitimately be missing.

As mentioned, it would be ok to not make this check for a pending flight, but either way is ok.

ericberman commented 4 years ago

You can easily find pending flights. Go to Logbook->Pending flights. I can't put them into the logbook because they may not have all of the required fields. They are by definition possibly incomplete or have errors, and they are NOT part of the logbook. It would just be confusing, for example, if you see a pending flight with 2 hours in your list and yet the totals didn't reflect those 2 hours (as totals shouldn't). Or do you include them when you download your logbook into Excel? What happens when you then do totals in Excel, and they don't match totals on the website? Etc. It just leads to all sorts of complexity and opportunities for confusion; far cleaner - and easier to understand - that this is your logbook over here, and those are your pending flights over there.

I see where you're going with the icons above, but I had rejected those for two reasons (or really the same reason in two contexts): green/red looks like the result of a status check, not an invitation to do one, so I shy away from that. And a checkmark also looks like a result, not a "click me" action.

Plain text "Check this flight" certainly works, but I kinda like having an icon.

As for placement: that's actually a really hard one. I think putting it into the drop-down actually makes the most sense. But (a) I don't always have a dropdown, and (b) more importantly, then I absolutely cannot simultaneously avoid the scrolling on the postback. The way that I'm avoiding the scrolling is by using an update panel, which means that literally a contiguous section of the page gets updated (but the whole page gets submitted). I can't avoid doing the page submission - that's the only way to capture what's been entered on the page, and the check then needs to happen on the server. So the button and the panel that shows the results of the check must be collocated on the screen.

As for a flight with a date and a comment but no route or landings: this is a very common and entirely legitimate scenario. The most common case is logging of ground instruction. But a sim session could also meet this.

KayRJay commented 4 years ago

Sorry, I didn't know about Logbook > Pending flights. Sorry about that. I am persuaded by your argument that the pending flights should be separate.

Three nits ...

As to the icons, the current icon does look like an invitation to check, so that's nice. Using words is really more clear than an icon, isn't it? I don't know why you prefer a possibly obscure icon to a button:

Screen Shot 2020-03-22 at 3 25 51 PM

I don't understand the intricacies of the "update panel" and why you can't move that icon to the right. What I see is this:

Screen Shot 2020-03-22 at 3 28 12 PM

The icon appears to be on the same line as the cancel and add flight buttons, and below the message block.

Thanks for the explanation re ground school and sim sessions. I guess I can see that, but is there really any value (to the FAA) in having just the date and comments?

ericberman commented 4 years ago

Why pending flights don't have both edit and delete? I suppose I could, but that's just another icon. Delete needs its own icon, but "click on an item to view its details and/or edit it" is a pretty universal paradigm. Nothing magic about the date; I could let you click on any part of it, but that leads to a whole lot of hover flashing. And you can click on the date in the main logbook view as well to view its (far more intricate) details. So I figured why not follow that model.

Edit screen says "flights" because you can have multiple pending flights. E.g., if you import and some flights have errors, they come here. If you import from CloudAhoy, they come here. Or are you talking about at the point that you click on a flight to review it? I suppose that could be singular. But the "review" is the key thing - you may not need any edits! Two common scenarios for this are (a) I am an airline pilot who put in my upcoming flights for the week; I don't add them to my logbook until I fly them, or (b) I imported from Cloudahoy, and they may be fine or not. So I'll change to "Review/Edit Pending Flight(s)".

I moved the icon to the right. I agree it works well there. The key thing is that in the HTML it needs to be contiguous with the box that pops up, which is why I can't bury it in, say, the drop-down. An update panel reduces flashing/scrolling when doing an http postback because it doesn't reload the whole page: it instead fetches a new copy of the page behind the scenes and then updates the section that is within the bounds of the updatepanel. So it's a contiguous block of HTML - as long as it comes immediately before or after the pop-up box, it can work. I could put the whole flight editing thing into an update panel (then position wouldn't matter), but my recollection is that I couldn't do that because it broke something else (but I forget what exactly), so I don't want to mess with that.

I could put more words, but I like the subtlety of the check-flights icon. At the end of the day, it doesn't matter nearly as much what the icon is as it matters that you recognize it.

KayRJay commented 4 years ago

Yup, it's just another icon, so not a big deal visually. I'm not asking for a drop-down menu on the pending flight list like in the logbook, but for consistency with the logbook drop-down, an Edit icon seems appropriate (and there is room).

Edit screen says "flights" because you can have multiple pending flights.

But I'm only reviewing or editing one at a time. I note that when I'm editing an existing (non-pending) flight from the logbook, the header is "Logbook for ". It should say "Edit a flight."

I can live with "Review". As I said, these were "nits".

Thanks for moving the icon. And I can live with it too.

Thanks for listening!

KayRJay commented 4 years ago

Thanks for moving the icon. But does it really need now to be on the far right, rather than near the Add flight button?

ericberman commented 4 years ago

surprisingly, yes. But it's OK with me - I don't want it crowding the Add/Update button.