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

Fix #7672 - Image can be added to root of Media when AllowAtRoot is false #7853

Merged
merged 9 commits into from
Aug 31, 2020
Merged

Fix #7672 - Image can be added to root of Media when AllowAtRoot is false #7853

merged 9 commits into from
Aug 31, 2020

Conversation

olibos
Copy link
Contributor

@olibos olibos commented Mar 29, 2020

This fixes #7672
With @mmrauta's message suggestion

Description

Set the Image Media Types AllowAtRoot property to false in Setting>Media Types>Image.
Create a Doc Type with a Media Picker property on it and create a node with this Doc Type.
Open the Media Picker.
Click upload while viewing the root of the Media folder. This will not open the file upload window.
Create a new media folder.
Go into the folder.
Click to return to the root.
Click upload while viewing the root. This will no longer open the file upload window.

localizationService.localize('media_uploadNotAllowed').then(function (message) { notificationsService.warning(message); });
}
else{
angular.element(".umb-file-dropzone .file-select").trigger("click");
Copy link
Contributor

Choose a reason for hiding this comment

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

@olibos you don't need find the element again. It is already available in fileSelect variable.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

My bad! First victim of daylight saving time 😂
Fixed in new version 😉

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@bjarnef have you seen the new commit?

Copy link
Contributor

Choose a reason for hiding this comment

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

@olibos yes I did... much better 😁 👍

@emmary2020
Copy link

Hey @olibos

Thanks for the work here - lovely to see the community collaborating :)

We'll take a look and get in touch soon,

Emma

olibos added 2 commits April 23, 2020 16:18
…-of-Media-when-AllowAtRoot-is-false

# Conflicts:
#	src/Umbraco.Web.UI.Client/src/views/common/infiniteeditors/mediapicker/mediapicker.controller.js
@olibos
Copy link
Contributor Author

olibos commented Apr 23, 2020

It seems that the latest updated breaks it
I'll have a look.

undefined makes JSON.parse crashed!
@olibos
Copy link
Contributor Author

olibos commented Apr 23, 2020

Seems that a modification form @BatJan breaks the picker when storage["umb_" + key] is undefined.

JSON.parse(undefined)
->Uncaught SyntaxError: Unexpected token u in JSON at position 0

It's now working 😃
@BatJan can you check if my patch doesn't make any regression?

olibos and others added 2 commits June 12, 2020 10:47
# Conflicts:
#	src/Umbraco.Web.UI.Client/src/views/common/infiniteeditors/mediapicker/mediapicker.controller.js
@nul800sebastiaan nul800sebastiaan merged commit 9c33f4b into umbraco:v8/contrib Aug 31, 2020
@nul800sebastiaan
Copy link
Member

Apologies for the delay on this one! 🙈
Thanks also @olibos for your help on this one - together with @mmrauta's fix this is very a very nice combo! ⭐

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

Successfully merging this pull request may close these issues.

Image can be added to root of Media when AllowAtRoot is false
4 participants