14 Commits

Author SHA1 Message Date
Remco Burema
71937bf828
DL: Align with online backend on allowed characters.
CURA-8395
2021-07-20 17:58:29 +02:00
Remco Burema
f9557295fa
Allow non-ASCII characters for DL project names.
CURA-8395
2021-07-16 12:39:41 +02:00
Konstantinos Karmas
11d86b98ef Merge branch 'master' into CURA-8112_Inform_the_user_about_their_subscription_limits 2021-07-14 15:52:27 +02:00
Konstantinos Karmas
7027a8f904 Fix mypy complaint again
Mypy doesn't recognize that the check for `None` has happened before calling the `callbackWrap` (before the get request has been made).

CURA-8112
2021-07-14 13:08:51 +02:00
Konstantinos Karmas
300176cdc6 Check for the maximum **private** projects
When checking whether the user is allowed to create a new library project, we need to retrieve the **private** (aka non-shared) projects that are linked to the user's account. If the user has reached the maximum private projects, then they are no longer allowed to create new ones.

**Note**: We need to set the `pagination_manager` to `None` when doing this get request, or else the next/previous links of the pagination will become mixed up with the pagination links of the list of projects shown to the user, corrupting them and creating the wrong "get more projects" link.

CURA-8112
2021-07-14 13:03:03 +02:00
Konstantinos Karmas
2961d20c04 Fix mypy complaint
CURA-8112
2021-07-13 17:38:15 +02:00
Konstantinos Karmas
2d45b8c2cd Show an "Upgrade plan" button to users that have reached maximum projects
Instead of letting users go through the project creation process only to get rejected with a "subscription limits reached" message, now the "New Library project" button is being replaced with an "Upgrade plan" button when the maximum allowed projects have been reached for the specific amount. The button is accompanied by a tooltip that explains the situation to the user. Once clicked, the user is redirected to the subscriptions page.

CURA-8112
2021-07-13 17:28:38 +02:00
Ghostkeeper
02932a1f62
Add filter to API call for project list
This passes the filter on to the API call and causes the API call, so that we only get the projects that the user searched for.

Contributes to issue CURA-8009.
2021-07-12 18:43:15 +02:00
Remco Burema
85f98bdaff
Appease type-checking system even further.
That last one should have worked really.

part of CURA-8138
2021-07-09 21:36:20 +02:00
Remco Burema
6f99837db5
Fix typing.
part of CURA-8138
2021-07-09 21:17:33 +02:00
Remco Burema
c78618bc15
Digital Library: Allow 'personal users' to DL.
Users with an account and an UM printer should have some basic access to the Digital Library. To this end, and to remain future proof, the online team has made an extension to its API so now feature budgets can be gauge. At the moment it's only checked wether the user has any access to personal projects at all. If so, the interface shows Digital Library functionality. Known issue: Removing the last printer from DF while still logged in leaves the DL access in the Cura interface until logged out or Cura restarted. Additionally, I think the response for a logged in user without any printer from the API is just 'data = empty list' instead of everything set to False and 0 (which should be the case as they're all listed as required fields in their docs ... maybe I'm missing something). In any case, the code as is now can handle that as well.

CURA-8138
2021-07-09 21:06:49 +02:00
Kostas Karmas
86bfb3a5aa Fix incompatible mypy type 2021-04-22 15:08:07 +02:00
Kostas Karmas
bc408a5a67 Fix mypy issues with the DigitalLibrary plugin 2021-04-22 15:00:42 +02:00
Kostas Karmas
d972c505d0 Initial commit for the DL 2021-04-20 11:30:49 +02:00