152 Commits

Author SHA1 Message Date
Ghostkeeper
cc82ff97a7
Merge branch 'CURA-8112_Inform_the_user_about_their_subscription_limits' 2021-07-16 10:04:43 +02:00
Konstantinos Karmas
82c189327d Change link of "Upgrade plan" button
CURA-8112
2021-07-15 16:36:49 +02:00
Jaime van Kessel
e9ecba1374
Remove bindingloop in project selector 2021-07-14 16:03:06 +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
fd322c0512 Fix having no "load more projects" available when using the search
When the `_onGetProjectsFirstPageFinished` is reached, the pagination manager already contains the correct pagination metadata and links, so calling `clear()` there resets them giving the impression that there is no next page.

This commit fixed that by calling the `clear()` function should when the search filter is applied, instead.

CURA-8009
2021-07-14 15:32:57 +02:00
Konstantinos Karmas
016371d771 Add the external link icon to the Upgrade plan button
CURA-8112
2021-07-14 14:34:00 +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
3dbbe7276b Remove check for account subscriptions
Since the variable `self._user_has_access` already contains the information on whether the user can access the Digital Library.

CURA-8112
2021-07-14 12:55:28 +02:00
Konstantinos Karmas
2961d20c04 Fix mypy complaint
CURA-8112
2021-07-13 17:38:15 +02:00
Konstantinos Karmas
f643f19af6 Fix tooltip not shown when the tooltip text is too long
When the tooltip text is too long and the tooltip width ends up being longer than the window it is supposed to be drawn into, the tooltip is not drawn at all. This commit fixed that by allowing the tooltip width of the ActionButton to be changed within QML, limiting it to a certain size that fits the purpose.

CURA-8112
2021-07-13 17:30:30 +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
Jaime van Kessel
888f62a9ea
Add missing typing
CURA-8009
2021-07-13 16:55:28 +02:00
Konstantinos Karmas
9d8286d90c Set the correct initial value in the feature budget attributes
They were defined as `Optional[int]` but started with the default value as `False`.

CURA-8112
2021-07-13 16:52:36 +02:00
Ghostkeeper
7f2e951b9c
Update tests to test filter too
Contributes to issue CURA-8009.
2021-07-13 16:24:21 +02:00
Ghostkeeper
72eb839d07
Add missing search filter parameter to refresh query
Thank you, automated tests.

Contributes to issue CURA-8009.
2021-07-13 16:18:36 +02:00
Ghostkeeper
eb2a315e42
Specify spacing between search bar and button
Instead of using the default of 5 pixels, we should use this element from the theme to match the margin around the page.

Contributes to issue CURA-8009.
2021-07-13 16:09:02 +02:00
Ghostkeeper
7fdf1dbdd4
Fix height of search bar
Because this item is in a layout, the height gets overridden. We should use the preferredHeight, or the one it defaults to, implicitHeight.

