Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
angular.forEach(data, function(row) {
view += '';
formioUtils.eachComponent(component.components, function(component) {
// Don't render disabled fields, or fields with undefined data.
if (!component.tableView || row[component.key] === undefined) {
return;
}
// If the component has a defined tableView, use that, otherwise try and use the raw data as a string.
var info = componentInfo.components.hasOwnProperty(component.type) ? componentInfo.components[component.type] : {};
if (info.tableView) {
// Reset the tableChild value for datagrids, so that components have headers.
view += '' + info.tableView(row[component.key] || '', component, $interpolate, componentInfo, false) + '';
}
else {
view += '';
if (component.prefix) {
view += component.prefix;
}
componentWillReceiveProps = (nextProps) => {
const { components } = this.props;
// If one of the fields is set to refresh on a value outside the datagrid, check it as well.
this.refresh = false;
FormioUtils.eachComponent(components, (component) => {
if ('refreshOn' in component && component.refreshOn) {
const { refreshOn } = component;
if (refreshOn === 'data') {
this.refresh = true;
}
if ((!this.data.hasOwnProperty(refreshOn) && nextProps.hasOwnProperty(refreshOn)) || this.data[refreshOn] !== nextProps.data[refreshOn]) {
this.refresh = true;
}
}
});
this.data = Object.assign({}, nextProps.data);
};
getColumns = () => {
let columns = [];
FormioUtils.eachComponent(this.props.form.components, function(component) {
if (component.input && component.tableView && component.key) {
columns.push({
key: 'data.' + component.key,
title: component.label || component.title || component.key,
sort: true,
component: Components.create(component, null, null, true)
});
}
});
return columns.slice(0, columns.length - 1);
};
setupColumns() {
FormioUtils.eachComponent(this.form.components, (component:any) => {
if (component.input && component.tableView) {
this.columns.push({
label: component.label,
key: 'data.' + component.key,
sort: '',
component: Components.create(component, null, null, true)
});
}
});
}
getColumns = () => {
let columns = [];
FormioUtils.eachComponent(this.props.form.components, function(component) {
if (component.input && component.tableView && component.key) {
columns.push({
key: 'data.' + component.key,
title: component.label || component.title || component.key,
sort: true,
component: Components.create(component, null, null, true)
});
}
});
columns.push({
key: 'operations',
title: 'Operations',
sort: false
});
this.service.loadForm().then(form => {
this.inviteForm = form;
FormioUtils.eachComponent(this.inviteForm.components, (component) => {
if (component.type === 'password' || component.key === 'invited' || component.key === 'onBoarded') {
component.hidden = true;
}
});
this.inviteSubmission.data.invited = true;
this.inviteSubmission.data.appUrl = window.location.origin;
this.inviteSubmission.data.projectUrl = encodeURIComponent(this.service.formio.projectUrl);
});
this.modalService.open(content, { size: 'lg' });
FormioGridComponent.prototype.setupColumns = function () {
var _this = this;
FormioUtils.eachComponent(this.form.components, function (component) {
if (component.input && component.tableView) {
_this.columns.push({
label: component.label,
key: 'data.' + component.key,
sort: '',
component: component
});
}
});
};
Object.defineProperty(FormioGridComponent.prototype, "loading", {