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

Adapt to NC 28 #190

Merged
merged 1 commit into from Mar 10, 2024
Merged

Adapt to NC 28 #190

merged 1 commit into from Mar 10, 2024

Conversation

artonge
Copy link

@artonge artonge commented Dec 7, 2023

The Files API changed a bit in NC v28.

Here are the changes:

  • Use vite to bundle the front-end files. Needed as the new API is available thought the @nextcloud/files package.
  • Declare jszip as a dependency in mindmap.js so it is automatically added to the bundle
  • Drop usage of setViewerMode as we do not have any equivalent
  • Switch from addAndFetchFileInfo to axios + emit to refresh the file list when the viewer is closed.
  • Use the new "file action" API from @nextcloud/files (registerFileAction and FileAction)
  • Use the new "new file menu" API from @nextcloud/files (addNewFileMenuEntry)

Drawback, the app is only compatible with 28. I guess we could make it compatible with previous versions by keeping both API.

Fix #191

@artonge artonge force-pushed the artonge/adapt_to_28 branch 3 times, most recently from 51e0487 to 99fd0d2 Compare December 11, 2023 15:48
@artonge artonge changed the title WIP Adapt to NC 28 Dec 11, 2023
@artonge artonge force-pushed the artonge/adapt_to_28 branch 3 times, most recently from 6827640 to 99d3d7f Compare December 11, 2023 15:56
src/mindmap.js Outdated Show resolved Hide resolved
src/mindmap.js Outdated Show resolved Hide resolved
src/mindmap.js Outdated Show resolved Hide resolved
src/mindmap.js Show resolved Hide resolved
src/mindmap.js Outdated Show resolved Hide resolved
@artonge artonge force-pushed the artonge/adapt_to_28 branch 2 times, most recently from 5a7cd0e to 895d7da Compare December 12, 2023 12:03
@artonge artonge marked this pull request as ready for review December 21, 2023 10:34
@artonge
Copy link
Author

artonge commented Dec 21, 2023

@ACTom The PR is ready, let me know what you think :)

Makefile Outdated Show resolved Hide resolved
@artonge artonge force-pushed the artonge/adapt_to_28 branch 2 times, most recently from 9dd879b to dea164d Compare January 10, 2024 16:23
@artonge
Copy link
Author

artonge commented Jan 10, 2024

@ACTom can you merge the PR?

@iYongHsu
Copy link

@artonge Hello, I pulled your Git branch, compiled it, and when I try to open the km file in Nextcloud, it prompts 'An internal server error occurred.

@artonge
Copy link
Author

artonge commented Jan 11, 2024

when I try to open the km file in Nextcloud, it prompts 'An internal server error occurred.

Can you share more information about the error?

@ACC-SEU
Copy link

ACC-SEU commented Jan 11, 2024

Excuse me, but I'm not an expert in developing web apps. Could you provide some information about how to build this?

I used the Makefile to pack the revised code and put it in the nextcloud/apps/ dir, but nothing happens.

Tips for those who are struggling with this app:
I found an extension in vscode: vscode-mindmap
This extension supports the .km file, and I'm currently using it as a replacement.

@artonge
Copy link
Author

artonge commented Jan 11, 2024

Let's keep the comments about the content of the pull request and not about how to install it :).
If you need help, the Nextcloud forum is the right place.

@iYongHsu
Copy link

when I try to open the km file in Nextcloud, it prompts 'An internal server error occurred.

Can you share more information about the error?

GET /apps/files_mindmap/ajax/loadfile?filename=%2FDocuments%2FNew%20mindmap.km&dir=%2FDocuments 400

@admorgan
Copy link

I also pulled the branch and ran make. Copied the executable to my server. I didn't get an error, just didn't get nextcloud to give me the option to create a new mindmap nor open the existing .km files on my server.

@gmag11
Copy link

gmag11 commented Jan 21, 2024

@artonge Hello, I pulled your Git branch, compiled it, and when I try to open the km file in Nextcloud, it prompts 'An internal server error occurred.

I have the same issue. When the file is in root folder it works fine. But if file is in any folder it gives 'An internal server error occurred'.

Creating a new mind map works in any folder. You can edit and save action is fine. When you try to open it, error happens when not in root folder.

Signed-off-by: Louis Chemineau <louis@chmn.me>
@artonge
Copy link
Author

artonge commented Jan 24, 2024

Creating a new mind map works in any folder. You can edit and save action is fine. When you try to open it, error happens when not in root folder.

Thanks for the feedback, the issue is addressed now :)

@Weredime
Copy link

@ACTom can you merge the PR?

Seems that as if @ACTom is inactive now

