Tabulator Invalid column definition option - tabulator

I have recently upgraded from Tabulator 4.9 to Tabulator 5.1.7.
Previously, I was adding some user-defined attributes into the column definitions.
The was done so that column headerContextMenu functions had ready access to info.
This all worked fine and we observed the expected warnings in the browser console.
With the new version, the presence of user-defined attributes in column definitions causes issues with headerContextMenu functions.
Uncaught TypeError: Cannot read properties of undefined (reading 'headerContextMenu')
The above error only occurs when there is a user-defined attribute in the column definition. I am seeing this on multiple tables in our application.
Are user-defined attributes in column definitions no longer allowed?

Because Tabulator now uses optional module, not all column definition options always exist, it therefore warns you if it detects you are using an option that is not being watched by a module, just incase you have forgotten to install that module.
You can disable this functionality by setting the debugInvalidOptions option to false
var table = new Tabulator("#example-table", {
debugInvalidOptions:false,
});
Full details can be found in the Debug Documentation

Related

AutoMapper: continue on exception?

In my AutoMapper scenario, I have a string property on my source type but a Uri property on the destination. Occasionally, this conversion is expected to fail when the source data is bad:
UriFormatException: Invalid URI: The hostname could not be parsed.
at Uri.ctor(String uriString)
When this happens, I would like AutoMapper to set the problematic property to null on the destination & continue on with the process of mapping the other elements. Known solutions to this are:
Writing a custom converter (with try/catch) just for that element
Using BeforeMap() as described here
But I feel that if I have to take those extra steps, AutoMapper hasn't fulfilled its promise as a time-saving tool. Isn't there some global 'continue-on-error' flag that I can set? Note that I am less concerned about Uris in particular than I am about the lack of configurable error handling.
No special setup needed to repro this--just a vanilla CreateMap() call that registers two classes with differently typed properties.

Compile Error: Definitions of property procedures for the same property are inconsistent

I am trying to create a custom Class Object in my VBA project that handles an XML Document created from the output of a web app.
The structure of the XML is always the same, and the same nodes are always present. So I wanted to create several class properties that would essentially act like shortcuts to certain node values or turn a list of node values into an array (easier to copy into excel).
I am running into the error:
Compile error:
Definitions of property procedures for the same property are inconsistent, or property procedure has an optional parameter, a ParamArray, or an invalid Set final parameter
The property that triggers the error is
Property Let Headers(Column As Long, Name As String)
MyDoc_Headers.ChildNodes(Column - 1).ChildNodes(1).nodeTypedValue = Name
End Property
Property Get Headers(Column As Long) As Variant
Headers = MyDoc_Headers.ChildNodes(Column - 1).ChildNodes(1).nodeTypedValue
End Property
This property is a shortcut to Read/Write the name value of the headers in the document. The Node MyDoc_Headers has the structure:
<Headers>
<Header>
<DisplayAt>DisplayOption</DisplayAt>
<Name>HeaderName</Name>
</Header>
</Headers>
Depending on what the user requested from the web app, the document has a different number of Headers but it is always two or more. This is why I ask for Column as an argument of the Headers property. My idea was to use that as an index to point to different childNodes of the Headers Node.
The idea is that the user could write .Headers(1) = "Header 1" and the class property would put that value into the Name Element of the Header Node in the Headers Node.
I must be implementing this in the wrong way. What is the correct way to implement a property like this?

Hybris: Error on initiating the workflow on removing print extension - unexpected validator error: cannot find spring bean

