]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/commitdiff
remove confirm modal for asset injection in edit-custom-config (#1219)
authorMicah Elizabeth Scott <beth@scanlime.org>
Sun, 7 Oct 2018 20:07:14 +0000 (13:07 -0700)
committerRigel Kent <par@rigelk.eu>
Sun, 7 Oct 2018 20:07:14 +0000 (22:07 +0200)
client/src/app/+admin/config/edit-custom-config/edit-custom-config.component.ts

index 4983b0425d4280ef0d5459c3f527a08725c2b703..25b303f44f18929a75eb6ed46e5b96c093a53806 100644 (file)
@@ -1,6 +1,5 @@
 import { Component, OnInit } from '@angular/core'
 import { ConfigService } from '@app/+admin/config/shared/config.service'
-import { ConfirmService } from '@app/core'
 import { ServerService } from '@app/core/server/server.service'
 import { CustomConfigValidatorsService, FormReactive, UserValidatorsService } from '@app/shared'
 import { NotificationsService } from 'angular2-notifications'
@@ -29,7 +28,6 @@ export class EditCustomConfigComponent extends FormReactive implements OnInit {
     private notificationsService: NotificationsService,
     private configService: ConfigService,
     private serverService: ServerService,
-    private confirmService: ConfirmService,
     private i18n: I18n
   ) {
     super()
@@ -124,28 +122,6 @@ export class EditCustomConfigComponent extends FormReactive implements OnInit {
   }
 
   async formValidated () {
-    const newCustomizationJavascript = this.form.value['customizationJavascript']
-    const newCustomizationCSS = this.form.value['customizationCSS']
-
-    const customizations = []
-    if (newCustomizationJavascript && newCustomizationJavascript !== this.oldCustomJavascript) customizations.push('JavaScript')
-    if (newCustomizationCSS && newCustomizationCSS !== this.oldCustomCSS) customizations.push('CSS')
-
-    if (customizations.length !== 0) {
-      const customizationsText = customizations.join('/')
-
-      // FIXME: i18n service does not support string concatenation
-      const message = this.i18n('You set custom {{customizationsText}}. ', { customizationsText }) +
-        this.i18n('This could lead to security issues or bugs if you do not understand it. ') +
-        this.i18n('Are you sure you want to update the configuration?')
-
-      const label = this.i18n('Please type') + ` "I understand the ${customizationsText} I set" ` + this.i18n('to confirm.')
-      const expectedInputValue = `I understand the ${customizationsText} I set`
-
-      const confirmRes = await this.confirmService.confirmWithInput(message, label, expectedInputValue)
-      if (confirmRes === false) return
-    }
-
     const data: CustomConfig = {
       instance: {
         name: this.form.value['instanceName'],