This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
db.projects.find({_id:ObjectId('5c77ef689ea802484df52353')}).forEach(function(project) { | |
print('Deleting the following project and all resources.'); | |
printjson(project); | |
db.forms.find({project: project._id}).forEach(function(form) { | |
print('Deleting form ' + form._id); | |
print('Deleting form(' + form._id + ') submissions'); | |
db.submissions.deleteMany({form: form._id}); | |
print('Deleting form(' + form._id + ') actions'); | |
db.actions.deleteMany({form: form._id}); | |
print('Deleting form(' + form._id + ') revisions'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { Component, AfterViewInit, ViewChild } from '@angular/core'; | |
import { FormioComponent } from 'angular-formio'; | |
@Component({ | |
template: '<formio src="https://examples.form.io/example"></formio>' | |
}) | |
export class FormRenderComponent implements AfterViewInit { | |
@ViewChild(FormioComponent) formioComponent: FormioComponent; | |
ngAfterViewInit() { | |
this.formioComponent.ready.then((formio) => { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// This shows how to override a Form.io component by extending it and creating your own methods. | |
import SelectComponent from 'formiojs/components/select/Select'; | |
import Components from 'formiojs/components/Components'; | |
export default class CustomSelect extends SelectComponent { | |
constructor(component, options, data) { | |
// Force all selects to use the html5 widget. | |
component.widget = 'html5'; | |
super(component, options, data); | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* This file shows how to create a custom component and register that within an Angular application. | |
* | |
* Get the base component class by referencing Formio.Components.components map. | |
*/ | |
import BaseComponent from 'formiojs/components/base/Base'; | |
import TableComponent from 'formiojs/components/table/Table'; | |
import Components from 'formiojs/components/Components'; | |
/** |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { Formio } from 'formiojs'; | |
const formio = new Formio('https://myproject.form.io/myform/submission/[SUBMISSION_ID]'); | |
formio.getDownloadUrl().then((downloadUrl) => { | |
console.log(downloadUrl); | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
db.projects.find({_id: ObjectId('<PROJECT_ID>')}).forEach(function(project) { | |
print('Deleting roles for project ' + project._id); | |
db.roles.deleteMany({project: project._id}); | |
print('Deleting form revisions for project ' + project._id); | |
db.formrevisions.deleteMany({project: project._id}); | |
db.forms.find({project: project._id}).forEach(function(form) { | |
print('Deleting actions for form ' + form._id); | |
db.actions.deleteMany({form: form._id}); | |
print('Deleting submissions for form ' + form._id); | |
db.submissions.deleteMany({form: form._id}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { async } from 'async'; | |
import Formio from 'formiojs'; | |
let destForm = new Formio('https://myproject.form.io/dest'); | |
let formio = new Formio('https://myproject.form.io/myform'); | |
formio.loadSubmissions({params: { | |
limit: 1000000 | |
}}).then(function(submissions) { | |
async.eachSeries(submissions, (submission, next) => { | |
destForm.saveSubmission(submission).then(next); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"form": ObjectId("59ef44fb7c82831822dd0a75"), | |
"deleted": { | |
"$eq": null | |
}, | |
"$or": [ | |
{ | |
"data.members": { | |
"$elemMatch": {"_id": "59ef8d025b59f1433dadaeb8"} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Formio.request('https://yourproject.form.io/projectname/report', 'POST', [ | |
{ | |
'$match': { | |
.... | |
} | |
}, | |
{ | |
'$contains': { | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import {TextFieldComponent} from 'formiojs/build/components/textfield/TextField'; | |
import Components from 'formiojs/build/components/index'; | |
export class ExtendedTextField extends TextFieldComponent { | |
constructor(component, options, data) { | |
super(component, options, data); | |
} | |
createInput(container) { | |
let input = super.createInput(container); | |
if (this.component.custom.listen) { |