@ernolf
Copy link

ernolf commented Jan 30, 2024

For me it works without any errors. I can create-, edit- and open .km files in any folder.
Only remaining issue: Shared .km files don't open but only offer download.

node: 'v21.6.1', npm: '10.2.4'
Nextcloud 28.0.2 RC5

ernolf

@artonge
Copy link
Author

artonge commented Jan 30, 2024

Only remaining issue: Shared .km files don't open but only offer download.

Was it the case before?

@michauk
Copy link

michauk commented Jan 30, 2024

For me it works without any errors. I can create-, edit- and open .km files in any folder. Only remaining issue: Shared .km files don't open but only offer download.

node: 'v21.6.1', npm: '10.2.4' Nextcloud 28.0.2 RC5

ernolf

OK, I only have 2 shared .km files. That must be why I can't open them. I don't have the button to create a new one, either.
I copied one the shared file I have, can't open.
I tried with the code from the forked repo
I'm a bit lost.
I "git archived" the artonge/adapt_to_28 branch. Maybe I did something wrong with my git commands (I'm not totally a "git" guy)

@artonge : before that, in NC27, yes, shared km were working. I only have shared mindmap files.

Regards

@maurerle
Copy link

I can confirm that this works well.

I give some more instructions for @michauk (though it won't help you as shared mindmap files are still broken)

First uninstall files_mindmap in nextcloud.

git clone https://github.com/nextcloud-gmbh/files_mindmap
cd files_mindmap
git checkout artonge/adapt_to_28
make

This runs npm and takes a while.
Now copy build/files_mindmap-0.0.30.tar.gz to your server and extract it.

tar xvf files_mindmap-0.0.30.tar.gz nextcloud/custom_apps
# eventually adjust permissions to the same user as the other custom apps have:
chown -R 82:82 nextcloud/custom_apps

The tar.gz is about 60MB large - which is quite heavy.

Now you can activate the app in the UI and have it working :)

@ernolf
Copy link

ernolf commented Jan 30, 2024

Was it the case before?

Yes absolutely. Example from a Nextcloud 27.1.6 Server: https://global-social.net/s/php-updater-mindmap

@ernolf
Copy link

ernolf commented Jan 30, 2024

I'm a bit lost.

You can try my build: https://help.nextcloud.com/t/nc28-mindmap-km-files-not-working/176809/11?u=ernolf

@rodinux
Copy link

rodinux commented Feb 5, 2024

I'm a bit lost.

You can try my build: https://help.nextcloud.com/t/nc28-mindmap-km-files-not-working/176809/11?u=ernolf

Thank you @ernolf , it works like a charm for me, also after upgrading to 28.0.2. I just upload your build, do a tar xvf files_mindmap-0.0.30.190.tar.gz, rename the folder files_mindmap, give him the correct permissions chown -R nextcloud: files_permissions, and place in the folder apps/ and activate it...

Why is it so long to accept the fix on the stable branch ??

Well, there is just something missing, I can't choose the name of the file when creating it, it is always New mindmap.km, If I create new one New mindmap(1).km. But I can rename them on the Files page and it still open them...

@ernolf
Copy link

ernolf commented Feb 10, 2024

Only remaining issue: Shared .km files don't open but only offer download.

Was it the case before?

@artonge : do you have a clue how to fix that?

@artonge
Copy link
Author

artonge commented Feb 12, 2024

@artonge : do you have a clue how to fix that?

The public page uses the legacy file list. So we need to restore the previous way file actions are registered to be compatible with both legacy and post 28 files API. Same thing for the "new file menu" I guess. This will also bring the benefit to keep the compatibility with previous versions of Nextcloud.

@nursoda
Copy link

nursoda commented Feb 18, 2024

@ernolf Thanks for building. Please consider removing "src node_modules package* vite*" from the package ;)

@Mer0me
Copy link

Mer0me commented Mar 3, 2024

I've installed the patch, thanks to @ernolf build. Now waiting for a working solution for shared mind map. Is somebody working on it ?

@msvp
Copy link

msvp commented Mar 4, 2024

Same for me, waiting for a working solution for shared mind map !
But i am just a user, can't help for programming anything...

@ACTom ACTom changed the base branch from master to dev March 10, 2024 13:14
@ACTom ACTom merged commit 954e72c into ACTom:dev Mar 10, 2024
@msvp
Copy link

msvp commented Mar 26, 2024

Hello Every one !
No new solution for share a mindmap ?
Please help !
Many thanks !

@micker
Copy link

micker commented May 6, 2024

hello i have same problem, no possibility share it (with edition)

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.

NC 28 compatibility