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

View QR Code Row #827

Open
wants to merge 1 commit into
base: single_tenant_app_snapshot_unmaintained
Choose a base branch
from
Open
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
8 changes: 8 additions & 0 deletions www/css/intro.css
Original file line number Diff line number Diff line change
Expand Up @@ -85,3 +85,11 @@
padding-left: 8%;
padding-right: 8%;
}
.qr-text {
padding-top: 5%;
padding-right: 8%;
padding-left: 8%;
font-size: 15px;
line-height: 1.5;
text-align: left;
}
3 changes: 2 additions & 1 deletion www/i18n/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,8 @@
"collection": "Collection",
"sync": "Sync",
"transition-notify": "Transition Notify",
"button-accept": "I accept"
"button-accept": "I accept",
"view-qrc": "View QR Code"
},

"general-settings":{
Expand Down
19 changes: 15 additions & 4 deletions www/js/control/general-settings.js
Original file line number Diff line number Diff line change
Expand Up @@ -82,17 +82,28 @@ angular.module('emission.main.control',['emission.services',
$scope.viewPrivacyPolicy = function($event) {
// button -> list element -> scroll
// const targetEl = $event.currentTarget.parentElement.parentElement;
if ($scope.ppp) {
$scope.ppp.show($event);
} else {

// if ($scope.ppp) {
// $scope.ppp.show($event);
// } else {
i18nUtils.geti18nFileName("templates/", "intro/consent-text", ".html").then((consentFileName) => {
$scope.consentTextFile = consentFileName;
$ionicPopover.fromTemplateUrl("templates/control/main-consent.html", {scope: $scope}).then((p) => {
$scope.ppp = p;
$scope.ppp.show($event);
});
}).catch((err) => Logger.displayError("Error while displaying privacy policy", err));
}
// }
}

$scope.viewQRCode = function($event) {
i18nUtils.geti18nFileName("templates/", "control/qrc", ".html").then((qrcFileName) => {
Copy link
Contributor

Choose a reason for hiding this comment

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

you don't need the QR code template to be internationalized.

$scope.qrcTextFile = qrcFileName;
$ionicPopover.fromTemplateUrl("templates/control/main-qrc.html", {scope: $scope}).then((p) => {
$scope.ppp = p;
$scope.ppp.show($event);
});
}).catch((err) => Logger.displayError("Error while displaying QR Code", err));
}

$scope.fixAppStatus = function() {
Expand Down
4 changes: 4 additions & 0 deletions www/templates/control/main-control.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@
<div class="control-list-text" translate>{{'.view-privacy'}}</div>
<div ng-click="viewPrivacyPolicy($event)" class="control-icon-button"><i class="ion-eye"></i></div>
</div>
<div class="control-list-item">
<div class="control-list-text" translate>{{'.view-qrc'}}</div>
<div ng-click="viewQRCode($event)" class="control-icon-button"><i class="ion-ios-barcode-outline"></i></div>
</div>
<div class="control-list-item">
<div class="control-list-text" translate>{{'.tracking'}}</div>
<label ng-click="userStartStopTracking()" class="toggle control-list-toggle toggle-color">
Expand Down
6 changes: 6 additions & 0 deletions www/templates/control/main-qrc.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<ion-popover-view style="width: 90%; height: 50%">
<ion-content style="margin: 0; padding: 0;">
<ng-include src="qrcTextFile"></ng-include>
</ion-content>
</ion-popover-view>

12 changes: 12 additions & 0 deletions www/templates/control/qrc.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<script src="/node_modules/qrcode-generator/js/qrcode.js"></script>
<script src="/node_modules/qrcode-generator/js/qrcode_UTF8.js"></script>
<script src="/node_modules/angular-qrcode/angular-qrcode.js"></script>
Comment on lines +1 to +3
Copy link
Contributor

@shankari shankari May 17, 2022

Choose a reason for hiding this comment

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

You need to have this module in package.json. Otherwise, anybody else who installs the app using setup_serve.sh will not have this module.

Also, the code in /node_modules is typically not available to the app. Are you sure this works? You need to install it using bower, or temporarily copy the files into www/manual_lib and check it in. Temporarily until we move to a build system.


<div class="qr-title">
<center><h4>QR Code h4</h4></center>
</div>
<div class="qr-text">
<h3>QR Code h3</h3>
QR Code coming soon!!
<qrcode data="string"></qrcode>
</div>