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

Create archive page #58

Merged
merged 41 commits into from
Jun 15, 2020
Merged

Create archive page #58

merged 41 commits into from
Jun 15, 2020

Conversation

kungpaogao
Copy link
Member

@kungpaogao kungpaogao commented Jun 7, 2020

Summary

This pull request implements the archive page and abstracts a lot of the existing code base. The archive is basically the same as the inventory, so most of this PR is aimed at maximizing reuse of code (mainly in components, network, store).

  1. Abstracted components
  • views/Archive.vue + routes - the new page
  • components/FurnitureTable.vue - data table and edit card dialog
  • components/FurnitureTableHeader.vue - header and search
  • components/ViewActionGroup.vue - creates buttons, tooltips, and menus for each view action; replaces InventoryActions.vue (improves Inventory View - actions #5)
    • data/ViewAction.ts - new type for view actions (e.g., table actions and edit card actions)
  1. Abstracted network/Firestore calls
  • network/firestore-service.ts - extended in inventory-service and archive-service
  • added calls to archive and unarchive items (completes an action in Inventory View - actions #5)
  1. Abstracted Vuex store modules
  • store/collection/* - abstracted version of the previous inventory module
    • implements createCollectionModule(collection: collections) factory function
  • more extensive typing for Vuex stores
  • added actions to archive and unarchive items - calls inventory-service and archive-service, respectively

This is a massive PR, and I should've broken it down more (i.e., handle Vuex abstractions in a separate PR).

Test Plan

image

Play around with the preview link.

Breaking Changes

Next Steps

  • add functions to the actions in the edit card dialog
  • abstract export function to handle archive collection in Firestore - @rayrayweng is doing this

kungpaogao and others added 30 commits May 28, 2020 01:50
- is the layout from Inventory
- allows for reuse in similar pages (e.g., archive)
- archive uses FurnitureTable
- no data currently
- editing and exporting need to be reimplemented
- made Firestore service into a class
- class tied to collection
- created inventory and archive variants
- backwards compatible!
- clear current when setting new current instead of when closing
- allows caller to pass in collection
- collection used to generate service
- allows actions to be decoupled
- actions in Inventory and Archive will be different
- takes actions as a prop
- EditCard stores actions and creates ViewActionGroup
- can set disabledMessage, which is displayed as tooltip
- added naive loading - only works for downloading
- changed to arrow functions so that `this` is lexically bound
- fixes bug where `this.collection` can't be accessed
- gets the document
- deletes it from inventory
- adds it to archive
- archives selected items
- calls InventoryService.archiveItem
- clears selected
- might add action types later
- working towards making Vuex less verbose
- trying to abstract the current model to be modular and reusable
- abstracted inventory into a "collection" module
- inventory, archive now separate Vuex modules
- createCollectionModule() is Vuex module factory function
- added back types... wups
- added more types
- fixed Vuex calls from Inventory and Archive
- rip
- superseded by collection modules
…tem categories

Update cloud function to take in extra parameter to incorporate exportation from other categories besides inventory
- create module using new moduleActions parameter
- fixed some code in inventory service to match
@kungpaogao kungpaogao added feature New feature or request code Code fixes and improvements labels Jun 7, 2020
@kungpaogao kungpaogao added this to the MVP milestone Jun 7, 2020
@kungpaogao kungpaogao self-assigned this Jun 7, 2020
@github-actions
Copy link

github-actions bot commented Jun 7, 2020

Update export spreadsheet to allow for greater flexibility with what page to export from
@github-actions
Copy link

@github-actions
Copy link

@github-actions
Copy link

@github-actions
Copy link

@kungpaogao kungpaogao merged commit fd86fec into master Jun 15, 2020
@kungpaogao kungpaogao deleted the kungpaogao/create-archive branch June 15, 2020 18:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
code Code fixes and improvements feature New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants