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

i can't modify plugin sample #10

Open
luca-moscatelli opened this issue Apr 22, 2024 · 4 comments
Open

i can't modify plugin sample #10

luca-moscatelli opened this issue Apr 22, 2024 · 4 comments

Comments

@luca-moscatelli
Copy link

luca-moscatelli commented Apr 22, 2024

i followed the guide to modify the plugin in develop but the plugin dosen't appear in the map i use yarn gulp dev and yarn watch the two command works but on the port 3001 i can't see the plugin i don't kwon if i do something wrong

@na9da
Copy link
Collaborator

na9da commented Apr 22, 2024

Hi @luca-moscatelli, thank you for reporting the issue.

Could you let me know which platform you are testing this on - Windows or Linux or maxOS ?

On Windows we have a few known issues, we are readying a new release over the next week which will hopefull fix and improve a few things.

@luca-moscatelli
Copy link
Author

i'm on windows 10, im also trying to implement an auth system with Auth0, in your opinion what is the best way to implemented ? it is possible change the view of data in catalog item with auth permission with a ad-hoc plugin ? also the plugin It works if it's installed via node-modules (yarn add -W 'terriajs-plugin-sample') only if packages is empty and not contain plugin-samples but this way i can't develop the plugin.

@luca-moscatelli
Copy link
Author

i have this error in packages/plugin-sample after yarn watch : : https://rollupjs.org/guide/en/#warning-treating-module-as-external-dependency assets/icons/cube.svg (imported by src/index.ts, src/Views/Main.tsx) [!] Error: The keyword 'interface' is reserved (Note that you need plugins to import files that are not JavaScript) ../../node_modules/terriajs/lib/Models/HasLocalData.ts (1:0) 1: interface HasLocalData { ^ 2: hasLocalData: boolean; 3: setFileInput(file: File): void; Error: The keyword 'interface' is reserved (Note that you need plugins to import files that are not JavaScript) at error (C:\Users\LucaMoscatelli\progetti\TerriaMap\node_modules\rollup\dist\shared\rollup.js:198:30) at Module.error (C:\Users\LucaMoscatelli\progetti\TerriaMap\node_modules\rollup\dist\shared\rollup.js:12560:16) at Module.tryParse (C:\Users\LucaMoscatelli\progetti\TerriaMap\node_modules\rollup\dist\shared\rollup.js:12937:25) at Module.setSource (C:\Users\LucaMoscatelli\progetti\TerriaMap\node_modules\rollup\dist\shared\rollup.js:12842:24) at ModuleLoader.addModuleSource (C:\Users\LucaMoscatelli\progetti\TerriaMap\node_modules\rollup\dist\shared\rollup.js:22090:20)

@na9da
Copy link
Collaborator

na9da commented Apr 30, 2024

@luca-moscatelli - Yes, that's the error I was expecting in the current version. We have a PR for a new build system that'll hopefully fix this issue in Windows.

As for implementing OAuth - you can see one approach in https://nsw.digitaltwin.terria.io/ which has a login button at the top that pops a new window where the login happens. On successful login the map is refreshed and the catalog returned by the backend server will include the authenticated items.

This was not implemented as a plugin, the plugin API doesn't yet support features required to do this. Instead this was done by forking and customizing terriamap. A login button can for eg be added using the method described in this doc.

And of course, there are also some custom backend elements to handle the authentication.

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

No branches or pull requests

2 participants