Contributes to issue CURA-8009.
2021-07-13 16:02:29 +02:00
Ghostkeeper
bec83920e4
Keep showing search icon while typing search query
This adds an option to the TextField element to show an icon on the left side in the text field. The icon remains visible when the user types in something (it's not part of the placeholder string).
Then we use that optional icon for the search bar in the Digital Library.

Contributes to issue CURA-8009.
2021-07-13 15:47:21 +02:00
Ghostkeeper
1566a282dc
Replace text and image if there's no projects due to search
It's a bit weird if it shows that you didn't add any projects yet if you just type in a gibberish search keyword.

Contributes to issue CURA-8009.
2021-07-13 15:16:09 +02:00
Ghostkeeper
13ca30ed98
Stylise search bar
This is the standard style for text fields in Cura. The spacing around the search icon is customised with the best approximation I could get using a simple string of placeholderText.

Contributes to issue CURA-8009.
2021-07-13 14:40:04 +02:00
Ghostkeeper
1269c28d0a
Reduce wait time before sending query
Most people should be able to type 5 characters per second. And those that can't will just have to see it refresh after every stroke.

Contributes to issue CURA-8009.
2021-07-12 18:46:54 +02:00
Ghostkeeper
94e229aa44
Clear list of projects every time we load the first page
Otherwise when we refresh the project list after searching it would put the new results at the end. That's not what we want.

Contributes to issue CURA-8009.
2021-07-12 18:44:11 +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
Ghostkeeper
65f7eb5ea8
Add function to update search filter when the user types
Seems to work fine.
The pyqtSignal is not technically necessary unless we display this filter in the interface anywhere. We don't currently. If the signal is not present it would complain about non-notifyable properties. And making it a slot instead of a signal seems a bit unintuitive to me in how the field is being used.

Contributes to issue CURA-8009.
2021-07-12 17:41:10 +02:00
Ghostkeeper
22826bc4d8
Add text field in a layout for search
The text field is not stylised yet, so far. Will do, but let's first make it functional.

Contributes to issue CURA-8009.
2021-07-12 17:16:16 +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
Ghostkeeper
5252d53187
Merge branch '4.10' 2021-06-17 12:07:25 +02:00
Remco Burema
8aa071056b
Now unused API field only took integers originally.
We want to keep it this way so people can still make plugins work for older versions of Cura, like 3.6, where the 'api' field with just a single major version, instead of the 'supported_sdk_versions', which can be either a version-string like '7.6.0' or a list of version strings.
2021-06-17 11:15:33 +02:00
Ghostkeeper
92ff9ac313
Merge branch '4.10' 2021-06-16 16:45:51 +02:00
Remco Burema
04002056ae
Update SDK/API from 7.5.0 to 7.6.0 for 4.10
CURA-8320
2021-06-15 16:08:07 +02:00
Remco Burema
9d951fbe10
Merge pull request #9724 from Ultimaker/CURA-8141_Double_click_to_open_digital_library_files
CURA-8141: Immediately open a digital library file after double clicking on it
2021-06-08 16:22:57 +02:00
Jaime van Kessel
45f8f3ba3c
Remove some code duplication in DF image filtering
CURA-8233
2021-05-18 15:52:06 +02:00
Jaime van Kessel
3018485077
Remove stray debug code
CURA-8233

Co-authored-by: Konstantinos Karmas <konskarm@gmail.com>
2021-05-17 15:24:46 +02:00
Jaime van Kessel
2a304ce90a
Filter images from DF open screen
CURA-8233
2021-05-17 14:12:46 +02:00
Jaime van Kessel
2d396a81c5
Remove unneeded pycapsule imports 2021-05-10 16:53:16 +02:00
Jaime van Kessel
0b1bbd8528
Remove unused variable
CURA-7959
2021-05-05 09:54:45 +02:00
Jaime van Kessel
49cd43e5d5
Rename variable in test
CURA-7959
2021-05-05 09:53:00 +02:00
Jaime van Kessel
5700e44914
Apply suggestions from code review
CURA-7959

Co-authored-by: Ghostkeeper <Ghostkeeper@users.noreply.github.com>
2021-05-05 09:32:59 +02:00
Kostas Karmas
1a3474ff09 Immediately open a digital library file after double clicking on it
CURA-8141
2021-04-29 16:35:32 +02:00
Jaime van Kessel
6dd62f9024
Add tests for DFFileModel
CURA-7959
2021-04-26 14:34:30 +02:00
Jaime van Kessel
29f62b0579
Add some tests for DFProjectModel
CURA-7959
2021-04-26 14:08:10 +02:00
Jaime van Kessel
7979483e48
Seperate the init of jobs and starting
This makes it a lot easier to test them

CURA-7959
2021-04-26 13:47:40 +02:00
Jaime van Kessel
cf8113608f
Add simple test for extracting error title
CURA-7959
2021-04-26 11:38:59 +02:00
Jaime van Kessel
32ec72a28c
Add first stubs for DF
CURA-7959
2021-04-26 10:55:32 +02:00
Kostas Karmas
8f46a51ff2 Remove commented out code 2021-04-22 15:16:46 +02:00
Kostas Karmas
c67b4ee3a0 Remove unused function 2021-04-22 15:08:47 +02:00
Kostas Karmas
86bfb3a5aa Fix incompatible mypy type 2021-04-22 15:08:07 +02:00