Skip to content

fix(files): do not load legacy files app js - #40065

Merged
skjnldsv merged 3 commits into
masterfrom
bugfix/files/navigation-api
Sep 27, 2023
Merged

fix(files): do not load legacy files app js#40065
skjnldsv merged 3 commits into
masterfrom
bugfix/files/navigation-api

Conversation

@max-nextcloud

Copy link
Copy Markdown
Contributor

OCP.Files.Navigation is undefined.

cypress-screenshot

Checklist

  • Code is properly formatted
  • Sign-off message is added to all commits
  • Tests are fixed by this
  • Screenshot of test failurs
  • Documentation is not required
  • Backports are not required

@skjnldsv

skjnldsv commented Aug 27, 2023

Copy link
Copy Markdown
Member

Where is legacy files still loaded?
Those scripts should not even be present in the page anymore :)

@max-nextcloud
max-nextcloudforce-pushed the bugfix/files/navigation-api branch from 58ab539 to e43a2abCompareAugust 27, 2023 10:19
@max-nextcloud

Copy link
Copy Markdown
ContributorAuthor

uh... interesting - i will investigate.

@max-nextcloud

Copy link
Copy Markdown
ContributorAuthor

Loaded directly from the html inside the cypress tests. I will see if it also loads without cypress...

grafik

@max-nextcloud

Copy link
Copy Markdown
ContributorAuthor

It's served with the initial template when loading apps/files:
grafik

@skjnldsv

skjnldsv commented Aug 27, 2023

Copy link
Copy Markdown
Member

Ah, found
This ain't supposed to still be there

OCA.Files.App.initialize();

EDIT: but it might still be used in public mode 🤔

@skjnldsv

skjnldsv commented Aug 27, 2023

Copy link
Copy Markdown
Member

It's a multi step, but requires a bit more:

  • Do not load the files merged js
  • Remove systemtagsfilelist js
  • Fix Sidebar to not rely on OCA.Files.App.fileList.filesClient
    // TODO: create new parser or use cdav-lib when available
    constfile=OCA.Files.App.fileList.filesClient._client.parseMultiStatus(response.data)
    // TODO: create new parser or use cdav-lib when available
    constfileInfo=OCA.Files.App.fileList.filesClient._parseFileInfo(file[0])

Then it should be good, public pages seems to still work, I gues they load their own minimal stuff

@max-nextcloud

This comment was marked as outdated.

@skjnldsv

Copy link
Copy Markdown
Member

if we don't include the file, dropping the initialize will not matter.
I think we can keep those files here until #39914 is complete and we do a cleanup pass

@max-nextcloud
max-nextcloudforce-pushed the bugfix/files/navigation-api branch from e43a2ab to ae66c40CompareAugust 27, 2023 12:31
@max-nextcloud

Copy link
Copy Markdown
ContributorAuthor

I think I got it... or at least some intermediate state.

Circles is missing the filesList though:
grafik

@max-nextcloudmax-nextcloud changed the title fix(files): use window._nc_navigation in legacy filefix(files): do not load legacy files app jsAug 27, 2023
@skjnldsv

Copy link
Copy Markdown
Member

Circles is missing the filesList though:

Circles is not upgraded for 28 though 🤔
I think that's a different topic anyway

// Load the files we need
\OCP\Util::addStyle('files', 'merged');
\OCP\Util::addScript('files', 'merged-index', 'files');
\OCP\Util::addScript('files', 'fileactions');

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

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

without the fileactions import files won't open anymore in the viewer. So I guess we still need it.

@skjnldsv - what do you think?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Tried latest Viewer?
We don't use the old fileactions ?

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

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

Yes... latest viewer, disabled contacts app which was causing errors and early return from circles app so it does not interfere. Still .md.pdf and .jpgs have no view action and clicking files triggers a download. Did not try other file types.

@max-nextcloud
max-nextcloudforce-pushed the bugfix/files/navigation-api branch from bf8d915 to e17a725CompareAugust 27, 2023 14:56
max-nextcloud added a commit to nextcloud/text that referenced this pull request Aug 27, 2023
max-nextcloud added a commit to nextcloud/text that referenced this pull request Aug 27, 2023
@skjnldsv

Copy link
Copy Markdown
Member

Is it still relevant?

@max-nextcloud
max-nextcloudforce-pushed the bugfix/files/navigation-api branch from e17a725 to c7c331bCompareSeptember 25, 2023 17:24
@max-nextcloud

Copy link
Copy Markdown
ContributorAuthor

Is it still relevant?

I think so. Cleaned it up and the main thing now is not to addScript('files', 'merged-index', 'files');.

@skjnldsv
skjnldsv requested review from a team, susnux and szaimen and removed request for a teamSeptember 26, 2023 11:42
@skjnldsvskjnldsv added 3. to review Waiting for reviews and removed 2. developing Work in progress labels Sep 26, 2023
@skjnldsvskjnldsv added this to the Nextcloud 28 milestone Sep 26, 2023
Signed-off-by: Max <max@nextcloud.com>
`OCA.Files.App.fileList` is not initiated anymore.
Signed-off-by: Max <max@nextcloud.com>
@max-nextcloud
max-nextcloudforce-pushed the bugfix/files/navigation-api branch from c7c331b to 27bcef7CompareSeptember 26, 2023 19:37
@max-nextcloud

Copy link
Copy Markdown
ContributorAuthor

/compile

Signed-off-by: nextcloud-command <nextcloud-command@users.noreply.github.com>
@skjnldsv
skjnldsv merged commit 5dcefad into masterSep 27, 2023
@skjnldsv
skjnldsv deleted the bugfix/files/navigation-api branch September 27, 2023 06:33
@skjnldsvskjnldsv added 4. to release Ready to be released and/or waiting for tests to finish and removed 3. to review Waiting for reviews labels Sep 27, 2023
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

4. to releaseReady to be released and/or waiting for tests to finishbugfeature: files

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

4 participants

@max-nextcloud@skjnldsv@susnux@nextcloud-command