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

Add initial notice #184

Merged
merged 12 commits into from
Nov 10, 2017
Merged

Add initial notice #184

merged 12 commits into from
Nov 10, 2017

Conversation

felixheidecke
Copy link
Contributor

@felixheidecke felixheidecke commented Nov 2, 2017

bildschirmfoto-2017-11-09-um-18 55 52

Fixes: #179

src/App.vue Outdated
.uk-modal-dialog.uk-margin-auto-vertical
button.uk-modal-close-default(type='button', uk-close)
.uk-modal-header
h2.uk-modal-title Important notice
Copy link
Member

Choose a reason for hiding this comment

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

translation support is missing

Copy link
Contributor

Choose a reason for hiding this comment

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

indeed, and translation support for handlebars is still missing too

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Will be there shortly ;-)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Translation support exists but has not been used in this early state. Will wait for the final text.

src/App.vue Outdated
@@ -7,15 +7,45 @@

main.uk-width-expand
router-view

#scaleout-notice-modal(uk-modal="bg-close : false")

Choose a reason for hiding this comment

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

Please do not use modals. Blank screen on initial market app startup where the user is asked to activate or disable the market app or similar. But no modals.

@DeepDiver1975
Copy link
Member

no idea if this is still needed.

owncloud/core#29458 will introduce an explicit config flag which allows us to find out if owncloud is clustered or not.

Please let me know if you need some api calls (market frontend and market backend) to query for this setting. I could think of adding notification on top of the page which tell the user that installation/uprade is not possible.

installing and upgrading will be disallowed by core

@DeepDiver1975
Copy link
Member

... and disable the install and update buttons

@PVince81
Copy link
Contributor

PVince81 commented Nov 6, 2017

owncloud/core#29458 will be in RC, please adjust this PR accordingly.

You can still display whatever message, but only if said setting is set.

@DeepDiver1975 we could expose the setting over capabilities API ?

@PVince81
Copy link
Contributor

PVince81 commented Nov 6, 2017

Capabilities API results are available by default in the JS array returned by OC.getCapabilities(), synchronously. (loaded at page load)

@hurradieweltgehtunter
Copy link

@felixheidecke could you adapt to @DeepDiver1975 's comment for cluster flag?
ty

@felixheidecke
Copy link
Contributor Author

@felixheidecke could you adapt to @DeepDiver1975 's comment for cluster flag?

@hurradieweltgehtunter Sure I can, but it will stray from the original idea. The message would pop-up every time you open the market app and say something like:

"Since this is a clustered setup, installing and updating apps will not work. Have fun anyway."

If that's okay, I'll need an API route telling me about the setup :-)

@PVince81
Copy link
Contributor

PVince81 commented Nov 7, 2017

@felixheidecke instead of an API route what we could do is to put said code into a separate JS file and only load said file from PHP (include it) whenever the mode is set. But I suspect that this approach is not compatible with webpack / vue JS ?

@felixheidecke
Copy link
Contributor Author

@PVince81 sorry. That won't work in this case :-|

@hurradieweltgehtunter
Copy link

Isn't there a global settings variable or sth else, which is delivered to the frontend and where the cluster flag could be included?
@felixheidecke read this flag and dependent on this enable/disable the whole market app (also in BE) ?

@PVince81
Copy link
Contributor

PVince81 commented Nov 7, 2017

global settings variable

either we need to add it to the capabilities API, then it will be available directly.

else we need to modify the PHP template to inject it through the DOM in a "data-xxx" attribute

@PVince81
Copy link
Contributor

PVince81 commented Nov 7, 2017

else we need to modify the PHP template to inject it through the DOM in a "data-xxx" attribute

would this be acceptable ? else we'll need another core PR to add the flag to the capabilities

@felixheidecke
Copy link
Contributor Author

@PVince81 Would this happen somewhere in the template??

@PVince81
Copy link
Contributor

PVince81 commented Nov 7, 2017

oops, so the template has no DOM elements at all ?

@felixheidecke
Copy link
Contributor Author

Eeeeexactly :-)

@felixheidecke
Copy link
Contributor Author

Feels hacky to use HTML as a vehicle to transport infos from PHP to JS :-/

@PVince81
Copy link
Contributor

