Merge branch 'fashion-logica' of https://git.hlcompany.ru/git/usersite into fashion-logica

This commit is contained in:
gofnnp 2022-09-29 21:47:34 +04:00
commit 2ca121cbac
12 changed files with 134 additions and 43 deletions

44
Jenkinsfile vendored
View File

@ -1,27 +1,31 @@
env.HL_BUILD_MODE = "jenkins" env.HL_BUILD_MODE = "jenkins"
node('Rubidium'){ node('Lithium'){
stage('get new version to repo') { stage('get new version to repo') {
dir('/opt/usersite-build'){ checkout scm
checkout([$class: 'GitSCM', branches: [[name: '*/fashion-logica']], doGenerateSubmoduleConfigurations: false, extensions: [], submoduleCfg: [], userRemoteConfigs: [[credentialsId: 'jenkins_all', url: 'https://git.hlcompany.ru/git/usersite.git']]]) if (lastCommitIsBumpCommit()) {
currentBuild.result = 'ABORTED'
error('Последний коммит - результат сборки jenkins')
} }
} sh "git checkout ${env.BRANCH_NAME}"
sh "git checkout -- ."
stage('build project') {
// sh label: '', script: 'systemctl stop lkcrm4retail'
// dir('/opt/SynthVisionBox/node'){
// sh label: '', script: 'npm install --only=prod'
// sh label: '', script: 'node db_updater.js'
// }
dir('/opt/usersite-build'){ sh "git pull"
// sh label: '', script: 'npm i' //sh "git submodule update --init --recursive"
// sh label: '', script: 'npm run build' //sh "git submodule update --remote --merge"
sh label: '', script: 'ng build' }
} stage("build and publish"){
sh label: '', script: 'npm i'
// sh label: '', script: 'systemctl start lkcrm4retail' sh label: '', script: 'npm run build'
} }
}
}
private boolean lastCommitIsBumpCommit() {
lastCommit = sh([script: 'git log -1', returnStdout: true])
if (lastCommit.contains("Author: jenkins")) {
return true
} else {
return false
}
}

View File

