diff --git a/backend/docker-compose.yml b/backend/docker-compose.yml deleted file mode 100644 index e2e1bc9..0000000 --- a/backend/docker-compose.yml +++ /dev/null @@ -1,37 +0,0 @@ -version: '3.7' - -services: - openvalidation-ide-backend: - image: openvalidation-ide-backend:latest - environment: - - SPRING_PROFILES_ACTIVE=dev - - OPENVALIDATION_IDE_DB=postgres - - OPENVALIDATION_IDE_DB_NAME=openvalidation_ide - - OPENVALIDATION_IDE_DB_USER=openvalidation_ide - - OPENVALIDATION_IDE_DB_PW=_OPeN_VALiDAtION_IdE - # - CORS_HEADERS=https://sample-1.com,https://sample-2.com - build: - context: . - depends_on: - - postgres - ports: - - '8080:8080' - networks: - - openvalidation_ide_backend - - postgres: - image: postgres:10.1 - volumes: - - openvalidation_ide_db:/var/lib/postgresql/data - environment: - - PGDATA=/var/lib/postgresql/data/pgdata - - POSTGRES_DB=openvalidation_ide - - POSTGRES_USER=openvalidation_ide - - POSTGRES_PASSWORD=_OPeN_VALiDAtION_IdE - networks: - - openvalidation_ide_backend -volumes: - openvalidation_ide_db: {} - -networks: - openvalidation_ide_backend: \ No newline at end of file diff --git a/docker-compose.yml b/docker-compose.yml index 1c7276b..3995345 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -7,6 +7,8 @@ services: context: ./frontend ports: - "80:80" + depends_on: + - openvalidation-languageserver openvalidation-ide-backend: image: openvalidation-ide-backend:latest diff --git a/frontend/angular.json b/frontend/angular.json index a0a73ae..b14c547 100644 --- a/frontend/angular.json +++ b/frontend/angular.json @@ -131,7 +131,8 @@ "e2e/tsconfig.json" ], "exclude": [ - "**/node_modules/**" + "**/node_modules/**", + "src/app/backend/**" ] } }, diff --git a/frontend/docker-compose.yml b/frontend/docker-compose.yml deleted file mode 100644 index dfd19e7..0000000 --- a/frontend/docker-compose.yml +++ /dev/null @@ -1,9 +0,0 @@ -version: '3.7' - -services: - openvalidation-ide-frontend: - image: openvalidation-ide-frontend:latest - build: - context: . - ports: - - '80:80' diff --git a/frontend/src/app/design-test/design-test.component.html b/frontend/src/app/design-test/design-test.component.html deleted file mode 100644 index 648ba23..0000000 --- a/frontend/src/app/design-test/design-test.component.html +++ /dev/null @@ -1,163 +0,0 @@ -
- - Company (disabled) - - - - - Clearable input - - - - - - Telephone - +1   - - mode_edit - - - - Choose a date - - - - - - - First name - - - - - Postal Code - - {{postalCode.value.length}} / 5 - - - - Address - - - -
- - - format_align_left - - - format_align_center - - - format_align_right - - - format_align_justify - - -
- -
- - - - - -
- - - - -
- -

- -
- - - - - - Link - - - - - - - Link -
- -

- -
- - -
- Shiba Inu - Dog Breed -
- Photo of a Shiba Inu - -

- The Shiba Inu is the smallest of the six original and distinct spitz breeds of dog from Japan. - A small, agile dog that copes very well with mountainous terrain, the Shiba Inu was originally - bred for hunting. -

