From 232961be0264b66a28e18b16dd26346b4530ed9e Mon Sep 17 00:00:00 2001 From: Daniel Date: Mon, 12 Jun 2023 10:50:27 +0200 Subject: [PATCH] runnable app, might still contain errors --- 1-update-frontend.sh | 103 ++++++++++++++++++ httpdocs/angular.json | 2 +- httpdocs/src/app/app-routing.module.ts | 6 - httpdocs/src/app/app.component.ts | 1 + httpdocs/src/app/app.module.ts | 3 +- .../app/components/aside/aside.component.html | 6 +- .../app/components/aside/aside.component.ts | 9 +- .../http.interceptor.ts | 0 .../src/app/interceptor/route-interceptor.ts | 5 +- httpdocs/src/app/model/entities/user-type.ts | 1 - httpdocs/src/app/model/entities/user.ts | 2 +- httpdocs/src/app/services/app.service.ts | 6 +- httpdocs/src/app/services/http.service.ts | 2 +- httpdocs/src/app/utils/const.ts | 5 - .../customer-contact-list.component.html | 2 +- .../customer-contact-list.component.ts | 4 +- .../customer-list.component.html | 2 +- .../customer-list/customer-list.component.ts | 4 +- ...tomer-contact-person-detail.component.html | 2 +- ...ustomer-contact-person-detail.component.ts | 4 +- ...ustomer-contact-person-view.component.html | 2 +- .../customer-contact-person-view.component.ts | 4 +- .../customer-data-view.component.html | 2 +- .../customer-data-view.component.ts | 4 +- .../customer-meeting-view.component.html | 2 +- .../customer-meeting-view.component.ts | 4 +- .../customer-note-detail.component.html | 2 +- .../customer-note-detail.component.ts | 4 +- .../customer-note-view.component.html | 2 +- .../customer-note-view.component.ts | 4 +- .../src/app/views/login/login.component.html | 3 + .../src/app/views/login/login.component.ts | 17 ++- .../meeting-calendar.component.html | 2 +- httpdocs/src/environments/environment.ts | 1 + 34 files changed, 163 insertions(+), 59 deletions(-) create mode 100755 1-update-frontend.sh rename httpdocs/src/app/{services => interceptor}/http.interceptor.ts (100%) diff --git a/1-update-frontend.sh b/1-update-frontend.sh new file mode 100755 index 0000000..eb1b3d5 --- /dev/null +++ b/1-update-frontend.sh @@ -0,0 +1,103 @@ +#!/bin/bash + +#export PATH=/opt/plesk/php/7.2/bin:$PATH; + +# Go into Maintenance Mode +#cp -rf /var/www/vhosts/h2790573.stratoserver.net/beta-too1s.h2790573.stratoserver.net/src/maintenance/index.php #/var/www/vhosts/h2790573.stratoserver.net/beta-too1s.h2790573.stratoserver.net/dist/ +#mv /var/www/vhosts/h2790573.stratoserver.net/beta-too1s.h2790573.stratoserver.net/dist/index.html #/var/www/vhosts/h2790573.stratoserver.net/beta-too1s.h2790573.stratoserver.net/dist/_index.html +#echo "$(tput setab 1)too1s is now in MAINTENANCE MODE!$(tput sgr 0)" + +# Check out beta +echo "$(tput setab 2)CRM backend will now be PULLED on LIVE$(tput sgr 0)" +cd /var/www/vhosts/plp-tool.de/httpdocs/git_repository/spt-plp-tool-gamma/httpdocs +git pull + +rm -rf /var/www/vhosts/plp-tool.de/httpdocs/plp-tool-live/symfony/composer.json +cp -rf /var/www/vhosts/plp-tool.de/httpdocs/git_repository/spt-plp-tool-gamma/httpdocs/symfony/composer.json /var/www/vhosts/plp-tool.de/httpdocs/plp-tool-live/symfony/ + +rm -rf /var/www/vhosts/plp-tool.de/httpdocs/plp-tool-live/symfony/composer.lock +cp -rf /var/www/vhosts/plp-tool.de/httpdocs/git_repository/spt-plp-tool-gamma/httpdocs/symfony/composer.lock /var/www/vhosts/plp-tool.de/httpdocs/plp-tool-live/symfony/ + +rm -rf /var/www/vhosts/plp-tool.de/httpdocs/plp-tool-live/symfony/symfony.lock +cp -rf /var/www/vhosts/plp-tool.de/httpdocs/git_repository/spt-plp-tool-gamma/httpdocs/symfony/symfony.lock /var/www/vhosts/plp-tool.de/httpdocs/plp-tool-live/symfony/ + +rm -rf /var/www/vhosts/plp-tool.de/httpdocs/plp-tool-live/symfony/updateDb.php +cp -rf /var/www/vhosts/plp-tool.de/httpdocs/git_repository/spt-plp-tool-gamma/httpdocs/symfony/updateDb.php /var/www/vhosts/plp-tool.de/httpdocs/plp-tool-live/symfony/ + +rm -rf /var/www/vhosts/plp-tool.de/httpdocs/plp-tool-live/symfony/assets/ +cp -rf /var/www/vhosts/plp-tool.de/httpdocs/git_repository/spt-plp-tool-gamma/httpdocs/symfony/assets /var/www/vhosts/plp-tool.de/httpdocs/plp-tool-live/symfony/ + +rm -rf /var/www/vhosts/plp-tool.de/httpdocs/plp-tool-live/symfony/import/ +cp -rf /var/www/vhosts/plp-tool.de/httpdocs/git_repository/spt-plp-tool-gamma/httpdocs/symfony/import /var/www/vhosts/plp-tool.de/httpdocs/plp-tool-live/symfony/ + +rm -rf /var/www/vhosts/plp-tool.de/httpdocs/plp-tool-live/symfony/public/ +cp -rf /var/www/vhosts/plp-tool.de/httpdocs/git_repository/spt-plp-tool-gamma/httpdocs/symfony/public /var/www/vhosts/plp-tool.de/httpdocs/plp-tool-live/symfony/ + +rm -rf /var/www/vhosts/plp-tool.de/httpdocs/plp-tool-live/symfony/src/ +cp -rf /var/www/vhosts/plp-tool.de/httpdocs/git_repository/spt-plp-tool-gamma/httpdocs/symfony/src /var/www/vhosts/plp-tool.de/httpdocs/plp-tool-live/symfony/ + +rm -rf /var/www/vhosts/plp-tool.de/httpdocs/plp-tool-live/symfony/templates/ +cp -rf /var/www/vhosts/plp-tool.de/httpdocs/git_repository/spt-plp-tool-gamma/httpdocs/symfony/templates /var/www/vhosts/plp-tool.de/httpdocs/plp-tool-live/symfony/ + +rm -rf /var/www/vhosts/plp-tool.de/httpdocs/plp-tool-live/symfony/config/services.yaml +cp -rf /var/www/vhosts/plp-tool.de/httpdocs/git_repository/spt-plp-tool-gamma/httpdocs/symfony/config/services.yaml /var/www/vhosts/plp-tool.de/httpdocs/plp-tool-live/symfony/config/ + +rm -rf /var/www/vhosts/plp-tool.de/httpdocs/plp-tool-live/symfony/config/packages/doctrine.yaml +cp -rf /var/www/vhosts/plp-tool.de/httpdocs/git_repository/spt-plp-tool-gamma/httpdocs/symfony/config/packages/doctrine.yaml /var/www/vhosts/plp-tool.de/httpdocs/plp-tool-live/symfony/config/packages/ + +rm -rf /var/www/vhosts/plp-tool.de/httpdocs/plp-tool-live/symfony/config/packages/framework.yaml +cp -rf /var/www/vhosts/plp-tool.de/httpdocs/git_repository/spt-plp-tool-gamma/httpdocs/symfony/config/packages/framework.yaml /var/www/vhosts/plp-tool.de/httpdocs/plp-tool-live/symfony/config/packages/ + +rm -rf /var/www/vhosts/plp-tool.de/httpdocs/plp-tool-live/symfony/config/packages/nelmio_cors.yaml +cp -rf /var/www/vhosts/plp-tool.de/httpdocs/git_repository/spt-plp-tool-gamma/httpdocs/symfony/config/packages/nelmio_cors.yaml /var/www/vhosts/plp-tool.de/httpdocs/plp-tool-live/symfony/config/packages/ + +rm -rf /var/www/vhosts/plp-tool.de/httpdocs/plp-tool-live/symfony/config/packages/security.yaml +cp -rf /var/www/vhosts/plp-tool.de/httpdocs/git_repository/spt-plp-tool-gamma/httpdocs/symfony/config/packages/security.yaml /var/www/vhosts/plp-tool.de/httpdocs/plp-tool-live/symfony/config/packages/ + +rm -rf /var/www/vhosts/plp-tool.de/httpdocs/plp-tool-live/symfony/config/packages/swiftmailer.yaml +cp -rf /var/www/vhosts/plp-tool.de/httpdocs/git_repository/spt-plp-tool-gamma/httpdocs/symfony/config/packages/swiftmailer.yaml /var/www/vhosts/plp-tool.de/httpdocs/plp-tool-live/symfony/config/packages/ + +cd /var/www/vhosts/plp-tool.de/httpdocs/plp-tool-live/symfony + +#php /var/www/vhosts/plp-tool.de/httpdocs/plp-tool-live/symfony/bin/console doctrine:schema:update --force +composer update +php updateDb.php + +echo "$(tput setab 2)DATABASE SCHEMA updated$(tput sgr 0)" + +php /var/www/vhosts/plp-tool.de/httpdocs/plp-tool-live/symfony/bin/console cache:clear --env=prod --no-debug --no-warmup + +echo "$(tput setab 2)CACHE cleared$(tput sgr 0)" + +rm -rf /var/www/vhosts/spawntree.de/crm.spawntree.de/httpdocs/e2e/ +rm -rf /var/www/vhosts/spawntree.de/crm.spawntree.de/httpdocs/src/ +rm -rf /var/www/vhosts/spawntree.de/crm.spawntree.de/httpdocs/.htaccess +rm -rf /var/www/vhosts/spawntree.de/crm.spawntree.de/httpdocs/.htpasswd +rm -rf /var/www/vhosts/spawntree.de/crm.spawntree.de/httpdocs/README.md +rm -rf /var/www/vhosts/spawntree.de/crm.spawntree.de/httpdocs/angular.json +rm -rf /var/www/vhosts/spawntree.de/crm.spawntree.de/httpdocs/browserslist +rm -rf /var/www/vhosts/spawntree.de/crm.spawntree.de/httpdocs/karma.conf.json +rm -rf /var/www/vhosts/spawntree.de/crm.spawntree.de/httpdocs/package.json +rm -rf /var/www/vhosts/spawntree.de/crm.spawntree.de/httpdocs/package-lock.json +rm -rf /var/www/vhosts/spawntree.de/crm.spawntree.de/httpdocs/tsconfig.json +rm -rf /var/www/vhosts/spawntree.de/crm.spawntree.de/httpdocs/tsconfig.app.json +rm -rf /var/www/vhosts/spawntree.de/crm.spawntree.de/httpdocs/tsconfig.spec.json +rm -rf /var/www/vhosts/spawntree.de/crm.spawntree.de/httpdocs/tslint.json + +cp -rf /var/www/vhosts/spawntree.de/crm.spawntree.de/git_repo/spt-crm-frontend/httpdocs/* /var/www/vhosts/spawntree.de/crm.spawntree.de/httpdocs/ + +echo "$(tput setab 2)Files have been copied to ANGULAR LIVE$(tput sgr 0)" + +cd /var/www/vhosts/spawntree.de/crm.spawntree.de/httpdocs/ +ng build --configuration=gamma --prod --aot + +cp -rf /var/www/vhosts/spawntree.de/crm.spawntree.de/httpdocs/git_repo/spt-crm-frontend/httpdocs/.htaccess /var/www/vhosts/spawntree.de/crm.spawntree.de/httpdocs/dist/ +cp -rf /var/www/vhosts/spawntree.de/crm.spawntree.de/httpdocs/git_repo/spt-crm-frontend/httpdocs/.htpasswd /var/www/vhosts/spawntree.de/crm.spawntree.de/httpdocs/dist/ + +echo "$(tput setab 2)ANGULAR APP built on LIVE$(tput sgr 0)" + +# Remove Maintenance Mode +# Angular App will publish all data in /dist/ folder so maintenance data does not have to be removed. +#mv /var/www/vhosts/h2790573.stratoserver.net/beta-too1s.h2790573.stratoserver.net/dist/_index.html #/var/www/vhosts/h2790573.stratoserver.net/beta-too1s.h2790573.stratoserver.net/dist/index.html +#rm /var/www/vhosts/h2790573.stratoserver.net/beta-too1s.h2790573.stratoserver.net/dist/index.php +echo "$(tput setab 2)PLP TOOL is now LIVE!$(tput sgr 0)" diff --git a/httpdocs/angular.json b/httpdocs/angular.json index 714ac4a..6636d3e 100644 --- a/httpdocs/angular.json +++ b/httpdocs/angular.json @@ -62,7 +62,7 @@ ], "optimization": true, "outputHashing": "all", - "sourceMap": false, + "sourceMap": true, "extractCss": true, "namedChunks": false, "aot": true, diff --git a/httpdocs/src/app/app-routing.module.ts b/httpdocs/src/app/app-routing.module.ts index 1264143..fcb7b0d 100644 --- a/httpdocs/src/app/app-routing.module.ts +++ b/httpdocs/src/app/app-routing.module.ts @@ -4,9 +4,6 @@ import { StartComponent } from './views/start/start.component'; import {CustomerManagementComponent} from './views/customer-management/customer-management.component'; import {LoginComponent} from './views/login/login.component'; import {RouteInterceptor} from './interceptor/route-interceptor'; -import {AccountingComponent} from './views/accounting/accounting.component'; -import {TechniqueComponent} from './views/technique/technique.component'; -import {SalesComponent} from './views/sales/sales.component'; const routes: Routes = [ @@ -33,7 +30,4 @@ export const routingComponents = [ LoginComponent, StartComponent, CustomerManagementComponent, - AccountingComponent, - TechniqueComponent, - SalesComponent, ]; diff --git a/httpdocs/src/app/app.component.ts b/httpdocs/src/app/app.component.ts index 78499ca..a77d1d2 100644 --- a/httpdocs/src/app/app.component.ts +++ b/httpdocs/src/app/app.component.ts @@ -25,6 +25,7 @@ export class AppComponent implements OnInit, OnDestroy { // Observe login state this.loginSub = this.appService.getLoginState$().subscribe( data => { + console.log(data); if (data !== null) { this.isLoggedIn = true; } else { diff --git a/httpdocs/src/app/app.module.ts b/httpdocs/src/app/app.module.ts index 8e86486..6d187dc 100644 --- a/httpdocs/src/app/app.module.ts +++ b/httpdocs/src/app/app.module.ts @@ -21,7 +21,7 @@ import {CacheService} from './services/cache.service'; import {MessageService} from './services/message.service'; import {HttpService} from './services/http.service'; import {HTTP_INTERCEPTORS, HttpClientModule} from '@angular/common/http'; -import {HttpClientInterceptor} from './services/http.interceptor'; + import {RouteInterceptor} from './interceptor/route-interceptor'; import { TechniqueComponent } from './views/technique/technique.component'; import { SalesComponent } from './views/sales/sales.component'; @@ -65,6 +65,7 @@ import { CalendarLegendComponent } from './components/calendar-legend/calendar-l import { CommonService } from './services/common.service'; import {GridRendererComponent} from './grid-cellrenderer/grid-renderer-component'; import {GridEditorComponent} from './grid-cellrenderer/grid-editor-component'; +import {HttpClientInterceptor} from "./interceptor/http.interceptor"; registerLocaleData(localeDe); diff --git a/httpdocs/src/app/components/aside/aside.component.html b/httpdocs/src/app/components/aside/aside.component.html index c967d23..69ad6b4 100644 --- a/httpdocs/src/app/components/aside/aside.component.html +++ b/httpdocs/src/app/components/aside/aside.component.html @@ -1,6 +1,6 @@ -
- Startseite -
+ + +