From a4f35e4961cd256be09cded4c0161bdfb7fbfe88 Mon Sep 17 00:00:00 2001
From: Guillaume Heurtier <guillaume.heurtier@maarch.org>
Date: Mon, 28 Dec 2020 14:14:12 +0100
Subject: [PATCH] FEAT #15751 TIME 2:55 run tu with gitlab

---
 .gitlab-ci.yml                                | 19 ++-----------------
 ci/docker_install_php.sh                      |  9 ++++++++-
 lang/fr.json                                  |  2 +-
 .../app/document/document.component.ts        |  3 ++-
 .../ConfigurationControllerTest.php           |  6 ++++--
 5 files changed, 17 insertions(+), 22 deletions(-)

diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 8459d5c995..4c0639172d 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -12,32 +12,17 @@ stages:
   - test
 
 before_script:
-  - ls -al
   - apt-get update -yqq > /dev/null
-  - mkdir -p /usr/share/man/man1
-  - mkdir -p /usr/share/man/man7
-  #- apt-get install apt-utils -yqq > /dev/null
   - apt-get install cron -yqq > /dev/null
-  #- apt-get install tar -yqq > /dev/null
-  #- apt-get install wkhtmltopdf -yqq > /dev/null
-  #- apt-get install wget -yqq > /dev/null
-  #- wget https://downloads.wkhtmltopdf.org/0.12/0.12.4/wkhtmltox-0.12.4_linux-generic-amd64.tar.xz
-  #- tar xvf wkhtmltox-0.12.4_linux-generic-amd64.tar.xz
-  #- mv wkhtmltox/bin/wkhtmlto* /usr/bin
-  #- chmod +x /usr/bin/wkhtmlto*
-  #- apt-get install libreoffice -yqq > /dev/null
-#  - apt-get install git -yqq > /dev/null
   - bash ci/docker_install_php.sh > /dev/null
   - ls -al
   - cat directory.txt
   - bash ci/docker_install_database.sh > /dev/null
   - mkdir -p /opt/maarchparapheur/docservers/{documents,attachments,signatures,esigned_documents}
-  - mkdir -p /var/www/html/
-#  - cp -r . /var/www/html/MaarchParapheur
   - ln -s $CI_PROJECT_DIR /var/www/html/MaarchParapheur
   - cd /var/www/html/MaarchParapheur
-#  - sed 's/127.0.0.1/postgres/' config/config.xml.default > config/config.xml
-  - sed 's!<server>.*</server>!<server>127.0.0.1</server>!;s!<password>.*</password>!<password>maarch</password>!;s!<name>.*</name>!<name>maarchparapheur</name>!;s!<user>.*</user>!<user>maarch</user>!;s!<enable>.*</enable>!<enable>true</enable>!' config/config.xml.default > config/config.xml
+  - sed 's!<server>.*</server>!<server>postgres</server>!;s!<password>.*</password>!<password>maarch</password>!;s!<name>.*</name>!<name>MaarchParapheur</name>!;s!<user>.*</user>!<user>maarch</user>!;s!<enable>.*</enable>!<enable>true</enable>!' config/config.xml.default > config/config.xml
+  - cat config/config.xml
   - sed -i 's/rights="none" pattern="PDF"/rights="read | write" pattern="PDF"/' /etc/ImageMagick-6/policy.xml
 
 job_php-7.4:
diff --git a/ci/docker_install_php.sh b/ci/docker_install_php.sh
index 536e5b5de5..5c73146a6c 100644
--- a/ci/docker_install_php.sh
+++ b/ci/docker_install_php.sh
@@ -5,11 +5,12 @@
 
 set -xe
 
-apt-get install -y libpq-dev libxml2-dev libxslt1-dev libpng-dev unoconv xpdf-utils imagemagick ghostscript \
+apt-get install -y libpq-dev libxml2-dev libxslt1-dev libpng-dev libzip-dev unoconv xpdf-utils imagemagick ghostscript \
   && docker-php-ext-configure pgsql -with-pgsql=/usr/local/pgsql \
   && docker-php-ext-configure pdo_pgsql --with-pdo-pgsql \
   && docker-php-ext-install pdo_pgsql pgsql \
   && docker-php-ext-install xsl \