-
- - - - -
- -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Name {{element.name}} Age {{element.age}} Street {{element.street}} City {{element.city}} Message expected? Passed {{element.passed ? 'check_circle_outline': 'error_outline' }}
-
-
diff --git a/frontend/src/app/design-test/design-test.component.scss b/frontend/src/app/design-test/design-test.component.scss deleted file mode 100644 index 6b86ccb..0000000 --- a/frontend/src/app/design-test/design-test.component.scss +++ /dev/null @@ -1,38 +0,0 @@ -.form-container { - display: grid; - width: 100%; - grid-template-columns: repeat(auto-fit, minmax(250px, 1fr) ); - grid-template-rows: auto; - gap: 30px; - justify-items: center; - align-items: center; -} - -.grid-2 { - display: grid; - width: 100%; - grid-template-columns: 1fr 3fr; - gap: 50px; - justify-items: center; - align-items: center; -} - -.w-100 { - width: 100%; -} - - -.example-header-image { - background-image: url('https://material.angular.io/assets/img/examples/shiba1.jpg'); - background-size: cover; -} - -.spacer { - height: 20px; - margin-right: 40px; -} - -.example-button-row button, -.example-button-row a { - margin-right: 8px; -} \ No newline at end of file diff --git a/frontend/src/app/design-test/design-test.component.spec.ts b/frontend/src/app/design-test/design-test.component.spec.ts deleted file mode 100644 index f6e769e..0000000 --- a/frontend/src/app/design-test/design-test.component.spec.ts +++ /dev/null @@ -1,25 +0,0 @@ -import { async, ComponentFixture, TestBed } from '@angular/core/testing'; - -import { DesignTestComponent } from './design-test.component'; - -describe('DesignTestComponent', () => { - let component: DesignTestComponent; - let fixture: ComponentFixture; - - beforeEach(async(() => { - TestBed.configureTestingModule({ - declarations: [ DesignTestComponent ] - }) - .compileComponents(); - })); - - beforeEach(() => { - fixture = TestBed.createComponent(DesignTestComponent); - component = fixture.componentInstance; - fixture.detectChanges(); - }); - - it('should create', () => { - expect(component).toBeTruthy(); - }); -}); diff --git a/frontend/src/app/design-test/design-test.component.ts b/frontend/src/app/design-test/design-test.component.ts index 8994f80..e69de29 100644 --- a/frontend/src/app/design-test/design-test.component.ts +++ b/frontend/src/app/design-test/design-test.component.ts @@ -1,32 +0,0 @@ -import { Component, OnInit } from '@angular/core'; -import * as faker from 'faker'; - -@Component({ - selector: 'ovide-design-test', - templateUrl: './design-test.component.html', - styleUrls: ['./design-test.component.scss'] -}) -export class DesignTestComponent implements OnInit { - - constructor() { } - - tableDisplayedColumns: string []; - tableDataSource: object[]; - - ngOnInit(): void { - this.tableDisplayedColumns = ['name', 'age', 'street', 'city', 'expected', 'passed']; - - const fakeData = () => { - return { - name: faker.name.findName(), - age: faker.random.number({min: 10, max: 80}), - street: faker.address.streetName(), - city: faker.address.city(), - expected: faker.random.boolean(), - passed: faker.random.boolean(), - }; - }; - this.tableDataSource = Array.from({length: 8}, fakeData); - } - -} diff --git a/frontend/src/app/material-design/material-design.module.ts b/frontend/src/app/material-design/material-design.module.ts index 9b96fc8..db7a8a8 100644 --- a/frontend/src/app/material-design/material-design.module.ts +++ b/frontend/src/app/material-design/material-design.module.ts @@ -1,71 +1,37 @@ import { NgModule } from '@angular/core'; -import { MatCheckboxModule } from '@angular/material/checkbox'; import { MatButtonModule } from '@angular/material/button'; import { MatInputModule } from '@angular/material/input'; -import { MatAutocompleteModule } from '@angular/material/autocomplete'; -import { MatDatepickerModule } from '@angular/material/datepicker'; import { MatFormFieldModule } from '@angular/material/form-field'; -import { MatRadioModule } from '@angular/material/radio'; -import { MatSelectModule } from '@angular/material/select'; -import { MatSliderModule } from '@angular/material/slider'; import { MatSlideToggleModule } from '@angular/material/slide-toggle'; -import { MatMenuModule } from '@angular/material/menu'; import { MatSidenavModule } from '@angular/material/sidenav'; -import { MatToolbarModule } from '@angular/material/toolbar'; -import { MatListModule } from '@angular/material/list'; -import { MatGridListModule } from '@angular/material/grid-list'; import { MatCardModule } from '@angular/material/card'; -import { MatStepperModule } from '@angular/material/stepper'; -import { MatTabsModule } from '@angular/material/tabs'; -import { MatExpansionModule } from '@angular/material/expansion'; import { MatButtonToggleModule } from '@angular/material/button-toggle'; import { MatChipsModule } from '@angular/material/chips'; import { MatIconModule } from '@angular/material/icon'; import { MatProgressSpinnerModule } from '@angular/material/progress-spinner'; import { MatProgressBarModule } from '@angular/material/progress-bar'; import { MatDialogModule } from '@angular/material/dialog'; -import { MatTooltipModule } from '@angular/material/tooltip'; import { MatSnackBarModule } from '@angular/material/snack-bar'; import { MatTableModule } from '@angular/material/table'; -import { MatSortModule } from '@angular/material/sort'; -import { MatPaginatorModule } from '@angular/material/paginator'; -import { MatNativeDateModule, MatRippleModule } from '@angular/material/core'; +import { MatRippleModule } from '@angular/material/core'; @NgModule({ exports: [ - MatCheckboxModule, - MatCheckboxModule, MatButtonModule, MatInputModule, - MatAutocompleteModule, - MatDatepickerModule, MatFormFieldModule, - MatRadioModule, - MatSelectModule, - MatSliderModule, MatSlideToggleModule, - MatMenuModule, MatSidenavModule, - MatToolbarModule, - MatListModule, - MatGridListModule, MatCardModule, - MatStepperModule, - MatTabsModule, - MatExpansionModule, MatButtonToggleModule, MatChipsModule, MatIconModule, MatProgressSpinnerModule, MatProgressBarModule, MatDialogModule, - MatTooltipModule, MatSnackBarModule, MatTableModule, - MatSortModule, - MatPaginatorModule, - MatNativeDateModule, MatRippleModule ] }) diff --git a/frontend/src/app/monaco-additions/syntax-highlighting/TokensProvider.ts b/frontend/src/app/monaco-additions/syntax-highlighting/TokensProvider.ts index 129d513..5732fea 100644 --- a/frontend/src/app/monaco-additions/syntax-highlighting/TokensProvider.ts +++ b/frontend/src/app/monaco-additions/syntax-highlighting/TokensProvider.ts @@ -87,7 +87,7 @@ function generateTokensHashMap( scopes: param.pattern }); - if (index == param.range.end.line) { + if (index === param.range.end.line) { tmp.push({ startIndex: param.range.end.character, scopes: 'empty' diff --git a/frontend/src/app/ovide.module.ts b/frontend/src/app/ovide.module.ts index 7ea77a3..d746075 100644 --- a/frontend/src/app/ovide.module.ts +++ b/frontend/src/app/ovide.module.ts @@ -19,14 +19,11 @@ import { environment } from 'environments/environment'; import { EllipsisDirective } from './directives/ellipsis.directive'; import { MonacoEditorModule } from 'ngx-monaco-editor'; -import { MonacoConfig } from '@ovide/ruleset-editor/monaco-config'; +import { monacoEditorConfig } from '@ovide/ruleset-editor/monaco-editor-config'; -import { DesignTestComponent } from './design-test/design-test.component'; import { OvideLogoComponent } from './ovide-logo/ovide-logo.component'; import { GaugeChartComponent } from './gauge-chart/gauge-chart.component'; -// import { ErrorHandlerService } from '@ovide/services/error-handler.service'; - @NgModule({ declarations: [ OvideAppComponent, @@ -37,7 +34,6 @@ import { GaugeChartComponent } from './gauge-chart/gauge-chart.component'; SchemaAttributeDialogComponent, RulesetTestsuiteComponent, EllipsisDirective, - DesignTestComponent, OvideLogoComponent, GaugeChartComponent ], @@ -50,13 +46,12 @@ import { GaugeChartComponent } from './gauge-chart/gauge-chart.component'; OvideBackendApiModule, MaterialDesignModule, NgxChartsModule, - MonacoEditorModule.forRoot(MonacoConfig), + MonacoEditorModule.forRoot(monacoEditorConfig), FormsModule ], providers: [ {provide: BASE_PATH, useValue: environment.API_BASE_PATH}, - {provide: 'LANGUAGE_SERVER_URL', useValue: environment.LANGUAGE_SERVER_URL}, - // {provide: HTTP_INTERCEPTORS, useClass: ErrorHandlerService, multi: true}, + {provide: 'LANGUAGE_SERVER_URL', useValue: environment.LANGUAGE_SERVER_URL} ], bootstrap: [OvideAppComponent] }) diff --git a/frontend/src/app/routing/ovide-routing.module.ts b/frontend/src/app/routing/ovide-routing.module.ts index 6bea268..c045412 100644 --- a/frontend/src/app/routing/ovide-routing.module.ts +++ b/frontend/src/app/routing/ovide-routing.module.ts @@ -4,11 +4,9 @@ import { RulesetsOverviewComponent } from '@ovide/rulesets-overview'; import { RulesetEditorComponent } from '@ovide/ruleset-editor'; import { RulesetCreatorComponent } from '@ovide/ruleset-creator'; import { RulesetTestsuiteComponent } from '@ovide/ruleset-testsuite'; -import { DesignTestComponent } from '@ovide/design-test/design-test.component'; const routes: Routes = [ - { path: 'design-test', component: DesignTestComponent }, { path: 'rulesets', children: [ { path: '', pathMatch: 'full', component: RulesetsOverviewComponent }, diff --git a/frontend/src/app/ruleset-creator/ruleset-creator.component.html b/frontend/src/app/ruleset-creator/ruleset-creator.component.html index 3f1514e..318f9e5 100644 --- a/frontend/src/app/ruleset-creator/ruleset-creator.component.html +++ b/frontend/src/app/ruleset-creator/ruleset-creator.component.html @@ -22,6 +22,5 @@

New Ruleset

- - + diff --git a/frontend/src/app/ruleset-creator/ruleset-creator.component.ts b/frontend/src/app/ruleset-creator/ruleset-creator.component.ts index fabb563..e04eb2d 100644 --- a/frontend/src/app/ruleset-creator/ruleset-creator.component.ts +++ b/frontend/src/app/ruleset-creator/ruleset-creator.component.ts @@ -2,12 +2,9 @@ import { Component, OnInit } from '@angular/core'; import { FormBuilder, FormGroup, Validators } from '@angular/forms'; import { RulesetCreateDto, RulesetsBackendService } from '@ovide/backend'; -import * as faker from 'faker'; import { Router } from '@angular/router'; import { trigger, transition, style, animate } from '@angular/animations'; import { ErrorHandlerService } from '@ovide/services/error-handler.service'; -import { catchError } from 'rxjs/operators'; -import { of } from 'rxjs'; @Component({ @@ -58,18 +55,4 @@ export class RulesetCreatorComponent implements OnInit { () => this.errorHandlerService.createError('Error creating ruleset.') ); } - - createRandom() { - this.rulesetsBackendService.createRuleset({ - name: faker.company.catchPhrase(), - createdBy: faker.name.findName(), - description: faker.lorem.paragraph(1) - }).pipe( - catchError(error => { - this.errorHandlerService.createError('Error creating random ruleset.'); - return of(); - }) - ).subscribe(); - } - } diff --git a/frontend/src/app/ruleset-editor/monaco-config.ts b/frontend/src/app/ruleset-editor/monaco-editor-config.ts similarity index 76% rename from frontend/src/app/ruleset-editor/monaco-config.ts rename to frontend/src/app/ruleset-editor/monaco-editor-config.ts index d025f9c..50dace3 100644 --- a/frontend/src/app/ruleset-editor/monaco-config.ts +++ b/frontend/src/app/ruleset-editor/monaco-editor-config.ts @@ -1,14 +1,12 @@ import { NgxMonacoEditorConfig } from 'ngx-monaco-editor'; -export const MonacoConfig: NgxMonacoEditorConfig = { +export const monacoEditorConfig: NgxMonacoEditorConfig = { baseUrl: 'assets', defaultOptions: {scrollBeyondLastLine: false}, onMonacoLoad: monacoOnLoad }; export function monacoOnLoad() { - // console.log((window as any).monaco); - monaco.languages.register({ id: 'ov', extensions: ['.ov'], diff --git a/frontend/src/app/ruleset-editor/ruleset-editor.component.ts b/frontend/src/app/ruleset-editor/ruleset-editor.component.ts index 6cfa8ee..0947e50 100644 --- a/frontend/src/app/ruleset-editor/ruleset-editor.component.ts +++ b/frontend/src/app/ruleset-editor/ruleset-editor.component.ts @@ -11,8 +11,6 @@ import { LanguageEnum } from 'ov-language-server-types'; import { BehaviorSubject, Observable, Subscription } from 'rxjs'; import { debounceTime, distinctUntilChanged, filter, map, retry, switchMap, take } from 'rxjs/operators'; -const ReconnectingWebSocket = require('reconnecting-websocket'); - @Component({ selector: 'ovide-ruleset-editor', templateUrl: './ruleset-editor.component.html', diff --git a/frontend/src/app/ruleset-testsuite/ruleset-testsuite.component.html b/frontend/src/app/ruleset-testsuite/ruleset-testsuite.component.html index 22bebf9..0bce81e 100644 --- a/frontend/src/app/ruleset-testsuite/ruleset-testsuite.component.html +++ b/frontend/src/app/ruleset-testsuite/ruleset-testsuite.component.html @@ -1,16 +1,16 @@

test suite

-
+
-
+
- +
diff --git a/frontend/src/app/ruleset-testsuite/ruleset-testsuite.component.ts b/frontend/src/app/ruleset-testsuite/ruleset-testsuite.component.ts index 007ab2f..73cfacb 100644 --- a/frontend/src/app/ruleset-testsuite/ruleset-testsuite.component.ts +++ b/frontend/src/app/ruleset-testsuite/ruleset-testsuite.component.ts @@ -17,6 +17,12 @@ import { FormControl } from '@angular/forms'; templateUrl: './ruleset-testsuite.component.html', styleUrls: ['./ruleset-testsuite.component.scss'], animations: [ + trigger('editorAnimation', [ + transition(':enter', [ + style({ transform: 'scale(0.9)', opacity: 0.2 }), + animate('.4s ease-in-out') + ]) + ]), trigger('scaleAnimation', [ transition(':enter', [ query('*', [ diff --git a/frontend/src/app/services/error-handler.service.ts b/frontend/src/app/services/error-handler.service.ts index d7fd55e..e11e9d9 100644 --- a/frontend/src/app/services/error-handler.service.ts +++ b/frontend/src/app/services/error-handler.service.ts @@ -4,7 +4,7 @@ import { MatSnackBar } from '@angular/material/snack-bar'; @Injectable({ providedIn: 'root' }) -export class ErrorHandlerService /*implements HttpInterceptor*/ { +export class ErrorHandlerService { private errorQueue = new Array(); private snackBarOpen = false; @@ -27,19 +27,4 @@ export class ErrorHandlerService /*implements HttpInterceptor*/ { } }); } - - // intercept(req: HttpRequest, next: HttpHandler): Observable> { - // return next.handle(req).pipe( - // tap(success => {}, - // error => { - // if (error instanceof HttpErrorResponse) { - // if (this.snackBarOpen) { - // this.errorQueue.push(error.message); - // } else { - // this.createError(error.message); - // } - // } - // }) - // ); - // } } diff --git a/frontend/tslint.json b/frontend/tslint.json index 7cea12f..5c3fb17 100644 --- a/frontend/tslint.json +++ b/frontend/tslint.json @@ -29,7 +29,10 @@ "max-classes-per-file": false, "max-line-length": [ true, - 140 + { + "limit": 140, + "ignore-pattern": "^import" + } ], "member-access": false, "member-ordering": [ @@ -71,6 +74,9 @@ true, "single" ], + "variable-name": { + "options": "allow-leading-underscore" + }, "trailing-comma": false, "no-conflicting-lifecycle": true, "no-host-metadata-property": true, @@ -88,4 +94,4 @@ "rulesDirectory": [ "codelyzer" ] -} \ No newline at end of file +}