Custom behaviour for selfAsserted content? - azure-ad-b2c

Following this disabled social account from logon sample. Here's what I see when the Local Account user exists and is disabled:
NB - I've changed the ContentDefinition so that it's using 2.1.7 instead of 1.1.0.
I'm assuming the "hide me" text box is to be hidden using css? Which would mean that I would have to implement my own Template?
Also, there's a Cancel and a Continue button. Because the dummy textbox doesn't actually do anything, clicking the Continue button does not work. So I assume I want to hide the Continue button, but only when the dummy text box is present? Does that mean I should be looking at Javascript?
Finally, the UserMessageIfClaimsTransformationBooleanValueIsNotEqual error message (defined in the AAD-DisabledUserPage Technical Profile) does not appear anywhere in the source of the page. It seems integral to the strategy in the sample. Am I missing something?
I've looked at Customise the UI, Customise the UI with HTML template and Enable JavaScript and page layouts. There doesn't seem to be anything on customising the generated content. Have I missed something in the documentation?

Very strange so I had a look at the sample.
This is an old sample. It still uses "socialIdpUserId".
<! - The claim socialIdpUserId has been renamed to issuerUserId →
I renamed this in the base file to "issuerUserId".
Essentially, they needed a "dead-end" page.
But the dead-end page needs an output claim so they made a dummy one but wanted in removed!
I would have used a paragraph element. Maybe it wasn't available then?
I wrote that up a while back.
My version is in this gist.
If disabled, the user sees:

You can hide Cancel and Continue by modifying the technical profile. See the Metadata section here.

Related

Kentico Forms - CMSCheckbox always renders an empty label

This is for: Kentico 11, kentico forms
I have been tracing an Accessibility violation caused by the CMSCheckbox. Finally found the issue. It seems kentico is forcing the label of the checkbox to be rendered even though it is empty. It is doing this by setting the Text property of the checkbox to a none breaking space if I do not set it to something.
I am using the CMSCheckbox in a form with a caption. I need the caption to be non empty as I use it for something else on submission of the form. Since the caption is a label for the same checkbox this violates yet another Accessibility rule of only having one label per control.
My question is:
- Why has kentico done this? Why is the CMSCheckbox forced to always have a label when asp does not force it?
This "hack" was added to support localization of the CMSCheckBox control. I am afraid but there are no settings available for this so you will need to create a custom form control and use the ASP check box inside it.

How to hide URL Selector content tab?

I am creating a custom webpart using the Url Selector from kentico. I want the user to select content just from the Media Library. I went to form controls -> Url Selector -> Properties -> Dialogs_Content_Hide -> Default Value -> Yes and it still showing it in the Web Part. If I select the Dialogs_Web_Hide, Dialogs_Libraries_Hide and select the yes option in the default values, they hide, all except the Content_Dialogs.
Is this a bug? Or its something wrong?
Here is an example of the tabs
First set the form controls properties back to the way they were. If you don't, it will cause all kinds of problems later on.
Secondly, when you create the property in the webpart in the UI, select the URL selector form control for your text fields control. The scroll down just a bit and under the Editing Control Settings you'll see an "Configure" link. Click it. In there you will be able to tell the form control what tabs you want to enable and disable.
To add to Brenden's answer; if this is something you need to do a lot for your current build, then I'd also suggest making a copy of the Url selector form control and customize the properties as you originally mentioned. This way, you leave the default control in place for the system and have a control tailored to your needs. I've done this just now to check with a new form control that I called Media URL selector. Do make sure that you select the same source file as the original control in the Cloned form control file name property - Kentico by default will try to locate a new file called <original filename>_1.ascx. The reason for this is that admin section of your site also makes use of this control, so you may cause a nasty side effect somewhere else in the system.
As for why the settings had no effect; these are the default values you are setting. If you already have the form control in use, then the default setting would have been applied as they originally were. If you find one of the fields in question, you can change the control type to Text box, click Save, and then reassign it to Media URL selector.

Issue related to Kentico on-line form (bizform) validation

I have created a form using Kentico on-line form and applied the built-in "required" validation on it. Whenever a textbox is empty then a required validation is shown. Now, I have entered a value in the textbox and press tab from the keyboard but the required message does not disappear. I want to remove or hide the message from the form when the user enters a value in the text box before the submit button is clicked.
How to resolve this issue?
I don't recall this being something that Kentico handles out-of-the-box. You'll most likely need to add some custom client-side script for this. Typically - where I work, at Ridgeway - we use custom layouts for forms, as the standard layout is fairly table-rich.

Kentico clone and customize cms.file

Here's what I'm trying to do. When a user uploads a file, i need them to make one of three options. I'll then create a transformation to link to the file, with the option they selected determining the which icon.
I started with cloning the cms.file, and then created the new field i needed for the options. I then uploaded a file using that page type. I don't see my option list (Drop-down list) on the upload screen, or after the file has been saved.
I'm been playing with the Layout but that doesn't seem to help. What am I missing here?
You could create a simple page type that has a file upload field, that would solve your issue, and also you could include your extra field or fields in your new page type.
I'm not sure we have enough information to debug why your custom page type might not be showing the field you added, but a possible workaround: depending on what you are basing the icon on, it may work to just use different icons based on the file type? Kentico even has a method you can use to get a file icon based on the extension:
<%# GetFileIcon(Eval("FileExtension")) %>
Otherwise, maybe you can include some more information about your custom page type such as a screen shot of the fields and of the form tab for that page type. Is the "icon" field you added simply not showing up in the form?

Modifying sharepoint edit dialog

I have successfully created a feature in sharepoint that modifies the existing edit dialog and adds a custom button to it like this.
and I am aware that I can pass back data when the user clicks the custom button like this.
<CommandUIHandlers>
<CommandUIHandler Command="ActivateUser" CommandAction="/_layouts/MyFeature/MakeUserActive.aspx?ListID={ListId}&ItemID={ItemId}&ItemUrl={ItemUrl}&ListUrlDir={ListUrlDir}" />
</CommandUIHandlers>
As detailed here
I can now handle the list item and perform my required actions on it BUT given that this button has been added in the modify context (IE: Inside the sharepoint edit item dialog) what if you want to save changes to the data itself?
To me it seems like using your custom button would always mean losing any changes the user has made to the data. Is there a way around this?
Good question!
You actually already linked to the solution: Right now you are simply redirecting the user by using a URL as your CommandAction: CommandAction="/_layouts/MyFeature/MakeUserActive.aspx?ListID={ListId}&ItemID={ItemId}&ItemUrl={ItemUrl}&ListUrlDir={ListUrlDir}"
This if course redirects the user to another page without saving the current entry. What you want to do is use Javascript as linked in the MSDN article:
CommandAction="javascript:alert('here be dragons');"
You can either work the the SharePoint Javascript object model here and use something like SP.ListOperation.Selection.getSelectedItems(); or you could use complete custom code.
From your aspx page name I can see you want to "make a use active" (btw: wouldn't "ActivateUser.aspx" be nicer?). If this simply means setting a property in another list you could do that with the SharePoint OM, if it is some custom stuff you would need a webservice which you can call from JavaScript and "activate the user" like that. You can of course always access the current form and pass on the values the user entered. Or you could create a custom save button which does some stuff (activate user) before saving.
Lastly: You can also have postbacks in your custom button where you could do anything you'd like.

Resources