Comments Widget Issue

I have recently added the Comments Widget to Liberty Create, it works beautifully in Build and Test environments.

We did a push to live last night and the Case Comments page that contains the Comments widget takes around 15-20 seconds to load everytime? I can’t see any messages in Detective so have no ideas how to fix.

In build and test it loads instantly.

Has anyone got any ideas what could be causing this 20 second delay?
Thanks JonathanFS

Hi Jonathan, I’ll get someone to look at this as soon as possible. Just wondering if it’s related to Security/Firewall settings. I, or one of my colleagues, will report back asap.

Thanks for raising this issue. Your feedback is greatly appreciated!

Best Regards - Mark Pearson
AppShare Manager

Hi Mark,

I think its to do with the large amount of Portal Users in our Live system as we have 82 users in Build, and 22635 in Live.

I am going to figure out how to update the user search to not return portal users, as we don’t need to tag them in comments, as this will drastically shorten user list, I’m hoping this will resolve this slow loading.

Thanks, JonathanFS

I think this is the line of code I need to modify to restrict user list to non portal users, as returns 22K records.

			var r = mats.search({
				'base_object_id': user_list_object,
				'selects': db_selects,
				"groupings": []
				, 'filters': [
					{ 'field_path': ':status', 'value': 'active', 'comparator': 'equal_to'}
				]
				//,"return" : "data"
			});

Any help appreciated?

We’re looking at it right now Jonathan! :slightly_smiling_face:
MP

1 Like

Hi Jonathan,

I reached out to one of our internal geniuses, Adam Mills, who replied as follows:

"Yes if they are in given subset you can add a filter for where subset is true. Add a reference to the subset then add another line below in the filters area.

‘filters’: [
{ ‘field_path’: ‘:status’, ‘value’: ‘active’, ‘comparator’: ‘equal_to’},
{ ‘field_path’: cs.ref(‘MySubset’), ‘value’: ‘1’}
] "

I hope this helps. Please get back to us if you continue to have issues!

Regards - MP

This isn’t working either, I get 2 errors shown below when I add in the additional filter for the subset.

I have a subset on User object named User > Not Portal User

And a Code Studio Subset Reference named

			var r = mats.search({
				'base_object_id': user_list_object,
				'selects': db_selects,
				"groupings": []
				, 'filters': [
					{ 'field_path': ':status', 'value': 'active', 'comparator': 'equal_to' },
					{ 'field_path': cs.ref('sub_user_not_portal_user'), 'value': '1'}
				]
				//,"return" : "data"
			});

image

This is first error detail

Is this the correct way to use a subset via a field_path filter?

                'filters': [
					{ 'field_path': ':status', 'value': 'active', 'comparator': 'equal_to' },
					{ 'field_path': cs.ref('sub_user_not_portal_user'), 'value': '1'}
				]

Thanks for your help @adam.mills

I have done a bodge for now, restricting list by user email address domain.
This now adds 300 users, not 22000 in Live.

{ 'field_path': cs.ref('field_user__email_address'), 'value': '@easthants.gov.uk', 'comparator': 'ends' }

I’m struggling to figure how to use choice values (displayables) in the filter for user_role.

Hello Again, we’ve seen your replies and will take a look once someone becomes available!

Regards - MP

1 Like

Hi Jonathan,

Is sub_user_not_portal_user a path from user_list_object which is the base, if not that may well be the problem, you need to create the reference to the subset from user_list_object through.

Adam

I believe the user_list_object is actually the User Object, as this is how its been setup in the Comments Widget I got from AppShare (but I dont understand how’s it setup in the code), I have set the subsets on the User Object but these aren’t accessible due to setup.

I have a workaround for now by looking at email domain which is working great.