@ -1,4 +1,5 @@
{ {
"$schema": "./node_modules/@angular/cli/lib/config/schema.json", "$schema": "./node_modules/@angular/cli/lib/config/schema.json",
"version": 1, "version": 1,
"newProjectRoot": "projects", "newProjectRoot": "projects",
@ -10,6 +11,7 @@
"style": "scss" "style": "scss"
} }
}, },
"root": "", "root": "",
"sourceRoot": "src", "sourceRoot": "src",
"prefix": "app", "prefix": "app",
@ -17,7 +19,7 @@
"build": { "build": {
"builder": "@angular-devkit/build-angular:browser", "builder": "@angular-devkit/build-angular:browser",
"options": { "options": {
"outputPath": "/var/www/fashion-logica", "outputPath": "/var/www/html/lk.crm4retail.ru/fashion-logica",
"baseHref": "/", "baseHref": "/",
"index": "src/index.html", "index": "src/index.html",
"main": "src/main.ts", "main": "src/main.ts",

View File

@ -32,6 +32,7 @@ import { QRCodeModule } from 'angularx-qrcode';
import { ShareButtonsModule } from 'ngx-sharebuttons/buttons'; import { ShareButtonsModule } from 'ngx-sharebuttons/buttons';
import { ShareIconsModule } from 'ngx-sharebuttons/icons'; import { ShareIconsModule } from 'ngx-sharebuttons/icons';
import { MessagingService } from './services/messaging.service'; import { MessagingService } from './services/messaging.service';
import { NotFoundComponent } from './pages/not-found/not-found.component';
@NgModule({ @NgModule({
declarations: [ declarations: [
@ -47,7 +48,8 @@ import { MessagingService } from './services/messaging.service';
OrderInfoComponent, OrderInfoComponent,
FooterButtonsComponent, FooterButtonsComponent,
UserDataComponent, UserDataComponent,
RefSystemComponent RefSystemComponent,
NotFoundComponent
], ],
imports: [ imports: [
BrowserModule, BrowserModule,
@ -56,7 +58,8 @@ import { MessagingService } from './services/messaging.service';
{ {
path: '**', path: '**',
component: MainComponent component: MainComponent
} },
// { path: '**', component: NotFoundComponent }
]), ]),
InputMaskModule, InputMaskModule,
ProgressSpinnerModule, ProgressSpinnerModule,

View File

@ -0,0 +1,8 @@
<div class="not-found-page">
<app-navbar></app-navbar>
<div class="not-found-page__container">
<h1>404</h1>
<p>Упс, что-то пошло не так!</p>
<button (click)="routeHome()">Вернуться на главную</button>
</div>
</div>

View File

@ -0,0 +1,28 @@
:host {
.not-found-page {
&__container {
text-align: center;
margin-top: 32px;
h1 {
font-size: 108px;
font-weight: 600;
color: #09467f;
}
p {
margin: 16px 0;
font-size: 14px;
}
button {
background-color: #09467f;
color: #fff;
border-radius: 8px;
display: flex;
justify-content: center;
align-items: center;
padding: 12px;
margin: 0 auto;
border: 0;
}
}
}
}

View File

@ -0,0 +1,23 @@
import { ComponentFixture, TestBed } from '@angular/core/testing';
import { NotFoundComponent } from './not-found.component';
describe('NotFoundComponent', () => {
let component: NotFoundComponent;
let fixture: ComponentFixture<NotFoundComponent>;
beforeEach(async () => {
await TestBed.configureTestingModule({
declarations: [ NotFoundComponent ]
})
.compileComponents();
fixture = TestBed.createComponent(NotFoundComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});
it('should create', () => {
expect(component).toBeTruthy();
});
});

View File

@ -0,0 +1,20 @@
import { Component, OnInit } from '@angular/core';
import { Router } from '@angular/router';
@Component({
selector: 'app-not-found',
templateUrl: './not-found.component.html',
styleUrls: ['./not-found.component.scss']
})
export class NotFoundComponent implements OnInit {
constructor(private router: Router) { }
ngOnInit(): void {
}
routeHome() {
this.router.navigate(['/']);
}
}

View File

@ -9,12 +9,13 @@ export const environment = {
systemId: 'g6zyv8tj53w28ov7cl', systemId: 'g6zyv8tj53w28ov7cl',
defaultUrl: 'https://fashionlogica.lk.crm4retail.ru', defaultUrl: 'https://fashionlogica.lk.crm4retail.ru',
firebase: { firebase: {
apiKey: "AIzaSyCujHg9GtN8Uxi-JcCN8zggvXlfNQRKc04", apiKey: "AIzaSyCnKvln5itnrBj62POCPHxshAN_Vmd0zds",
authDomain: "push-notification-test2-56dac.firebaseapp.com", authDomain: "fashionlogicanotification.firebaseapp.com",
projectId: "push-notification-test2-56dac", projectId: "fashionlogicanotification",
storageBucket: "push-notification-test2-56dac.appspot.com", storageBucket: "fashionlogicanotification.appspot.com",
messagingSenderId: "1004369687552", messagingSenderId: "99855572145",
appId: "1:1004369687552:web:a6cc20625e05520a37d4e5" appId: "1:99855572145:web:7548c189d61b3bcc92d690",
measurementId: "G-RQF97ZK7R1"
}, },
version: packageJson.version, version: packageJson.version,
} }

View File

@ -9,12 +9,13 @@ export const environment = {
systemId: 'g6zyv8tj53w28ov7cl', systemId: 'g6zyv8tj53w28ov7cl',
defaultUrl: 'http://192.168.0.179:4200', defaultUrl: 'http://192.168.0.179:4200',
firebase: { firebase: {
apiKey: "AIzaSyCujHg9GtN8Uxi-JcCN8zggvXlfNQRKc04", apiKey: 'AIzaSyCnKvln5itnrBj62POCPHxshAN_Vmd0zds',
authDomain: "push-notification-test2-56dac.firebaseapp.com", authDomain: 'fashionlogicanotification.firebaseapp.com',
projectId: "push-notification-test2-56dac", projectId: 'fashionlogicanotification',
storageBucket: "push-notification-test2-56dac.appspot.com", storageBucket: 'fashionlogicanotification.appspot.com',
messagingSenderId: "1004369687552", messagingSenderId: '99855572145',
appId: "1:1004369687552:web:a6cc20625e05520a37d4e5" appId: '1:99855572145:web:7548c189d61b3bcc92d690',
measurementId: 'G-RQF97ZK7R1',
}, },
version: packageJson.version, version: packageJson.version,
}; };

View File

@ -2,12 +2,13 @@ importScripts('https://www.gstatic.com/firebasejs/7.4.1/firebase-app.js');
importScripts('https://www.gstatic.com/firebasejs/7.4.1/firebase-messaging.js'); importScripts('https://www.gstatic.com/firebasejs/7.4.1/firebase-messaging.js');
firebase.initializeApp({ firebase.initializeApp({
apiKey: "AIzaSyCujHg9GtN8Uxi-JcCN8zggvXlfNQRKc04", apiKey: "AIzaSyCnKvln5itnrBj62POCPHxshAN_Vmd0zds",
authDomain: "push-notification-test2-56dac.firebaseapp.com", authDomain: "fashionlogicanotification.firebaseapp.com",
projectId: "push-notification-test2-56dac", projectId: "fashionlogicanotification",
storageBucket: "push-notification-test2-56dac.appspot.com", storageBucket: "fashionlogicanotification.appspot.com",
messagingSenderId: "1004369687552", messagingSenderId: "99855572145",
appId: "1:1004369687552:web:a6cc20625e05520a37d4e5" appId: "1:99855572145:web:7548c189d61b3bcc92d690",
measurementId: "G-RQF97ZK7R1"
}); });
const messaging = firebase.messaging(); const messaging = firebase.messaging();

View File

@ -2,7 +2,7 @@
<html lang="ru"> <html lang="ru">
<head> <head>
<meta charset="utf-8"> <meta charset="utf-8">
<title>Fashion logica</title> <title>Fashionlogica</title>
<base href="/"> <base href="/">
<meta name="viewport" content="width=device-width, initial-scale=1"> <meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="apple-touch-icon" href="./assets/icons/apple-icon-180x180.png"> <link rel="apple-touch-icon" href="./assets/icons/apple-icon-180x180.png">

View File

@ -56,5 +56,5 @@
"purpose": "maskable any" "purpose": "maskable any"
} }
], ],
"gcm_sender_id": "1004369687552" "gcm_sender_id": "99855572145"
} }