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

Files data card #1279

Merged
merged 22 commits into from
Mar 12, 2021
Merged

Files data card #1279

merged 22 commits into from
Mar 12, 2021

Conversation

ptbrowne
Copy link
Contributor

@ptbrowne ptbrowne commented Mar 10, 2021

  • The permission "io.cozy.files" triggers the showing of this card. This will surely change in the future. A workshop is planned on how to decide whether to display a datacard, see Choose a data card for a konnector #1275
  • Shows the last 5 files imported by the konnector for the account that is shown
  • A click on the file brings the viewer
  • useRealtime is used so that the list of files is updated when the konnector
    imports data
  • This functionality is in testing right now and the flag harvest.datacards.files
    needs to be set

Next steps:

  • Add an animation for new items entering the list. This will make the realtime
    more obvious
  • Repair the "running" button of harvest, right now, after reopening the modal,
    the state is not good
  • Add tests. Since I was in an exploratory phase and since we do not know yet
    if this code will survive, I plan to add tests when the flag is removed.
  • Use bills instead of files, this way we'll have the amount/date of the bill

Those steps will be done in a future PR.
This future is testable on the following adhoc build:

  • git://github.com/cozy/cozy-home.git#build-files-datacard
  • flag('harvest.datacards.files', true)

The file datacard functionality is behind the harvest.datacards.files
flag. This flag activates the file datacard for konnectors that have
permission on io.cozy.files and deactivates the drive card that is
shown for triggers that have message.folder_to_save.

The precise logic on when to show the datacards has not been completely
decided yet. It will surely change in the future.
Otherwise, we have a warning "sort on indexed fields" since at the point
of the sort, the query definition does not have any indexed field
It will be easy to re-add if we need it
The check on client.plugins would return early if the client did not
have the realtime plugin; thus, useEffect was called conditionally.
Now the check for plugins is done inside the useEffect.
Copy link
Contributor

@Crash-- Crash-- left a comment

Choose a reason for hiding this comment

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

It remains to put all the logic of certifications in the viewer directly since we don't redirect to Drive's viewer ^^.

Nice work

packages/cozy-realtime/package.json Outdated Show resolved Hide resolved
packages/cozy-harvest-lib/src/datacards/FileDataCard.jsx Outdated Show resolved Hide resolved
packages/cozy-harvest-lib/src/datacards/FileDataCard.jsx Outdated Show resolved Hide resolved
packages/cozy-harvest-lib/src/datacards/FileDataCard.jsx Outdated Show resolved Hide resolved
packages/cozy-harvest-lib/src/datacards/FileDataCard.jsx Outdated Show resolved Hide resolved
packages/cozy-harvest-lib/package.json Outdated Show resolved Hide resolved
packages/cozy-harvest-lib/src/datacards/FileDataCard.jsx Outdated Show resolved Hide resolved
packages/cozy-harvest-lib/src/datacards/FileDataCard.jsx Outdated Show resolved Hide resolved
@ptbrowne ptbrowne requested a review from Crash-- March 11, 2021 17:29
Copy link
Contributor

@Crash-- Crash-- left a comment

Choose a reason for hiding this comment

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

👏

@ptbrowne ptbrowne merged commit cd9f238 into master Mar 12, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants