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

current update is saved when new log is created #88

Merged
merged 17 commits into from
May 3, 2024

Conversation

ryansrofe
Copy link
Collaborator

Description

When a user creates a log without saving and then tries to create a new log, the first log will be cleared. This update fixes that issue by bringing back the stored values in updates. If a user cancels their update the changes will not be committed.

Fixes # (issue)

Type of Change

  • Bug fix (non-breaking change which fixes an issue)

How Has This Been Tested?

Tested locally in Figma.

When a user creates a log without saving and then tries to create a new log, the first log will be cleared. This update fixes that issue by bringing back the stored values in updates. If a user cancels their update the changes will not be committed.
@ryansrofe ryansrofe added bug Something isn't working enhancement New feature or request labels Apr 17, 2024
@ryansrofe ryansrofe added this to the Version 3 milestone Apr 17, 2024
@ryansrofe ryansrofe requested a review from cpresler April 17, 2024 22:15
@ryansrofe ryansrofe self-assigned this Apr 17, 2024
Copy link
Contributor

@cpresler cpresler left a comment

Choose a reason for hiding this comment

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

Mostly looks good, but there are a couple of places we need to be checking/storing error states so we don't create a validation loop hole.

: changeLog.createdDate,
'date',
),
er: false,
Copy link
Contributor

Choose a reason for hiding this comment

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

should we be doing a check against changeLog.state?.updates?.createdDateTmp?.date?.er? It's edge case, but if a user exits editing while they have an error in the date we wouldn't want to erase that when they return - the validation logic only runs onTextEditEnd for the input.

^ This would apply to both date and time error values

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

input fields have been refactored to include optional error messaging. The date and time fields are fully being tracked for errors etc for users and are kept in place if they navigate to another log and come back.

key: changeLog.state?.updates?.link?.key ? changeLog.state?.updates?.link?.key : '',
},
type: changeLog.state?.updates?.type ? changeLog.state?.updates?.type : changeLog.type,
change: changeLog.state?.updates?.change ? changeLog.state?.updates?.change : changeLog.change,
linkFormError: { label: false, url: false },
Copy link
Contributor

Choose a reason for hiding this comment

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

similar to my other comment, I think we should be checking for error values here as well.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

input fields have been refactored to include optional error messaging. The link fields are fully being tracked for errors etc for users and are kept in place if they navigate to another log and come back.

Added a new value for GAP, this required an adjustment of the other GAP values to accommodate for the new GAP.lg value. The number values should be the same, the reference is just updated.
Added a new value for GAP, this required an adjustment of the other GAP values to accommodate for the new GAP.lg value. The number values should be the same, the reference is just updated. The vertical padding has also been removed. The new GAP.lg value makes this padding not needed.
Added a new value for GAP, this required an adjustment of the other GAP values to accommodate for the new GAP.lg value. The number values should be the same, the reference is just updated. The vertical padding has also been removed for last row. The new GAP.lg value makes this last row padding not needed. The radius tweak rounds the corners when avatars are hidden and squares off the top when shown to make it flush with the circle.
padding adjustments and new error messaging. The date error text was breaking out of the widget bounds when avatars and log types are off. All errors messages have been condensed in this consistent format.
- padding adjustments
- font size +1 to match the date/time fields
- new condensed error messaging in consistent format
- separated error messages
- removed extraneous autolayout
- padding and spacing adjustments to take advantage of new GAP.lg option
- updated error handling for links. When there is an error for label or URL the save change button will now toggle to error state consistent with date and time errors.
- handling of dates and times (both error and valid) if a user switches to another log before saving.
- bug fix when user enters update text and then removes it the previous text reappears. This no longer happens and users can add, remove etc without issue and this field is the only optional field.
- added autolayout names as needed
very small adjustment to make dividers have rounded corners. All dividers, lines, and dashed lines should be rounded.

The only place dashes are not rounded is the log type button. This will require a bit of refactor that isn't as easy to just get in line like the rest.

I switched out the Rectangle for a Line because of how the dashes work.
changes the border for the left side to the darker grey when the row is actively focused and being edited. Provides a bit of a focus state when there are many rows.

Also updated corner radius for the divider to make style guide.
The way in which errors are presented to the user was refactored and this function is not needed.

Padding token was adjusted in a previous commit and is being removed here.
👆 Error in our tests

Updated the typings file as suggested here --> https://www.figma.com/plugin-docs/api/typings/

Did the same for widget typings.
updating style token documentation, adding needed values
switching out tokens
cleaning up tokens
removing inline formulas using tokens
fixing change type list key bug
refactored all log input fields into a new component
date and time fields
main log update field
link label and URL fields
is there a reason we are limiting the number of links to 8?
@ryansrofe
Copy link
Collaborator Author

Quite a few updates to finish out this PR. Four sets of changes:

  • Adding error tracking for Date, Time, Link Label, and URL fields
  • New Input Field component to handle all log-based inputs with optional error messaging
  • Added focus indicator (darker avatar line) for the log currently being edited
  • Fit and finish, adjusting styles and tokens cleanup, removing older unused assets

@ryansrofe ryansrofe requested a review from cpresler April 28, 2024 18:21
Copy link
Contributor

@cpresler cpresler left a comment

Choose a reason for hiding this comment

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

Changes look good!

@ryansrofe ryansrofe merged commit 74ce524 into main May 3, 2024
1 check passed
@ryansrofe ryansrofe deleted the keep-edits-without-save branch May 3, 2024 18:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants