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

Migrate apps management to Vue.js #9565

Merged
merged 50 commits into from
Jun 6, 2018
Merged

Conversation

juliusknorr
Copy link
Member

@juliusknorr juliusknorr commented May 23, 2018

This PR will move the apps management to vue, heavily based on the work done by @skjnldsv in #8824

General improvements to the existing feature set:

@skjnldsv
Copy link
Member

Weeeeeeee! Let me know if you need help!
I'll probably move the new components to the repo as soon as I can :)

@juliusknorr juliusknorr force-pushed the feature/noid/app-settings branch from 7a59cf0 to a40d969 Compare May 25, 2018 13:52
@codecov
Copy link

codecov bot commented May 25, 2018

Codecov Report

Merging #9565 into master will decrease coverage by 1.37%.
The diff coverage is 14.45%.

@@             Coverage Diff              @@
##             master    #9565      +/-   ##
============================================
- Coverage     53.34%   51.96%   -1.38%     
- Complexity    24451    25743    +1292     
============================================
  Files          1478     1633     +155     
  Lines         81470    95346   +13876     
  Branches          0     1307    +1307     
============================================
+ Hits          43459    49551    +6092     
- Misses        38011    45795    +7784
Impacted Files Coverage Δ Complexity Δ
settings/js/apps.js 3.44% <ø> (ø) 0 <0> (?)
settings/routes.php 0% <0%> (ø) 0 <0> (ø) ⬇️
lib/private/legacy/app.php 62.36% <0%> (-0.28%) 196 <0> (ø)
lib/private/App/AppManager.php 95.62% <100%> (+0.02%) 61 <0> (ø) ⬇️
settings/Controller/AppSettingsController.php 19.62% <15.09%> (-2.6%) 79 <75> (-10)
.../tests/Unit/Collaboration/CommentersSorterTest.php 25.55% <0%> (-66.45%) 6% <0%> (ø)
apps/sharebymail/tests/SettingsTest.php 52.17% <0%> (-47.83%) 3% <0%> (ø)
lib/private/Security/RateLimiting/Limiter.php 55.55% <0%> (-44.45%) 5% <0%> (ø)
...b/private/App/AppStore/Fetcher/CategoryFetcher.php 69.23% <0%> (-30.77%) 1% <0%> (ø)
...ps/comments/tests/Unit/AppInfo/ApplicationTest.php 69.56% <0%> (-30.44%) 4% <0%> (ø)
... and 348 more


const mutations = {

APPS_API_FAILURE(state, error) {
Copy link
Member

Choose a reason for hiding this comment

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

Any reason not to use the global API_Failure?

Copy link
Member Author

Choose a reason for hiding this comment

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

I introduced this because the apps management controller endpoints are no OCS API at the moment, so the regular API_FAILURE will not work. I didn't move them to proper OCS since I wanted to keep backend code changes in the beginning. If nobody protests, i would tackle that in a follow up PR.

Copy link
Member

Choose a reason for hiding this comment

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

Guess who will earn a beer in Berlin if he makes that happen ;) 🍺

Copy link
Member

Choose a reason for hiding this comment

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

SO many beers :D

@juliusknorr juliusknorr force-pushed the feature/noid/app-settings branch 2 times, most recently from 7704564 to 4c27804 Compare May 30, 2018 15:13
@juliusknorr juliusknorr added 3. to review Waiting for reviews and removed 2. developing Work in progress labels Jun 2, 2018
@juliusknorr juliusknorr force-pushed the feature/noid/app-settings branch from e90021c to 1340a58 Compare June 2, 2018 08:17
@juliusknorr
Copy link
Member Author

Ready for review. @nextcloud/designers @nextcloud/javascript

@rullzer
Copy link
Member

rullzer commented Jun 2, 2018

  • If I enable an app. The state is toggled in the sidebar. But not in the main view
  • I like the list overview (with the details). But a lot of the thumbnails in the list are to small to be meaningfull
  • For apps without a screenshot (and rating) the sidebar looks a bit off. Large space between the title and the author etc.

</div>

<p class="documentation">
<a class="appslink" :href="appstoreUrl" v-if="!app.internal" target="_blank" rel="noreferrer noopener">Im Store anzeigen ↗</a>
Copy link
Member

Choose a reason for hiding this comment

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

Lets write that in English ;)
And make it translatatble

