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

fix: Make working back button for a file at another Cozy #2999

Merged
merged 4 commits into from
Oct 9, 2023

Conversation

cballevre
Copy link
Contributor

@cballevre cballevre commented Oct 6, 2023

### 🐛 Bug Fixes

* Make working back button for a file at another Cozy

Context:
Historically, we were going backwards in the browser's history for 3 reasons:

  • We cannot use the relative route because it is not a sub-route of where the user is coming from
  • The OnlyOffice shared file opens in the owner's cozy, to return you must reopen the previous cozy
  • The creation process has redirect process that we need to avoid if we don't want to fall into an endless lopp

Why did we decide to use redirectLink instead of jumping to the browser history?

  • It doesn't matter how many steps before if you have redirect link you can bring the user back to the starting point
  • It's a lot more predictable where the user will end up

To get around the problem of whether or not the url is shared in the search parameters, we use the /permission/self request in the stack as it is included with who the file is shared with. Each person in a share has a unique link, so there is only one person included.

@cballevre cballevre force-pushed the feat/office-back-with-redirect-link branch from de466c9 to dda671b Compare October 9, 2023 07:27
@bundlemon
Copy link

bundlemon bot commented Oct 9, 2023

BundleMon

Files updated (5)
Status Path Size Limits
drive/public/drive.(hash).js
1.59MB (+58.39KB +3.73%) 1.65MB
drive/vendors/drive.(hash).js
1.36MB (+55.33KB +4.15%) 1.6MB
drive/intents/drive.(hash).js
162.42KB (+3.07KB +1.93%) 171KB
drive/app/drive.(hash).js
269.65KB (+1.52KB +0.57%) 280KB
drive/services/qualificationMigration/drive.j
s
249.66KB (+12B 0%) 500KB
Unchanged files (14)
Status Path Size Limits
drive/public/pdf.worker.entry.(hash).worker.j
s
343.37KB 345KB
drive/services/dacc/drive.js
254.52KB 500KB
drive/public/cozy-client-js.js
158.97KB 160KB
drive/public/drive.(hash).min.css
92.6KB 100KB
drive/app-drive.(hash).min.css
55.72KB 56KB
drive/intents-drive.(hash).min.css
37.06KB 40KB
drive/onlyOffice/slide.pptx
24.82KB 25KB
drive/onlyOffice/text.docx
5.84KB 6KB
drive/onlyOffice/spreadsheet.xlsx
5.01KB 6KB
drive/manifest.webapp
1.77KB 2KB
drive/index.html
529B 1KB
drive/intents/index.html
515B 1KB
drive/img/app-icon.(hash).svg
419B 1KB
drive/manifest.json
184B 1KB

Total files change +118.32KB +2.6%

Groups updated (5)
Status Path Size Limits
drive/public/**
2.18MB (+58.39KB +2.69%) +7%
drive/vendors/**
1.36MB (+55.33KB +4.15%) +6%
drive/intents/**
162.92KB (+3.07KB +1.92%) +6%
drive/app/**
269.65KB (+1.52KB +0.57%) +10%
drive/services/**
504.18KB (+20B 0%) +1%
Unchanged groups (3)
Status Path Size Limits
drive/screenshots/**
2.13MB +0.4%
drive/onlyOffice/**
35.68KB +0.4%
drive/img/**
419B +0.4%

Final result: ✅

View report in BundleMon website ➡️


Current branch size history | Target branch size history

Copy link
Contributor

Choose a reason for hiding this comment

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

Why this change? Can we add a bit more of context please?

return (
<IconButton
data-testid="onlyoffice-backButton"
className="u-ml-half-s"
onClick={onClick}
size="medium"
aria-label={t('button.back')}
Copy link
Contributor

Choose a reason for hiding this comment

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

<3

@cballevre cballevre merged commit c3b57b5 into master Oct 9, 2023
3 checks passed
@cballevre cballevre deleted the feat/office-back-with-redirect-link branch October 9, 2023 08:14
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