Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
public parse = (json: any, errors?: AC.IValidationError[]) => {
super.parse(json, errors);
this.value = this.defaultValue;
this.placeholder = AC.getStringValue(json.placeholder);
this.min = AC.getStringValue(json.min);
this.max = AC.getStringValue(json.max);
}
public parse = (json: any, errors?: any) => {
this.value = json.value;
this.id = AC.getStringValue(json.id);
this.isMultiline = AC.getBoolValue(json.isMultiline, false);
this.maxLength = Shared.getIntValue(json.maxLength);
this.placeholder = AC.getStringValue(json.placeholder);
this.label = AC.getStringValue(json.label);
}
public parse = (json: any, errors?: AC.IValidationError[]) => {
super.parse(json, errors);
this.value = this.defaultValue;
this.placeholder = AC.getStringValue(json.placeholder);
this.min = AC.getStringValue(json.min);
this.max = AC.getStringValue(json.max);
}
public parse = (json: any, errors?: any) => {
this.value = json.value;
this.id = AC.getStringValue(json.id);
this.isMultiline = AC.getBoolValue(json.isMultiline, false);
this.maxLength = Shared.getIntValue(json.maxLength);
this.placeholder = AC.getStringValue(json.placeholder);
this.label = AC.getStringValue(json.label);
}
public parse = (json: any, errors?: AC.IValidationError[]) => {
super.parse(json, errors);
this.value = this.defaultValue;
this.placeholder = AC.getStringValue(json.placeholder);
this.min = AC.getStringValue(json.min);
this.max = AC.getStringValue(json.max);
}
public parse = (json: any, errors?: AC.IValidationError[]) => {
this.id = AC.getStringValue(json.id);
this.placeholder = AC.getStringValue(json.placeholder);
this.parseDates(json, errors);
}
export function parseCatalogue(input: any): CatalogueEntry[] {
let entries: any[] = null;
if (Array.isArray(input)) {
entries = input;
}
else {
entries = Array.isArray(input["entries"]) ? input["entried"] : null;
}
let result: CatalogueEntry[] = [];
if (entries != null) {
for (let entry of entries) {
if (typeof entry === "object") {
let displayName = Adaptive.getStringValue(entry["displayName"]);
let cardPayloadUrl = Adaptive.getStringValue(entry["cardPayloadUrl"]);
if (!Adaptive.isNullOrEmpty(displayName) && !Adaptive.isNullOrEmpty(cardPayloadUrl)) {
result.push(
new CatalogueEntry(
displayName,
cardPayloadUrl,
Adaptive.getStringValue(entry["dataSampleUrl"])));
}
}
}
}
return result;
}
public parse = (json: any, errors?: AC.IValidationError[]) => {
this.id = AC.getStringValue(json.id);
this.value = json.value;
this.valueOn = AC.getStringValue(json.valueOn);
this.valueOff = AC.getStringValue(json.valueOff);
this.title = AC.getStringValue(json.title);
}
public parse = (json: any, errors?: AC.IValidationError[]) => {
this.id = json.id ? AC.getStringValue(json.id) : null;
this.value = json.value;
this.selectedValues = this.defaultValueToArray(this.value);
this.choices = json.choices;
this.isMultiSelect = AC.getBoolValue(json.isMultiSelect, false);
this.title = AC.getStringValue(json.title);
this.style = AC.getStringValue(json.style);
}
private parseDates = (json: any, errors?: AC.IValidationError[]) => {
const dateString = AC.getStringValue(json.value);
this.value = dateString;
this.date = dateString ? this.getDate(dateString) : new Date();
this.minDate = json.min ? this.getDate(AC.getStringValue(json.min)) : undefined;
this.maxDate = json.max ? this.getDate(AC.getStringValue(json.max)) : undefined;
}