Copy link
Member

@ChristophWurst ChristophWurst left a comment

Choose a reason for hiding this comment

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

Good stuff, but quite a big PR to review 🙈

I commented on a few spots that might need polishing.

@@ -37,6 +37,7 @@
use OCP\App\IAppManager;
use OCP\App\ManagerEvent;
use OCP\ICacheFactory;
use OCP\IConfig;
Copy link
Member

Choose a reason for hiding this comment

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

the import on L35 is unused then, I guess 😉

Copy link
Member Author

Choose a reason for hiding this comment

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

Right, removed :)

$this->appConfig->setValue($appId, 'enabled', 'no');

// run uninstall steps
$appData = $this->getAppInfo($appId);
Copy link
Member

Choose a reason for hiding this comment

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

was this removed intentionally?

}

public function getApp(string $appId) {
return $this->apps[$appId];
Copy link
Member

Choose a reason for hiding this comment

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

null checks, e.g. with ?? syntax would be great

return new JSONResponse($this->getAllCategories());
public function listApps(): JSONResponse {

$this->fetchApps();
Copy link
Member

Choose a reason for hiding this comment

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

IMO this class should be split into multiple at some point. There's so much going on here and the code is quite hard to understand for me.

Copy link
Member Author

Choose a reason for hiding this comment

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

Toally with you on that. It will get a lot simpler once those methods are moved to proper OCS endpoints, but I'd do that in a follow up PR as mentioned in #9565 (comment)

@@ -197,6 +197,21 @@ const actions = {
.catch((error) => context.commit('API_FAILURE', error));
},

getGroups(context) { /* { offset, limit, search } */
Copy link
Member

Choose a reason for hiding this comment

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

what do these comments mean?

Copy link
Member

Choose a reason for hiding this comment

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

I think it's a removed ES6 destructuring part of the function that was set aside?

@juliusknorr juliusknorr force-pushed the feature/noid/app-settings branch 2 times, most recently from a5fe179 to 36ce686 Compare June 5, 2018 15:48
@juliusknorr
Copy link
Member Author

If I enable an app. The state is toggled in the sidebar. But not in the main view
@rullzer Cannot reproduce that. Can you provide some steps how and which enable button you have clicked?

I like the list overview (with the details). But a lot of the thumbnails in the list are to small to be meaningfull

I've changed the behavior there, so we always show the app icon in the list view.

All other comments should be fixed.

Copy link
Member

@rullzer rullzer left a comment

Choose a reason for hiding this comment

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

I like it!

Lets get this in. And fix tiny things later if we find them!

@rullzer
Copy link
Member

rullzer commented Jun 5, 2018

CI not happy

Signed-off-by: Julius Härtl <[email protected]>

Move app management ajax code to AppSettingsController

Signed-off-by: Julius Härtl <[email protected]>
@juliusknorr juliusknorr force-pushed the feature/noid/app-settings branch from edece7c to c97d6d5 Compare June 6, 2018 09:44
Signed-off-by: Julius Härtl <[email protected]>
Signed-off-by: Julius Härtl <[email protected]>
@juliusknorr juliusknorr force-pushed the feature/noid/app-settings branch from c97d6d5 to 23ca2a4 Compare June 6, 2018 09:49
Signed-off-by: Julius Härtl <[email protected]>
@juliusknorr
Copy link
Member Author

@rullzer Fixed the CI failures. 😉

Copy link
Member

@MorrisJobke MorrisJobke left a comment

Choose a reason for hiding this comment

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

Tested and works 👍

@skjnldsv
Copy link
Member

skjnldsv commented Jun 6, 2018

🎉 ❤️

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
4. to release Ready to be released and/or waiting for tests to finish enhancement feature: apps management
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants