Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 42 additions & 0 deletions .github/workflows/dockerhub.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: Push docker images to Dockerhub

on:
push:
branches: master
tags:
- "v*.*.*"

jobs:
multi:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Set up QEMU
uses: docker/setup-qemu-action@v1
- name: Set output
id: vars
run: echo ::set-output name=tag::${GITHUB_REF#refs/*/}
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
- name: Login to DockerHub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKER_HUB_USERNAME }}
password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}

- name: Build and push latest Pattern Atlas UI
if: ${{ steps.vars.outputs.tag == 'master' }}
uses: docker/build-push-action@v2
with:
context: .
push: true
tags: patternatlas/pattern-atlas-ui:latest

- name: Build and push version of Pattern Atlas UI
if: ${{ steps.vars.outputs.tag != 'master' }}
uses: docker/build-push-action@v2
with:
context: .
push: true
tags: patternatlas/pattern-atlas-ui:${{ steps.vars.outputs.tag }}
24 changes: 24 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: Lint

on: [push, pull_request]

jobs:
run-linters:
name: Run linters
runs-on: ubuntu-latest

steps:
- name: Check out Git repository
uses: actions/checkout@v2

- name: Set up Node.js
uses: actions/setup-node@v1
with:
node-version: 12

# ESLint and Prettier must be in `package.json`
- name: Install Node.js dependencies
run: npm install

- name: Run linters
run: yarn lint-ci
Original file line number Diff line number Diff line change
Expand Up @@ -39,15 +39,15 @@ export class AdminManagementDetailComponent implements OnInit {

createForm() {
this.userForm = this.userFormBuilder.group({
name: [this.user.name, Validators.required],
email: [this.user.email, [Validators.required, Validators.email]],
userRoles: [this.user.roles],
password: ['', Validators.required],
confirmPassword: ['']
},
{
validator: ValidatePassword
});
name: [this.user.name, Validators.required],
email: [this.user.email, [Validators.required, Validators.email]],
userRoles: [this.user.roles],
password: ['', Validators.required],
confirmPassword: ['']
},
{
validator: ValidatePassword
});
}

checkPasswords(control: AbstractControl) {
Expand Down
46 changes: 23 additions & 23 deletions src/app/authentication/_services/authentication.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -115,15 +115,15 @@ export class AuthenticationService {

this.http.post<any>(environment.tokenUrl, params).subscribe(token => {

const accessToken = token[accessTokenKey];
const refreshToken = token[refreshTokenKey];
const accessToken = token[accessTokenKey];
const refreshToken = token[refreshTokenKey];

localStorage.setItem(accessTokenKey, accessToken);
localStorage.setItem(refreshTokenKey, refreshToken);
localStorage.setItem(accessTokenKey, accessToken);
localStorage.setItem(refreshTokenKey, refreshToken);

this.accessTokenSubject.next(accessToken);
},
error => console.error('Error getToken(): ', error)
this.accessTokenSubject.next(accessToken);
},
error => console.error('Error getToken(): ', error)
);
}
}
Expand All @@ -137,33 +137,33 @@ export class AuthenticationService {
.set('refresh_token', `${this.getRefreshToken()}`)
this.http.post<any>('http://localhost:8081/oauth/token', params).subscribe(token => {

const accessToken = token[accessTokenKey];
const refreshToken = token[refreshTokenKey];
const accessToken = token[accessTokenKey];
const refreshToken = token[refreshTokenKey];

localStorage.setItem(accessTokenKey, accessToken);
localStorage.setItem(refreshTokenKey, refreshToken);
localStorage.setItem(accessTokenKey, accessToken);
localStorage.setItem(refreshTokenKey, refreshToken);

this.accessTokenSubject.next(accessToken);
},
error => {
console.error('Error getToken via refreshToken: ', error)
this.accessTokenSubject.next(accessToken);
},
error => {
console.error('Error getToken via refreshToken: ', error)

}
}
);
}

getUserInfo() {
this.http.get<PAUser>('http://localhost:8081/user_info').subscribe(user => {

console.log('UserInfo: ', user);
this.userSubject.next(user);
this.roleSubject.next(user.roles);
console.log('UserInfo: ', user);
this.userSubject.next(user);
this.roleSubject.next(user.roles);

},
error => {
console.error('Error getToken via refreshToken: ', error)
},
error => {
console.error('Error getToken via refreshToken: ', error)

}
}
);
}

Expand Down
26 changes: 13 additions & 13 deletions src/app/core/component/cardrenderer/card-renderer.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,19 +42,19 @@ export class CardRendererComponent {
}
})
.afterClosed().subscribe(dialoganswer => {
if (dialoganswer) {
this.patternService.deletePattern(pattern._links.self.href)
.subscribe(
value => {
this.handlePatternDelete(pattern);
this.toasterService.pop('success', 'Pattern deleted!');
},
error => {
this.toasterService.pop('error', 'Could not delete pattern!', 'A Pattern can only be deleted if it is not a part of any Pattern Views');
}
);
}
});
if (dialoganswer) {
this.patternService.deletePattern(pattern._links.self.href)
.subscribe(
value => {
this.handlePatternDelete(pattern);
this.toasterService.pop('success', 'Pattern deleted!');
},
error => {
this.toasterService.pop('error', 'Could not delete pattern!', 'A Pattern can only be deleted if it is not a part of any Pattern Views');
}
);
}
});

}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@ export class DefaultPlRendererComponent implements OnInit, OnDestroy {
description: res.description,
relationType: res.type,
isDelete: true, //indicates that the dialog is called from the linked removedRemoved method --> not create,
// but a delete / edit operation
// but a delete / edit operation
}
});
dialogRef.afterClosed().subscribe((dialogResult) => {
Expand Down
10 changes: 5 additions & 5 deletions src/app/core/directives/emit-event-on-added-edge.directive.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,16 @@ import { debounceTime, takeUntil } from 'rxjs/operators';
})
export class EmitEventOnAddedEdgeDirective implements OnInit, OnDestroy {
@Output('onAddedEdge') edgeAddedEventEmitter = new EventEmitter<any>(); // eslint-disable-line
// @angular-eslint/no-output-rename
// @angular-eslint/no-output-rename
@Output('onRemovedEdge') edgeRemovedEventEmitter = new EventEmitter<any>(); // eslint-disable-line
// @angular-eslint/no-output-rename
// @angular-eslint/no-output-rename
@Output('onClickedNode') nodeClickedEventEmitter = new EventEmitter<any>(); // eslint-disable-line
// @angular-eslint/no-output-rename
// @angular-eslint/no-output-rename
@Output('onClickedBackground') backgroundClickedEventEmitter = new EventEmitter<any>(); // eslint-disable-line
// @angular-eslint/no-output-rename
// @angular-eslint/no-output-rename
// eslint-disable-next-line @angular-eslint/no-output-on-prefix
@Output('onNodePositionChange') onNodePositionChangeEventEmitter = new EventEmitter<any>(); // eslint-disable-line
// @angular-eslint/no-output-rename
// @angular-eslint/no-output-rename

constructor() {
}
Expand Down
2 changes: 1 addition & 1 deletion src/app/core/directives/emit-event-on-keyup.directive.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ export class EmitEventOnKeyupDirective implements OnInit, OnDestroy {
}

@Output('onKeyup') keyUpEventEmitter = new EventEmitter<any>(); // eslint-disable-line
// @angular-eslint/no-output-rename
// @angular-eslint/no-output-rename

private clicks = new Subject();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,13 +47,13 @@ export class CreatePatternComponent implements OnInit {
className: 'fa fa-subscript',
title: 'Add Formula',
}, {
name: 'pattern-link',
action: (editor) => {
this.addPatternReference(editor);
name: 'pattern-link',
action: (editor) => {
this.addPatternReference(editor);
},
className: 'fa fab fa-product-hunt',
title: 'Reference Pattern',
},
className: 'fa fab fa-product-hunt',
title: 'Reference Pattern',
},
'|', // Separator
MarkdownEditorUtils.helpButton
],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,14 +78,14 @@ export class PatternViewManagementComponent implements OnInit {
}).afterClosed().subscribe(dialogAnswer => {
if (dialogAnswer) {
this.patternViewService.deletePatternView(patternView).subscribe((response) => {
for (let i = 0; i < this.patternViewResponse._embedded.patternViews.length; i++) {
this.patternViewResponse._embedded.patternViews[i].id === patternView.id ? this.patternViewResponse._embedded.patternViews.splice(i, 1) : null;
}
this.toastService.pop('success', 'Pattern View deleted!');
},
(error) => {
this.toastService.pop('error', 'Pattern View could not be deleted!');
for (let i = 0; i < this.patternViewResponse._embedded.patternViews.length; i++) {
this.patternViewResponse._embedded.patternViews[i].id === patternView.id ? this.patternViewResponse._embedded.patternViews.splice(i, 1) : null;
}
this.toastService.pop('success', 'Pattern View deleted!');
},
(error) => {
this.toastService.pop('error', 'Pattern View could not be deleted!');
}
);
}
})
Expand Down