-
Notifications
You must be signed in to change notification settings - Fork 3
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
feat(OY2-26082): Package actions FE #317
Conversation
type Attachments = NonNullable<opensearch.changelog.Document["attachments"]>; | ||
|
||
export const useAttachmentService = ( | ||
props: Pick<opensearch.changelog.Document, "packageId"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is some redundancy between the prop and the function signatures within the hook.
The main reason this requires the top level changelog document is for access to the packageId. In addition, it provided consistent props scaffolding.
const [loading, setLoading] = useState(false); | ||
const [error, setError] = useState(""); | ||
|
||
const onUrl = async (ATT: Attachments[number]) => { | ||
setLoading(true); | ||
try { | ||
return await getAttachmentUrl( | ||
props.packageId, | ||
ATT.bucket, | ||
ATT.key, | ||
ATT.filename | ||
); | ||
} catch (e) { | ||
const err = e instanceof Error ? e.message : "Failed download"; | ||
setError(err); | ||
} finally { | ||
setLoading(false); | ||
} | ||
}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we utilize react-query
for this, and pass the export thru this hook?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I completely overlooked that... great point out!
Makes it much cleaner 🤟
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm stepping through the env checking AC.
I've noticed one so far
"The Administrative Package Changes should only show if at least one applicable update has been entered"
Section is showing even when empty. Will comment if I find others
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Based on AC 5.b, I think you should drop the timezone annotation on each activity title.
So the GMT -5 bit.
Personally I don't mind it. If you feel it's helpful, we can see about AC variance. As is though, I think the AC is specifying it not be present.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
AC 5.d: "The default expansion state of the most recent item is expanded, all other items default to collapsed."
I'm seeing everything collapsed by default.
Official guidance is to remove the GMT -X bit. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@pkim-gswell It looks like the fixes are in, and this all looks great.
🎉 This PR is included in version 1.5.0-val.1 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
Purpose
This ticket is part of the FE piece to the Package Activity + Admin Package changelog epic.
The initial Package Activity and Admin Package section views were started in the previous ticket.
Included in this PR are the multi-attachment "download all" functionality.
Linked Issues to Close
https://qmacbis.atlassian.net/browse/OY2-26082
Approach
In the initial planning phase, I identified two possible solution paths for download all.
getAttachments
endpoint and installing external dependencies to enable the FE for zipping.I went with the latter approach. With our existing systems, FE dedicated responsibility was more practical and required less additional code.
new dependencies added:
Assorted Notes/Considerations/Learning
List any other information that you think is important... a post-merge activity, someone to notify, what you learned, etc.