Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/experiments/go pro/multi select file upload #1205

Merged
merged 26 commits into from
Mar 11, 2022
Merged
Show file tree
Hide file tree
Changes from 11 commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
5aa7b3f
Merge pull request #1198 from numbersprotocol/develop
shc261392 Jan 27, 2022
fe1813a
remove unused GoPro UI components
sultanmyrza Jan 28, 2022
d994209
style(go-pro-media-item-detail-on-camera.component.html)
sultanmyrza Jan 28, 2022
06808dd
fix(go-pro-media-item-detail-on-camera.component.ts)
sultanmyrza Jan 28, 2022
6b9a1d6
refactor(go-pro-bluetooth.service.ts)
sultanmyrza Jan 28, 2022
7b8786e
style(go-pro.page.html)
sultanmyrza Jan 28, 2022
4a53b02
feat: trigger bluetooth pairing at first connection
sultanmyrza Jan 28, 2022
ffaee21
change(go-pro-media.servie.ts): refactor, remove unused methods
sultanmyrza Jan 28, 2022
bee915c
feat(go-pro-media-list-on-camera): multi-select upload
sultanmyrza Jan 28, 2022
e045837
add missing "node_modules/ngx-long-press2"
sultanmyrza Jan 28, 2022
df37236
fix(go-pro-media-list-on-camera.component.scss):
sultanmyrza Jan 28, 2022
c98c7a0
move html styles to scss classes
sultanmyrza Feb 8, 2022
66191db
fix(go-pro.page): typo
sultanmyrza Feb 8, 2022
d03c833
refactor(go-pro-bluetooth.service.ts): use isEqual
sultanmyrza Feb 8, 2022
ccb1320
refactor(go-pro-bluetooth.service.ts): lazy init
sultanmyrza Feb 10, 2022
73668e0
refactor(go-pro-page.ts): use try-catch-finally block
sultanmyrza Feb 10, 2022
03dd1d6
refactor(go-pro-media-list-on-camera.component.ts)
sultanmyrza Feb 10, 2022
a8e8dac
refactor(go-pro-media-list-on-camera.component.ts):
sultanmyrza Feb 10, 2022
5c98461
refactor(go-pro.page.ts): remove unused comments
sultanmyrza Feb 10, 2022
8c26a53
refactor(go-pro-media.service.ts): remove unused methods
sultanmyrza Feb 10, 2022
2f0ce31
refactor(go-pro-media.service.ts): move url utility
sultanmyrza Feb 10, 2022
1688367
refactor(go-pro-wifi.service.ts): use preferenceManager
sultanmyrza Feb 12, 2022
4e5d9a3
refactor(go-pro-bluetooth.service.ts):
sultanmyrza Feb 12, 2022
f071852
refactor(home.page.ts): fix no-async-promise-executor
sultanmyrza Feb 12, 2022
cd713b0
fix(go-pro-bluetooth.service.ts): disconnect before connection to new…
sultanmyrza Feb 19, 2022
34ea1af
fix test related to GoPro Bluetoot and WiFi services
sultanmyrza Mar 9, 2022
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
25 changes: 25 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@
"immutable": "^4.0.0-rc.14",
"lodash-es": "^4.17.21",
"material-design-icons-iconfont": "^6.1.0",
"ngx-long-press2": "^2.0.0",
sultanmyrza marked this conversation as resolved.
Show resolved Hide resolved
"ngx-pinch-zoom": "^2.6.0",
"process": "^0.11.10",
"rxjs": "^6.6.7",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,11 @@
</video>

<div style="height: 24px"></div>
<ion-button (click)="uploadToCapture()" expand="block">
<ion-button
(click)="uploadToCapture()"
expand="block"
style="color: white; --box-shadow: 0; margin: 0 16px 0 16px"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would be good if these styles can be put in the .scss file and keep inline styling usage minimal

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hope this commit "move all html styles to" will resolve

>
Upload to capture directly from camera
</ion-button>
</div>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
import { Location } from '@angular/common';
import { Component, Inject, OnInit } from '@angular/core';
import { Component, OnInit } from '@angular/core';
import { ActivatedRoute, Router } from '@angular/router';
import { NetworkPlugin } from '@capacitor/core';
import {
AlertController,
LoadingController,
ToastController,
} from '@ionic/angular';
import { NETOWRK_PLUGIN } from '../../../../shared/capacitor-plugins/capacitor-plugins.module';
import { GoProFile } from '../go-pro-media-file';
import { GoProMediaService } from '../services/go-pro-media.service';
import { GoProWifiService } from '../services/go-pro-wifi.service';
Expand All @@ -33,11 +31,9 @@ export class GoProMediaItemDetailOnCameraComponent implements OnInit {
public alertController: AlertController,
public loadingController: LoadingController,
public goProMediaService: GoProMediaService,
public goProWiFiService: GoProWifiService,
@Inject(NETOWRK_PLUGIN)
private readonly networkPlugin: NetworkPlugin
public goProWiFiService: GoProWifiService
) {
this.route.queryParams.subscribe(() => {
this.route.queryParams.subscribe(_ => {
const state = this.router.getCurrentNavigation()?.extras.state;
if (state) {
this.mediaFile = state.goProMediaFile;
Expand All @@ -46,31 +42,7 @@ export class GoProMediaItemDetailOnCameraComponent implements OnInit {
}

ngOnInit() {
this.mediaType = GoProMediaService.getFileType(this.mediaFile?.url);
}

async downloadFileFromGoProCamera() {
if (!this.mediaFile) {
return;
}

const fileName = GoProMediaService.extractFileNameFromUrl(
this.mediaFile.url
);

const loading = await this.loadingController.create({
message: 'Please wait... Download in progress',
});
await loading.present();

try {
await this.goProMediaService.downloadFromGoProCamera(this.mediaFile);
this.presentToast(`${fileName} downloaded ✅`);
} catch (error) {
this.presentToast(`Failed to download ${fileName} ❌`);
}

await loading.dismiss();
this.mediaType = this.goProMediaService.getFileType(this.mediaFile?.url);
}

async uploadToCapture() {
Expand Down

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,12 @@
<img
*ngIf="mediaFile?.thumbnailUrl"
[src]="mediaFile!.thumbnailUrl"
(click)="showDetails()"
loading="lazy"
decoding="async"
[ngStyle]="{ border: selected ? '2px solid black' : '' }"
/>
<mat-icon *ngIf="!mediaFile?.thumbnailUrl" class="is-thumbnail-missing">
broken_image
</mat-icon>

<div [class.selected]="selected"></div>
Original file line number Diff line number Diff line change
Expand Up @@ -32,3 +32,13 @@ img {
object-fit: cover;
object-position: center;
}

.selected {
position: absolute;
left: 0;
top: 0;
right: 0;
bottom: 0;
border: 3px solid #564dfc;
border-radius: 4px;
}
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import { GoProMediaService } from '../services/go-pro-media.service';
export class GoProMediaListItemOnCameraComponent {
mediaType: 'unknown' | 'video' | 'image' = 'unknown';
@Input() mediaFile: GoProFile | undefined;
@Input() selected = false;

constructor(
private readonly router: Router,
Expand Down

This file was deleted.

Loading