-
Notifications
You must be signed in to change notification settings - Fork 7
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
Example invoice #57
Open
ltfschoen
wants to merge
134
commits into
maciejhirsz:master
Choose a base branch
from
ltfschoen:luke/invoice-debug
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Example invoice #57
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
… row to column for details table
…able row. update readme
…ns so looks right. still error
…g range after removal
…e all rows and sstill upload a csv file
ltfschoen
force-pushed
the
luke/invoice-debug
branch
from
May 8, 2023 23:19
0fc4ffc
to
ad96441
Compare
ltfschoen
force-pushed
the
luke/invoice-debug
branch
from
May 8, 2023 23:21
ad96441
to
c29ba76
Compare
…ant to replace all csv files
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
run with
from_org_addr
input field in the UIfrom_org_addr
input field in the UI with multiple editable input fields with details likeinv_date
,from_org_addr
, etc (from details.csv labels. so we can choose a 'details' file details.csv to populate those input fields in the UI, whose input fields are still then editableEmpty
, try usingcondition.then(|| view! { ... })
https://doc.rust-lang.org/std/primitive.bool.html#method.then. See Discord thread "how to useEmpty
...". Update: did this to conditionally render the hint only when not already editingupdate
instead ofupdate_silent
again.onload_details
andonload_main
into common method, or move common aspects into common function. See 1cc4c97. See Discord thread "how to change the onchange...". Update: This feature is only possible with nightly, might be possible in futureonchange
(until refresh or upload a different document), but the issue doesn't happen on Firefox - solved using this https://stackoverflow.com/a/48499451/3208553, in this commit daa517aonchange
to something else so if try upload same file twice in a row on Brave or Chrome, it updates#details,name,age\nluke,....
, where there is a mapping fromdetails
toTableVariant::Details
. so if they provide a valid one identified by prefix with#
at the start, then it will store that valuedetails
as theTable
's propertyvariant
value, otherwise it will error if invalid one is provided, or if it is not provided thenTableVariant::Unknown
will be stored (perhaps if loaded from mock data) unless they click the relevant button that triggers sayonload_details
, which manually overrides it withTableVariant::Details
withget(state).table.variant = table_variant;
Table
's propertyvariant
value has a value other thanTableVariant::Unknown
, so if it wasTableVariant::Details
then it'd modify the string to be downloaded so it would be prefixed with#details,
before anything else. See commit 8eb05e1HeadDetails
we useEditing::Cell { row, col }
whereas inHead
we just use(Editing::Column { col }
. In the state for "details" table we're storing thevariables
in columns, thedata
in row[0], and the labels in row[1], but we want the variables removed, the labels to be instead in row[0] and data values in row[1]. In csv.rs we're pushing the table variant prefix on the variables in details, but we're pushing the table variant prefix on the labels in main because it doesn't have any variables. it's inconsistent but it still works, but need to remove variables and only keep labels. fixed in commit 8e1fd25"description,total,qr,aaa\neat,1,0x0,\nsleep,2,0x1,"
) then pad those values so do not get errors saving. See commit 79433ceonload_common
with Maciej feedback to pass function to the function as follows:and call with
onload_common(|state| &mut state.main, state, event).await;
to duplicateonload_common
, so the closure will be inlined in the release build.also replace
with the following as they should compile to the same code with optimizations on, which is an extra layer of a state machine for the compiler to chug through:
InvalidRowLength
. but also give option to specify the table variant#main
, or#details
, we know where they should go in the UI. error if try upload two files both with same variant..... would it be cooler if they were in same file, but that's not a very organised approach#
value into aconst
, but not sure how to use the const in a regex so would have to change that manually. also wouldn't mind creating a mapping from TableVariant to string by creating a FromTableVariant that extends String, and also the other way arround. Also think i need to have higher order Error enum since some errors might have shared usage across state.rs and csv.rs files . Draft commit with TODOs here 8eb05e1Head
andHeadDetails
into single componentHead
, and combineCell
withCellDetails
into a single componentCell
. Do this by usingget: impl Fn(&mut State) -> &mut Content
instead ofstate: ...
techniqueScreenshot Preview (9 May 2023):
Screenshot Preview (8 May 2023):