+  && docker-php-ext-install zip \
   && pecl install xdebug-2.9.3 \
   && docker-php-ext-enable xdebug \
   && docker-php-ext-install gd \
@@ -25,3 +26,9 @@ apt-get install -y libpq-dev libxml2-dev libxslt1-dev libpng-dev unoconv xpdf-ut
   && echo "</Directory>" >> directory.txt \
   && sed -i -e '/CustomLog/r directory.txt' /etc/apache2/sites-available/000-default.conf \
   && cp ci/php.ini /usr/local/etc/php/conf.d/php.ini
+
+# Install needed php extensions: ldap
+apt-get update && \
+    apt-get install libldap2-dev -y && \
+#    docker-php-ext-configure ldap --with-libdir=lib/x86_64-linux-gnu/ && \
+    docker-php-ext-install ldap
diff --git a/lang/fr.json b/lang/fr.json
index 949379e710..3d25da7b90 100755
--- a/lang/fr.json
+++ b/lang/fr.json
@@ -418,7 +418,7 @@
 		"resource": "Ressource",
 		"manage_historyAdmin": "Consulter l'historique",
 		"manage_historyDesc": "Consulter les différents événements de l'application",
-		"loadingValidation": "Validation du document en cours ...",
+		"loadingValidation": "Validation en cours du document ...",
 		"workflowTemplateAdded": "Modèle de circuit ajouté",
 		"by": "par",
 		"the": "le",
diff --git a/src/frontend/app/document/document.component.ts b/src/frontend/app/document/document.component.ts
index ea51d0cf79..134578861f 100755
--- a/src/frontend/app/document/document.component.ts
+++ b/src/frontend/app/document/document.component.ts
@@ -662,7 +662,7 @@ export class DocumentComponent implements OnInit {
                         }).then((load: HTMLIonLoadingElement) => {
                             this.load = load;
                             this.load.present();
-                            if ((currentUserWorkflow.signatureMode === 'rgs_2stars') || (currentUserWorkflow.signatureMode === 'inca_card') || (currentUserWorkflow.signatureMode === 'rgs_2stars_timestamped' ) || (currentUserWorkflow.signatureMode === 'inca_card_eidas')) {
+                            if ((currentUserWorkflow.signatureMode === 'rgs_2stars') || (currentUserWorkflow.signatureMode === 'inca_card')) {
                                 this.load.dismiss();
                             }
                         });
@@ -674,6 +674,7 @@ export class DocumentComponent implements OnInit {
                                     this.signaturesService.documentsListCount.current--;
                                 }
                             }
+                            this.load.present();                           
                                 const config: MatBottomSheetConfig = {
                                     disableClose: true,
                                     direction: 'ltr'
diff --git a/test/unitTests/app/configuration/ConfigurationControllerTest.php b/test/unitTests/app/configuration/ConfigurationControllerTest.php
index ba1987db5b..44463a33f3 100755
--- a/test/unitTests/app/configuration/ConfigurationControllerTest.php
+++ b/test/unitTests/app/configuration/ConfigurationControllerTest.php
@@ -18,8 +18,10 @@ class ConfigurationControllerTest extends TestCase
 
     public function testCreate()
     {
-        \Configuration\models\ConfigurationModel::delete(['id' => 1]);
-        \Configuration\models\ConfigurationModel::delete(['id' => 2]);
+        $configuration = \Configuration\models\ConfigurationModel::getByIdentifier(['identifier' => 'emailServer', 'select' => ['id']]);
+        \Configuration\models\ConfigurationModel::delete(['id' => $configuration[0]['id']]);
+        $configuration = \Configuration\models\ConfigurationModel::getByIdentifier(['identifier' => 'ldapServer', 'select' => ['id']]);
+        \Configuration\models\ConfigurationModel::delete(['id' => $configuration[0]['id']]);
 
         $configurationController = new \Configuration\controllers\ConfigurationController();
 
-- 
GitLab