@formio/angular 5.2.9-rc.1 → 5.2.9-rc.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/auth/auth.service.d.ts +0 -1
- package/auth/auth.service.d.ts.map +1 -1
- package/auth/formio-angular-auth.metadata.json +1 -1
- package/bundles/formio-angular-auth.umd.js +10 -11
- package/bundles/formio-angular-auth.umd.js.map +1 -1
- package/bundles/formio-angular-grid.umd.js +1 -1
- package/bundles/formio-angular-grid.umd.js.map +1 -1
- package/bundles/formio-angular.umd.js +3 -3
- package/esm2015/auth/auth.service.js +11 -12
- package/esm2015/components/formbuilder/formbuilder.component.js +1 -1
- package/esm2015/components/formio/formio.component.js +1 -1
- package/esm2015/components/formioreport/formioreport.component.js +1 -1
- package/esm2015/grid/form/FormGridBody.component.js +2 -2
- package/fesm2015/formio-angular-auth.js +10 -11
- package/fesm2015/formio-angular-auth.js.map +1 -1
- package/fesm2015/formio-angular-grid.js +1 -1
- package/fesm2015/formio-angular-grid.js.map +1 -1
- package/fesm2015/formio-angular.js +3 -3
- package/formio-angular.metadata.json +1 -1
- package/grid/formio-angular-grid.metadata.json +1 -1
- package/package.json +2 -2
package/auth/auth.service.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"auth.service.d.ts","sourceRoot":"","sources":["../../../projects/angular-formio/auth/src/auth.service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAsB,MAAM,eAAe,CAAC;AACjE,OAAO,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AACjD,OAAO,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAIlD,qBACa,iBAAiB;IA6BnB,SAAS,EAAE,eAAe;IAC1B,MAAM,EAAE,gBAAgB;IA7B1B,IAAI,EAAE,GAAG,CAAC;IACV,aAAa,UAAS;IAEtB,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,EAAE,YAAY,CAAC,MAAM,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"FormioAuthConfig":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Injectable","line":15,"character":1}}],"members":{}},"FormioAuthService":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Injectable","line":6,"character":1}}],"members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","module":"@formio/angular","name":"FormioAppConfig","line":36,"character":22},{"__symbolic":"reference","name":"FormioAuthConfig"}]}],"onLoginSubmit":[{"__symbolic":"method"}],"onRegisterSubmit":[{"__symbolic":"method"}],"onResetPassSubmit":[{"__symbolic":"method"}],"init":[{"__symbolic":"method"}],"setUser":[{"__symbolic":"method"}],"setUserRoles":[{"__symbolic":"method"}],"logoutError":[{"__symbolic":"method"}],"logout":[{"__symbolic":"method"}]
|
|
1
|
+
{"__symbolic":"module","version":4,"metadata":{"FormioAuthConfig":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Injectable","line":15,"character":1}}],"members":{}},"FormioAuthService":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Injectable","line":6,"character":1}}],"members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","module":"@formio/angular","name":"FormioAppConfig","line":36,"character":22},{"__symbolic":"reference","name":"FormioAuthConfig"}]}],"onLoginSubmit":[{"__symbolic":"method"}],"onRegisterSubmit":[{"__symbolic":"method"}],"onResetPassSubmit":[{"__symbolic":"method"}],"init":[{"__symbolic":"method"}],"setUser":[{"__symbolic":"method"}],"setUserRoles":[{"__symbolic":"method"}],"logoutError":[{"__symbolic":"method"}],"logout":[{"__symbolic":"method"}]}},"FormioAuthComponent":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Component","line":1,"character":1},"arguments":[{"template":"<div class=\"card card-primary panel panel-default\">\n <div class=\"card-header panel-heading\">\n <ul class=\"nav nav-tabs card-header-tabs\">\n <li class=\"nav-item\" role=\"presentation\" routerLinkActive=\"active\"><a class=\"nav-link\" routerLink=\"login\" routerLinkActive=\"active\">Login</a></li>\n <li class=\"nav-item\" role=\"presentation\" routerLinkActive=\"active\"><a class=\"nav-link\" routerLink=\"register\" routerLinkActive=\"active\">Register</a></li>\n <li class=\"nav-item\" role=\"presentation\" routerLinkActive=\"active\"><a class=\"nav-link\" routerLink=\"resetpass\" routerLinkActive=\"active\">Reset Password</a></li>\n </ul>\n </div>\n <div class=\"card-body panel-body\">\n <router-outlet></router-outlet>\n </div>\n</div>\n"}]}],"members":{}},"FormioAuthLoginComponent":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Component","line":2,"character":1},"arguments":[{"template":"<formio [src]=\"service.loginForm\" (submit)=\"service.onLoginSubmit($event)\"></formio>\n"}]}],"members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","name":"FormioAuthService"}]}]}},"FormioAuthRegisterComponent":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Component","line":2,"character":1},"arguments":[{"template":"<formio [src]=\"service.registerForm\" (submit)=\"service.onRegisterSubmit($event)\"></formio>\n"}]}],"members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","name":"FormioAuthService"}]}]}},"FormioResetPassComponent":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Component","line":2,"character":1},"arguments":[{"template":"<formio [src]=\"service.resetPassForm\" (submit)=\"service.onResetPassSubmit($event)\"></formio>\n"}]}],"members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","name":"FormioAuthService"}]}]}},"FormioAuthRoutes":{"__symbolic":"function","parameters":["config"],"value":[{"path":"","component":{"__symbolic":"if","condition":{"__symbolic":"binop","operator":"&&","left":{"__symbolic":"reference","name":"config"},"right":{"__symbolic":"select","expression":{"__symbolic":"reference","name":"config"},"member":"auth"}},"thenExpression":{"__symbolic":"select","expression":{"__symbolic":"reference","name":"config"},"member":"auth"},"elseExpression":{"__symbolic":"reference","name":"FormioAuthComponent"}},"children":[{"path":"","redirectTo":"login","pathMatch":"full"},{"path":"login","component":{"__symbolic":"if","condition":{"__symbolic":"binop","operator":"&&","left":{"__symbolic":"reference","name":"config"},"right":{"__symbolic":"select","expression":{"__symbolic":"reference","name":"config"},"member":"login"}},"thenExpression":{"__symbolic":"select","expression":{"__symbolic":"reference","name":"config"},"member":"login"},"elseExpression":{"__symbolic":"reference","name":"FormioAuthLoginComponent"}}},{"path":"register","component":{"__symbolic":"if","condition":{"__symbolic":"binop","operator":"&&","left":{"__symbolic":"reference","name":"config"},"right":{"__symbolic":"select","expression":{"__symbolic":"reference","name":"config"},"member":"register"}},"thenExpression":{"__symbolic":"select","expression":{"__symbolic":"reference","name":"config"},"member":"register"},"elseExpression":{"__symbolic":"reference","name":"FormioAuthRegisterComponent"}}},{"path":"resetpass","component":{"__symbolic":"if","condition":{"__symbolic":"binop","operator":"&&","left":{"__symbolic":"reference","name":"config"},"right":{"__symbolic":"select","expression":{"__symbolic":"reference","name":"config"},"member":"resetpass"}},"thenExpression":{"__symbolic":"select","expression":{"__symbolic":"reference","name":"config"},"member":"resetpass"},"elseExpression":{"__symbolic":"reference","name":"FormioResetPassComponent"}}}]}]},"FormioAuth":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"NgModule","line":12,"character":1},"arguments":[{"imports":[{"__symbolic":"reference","module":"@angular/common","name":"CommonModule","line":14,"character":4},{"__symbolic":"reference","module":"@formio/angular","name":"FormioModule","line":15,"character":4},{"__symbolic":"reference","module":"@angular/router","name":"RouterModule","line":16,"character":4}],"declarations":[{"__symbolic":"reference","name":"FormioAuthComponent"},{"__symbolic":"reference","name":"FormioAuthLoginComponent"},{"__symbolic":"reference","name":"FormioAuthRegisterComponent"},{"__symbolic":"reference","name":"FormioResetPassComponent"}]}]}],"members":{},"statics":{"forRoot":{"__symbolic":"function","parameters":["config"],"value":{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@formio/angular","name":"extendRouter","line":27,"character":11},"arguments":[{"__symbolic":"reference","name":"FormioAuth"},{"__symbolic":"reference","name":"config"},{"__symbolic":"reference","name":"FormioAuthRoutes"}]}},"forChild":{"__symbolic":"function","parameters":["config"],"value":{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@formio/angular","name":"extendRouter","line":30,"character":11},"arguments":[{"__symbolic":"reference","name":"FormioAuth"},{"__symbolic":"reference","name":"config"},{"__symbolic":"reference","name":"FormioAuthRoutes"}]}}}}},"origins":{"FormioAuthConfig":"./auth.config","FormioAuthService":"./auth.service","FormioAuthComponent":"./auth.component","FormioAuthLoginComponent":"./login/login.component","FormioAuthRegisterComponent":"./register/register.component","FormioResetPassComponent":"./resetpass/resetpass.component","FormioAuthRoutes":"./auth.routes","FormioAuth":"./auth.module"},"importAs":"@formio/angular/auth"}
|
|
@@ -160,19 +160,18 @@
|
|
|
160
160
|
this.onError.emit();
|
|
161
161
|
};
|
|
162
162
|
FormioAuthService.prototype.logout = function () {
|
|
163
|
-
this.setUser(null);
|
|
164
|
-
var namespace = formiojs.Formio.namespace || 'formio';
|
|
165
|
-
if (localStorage.getItem(namespace + "LogoutAuthUrl")) {
|
|
166
|
-
window.open(localStorage.getItem(namespace + "LogoutAuthUrl"), null, 'width=1020,height=618');
|
|
167
|
-
localStorage.removeItem(namespace + "LogoutAuthUrl");
|
|
168
|
-
}
|
|
169
|
-
this.handleLogout(namespace);
|
|
170
|
-
};
|
|
171
|
-
FormioAuthService.prototype.handleLogout = function (namespace) {
|
|
172
163
|
var _this = this;
|
|
173
|
-
localStorage.removeItem(namespace + "Token");
|
|
174
164
|
formiojs.Formio.logout()
|
|
175
|
-
.then(function () {
|
|
165
|
+
.then(function () {
|
|
166
|
+
_this.setUser(null);
|
|
167
|
+
var namespace = formiojs.Formio.namespace || 'formio';
|
|
168
|
+
if (localStorage.getItem(namespace + "LogoutAuthUrl")) {
|
|
169
|
+
window.open(localStorage.getItem(namespace + "LogoutAuthUrl"), null, 'width=1020,height=618');
|
|
170
|
+
localStorage.removeItem(namespace + "LogoutAuthUrl");
|
|
171
|
+
}
|
|
172
|
+
localStorage.removeItem(namespace + "Token");
|
|
173
|
+
_this.onLogout.emit();
|
|
174
|
+
})
|
|
176
175
|
.catch(function () { return _this.logoutError(); });
|
|
177
176
|
};
|
|
178
177
|
return FormioAuthService;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"formio-angular-auth.umd.js","sources":["../../../projects/angular-formio/auth/src/auth.config.ts","../../../projects/angular-formio/auth/src/auth.service.ts","../../../projects/angular-formio/auth/src/auth.component.ts","../../../projects/angular-formio/auth/src/login/login.component.ts","../../../projects/angular-formio/auth/src/register/register.component.ts","../../../projects/angular-formio/auth/src/resetpass/resetpass.component.ts","../../../projects/angular-formio/auth/src/auth.routes.ts","../../../projects/angular-formio/auth/src/auth.module.ts","../../../projects/angular-formio/auth/src/public_api.ts","../../../projects/angular-formio/auth/src/formio-angular-auth.ts"],"sourcesContent":["import { Injectable } from '@angular/core';\n\nexport interface FormioAuthFormConfig {\n path?: string;\n form?: string;\n component?: any;\n}\n\nexport interface FormioAuthRouteConfig {\n auth?: any;\n login?: any;\n register?: any;\n resetpass?: any;\n}\n\n@Injectable()\nexport class FormioAuthConfig {\n component?: any;\n delayAuth?: any;\n login?: FormioAuthFormConfig;\n register?: FormioAuthFormConfig;\n resetpass?: FormioAuthFormConfig;\n oauth?: FormioOAuthConfig;\n}\n\n\nexport interface FormioOAuthConfig {\n type: FormioOauthType;\n options: FormioOktaConfig | FormioSamlConfig;\n}\n\nexport enum FormioOauthType {\n okta = 'okta',\n saml = 'saml',\n}\n\nexport interface FormioOktaConfig extends OktaConfig {\n formio?: any;\n}\n\nexport interface FormioSamlConfig {\n relay: string;\n}\n\n// for more details about Okta configuration options see https://github.com/okta/okta-auth-js#configuration-reference\nexport interface OktaConfig {\n url?: string;\n tokenManager?: OktaTokenManagerConfig;\n issuer?: string;\n clientId?: string;\n redirectUri?: string;\n postLogoutRedirectUri?: string;\n pkce?: boolean;\n authorizeUrl?: string;\n userinfoUrl?: string;\n tokenUrl?: string;\n ignoreSignature?: boolean;\n maxClockSkew?: number;\n scopes?: string[];\n httpRequestClient?: Function;\n}\n\nexport interface OktaTokenManagerConfig {\n storage?: string | {\n getItem?: Function;\n setItem?: Function;\n };\n secure?: boolean;\n autoRenew?: boolean;\n expireEarlySeconds?: number;\n storageKey?: string;\n}\n","import { EventEmitter, Injectable, Inject } from '@angular/core';\nimport { FormioAuthConfig } from './auth.config';\nimport { FormioAppConfig } from '@formio/angular';\nimport { get, each } from 'lodash';\nimport { Formio } from 'formiojs';\n\n@Injectable()\nexport class FormioAuthService {\n public user: any;\n public authenticated = false;\n\n public loginForm: string;\n public onLogin: EventEmitter<object>;\n public onLogout: EventEmitter<object>;\n\n public registerForm: string;\n public onRegister: EventEmitter<object>;\n public onUser: EventEmitter<object>;\n public onError: EventEmitter<any>;\n\n public resetPassForm: string;\n public onResetPass: EventEmitter<object>;\n\n public ready: Promise<boolean>;\n public readyResolve: any;\n public readyReject: any;\n\n public projectReady?: Promise<any>;\n public accessReady?: Promise<any>;\n public userReady?: Promise<any>;\n public formAccess: any = {};\n public submissionAccess: any = {};\n public roles: any;\n public is: any = {};\n\n constructor(\n public appConfig: FormioAppConfig,\n public config: FormioAuthConfig\n ) {\n this.user = null;\n\n if (this.appConfig && this.appConfig.appUrl) {\n Formio.setBaseUrl(this.appConfig.apiUrl);\n Formio.setProjectUrl(this.appConfig.appUrl);\n Formio.formOnly = !!this.appConfig.formOnly;\n } else {\n console.error('You must provide an AppConfig within your application!');\n }\n\n this.loginForm =\n this.appConfig.appUrl +\n '/' +\n get(this.config, 'login.form', 'user/login');\n this.registerForm =\n this.appConfig.appUrl +\n '/' +\n get(this.config, 'register.form', 'user/register');\n this.resetPassForm =\n this.appConfig.appUrl +\n '/' +\n get(this.config, 'register.form', 'resetpass');\n this.onLogin = new EventEmitter();\n this.onLogout = new EventEmitter();\n this.onRegister = new EventEmitter();\n this.onUser = new EventEmitter();\n this.onError = new EventEmitter();\n\n this.ready = new Promise((resolve: any, reject: any) => {\n this.readyResolve = resolve;\n this.readyReject = reject;\n });\n\n // Register for the core events.\n Formio.events.on('formio.badToken', () => this.logoutError());\n Formio.events.on('formio.sessionExpired', () => this.logoutError());\n if (!this.config.delayAuth) {\n this.init();\n }\n }\n\n onLoginSubmit(submission: object) {\n this.setUser(submission);\n this.onLogin.emit(submission);\n }\n\n onRegisterSubmit(submission: object) {\n this.setUser(submission);\n this.onRegister.emit(submission);\n }\n\n onResetPassSubmit(submission: object) {\n this.onResetPass.emit(submission);\n }\n\n init() {\n this.projectReady = Formio.makeStaticRequest(this.appConfig.appUrl).then(\n (project: any) => {\n each(project.access, (access: any) => {\n this.formAccess[access.type] = access.roles;\n });\n },\n (): any => {\n this.formAccess = {};\n return null;\n }\n );\n\n // Get the access for this project.\n this.accessReady = Formio.makeStaticRequest(\n this.appConfig.appUrl + '/access'\n ).then(\n (access: any) => {\n each(access.forms, (form: any) => {\n this.submissionAccess[form.name] = {};\n form.submissionAccess.forEach((subAccess: any) => {\n this.submissionAccess[form.name][subAccess.type] = subAccess.roles;\n });\n });\n this.roles = access.roles;\n return access;\n },\n (): any => {\n this.roles = {};\n return null;\n }\n );\n\n let currentUserPromise: Promise<any>;\n if (this.config.oauth) {\n // Make a fix to the hash to remove starting \"/\" that angular might put there.\n if (window.location.hash && window.location.hash.match(/^#\\/access_token/)) {\n history.pushState(null, null, window.location.hash.replace(/^#\\/access_token/, '#access_token'));\n }\n\n // Initiate the SSO if they provide oauth settings.\n currentUserPromise = Formio.ssoInit(this.config.oauth.type, this.config.oauth.options);\n } else {\n currentUserPromise = Formio.currentUser();\n }\n\n this.userReady = currentUserPromise.then((user: any) => {\n this.setUser(user);\n return user;\n });\n\n // Trigger we are redy when all promises have resolved.\n if (this.accessReady) {\n this.accessReady\n .then(() => this.projectReady)\n .then(() => this.userReady)\n .then(() => this.readyResolve(true))\n .catch((err: any) => this.readyReject(err));\n }\n }\n\n setUser(user: any) {\n const namespace = Formio.namespace || 'formio';\n if (user) {\n this.user = user;\n localStorage.setItem(`${namespace}AppUser`, JSON.stringify(user));\n this.setUserRoles();\n } else {\n this.user = null;\n this.is = {};\n localStorage.removeItem(`${namespace}AppUser`);\n Formio.clearCache();\n Formio.setUser(null);\n }\n\n this.authenticated = !!Formio.getToken();\n this.onUser.emit(this.user);\n }\n\n setUserRoles() {\n if (this.accessReady) {\n this.accessReady.then(() => {\n each(this.roles, (role: any, roleName: string) => {\n if (this.user.roles.indexOf(role._id) !== -1) {\n this.is[roleName] = true;\n }\n });\n });\n }\n }\n\n logoutError() {\n this.setUser(null);\n const namespace = Formio.namespace || 'formio';\n localStorage.removeItem(`${namespace}Token`);\n this.onError.emit();\n }\n\n logout() {\n this.setUser(null);\n const namespace = Formio.namespace || 'formio';\n if(localStorage.getItem(`${namespace}LogoutAuthUrl`)) {\n window.open(localStorage.getItem(`${namespace}LogoutAuthUrl`), null, 'width=1020,height=618');\n localStorage.removeItem(`${namespace}LogoutAuthUrl`)\n }\n this.handleLogout(namespace);\n }\n\n handleLogout(namespace) {\n localStorage.removeItem(`${namespace}Token`);\n Formio.logout()\n .then(() => this.onLogout.emit())\n .catch(() => this.logoutError());\n }\n}\n","import { Component } from '@angular/core';\n@Component({\n templateUrl: './auth.component.html'\n})\nexport class FormioAuthComponent {}\n","import { Component } from '@angular/core';\nimport { FormioAuthService } from '../auth.service';\n@Component({\n templateUrl: './login.component.html'\n})\nexport class FormioAuthLoginComponent {\n constructor(public service: FormioAuthService) {}\n}\n","import { Component } from '@angular/core';\nimport { FormioAuthService } from '../auth.service';\n@Component({\n templateUrl: './register.component.html'\n})\nexport class FormioAuthRegisterComponent {\n constructor(public service: FormioAuthService) {}\n}\n","import { Component } from '@angular/core';\nimport { FormioAuthService } from '../auth.service';\n@Component({\n templateUrl: './resetpass.component.html'\n})\nexport class FormioResetPassComponent {\n constructor(public service: FormioAuthService) {}\n}\n","import { Routes } from '@angular/router';\nimport { FormioAuthRouteConfig } from './auth.config';\nimport { FormioAuthComponent } from './auth.component';\nimport { FormioAuthLoginComponent } from './login/login.component';\nimport { FormioAuthRegisterComponent } from './register/register.component';\nimport { FormioResetPassComponent } from './resetpass/resetpass.component';\n\nexport function FormioAuthRoutes(config?: FormioAuthRouteConfig): Routes {\n return [\n {\n path: '',\n component: config && config.auth ? config.auth : FormioAuthComponent,\n children: [\n {\n path: '',\n redirectTo: 'login',\n pathMatch: 'full'\n },\n {\n path: 'login',\n component: config && config.login ? config.login : FormioAuthLoginComponent\n },\n {\n path: 'register',\n component: config && config.register ? config.register : FormioAuthRegisterComponent\n },\n {\n path: 'resetpass',\n component: config && config.resetpass ? config.resetpass : FormioResetPassComponent\n }\n ]\n }\n ];\n}\n","import { NgModule } from '@angular/core';\nimport { CommonModule } from '@angular/common';\nimport { RouterModule } from '@angular/router';\nimport { FormioModule } from '@formio/angular';\nimport { FormioAuthComponent } from './auth.component';\nimport { FormioAuthLoginComponent } from './login/login.component';\nimport { FormioAuthRegisterComponent } from './register/register.component';\nimport { FormioResetPassComponent } from './resetpass/resetpass.component';\nimport { FormioAuthRouteConfig } from './auth.config';\nimport { FormioAuthRoutes } from './auth.routes';\nimport { extendRouter } from '@formio/angular';\n\n@NgModule({\n imports: [\n CommonModule,\n FormioModule,\n RouterModule\n ],\n declarations: [\n FormioAuthComponent,\n FormioAuthLoginComponent,\n FormioAuthRegisterComponent,\n FormioResetPassComponent\n ]\n})\nexport class FormioAuth {\n static forRoot(config?: FormioAuthRouteConfig): any {\n return extendRouter(FormioAuth, config, FormioAuthRoutes);\n }\n static forChild(config?: FormioAuthRouteConfig): any {\n return extendRouter(FormioAuth, config, FormioAuthRoutes);\n }\n}\n","/*\n * Public API Surface of angular-formio\n */\n\nexport * from './index';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public_api';\n"],"names":["Injectable","Formio","get","EventEmitter","each","FormioAppConfig","Component","extendRouter","NgModule","CommonModule","FormioModule","RouterModule"],"mappings":";;;;;;AAgBA,QAAA,gBAAA,kBAAA,YAAA;IAAA,IAAA,SAAA,gBAAA,GAAA;;;;;gBADCA,eAAU,EAAA;;IAgBX,IAAY,eAGX,CAAA;IAHD,CAAA,UAAY,eAAe,EAAA;IACzB,IAAA,eAAA,CAAA,MAAA,CAAA,GAAA,MAAa,CAAA;IACb,IAAA,eAAA,CAAA,MAAA,CAAA,GAAA,MAAa,CAAA;IACf,CAAC,EAHW,eAAe,KAAf,eAAe,GAG1B,EAAA,CAAA,CAAA;;AC3BD,QAAA,iBAAA,kBAAA,YAAA;QA4BE,SACS,iBAAA,CAAA,SAA0B,EAC1B,MAAwB,EAAA;YAFjC,IA2CC,KAAA,GAAA,IAAA,CAAA;IA1CQ,QAAA,IAAS,CAAA,SAAA,GAAT,SAAS,CAAiB;IAC1B,QAAA,IAAM,CAAA,MAAA,GAAN,MAAM,CAAkB;IA5B1B,QAAA,IAAa,CAAA,aAAA,GAAG,KAAK,CAAC;IAqBtB,QAAA,IAAU,CAAA,UAAA,GAAQ,EAAE,CAAC;IACrB,QAAA,IAAgB,CAAA,gBAAA,GAAQ,EAAE,CAAC;IAE3B,QAAA,IAAE,CAAA,EAAA,GAAQ,EAAE,CAAC;IAMlB,QAAA,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;YAEjB,IAAI,IAAI,CAAC,SAAS,IAAI,IAAI,CAAC,SAAS,CAAC,MAAM,EAAE;gBAC3CC,eAAM,CAAC,UAAU,CAAC,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC;gBACzCA,eAAM,CAAC,aAAa,CAAC,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC;gBAC5CA,eAAM,CAAC,QAAQ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AM,CAAC,KAAK,GAAG,MAAM,CAAC,KAAK,GAAG,wBAAwB;IAC5E,iBAAA;IACD,gBAAA;IACE,oBAAA,IAAI,EAAE,UAAU;IAChB,oBAAA,SAAS,EAAE,MAAM,IAAI,MAAM,CAAC,QAAQ,GAAG,MAAM,CAAC,QAAQ,GAAG,2BAA2B;IACrF,iBAAA;IACD,gBAAA;IACE,oBAAA,IAAI,EAAE,WAAW;IACjB,oBAAA,SAAS,EAAE,MAAM,IAAI,MAAM,CAAC,SAAS,GAAG,MAAM,CAAC,SAAS,GAAG,wBAAwB;IACpF,iBAAA;IACF,aAAA;IACF,SAAA;SACF,CAAC;IACJ;;ACRA,QAAA,UAAA,kBAAA,YAAA;IAAA,IAAA,SAAA,UAAA,GAAA;;QACS,UAAO,CAAA,OAAA,GAAd,UAAe,MAA8B,EAAA;YAC3C,OAAOC,oBAAY,CAAC,UAAU,EAAE,MAAM,EAAE,gBAAgB,CAAC,CAAC;SAC3D,CAAA;QACM,UAAQ,CAAA,QAAA,GAAf,UAAgB,MAA8B,EAAA;YAC5C,OAAOA,oBAAY,CAAC,UAAU,EAAE,MAAM,EAAE,gBAAgB,CAAC,CAAC;SAC3D,CAAA;;;;IAnBF,IAAA,EAAA,IAAA,EAAAC,aAAQ,EAAC,IAAA,EAAA,CAAA;IACR,gBAAA,OAAO,EAAE;wBACPC,mBAAY;wBACZC,oBAAY;wBACZC,mBAAY;IACb,iBAAA;IACD,gBAAA,YAAY,EAAE;wBACZ,mBAAmB;wBACnB,wBAAwB;wBACxB,2BAA2B;wBAC3B,wBAAwB;IACzB,iBAAA;IACF,aAAA,EAAA,EAAA;;;ICxBD;;IAEG;;ICFH;;IAEG;;;;;;;;;;;;;;;;;"}
|
|
1
|
+
{"version":3,"file":"formio-angular-auth.umd.js","sources":["../../../projects/angular-formio/auth/src/auth.config.ts","../../../projects/angular-formio/auth/src/auth.service.ts","../../../projects/angular-formio/auth/src/auth.component.ts","../../../projects/angular-formio/auth/src/login/login.component.ts","../../../projects/angular-formio/auth/src/register/register.component.ts","../../../projects/angular-formio/auth/src/resetpass/resetpass.component.ts","../../../projects/angular-formio/auth/src/auth.routes.ts","../../../projects/angular-formio/auth/src/auth.module.ts","../../../projects/angular-formio/auth/src/public_api.ts","../../../projects/angular-formio/auth/src/formio-angular-auth.ts"],"sourcesContent":["import { Injectable } from '@angular/core';\n\nexport interface FormioAuthFormConfig {\n path?: string;\n form?: string;\n component?: any;\n}\n\nexport interface FormioAuthRouteConfig {\n auth?: any;\n login?: any;\n register?: any;\n resetpass?: any;\n}\n\n@Injectable()\nexport class FormioAuthConfig {\n component?: any;\n delayAuth?: any;\n login?: FormioAuthFormConfig;\n register?: FormioAuthFormConfig;\n resetpass?: FormioAuthFormConfig;\n oauth?: FormioOAuthConfig;\n}\n\n\nexport interface FormioOAuthConfig {\n type: FormioOauthType;\n options: FormioOktaConfig | FormioSamlConfig;\n}\n\nexport enum FormioOauthType {\n okta = 'okta',\n saml = 'saml',\n}\n\nexport interface FormioOktaConfig extends OktaConfig {\n formio?: any;\n}\n\nexport interface FormioSamlConfig {\n relay: string;\n}\n\n// for more details about Okta configuration options see https://github.com/okta/okta-auth-js#configuration-reference\nexport interface OktaConfig {\n url?: string;\n tokenManager?: OktaTokenManagerConfig;\n issuer?: string;\n clientId?: string;\n redirectUri?: string;\n postLogoutRedirectUri?: string;\n pkce?: boolean;\n authorizeUrl?: string;\n userinfoUrl?: string;\n tokenUrl?: string;\n ignoreSignature?: boolean;\n maxClockSkew?: number;\n scopes?: string[];\n httpRequestClient?: Function;\n}\n\nexport interface OktaTokenManagerConfig {\n storage?: string | {\n getItem?: Function;\n setItem?: Function;\n };\n secure?: boolean;\n autoRenew?: boolean;\n expireEarlySeconds?: number;\n storageKey?: string;\n}\n","import { EventEmitter, Injectable, Inject } from '@angular/core';\nimport { FormioAuthConfig } from './auth.config';\nimport { FormioAppConfig } from '@formio/angular';\nimport { get, each } from 'lodash';\nimport { Formio } from 'formiojs';\n\n@Injectable()\nexport class FormioAuthService {\n public user: any;\n public authenticated = false;\n\n public loginForm: string;\n public onLogin: EventEmitter<object>;\n public onLogout: EventEmitter<object>;\n\n public registerForm: string;\n public onRegister: EventEmitter<object>;\n public onUser: EventEmitter<object>;\n public onError: EventEmitter<any>;\n\n public resetPassForm: string;\n public onResetPass: EventEmitter<object>;\n\n public ready: Promise<boolean>;\n public readyResolve: any;\n public readyReject: any;\n\n public projectReady?: Promise<any>;\n public accessReady?: Promise<any>;\n public userReady?: Promise<any>;\n public formAccess: any = {};\n public submissionAccess: any = {};\n public roles: any;\n public is: any = {};\n\n constructor(\n public appConfig: FormioAppConfig,\n public config: FormioAuthConfig\n ) {\n this.user = null;\n\n if (this.appConfig && this.appConfig.appUrl) {\n Formio.setBaseUrl(this.appConfig.apiUrl);\n Formio.setProjectUrl(this.appConfig.appUrl);\n Formio.formOnly = !!this.appConfig.formOnly;\n } else {\n console.error('You must provide an AppConfig within your application!');\n }\n\n this.loginForm =\n this.appConfig.appUrl +\n '/' +\n get(this.config, 'login.form', 'user/login');\n this.registerForm =\n this.appConfig.appUrl +\n '/' +\n get(this.config, 'register.form', 'user/register');\n this.resetPassForm =\n this.appConfig.appUrl +\n '/' +\n get(this.config, 'register.form', 'resetpass');\n this.onLogin = new EventEmitter();\n this.onLogout = new EventEmitter();\n this.onRegister = new EventEmitter();\n this.onUser = new EventEmitter();\n this.onError = new EventEmitter();\n\n this.ready = new Promise((resolve: any, reject: any) => {\n this.readyResolve = resolve;\n this.readyReject = reject;\n });\n\n // Register for the core events.\n Formio.events.on('formio.badToken', () => this.logoutError());\n Formio.events.on('formio.sessionExpired', () => this.logoutError());\n if (!this.config.delayAuth) {\n this.init();\n }\n }\n\n onLoginSubmit(submission: object) {\n this.setUser(submission);\n this.onLogin.emit(submission);\n }\n\n onRegisterSubmit(submission: object) {\n this.setUser(submission);\n this.onRegister.emit(submission);\n }\n\n onResetPassSubmit(submission: object) {\n this.onResetPass.emit(submission);\n }\n\n init() {\n this.projectReady = Formio.makeStaticRequest(this.appConfig.appUrl).then(\n (project: any) => {\n each(project.access, (access: any) => {\n this.formAccess[access.type] = access.roles;\n });\n },\n (): any => {\n this.formAccess = {};\n return null;\n }\n );\n\n // Get the access for this project.\n this.accessReady = Formio.makeStaticRequest(\n this.appConfig.appUrl + '/access'\n ).then(\n (access: any) => {\n each(access.forms, (form: any) => {\n this.submissionAccess[form.name] = {};\n form.submissionAccess.forEach((subAccess: any) => {\n this.submissionAccess[form.name][subAccess.type] = subAccess.roles;\n });\n });\n this.roles = access.roles;\n return access;\n },\n (): any => {\n this.roles = {};\n return null;\n }\n );\n\n let currentUserPromise: Promise<any>;\n if (this.config.oauth) {\n // Make a fix to the hash to remove starting \"/\" that angular might put there.\n if (window.location.hash && window.location.hash.match(/^#\\/access_token/)) {\n history.pushState(null, null, window.location.hash.replace(/^#\\/access_token/, '#access_token'));\n }\n\n // Initiate the SSO if they provide oauth settings.\n currentUserPromise = Formio.ssoInit(this.config.oauth.type, this.config.oauth.options);\n } else {\n currentUserPromise = Formio.currentUser();\n }\n\n this.userReady = currentUserPromise.then((user: any) => {\n this.setUser(user);\n return user;\n });\n\n // Trigger we are redy when all promises have resolved.\n if (this.accessReady) {\n this.accessReady\n .then(() => this.projectReady)\n .then(() => this.userReady)\n .then(() => this.readyResolve(true))\n .catch((err: any) => this.readyReject(err));\n }\n }\n\n setUser(user: any) {\n const namespace = Formio.namespace || 'formio';\n if (user) {\n this.user = user;\n localStorage.setItem(`${namespace}AppUser`, JSON.stringify(user));\n this.setUserRoles();\n } else {\n this.user = null;\n this.is = {};\n localStorage.removeItem(`${namespace}AppUser`);\n Formio.clearCache();\n Formio.setUser(null);\n }\n\n this.authenticated = !!Formio.getToken();\n this.onUser.emit(this.user);\n }\n\n setUserRoles() {\n if (this.accessReady) {\n this.accessReady.then(() => {\n each(this.roles, (role: any, roleName: string) => {\n if (this.user.roles.indexOf(role._id) !== -1) {\n this.is[roleName] = true;\n }\n });\n });\n }\n }\n\n logoutError() {\n this.setUser(null);\n const namespace = Formio.namespace || 'formio';\n localStorage.removeItem(`${namespace}Token`);\n this.onError.emit();\n }\n\n logout() {\n Formio.logout()\n .then(() => {\n this.setUser(null);\n const namespace = Formio.namespace || 'formio';\n if (localStorage.getItem(`${namespace}LogoutAuthUrl`)) {\n window.open(localStorage.getItem(`${namespace}LogoutAuthUrl`), null, 'width=1020,height=618');\n localStorage.removeItem(`${namespace}LogoutAuthUrl`);\n }\n localStorage.removeItem(`${namespace}Token`);\n this.onLogout.emit();\n })\n .catch(() => this.logoutError());\n }\n}\n","import { Component } from '@angular/core';\n@Component({\n templateUrl: './auth.component.html'\n})\nexport class FormioAuthComponent {}\n","import { Component } from '@angular/core';\nimport { FormioAuthService } from '../auth.service';\n@Component({\n templateUrl: './login.component.html'\n})\nexport class FormioAuthLoginComponent {\n constructor(public service: FormioAuthService) {}\n}\n","import { Component } from '@angular/core';\nimport { FormioAuthService } from '../auth.service';\n@Component({\n templateUrl: './register.component.html'\n})\nexport class FormioAuthRegisterComponent {\n constructor(public service: FormioAuthService) {}\n}\n","import { Component } from '@angular/core';\nimport { FormioAuthService } from '../auth.service';\n@Component({\n templateUrl: './resetpass.component.html'\n})\nexport class FormioResetPassComponent {\n constructor(public service: FormioAuthService) {}\n}\n","import { Routes } from '@angular/router';\nimport { FormioAuthRouteConfig } from './auth.config';\nimport { FormioAuthComponent } from './auth.component';\nimport { FormioAuthLoginComponent } from './login/login.component';\nimport { FormioAuthRegisterComponent } from './register/register.component';\nimport { FormioResetPassComponent } from './resetpass/resetpass.component';\n\nexport function FormioAuthRoutes(config?: FormioAuthRouteConfig): Routes {\n return [\n {\n path: '',\n component: config && config.auth ? config.auth : FormioAuthComponent,\n children: [\n {\n path: '',\n redirectTo: 'login',\n pathMatch: 'full'\n },\n {\n path: 'login',\n component: config && config.login ? config.login : FormioAuthLoginComponent\n },\n {\n path: 'register',\n component: config && config.register ? config.register : FormioAuthRegisterComponent\n },\n {\n path: 'resetpass',\n component: config && config.resetpass ? config.resetpass : FormioResetPassComponent\n }\n ]\n }\n ];\n}\n","import { NgModule } from '@angular/core';\nimport { CommonModule } from '@angular/common';\nimport { RouterModule } from '@angular/router';\nimport { FormioModule } from '@formio/angular';\nimport { FormioAuthComponent } from './auth.component';\nimport { FormioAuthLoginComponent } from './login/login.component';\nimport { FormioAuthRegisterComponent } from './register/register.component';\nimport { FormioResetPassComponent } from './resetpass/resetpass.component';\nimport { FormioAuthRouteConfig } from './auth.config';\nimport { FormioAuthRoutes } from './auth.routes';\nimport { extendRouter } from '@formio/angular';\n\n@NgModule({\n imports: [\n CommonModule,\n FormioModule,\n RouterModule\n ],\n declarations: [\n FormioAuthComponent,\n FormioAuthLoginComponent,\n FormioAuthRegisterComponent,\n FormioResetPassComponent\n ]\n})\nexport class FormioAuth {\n static forRoot(config?: FormioAuthRouteConfig): any {\n return extendRouter(FormioAuth, config, FormioAuthRoutes);\n }\n static forChild(config?: FormioAuthRouteConfig): any {\n return extendRouter(FormioAuth, config, FormioAuthRoutes);\n }\n}\n","/*\n * Public API Surface of angular-formio\n */\n\nexport * from './index';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public_api';\n"],"names":["Injectable","Formio","get","EventEmitter","each","FormioAppConfig","Component","extendRouter","NgModule","CommonModule","FormioModule","RouterModule"],"mappings":";;;;;;AAgBA,QAAA,gBAAA,kBAAA,YAAA;IAAA,IAAA,SAAA,gBAAA,GAAA;;;;;gBADCA,eAAU,EAAA;;IAgBX,IAAY,eAGX,CAAA;IAHD,CAAA,UAAY,eAAe,EAAA;IACzB,IAAA,eAAA,CAAA,MAAA,CAAA,GAAA,MAAa,CAAA;IACb,IAAA,eAAA,CAAA,MAAA,CAAA,GAAA,MAAa,CAAA;IACf,CAAC,EAHW,eAAe,KAAf,eAAe,GAG1B,EAAA,CAAA,CAAA;;AC3BD,QAAA,iBAAA,kBAAA,YAAA;QA4BE,SACS,iBAAA,CAAA,SAA0B,EAC1B,MAAwB,EAAA;YAFjC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AAgB,CAAC,CAAC;SAC3D,CAAA;;;;IAnBF,IAAA,EAAA,IAAA,EAAAC,aAAQ,EAAC,IAAA,EAAA,CAAA;IACR,gBAAA,OAAO,EAAE;wBACPC,mBAAY;wBACZC,oBAAY;wBACZC,mBAAY;IACb,iBAAA;IACD,gBAAA,YAAY,EAAE;wBACZ,mBAAmB;wBACnB,wBAAwB;wBACxB,2BAA2B;wBAC3B,wBAAwB;IACzB,iBAAA;IACF,aAAA,EAAA,EAAA;;;ICxBD;;IAEG;;ICFH;;IAEG;;;;;;;;;;;;;;;;;"}
|
|
@@ -647,7 +647,7 @@
|
|
|
647
647
|
FormGridBodyComponent.decorators = [
|
|
648
648
|
{ type: core.Component, args: [{
|
|
649
649
|
selector: 'form-grid-body',
|
|
650
|
-
template: "<ng-template>\n <tbody *ngIf=\"rows\">\n <tr *ngFor=\"let form of rows\">\n <td>\n <div class=\"row\">\n <div class=\"col-sm-8\">\n <a routerLink=\"{{form._id}}/view\" (click)=\"onRowSelect($event, form)\"><h5>{{ form.title }}</h5></a>\n <div class=\"form-updated small text-muted\">\n Updated {{ form.modified | timeSince }} ago\n </div>\n </div>\n <div class=\"col-sm-4\">\n <button *ngIf=\"actionAllowed('formView')\" class=\"btn btn-outline-secondary btn-sm form-btn form-btn-use\" (click)=\"onRowAction($event, form, 'view')\"><span class=\"fa fa-pencil\"></span> Enter Data</button> \n <button *ngIf=\"actionAllowed('formSubmission')\" class=\"btn btn-outline-secondary btn-sm form-btn\" (click)=\"onRowAction($event, form, 'submission')\"><span class=\"fa fa-list-alt\"></span> View Data</button> \n <button *ngIf=\"actionAllowed('formEdit')\" class=\"btn btn-outline-secondary btn-sm form-btn\" (click)=\"onRowAction($event, form, 'edit')\"><span class=\"fa fa-edit\"></span> Edit Form</button> \n <button *ngIf=\"actionAllowed('
|
|
650
|
+
template: "<ng-template>\n <tbody *ngIf=\"rows\">\n <tr *ngFor=\"let form of rows\">\n <td>\n <div class=\"row\">\n <div class=\"col-sm-8\">\n <a routerLink=\"{{form._id}}/view\" (click)=\"onRowSelect($event, form)\"><h5>{{ form.title }}</h5></a>\n <div class=\"form-updated small text-muted\">\n Updated {{ form.modified | timeSince }} ago\n </div>\n </div>\n <div class=\"col-sm-4\">\n <button *ngIf=\"actionAllowed('formView')\" class=\"btn btn-outline-secondary btn-sm form-btn form-btn-use\" (click)=\"onRowAction($event, form, 'view')\"><span class=\"fa fa-pencil\"></span> Enter Data</button> \n <button *ngIf=\"actionAllowed('formSubmission')\" class=\"btn btn-outline-secondary btn-sm form-btn\" (click)=\"onRowAction($event, form, 'submission')\"><span class=\"fa fa-list-alt\"></span> View Data</button> \n <button *ngIf=\"actionAllowed('formEdit')\" class=\"btn btn-outline-secondary btn-sm form-btn\" (click)=\"onRowAction($event, form, 'edit')\"><span class=\"fa fa-edit\"></span> Edit Form</button> \n <button *ngIf=\"actionAllowed('formDelete')\" class=\"btn btn-danger btn-sm form-btn form-btn-delete\" (click)=\"onRowAction($event, form, 'delete')\" title=\"Delete form\"><span class=\"fa fa-trash\"></span></button>\n </div>\n </div>\n </td>\n </tr>\n </tbody>\n</ng-template>\n",
|
|
651
651
|
styles: [".form-btn{font-size:.75rem;margin:2px 0}\n"]
|
|
652
652
|
},] }
|
|
653
653
|
];
|