-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #5 from baloise-incubator/drag_sync_feature
Drag sync feature
- Loading branch information
Showing
24 changed files
with
286 additions
and
73 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3 changes: 3 additions & 0 deletions
3
angular-frontend/src/app/components/dragged-item/dragged-item.component.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
<div class="dragged-item" [ngClass]="'ghost-item'"> | ||
<img [alt]="itemDragInfo" [src]="'assets/items/' + itemDragInfo.name + '.png'"/> | ||
</div> |
9 changes: 9 additions & 0 deletions
9
angular-frontend/src/app/components/dragged-item/dragged-item.component.scss
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
.ghost-item { | ||
width:50px; | ||
height:50px; | ||
border-radius:9px; | ||
margin:3px; | ||
border-width:2px; | ||
border-style: dashed; | ||
border-color: gray; | ||
} |
12 changes: 12 additions & 0 deletions
12
angular-frontend/src/app/components/dragged-item/dragged-item.component.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import {Component, Input} from '@angular/core'; | ||
import {ItemDragInfo} from "../../../model"; | ||
|
||
@Component({ | ||
selector: 'app-dragged-item', | ||
templateUrl: './dragged-item.component.html', | ||
styleUrls: ['./dragged-item.component.scss'] | ||
}) | ||
export class DraggedItemComponent { | ||
@Input() | ||
itemDragInfo!: ItemDragInfo | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
angular-frontend/src/app/components/inventory-item/inventory-item.component.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
<div class="inventory-item" [ngClass]="item.userLock ? store.getColorForUserName(item.userLock): ''" | ||
[draggable]="item.userLock === currentUser" (dragstart)="onDragStart($event)"> | ||
[draggable]="item.userLock === currentUser" (dragstart)="onDragStart($event)" (drag)="onDragging($event)" (dragend)="onDragEnd($event)"> | ||
<img [alt]="item" [src]="'assets/items/' + item.name + '.png'"/> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,26 @@ | ||
import { Credentials } from "./model"; | ||
import { environment } from "./environments/environment"; | ||
import {HttpClient} from "@angular/common/http"; | ||
import {catchError, Observable} from "rxjs"; | ||
import {Injectable} from "@angular/core"; | ||
|
||
@Injectable() | ||
export class HttpService { | ||
host: String; | ||
protocol: String; | ||
|
||
constructor() { | ||
constructor(private http: HttpClient) { | ||
this.host = environment.backend.host; | ||
this.protocol = environment.backend.protocol; | ||
} | ||
|
||
getWebSocket(credentials: Credentials): WebSocket { | ||
console.log("Create web socket to: '" + this.host + "'"); | ||
return new WebSocket(`${this.protocol}://${credentials.username}:${credentials.passcode}@${this.host}/api/connect`); | ||
return new WebSocket(`${this.protocol}://${credentials.username}:${credentials.password}@${this.host}/api/connect`); | ||
} | ||
|
||
getRegistrationURL(credentials : Credentials) : Observable<boolean> { | ||
return this.http.post<boolean>(`http://${this.host}/api/user/registration`, credentials) | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.