PVince81 commented Nov 7, 2017

Feels hacky to use HTML as a vehicle to transport infos from PHP to JS :-/

don't look into core PHP code then...

Ok, looks like the capabilities is the only way. Adding a new endpoint feels like overkill.

Config delivers license state, internet connection state and cluster
mode
@PVince81
Copy link
Contributor

PVince81 commented Nov 7, 2017

I've added/modifed an endpoint as discused with @felixheidecke, see 203a1f6

Http::STATUS_NOT_FOUND
);
$config = [
'canInstall' => ($this->config->getSystemValue('operation.mode', 'single-instance') === 'single-instance'),
Copy link
Member

Choose a reason for hiding this comment

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

no - IAppManager::canInstall() is to be called - or better MarketService::canInstall

Copy link
Contributor

Choose a reason for hiding this comment

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

done

@PVince81
Copy link
Contributor

PVince81 commented Nov 8, 2017

@felixheidecke good point. Looking at the core code for AppManager::canInstall, I see that i also checks writeability of the apps folder. So might need to tweak the message to say "either you're in a clustered env or apps folder is not writeable".

@felixheidecke
Copy link
Contributor Author

Could we supply a message/string alongside that says something like 'cluster setup' or 'apps folder not writable' or whatever?

@PVince81
Copy link
Contributor

PVince81 commented Nov 8, 2017

We can supply a message, but it will imply redoing the same check in the market app to tweak the message. Or we need to adjust core to either return a reason string instead of boolean for canInstall, or another method to check for writeability of apps folder. Not sure which one is the least ugly.

@DeepDiver1975
Copy link
Member

Can we please keep it simple?
Installation/updating is not allowed. Game over.

@DeepDiver1975
Copy link
Member

Please use the marketservice::caninstall

@PVince81
Copy link
Contributor

PVince81 commented Nov 8, 2017

Please use the marketservice::caninstall

Done

@felixheidecke
Copy link
Contributor Author

Installation/updating is not allowed. Game over.

Is this the new message to be displayed? 😁 @pmaier1 @DeepDiver1975

@PVince81
Copy link
Contributor

PVince81 commented Nov 8, 2017

Maybe don't display a warning at all, but grey out the install buttons.

And close the install button, display a message like "App cannot be installed over the web UI either because this is a clustered setup or the web server has no permissions to write to the apps folder".

Now if we consider the separation between OC admin and sysadmin, the OC admin might not need to know about apps folder permissions and a message like "App cannot be installed over the web UI, please check with the system administrator" + link to docs ?

@PVince81
Copy link
Contributor

PVince81 commented Nov 8, 2017

or => "App cannot be installed over the web UI in this setup"

@felixheidecke
Copy link
Contributor Author

If the API is smart enough, it should already send a canInstall: false per app.

@DeepDiver1975
Copy link
Member

If the API is smart enough, it should already send a canInstall: false per app.

what would be possible

@DeepDiver1975
Copy link
Member

any travis hates us - please fix - maybe related to #186 ?????

@felixheidecke
Copy link
Contributor Author

See #184 (comment) for updated notice.

@PVince81
Copy link
Contributor

@felixheidecke some trouble with travis / node ?

@PVince81
Copy link
Contributor

Assuming you were happy with the backend code @DeepDiver1975 ?

Who reviews the frontend code ?

@felixheidecke
Copy link
Contributor Author

Who reviews the frontend code?

That's always a goooood question. @hurradieweltgehtunter and @tboerger know vue. 🤔

@PVince81
Copy link
Contributor

@felixheidecke please retest this properly, not only the new switch but also the license related code.

The server backend has changed and there's a key called "licenseKeyAvailable" but I don't see it read anywhere in the UI code. See https://github.com/owncloud/market/pull/184/files#diff-6248f15975b779eff847acf5c338dd48R277

Copy link
Contributor

@PVince81 PVince81 left a comment

Choose a reason for hiding this comment

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

Code looks good, thanks 👍

@PVince81 PVince81 merged commit 242746d into master Nov 10, 2017
@PVince81 PVince81 deleted the scaleout-notices branch November 10, 2017 16:16
@patrickjahns patrickjahns mentioned this pull request Nov 13, 2017
14 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants