Super-Commit

parent 3eb7fe2d
Pipeline #15338 failed with stages
in 1 minute and 8 seconds
{
"$schema": "./node_modules/@angular/cli/lib/config/schema.json",
"project": {
"name": "frontend"
},
"apps": [
{
"root": "src",
"outDir": "dist",
"assets": [
"assets/fonts",
"assets/i18n",
"assets/icons",
"manifest.json"
],
"index": "index.html",
"main": "main.ts",
"polyfills": "polyfills.ts",
"test": "test.ts",
"tsconfig": "tsconfig.app.json",
"testTsconfig": "tsconfig.spec.json",
"prefix": "app",
"serviceWorker": false,
"styles": [
"styles.scss"
],
"scripts": [],
"environmentSource": "environments/environment.ts",
"environments": {
"dev": "environments/environment.ts",
"prod": "environments/environment.prod.ts"
}
}
],
"e2e": {
"protractor": {
"config": "./protractor.conf.js"
}
},
"lint": [
{
"project": "src/tsconfig.app.json"
},
{
"project": "src/tsconfig.spec.json"
},
{
"project": "e2e/tsconfig.e2e.json"
}
],
"test": {
"karma": {
"config": "./karma.conf.js"
}
},
"defaults": {
"styleExt": "scss",
"component": {
}
}
}
{
"$schema": "./node_modules/@angular/cli/lib/config/schema.json",
"version": 1,
"newProjectRoot": "projects",
"projects": {
"frontend": {
"root": "",
"sourceRoot": "src",
"projectType": "application",
"prefix": "app",
"schematics": {},
"architect": {
"build": {
"builder": "@angular-devkit/build-angular:browser",
"options": {
"outputPath": "dist",
"index": "src/index.html",
"main": "src/main.ts",
"tsConfig": "src/tsconfig.app.json",
"polyfills": "src/polyfills.ts",
"assets": [
"src/assets/fonts",
"src/assets/i18n",
"src/assets/icons",
"src/assets/serverEndpoint.json"
],
"styles": [
"src/styles.scss",
{
"input": "./node_modules/bootstrap/dist/css/bootstrap.css"
}
],
"scripts": []
},
"configurations": {
"production": {
"optimization": true,
"outputHashing": "all",
"sourceMap": false,
"extractCss": true,
"namedChunks": false,
"aot": true,
"extractLicenses": true,
"vendorChunk": true,
"buildOptimizer": true,
"serviceWorker": true,
"ngswConfigPath": "src/ngsw-config.json",
"fileReplacements": [
{
"replace": "src/environments/environment.ts",
"with": "src/environments/environment.prod.ts"
}
]
}
}
},
"serve": {
"builder": "@angular-devkit/build-angular:dev-server",
"options": {
"browserTarget": "frontend:build"
},
"configurations": {
"production": {
"browserTarget": "frontend:build:production"
}
}
},
"extract-i18n": {
"builder": "@angular-devkit/build-angular:extract-i18n",
"options": {
"browserTarget": "frontend:build"
}
},
"test": {
"builder": "@angular-devkit/build-angular:karma",
"options": {
"main": "src/test.ts",
"polyfills": "src/polyfills.ts",
"tsConfig": "src/tsconfig.spec.json",
"karmaConfig": "src/karma.conf.js",
"styles": [
"src/styles.scss"
],
"scripts": [],
"assets": [
"src/assets/fonts",
"src/assets/i18n",
"src/assets/icons",
"src/assets/serverEndpoint.json"
]
}
},
"lint": {
"builder": "@angular-devkit/build-angular:tslint",
"options": {
"tsConfig": [
"src/tsconfig.app.json",
"src/tsconfig.spec.json"
],
"exclude": []
}
}
}
},
"frontend-e2e": {
"root": "",
"sourceRoot": "",
"projectType": "application",
"architect": {
"e2e": {
"builder": "@angular-devkit/build-angular:protractor",
"options": {
"protractorConfig": "./protractor.conf.js",
"devServerTarget": "frontend:serve"
}
},
"lint": {
"builder": "@angular-devkit/build-angular:tslint",
"options": {
"tsConfig": [
"e2e/tsconfig.e2e.json"
],
"exclude": []
}
}
}
}
},
"defaultProject": "frontend"
}
\ No newline at end of file
// Karma configuration file, see link for more information
// https://karma-runner.github.io/0.13/config/configuration-file.html
module.exports = function (config) {
config.set({
basePath: '',
frameworks: ['jasmine', '@angular/cli'],
plugins: [
require('karma-jasmine'),
require('karma-chrome-launcher'),
require('karma-jasmine-html-reporter'),
require('karma-coverage-istanbul-reporter'),
require('@angular/cli/plugins/karma')
],
client:{
clearContext: false // leave Jasmine Spec Runner output visible in browser
},
coverageIstanbulReporter: {
reports: [ 'html', 'lcovonly' ],
fixWebpackSourcePaths: true
},
angularCli: {
environment: 'dev'
},
reporters: ['progress', 'kjhtml'],
port: 9876,
colors: true,
logLevel: config.LOG_INFO,
autoWatch: true,
browsers: ['Chrome'],
singleRun: false
});
};
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -11,6 +11,19 @@
"not ie <= 10",
"not ie_mob <= 10"
],
"jest": {
"transform": {
".(ts|tsx)": "<rootDir>/node_modules/ts-jest/preprocessor.js"
},
"moduleFileExtensions": [
"ts",
"tsx",
"js"
],
"transformIgnorePatterns": [],
"preset": "jest-preset-angular",
"setupTestFrameworkScriptFile": "<rootDir>/src/setupJest.ts"
},
"description": "Version 2 of arsnova.click (Frontend WebApp)",
"scripts": {
"ng": "ng",
......@@ -30,23 +43,22 @@
},
"private": true,
"dependencies": {
"@angular/animations": "^6.0.0",
"@angular/common": "^6.0.0",
"@angular/compiler": "^6.0.0",
"@angular/core": "^6.0.0",
"@angular/forms": "^6.0.0",
"@angular/http": "^6.0.0",
"@angular/platform-browser": "^6.0.0",
"@angular/platform-browser-dynamic": "^6.0.0",
"@angular/router": "^6.0.0",
"@angular/service-worker": "^6.0.0",
"@angular/animations": "^6.0.2",
"@angular/common": "^6.0.2",
"@angular/compiler": "^6.0.2",
"@angular/core": "^6.0.2",
"@angular/forms": "^6.0.2",
"@angular/http": "^6.0.2",
"@angular/platform-browser": "^6.0.2",
"@angular/platform-browser-dynamic": "^6.0.2",
"@angular/router": "^6.0.2",
"@angular/service-worker": "^6.0.2",
"@ng-bootstrap/ng-bootstrap": "^2.0.0-alpha.0",
"@ng-bootstrap/schematics": "^2.0.0-alpha.1",
"@ngx-translate/core": "^10.0.1",
"@ngx-translate/http-loader": "~3.0.1",
"@techiediaries/ngx-qrcode": "0.0.5",
"angulartics2": "^6.0.0",
"bootstrap": "^4.0.0",
"classlist.js": "^1.1.20150312",
"highlight.js": "^9.12.0",
"intro.js": "^2.9.3",
......@@ -54,37 +66,37 @@
"messageformat": "^2.0.2",
"ngx-qrcode2": "^0.1.0",
"ngx-translate-messageformat-compiler": "^4.0.0",
"npm": "^6.0.1",
"rxjs": "^6.0.0",
"rxjs": "^6.1.0",
"zone.js": "^0.8.26"
},
"devDependencies": {
"@angular-devkit/build-angular": "^0.6.0",
"@angular/cli": "^6.0.0",
"@angular/compiler-cli": "^6.0.0",
"@angular/language-service": "^6.0.0",
"@types/jasmine": "~2.8.6",
"@angular-devkit/build-angular": "^0.6.1",
"@angular/cli": "^6.0.1",
"@angular/compiler-cli": "^6.0.2",
"@angular/language-service": "^6.0.2",
"@types/jasmine": "~2.8.7",
"@types/jasminewd2": "~2.0.3",
"@types/node": "^10.0.9",
"@types/webpack": "~3.8.5",
"@types/node": "^10.1.0",
"@types/webpack": "~4.1.7",
"arsnova-click-v2-types": "git+https://git.thm.de/arsnova/arsnova-click-v2-types.git",
"codelyzer": "^4.3.0",
"http-server": "^0.11.1",
"istanbul-instrumenter-loader": "^3.0.1",
"jasmine-core": "~2.99.1",
"jasmine": "^3.1.0",
"jasmine-core": "~3.1.0",
"jasmine-spec-reporter": "~4.2.1",
"karma": "~1.7.1",
"karma": "~2.0.2",
"karma-chrome-launcher": "~2.2.0",
"karma-coverage-istanbul-reporter": "~1.4.2",
"karma-jasmine": "~1.1.1",
"karma-jasmine-html-reporter": "^0.2.2",
"karma-jasmine-html-reporter": "^1.1.0",
"karma-mocha-reporter": "^2.2.5",
"karma-phantomjs-launcher": "^1.0.4",
"protractor": "^5.3.2",
"purify-css": "~1.2.5",
"ts-node": "~5.0.1",
"tslint": "~5.9.1",
"typescript": "~2.7.2"
"ts-node": "~6.0.3",
"tslint": "~5.10.0",
"typescript": "^2.7"
},
"keywords": [
"arsnova",
......
let path = require('path');
let fs = require('fs');
// https://github.com/purifycss/purifycss
let purifycss = require('purify-css');
function fromDir(startPath, filter, callback) {
if (!fs.existsSync(startPath)) {
console.log('no dir ', startPath);
return;
}
const files = fs.readdirSync(startPath);
for (let i = 0; i < files.length; i++) {
const filename = path.join(startPath, files[i]);
const stat = fs.lstatSync(filename);
if (stat.isDirectory()) {
fromDir(filename, filter, callback); // recurse
} else if (filter.test(filename)) {
callback(filename);
}
}
}
fromDir('./dist', /\.css/, function (filename) {
const content = ['./dist/*.js', './dist/*.html'];
const css = [filename];
const options = {
output: filename,
minify: true,
info: true,
};
console.log('-- found: ', filename);
purifycss(content, css, options);
});
\ No newline at end of file
@import "~bootstrap/scss/bootstrap";
@import "assets/bootstrap4/scss/bootstrap";
@import "~intro.js/introjs.css";
@import "~intro.js/themes/introjs-nassim.css";
@import "../../../styles_vendor";
@mixin showFooterElements() {
opacity: 0.95;
.footerElement {
.footerElemText {
display: block;
}
}
}
span.before,
span.after {
width: 50px;
top: 0;
color: #fff;
font-size: 2rem;
z-index: 1050;
}
span.before {
background: linear-gradient(to right, #000, rgba(0,0,0, 0.2));
}
span.after {
background: linear-gradient(to left, #000, rgba(0,0,0, 0.2));
right: 0;
}
.navbar-footer {
position: absolute;
left: 0;
z-index: 1040;
@include media-breakpoint-up(sm) {
@include border-right-radius($border-radius);
&:hover {
opacity: 0.95;
.footerElement {
.footerElemText {
display: block;
}
@include media-breakpoint-only(sm) {
position: absolute;
.footerElement {
.footerElemText {
display: none;
}
}
&:hover {
@include showFooterElements;
}
}
@include media-breakpoint-up(md) {
opacity: 0.95;
}
@include media-breakpoint-down(xs) {
overflow: scroll;
justify-content: left;
height: 50px;
width: 100%;
overflow: hidden;
position: relative;
}
@include media-breakpoint-up(sm) {
justify-content: center;
@include border-right-radius($border-radius);
max-width: 20vw;
}
.footerElement {
cursor: pointer;
display: flex;
align-items: center;
flex-shrink: 0;
@include media-breakpoint-down(xs) {
padding: 10px;
flex-grow: 1;
.footerElemText {
line-height: 40px;
}
}
@include media-breakpoint-up(sm) {
padding: 0;
flex-grow: 0;
}
.footerElemText {
flex-shrink: 0;
@include media-breakpoint-up(sm) {
display: none;
.footerElemText {
flex-shrink: 0;
max-width: 15vw;
}
}
p {
margin: 0;
line-height: 25px;
}
}
}
import {async, ComponentFixture, TestBed} from '@angular/core/testing';
import {FooterBarComponent} from './footer-bar.component';
import {HttpClient, HttpClientModule} from '@angular/common/http';
import {TranslateCompiler, TranslateLoader, TranslateModule} from '@ngx-translate/core';
import {TranslateMessageFormatCompiler} from 'ngx-translate-messageformat-compiler';
import {createTranslateLoader} from '../../../lib/translation.factory';
import {RouterTestingModule} from '@angular/router/testing';
import {NgbModule} from '@ng-bootstrap/ng-bootstrap';
import {ActiveQuestionGroupService} from '../../service/active-question-group.service';
import {SettingsService} from '../../service/settings.service';
import {FooterBarService} from '../../service/footer-bar.service';
import {FileUploadService} from '../../service/file-upload.service';
import {WebsocketService} from '../../service/websocket.service';
import {TrackingService} from '../../service/tracking.service';
import {SharedService} from '../../service/shared.service';
import {ConnectionService} from '../../service/connection.service';
import {CurrentQuizService} from '../../service/current-quiz.service';
import {ArsnovaClickAngulartics2Piwik} from '../../shared/tracking/ArsnovaClickAngulartics2Piwik';
import {Angulartics2Module} from 'angulartics2';
import {WebsocketMockService} from '../../service/websocket.mock.service';
import {CurrentQuizMockService} from '../../service/current-quiz.mock.service';
import {ConnectionMockService} from '../../service/connection.mock.service';
import {ActiveQuestionGroupMockService} from '../../service/active-question-group.mock.service';
import {TrackingMockService} from '../../service/tracking.mock.service';
describe('FooterBarComponent', () => {
let component: FooterBarComponent;
......@@ -8,18 +30,50 @@ describe('FooterBarComponent', () => {
beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [FooterBarComponent]
})
.compileComponents();
imports: [
RouterTestingModule,
HttpClientModule,
NgbModule.forRoot(),
TranslateModule.forRoot({
loader: {
provide: TranslateLoader,
useFactory: (createTranslateLoader),
deps: [HttpClient]
},
compiler: {
provide: TranslateCompiler,
useClass: TranslateMessageFormatCompiler
}
}),
],
providers: [
FooterBarService,
SharedService,
{provide: CurrentQuizService, useClass: CurrentQuizMockService},
SettingsService,
{provide: ConnectionService, useClass: ConnectionMockService},
{provide: WebsocketService, useClass: WebsocketMockService},
{provide: TrackingService, useClass: TrackingMockService},
FileUploadService,
{provide: ActiveQuestionGroupService, useClass: ActiveQuestionGroupMockService},
],
declarations: [
FooterBarComponent
]
}).compileComponents();
}));
beforeEach(() => {
beforeEach(async(() => {
fixture = TestBed.createComponent(FooterBarComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});
}));
it('should be created', () => {
it('should be created', async(() => {
expect(component).toBeTruthy();
});
}));
it('should contain a TYPE definition', async(() => {
expect(FooterBarComponent.TYPE).toEqual('FooterBarComponent');
}));
});
......@@ -28,7 +28,7 @@
}
.header-label {
font-size: 1.8rem;
font-size: 1.5rem;
}
}
......
......@@ -2,34 +2,39 @@
<div id="mathjaxStyle"></div>
<div *ngIf="targetEnvironment === ENVIRONMENT_TYPE.ANSWEROPTIONS"
id="answer-option-preview"
[class]="'preview-frame ' + deviceClass()">
<app-header></app-header>
[class]="'preview-frame overflow-auto relative ' + deviceClass()">
<img src="/assets/icons/phone_empty.png" class="w-100 position-absolute" draggable="false"/>
<div class="px-4 preview-content relative overflow-auto">
<app-header></app-header>
<ng-container *ngIf="connectionService.serverAvailable;else notAvailableTmpl">
<div id="answer-option-element-wrapper"
class="d-flex justify-content-around align-items-center flex-wrap">
<div *ngFor="let elem of dataSource; let i = index"
class="answer-option-element d-flex justify-content-center align-items-center rounded m-2 pointer"
[style.flex-basis]="question.showOneAnswerPerRow ? '100%' : getComputedWidth()">
<p *ngIf="question.displayAnswerText"
class="markdown-answer"
[innerHTML]="sanitizeHTML(elem)"></p>
<p *ngIf="!question.displayAnswerText"
class="mb-0"
[innerHTML]="normalizeAnswerOptionIndex(i)"></p>
<ng-container *ngIf="connectionService.serverAvailable;else notAvailableTmpl">
<div id="answer-option-element-wrapper"
class="d-flex justify-content-around align-items-center flex-wrap">
<div *ngFor="let elem of dataSource; let i = index"
class="answer-option-element d-flex justify-content-center align-items-center rounded m-2 pointer"
[style.flex-basis]="question.showOneAnswerPerRow ? '100%' : getComputedWidth()">
<p *ngIf="question.displayAnswerText"
class="mb-0 markdown-answer"
[innerHTML]="sanitizeHTML(elem)"></p>
<p *ngIf="!question.displayAnswerText"
class="mb-0"
[innerHTML]="normalizeAnswerOptionIndex(i)"></p>
</div>
</div>
</div>
</ng-container>
</ng-container>
</div>
</div>
<div *ngIf="targetEnvironment === ENVIRONMENT_TYPE.QUESTION"
id="question-preview"
[class]="'preview-frame overflow-auto ' + deviceClass()">
<app-header></app-header>
<ng-container *ngIf="connectionService.serverAvailable;else notAvailableTmpl">
<p class="p-0" [innerHTML]="sanitizeHTML(dataSource)"></p>
</ng-container>
[class]="'preview-frame overflow-auto relative ' + deviceClass()">