Not sure where to check it. No dependencies are found in xml files. I don't find constraints related to this.
INFO | jvm 1 | main | 2017/03/14 11:10:30.867 | ESC[mESC[0;33m2017-03-14 11:10:30 WARN [Thread-17] [10.0.12.6] [EditorArea] Cound not update item, reason: [com.sbs.ecomm.hybris.sbproductcockpit.workflow.SBProductWor‌​kflowCreationInterce‌​ptor#5d47afd3]: unexpected validator error: cannot find spring bean [workflowAssignedJobAttributeHandler] configured for dynamic attribute [Workflow.assignedJob] from extension [print]
The dynamic attribute handler was initially defined in the print extension.
When the system was initialized the type system therefore got the attribute assignedJob stored in the database.
Now you removed the extension and the code for this dynamic attribute. That's why you get the error at runtime, because the type system in the database still has this attribute registered and tries to load the value using the dynamic attribute handler (for which the code is no longer present).
You can manually remove the assignedJob attribute through the hmc/backoffice in the type management section as far as I know (for sure thats possible in the hmc).
If an extension has been removed (that has previously been present) the typesystem in the database is not automatically removed.
You might also take a look at the orphaned types in the hac. All types of the print extension should show up there now as they are in the database but no longer present in the code/platform.
(Just remembered that I answered a similar problem for missing attributes here: https://stackoverflow.com/a/32824789/932201 .. that contains the steps how to remove an attribute)
Hope this helps!
In your class SBProductWor‌​kflowCreationInterce‌​ptor you probably save a Workflow model. This model has an handler and both are defined in the print extension.
You can't remove the print extension without removing the dependancies in your custom classes.

TypeScript, MongoDB and Reference Issues

I've got a NodeJS app (built in Visual Studio) which uses TypeScript, and MongoDB.
I've written a small library which wraps the MongoDB driver in some TypeScript classes and just today it started acting up.
If I include this line at the top of one of my library files:
/// <reference path='./_scripts/typings/mongodb/mongodb.d.ts' />
it build briefly, before begining to complain about "Duplicate identifier"s, and lots of them, for example:
Error 6 Type name 'Transform' in extends clause does not reference constructor function for '"stream".Transform'.
Error 7 Type name 'events.EventEmitter' in extends clause does not reference constructor function for 'events.EventEmitter'.
Error 8 Duplicate identifier 'errno'.
Error 9 Duplicate identifier 'code'.
Error 10 Duplicate identifier 'path'.
So I take that out, and everything is briefly ok, until I start seeing issues reported around this line:
import mongodbNS = require('mongodb');
If I were to then remove that line, I would see errors with things like:
public Connect: () => Promise<mongodbNS.Db>;
I can muddle through by adding a removing things and taking advantage of the brief window of compilability which opens up - but clearly this is not the way.
What is?
and they all come from node.d.ts
This is happening because you have two versions of node.d.ts (i.e. different files on disk) in your project.

How to avoid page-object deprecated for checkbox

I use cucumber since one year, and I am adding page-object-gem into it since few weeks.
When I execute the test, I get message :
DEPRECATION WARNING
You are calling a method named checkbox at commentPage.rb:23:in `block in delete_comment'.
This method does not exist in page-object so it is being passed to the driver.
This feature will be removed in the near future.
Please change your code to call the correct page-object method.
(I have got the same for other cases, but this "trivial" example should be easier to explain)
I search a way to avoid that, but it seems complicated.
For the test, I am checking a page, on which there is a table. Each row show a line, and I need to check the checkbox of a particular line.
My code in the pageObject:
table(:comment_list, :class => 'comments')
button(:delete, :text => "Delete")
def delete_comment (text)
self.comment_list_element.each do |row|
if row.text.include? "#{text}"
row.checkbox.set
self.delete
return true
end
end
false
end
Did I need a pretreatment of my table to use it during the test ?
You are getting the warning because you are calling a method that is on Watir and not page-object (checkbox method on a table row). If you want to access the Checkbox you can simply call the method that will return the nested element. This would change that portion of the call to row.checkbox_element. But you next call will also get the same issue. First of all the set method does not exist on CheckBox. In page-object the methods are check and uncheck. The full call should be:
row.checkbox_element.check
The reason you are getting the deprecation error is because I plan to remove the forwarding of calls to the underlying driver in the future. This ability really causes a lot of problems in complex situations.
In your code, row is a PageObject::Elements::TableRow, which does not have a checkbox method defined. I have not come across any examples where page-object elements were chained.
As a workaround, you could convert the PageObject::Elements::TableRow to a regular Watir::TableRow by doing:
row.element
So your code will work if you do:
row.element.checkbox.set

Resources