Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
L
leonardo-mannelli
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Matteo
leonardo-mannelli
Commits
5c1f5ba8
Commit
5c1f5ba8
authored
Mar 02, 2022
by
Matteo
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Gestione versione app + validazione pagina di registrazione
parent
056d81ff
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
80 additions
and
2 deletions
+80
-2
app.module.ts
src/app/app.module.ts
+2
-0
registrazione.page.html
src/app/auth/pages/registrazione/registrazione.page.html
+35
-0
registrazione.page.ts
src/app/auth/pages/registrazione/registrazione.page.ts
+1
-1
home.page.ts
src/app/pages/home/home.page.ts
+22
-1
util.service.ts
src/app/service/util.service.ts
+20
-0
No files found.
src/app/app.module.ts
View file @
5c1f5ba8
...
...
@@ -22,6 +22,7 @@ import { TranslateHttpLoader } from '@ngx-translate/http-loader';
import
{
HttpClient
}
from
'@angular/common/http'
;
//import { Push } from '@ionic-native/push/ngx';
import
{
IonicStorageModule
}
from
'@ionic/storage-angular'
;
import
{
AppVersion
}
from
'@awesome-cordova-plugins/app-version/ngx'
;
export
function
createTranslateLoader
(
http
:
HttpClient
)
{
return
new
TranslateHttpLoader
(
http
,
'./assets/i18n/'
,
'.json'
);
...
...
@@ -55,6 +56,7 @@ export function createTranslateLoader(http: HttpClient) {
EmailComposer
,
InAppBrowser
,
SocialSharing
,
AppVersion
,
//Push,
{
provide
:
RouteReuseStrategy
,
useClass
:
IonicRouteStrategy
}
],
...
...
src/app/auth/pages/registrazione/registrazione.page.html
View file @
5c1f5ba8
...
...
@@ -68,12 +68,47 @@
</ion-row>
<ion-row
color=
"primary"
justify-content-center
>
<div
class=
"validation-errors"
justify-content-center
>
<ng-container
*
ngFor=
"let validation of validation_messages.nome"
>
<div
class=
"error-message"
*
ngIf=
"matching_email_group.get('nome').hasError(validation.type) && (matching_email_group.get('nome').dirty
|| matching_email_group.get('nome').touched)"
>
{{ validation.message }}
</div>
</ng-container>
<ng-container
*
ngFor=
"let validation of validation_messages.cognome"
>
<div
class=
"error-message"
*
ngIf=
"matching_email_group.get('cognome').hasError(validation.type) && (matching_email_group.get('cognome').dirty
|| matching_email_group.get('cognome').touched)"
>
{{ validation.message }}
</div>
</ng-container>
<ng-container
*
ngFor=
"let validation of validation_messages.cellulare"
>
<div
class=
"error-message"
*
ngIf=
"matching_email_group.get('cellulare').hasError(validation.type) && (matching_email_group.get('cellulare').dirty
|| matching_email_group.get('cellulare').touched)"
>
{{ validation.message }}
</div>
</ng-container>
<ng-container
*
ngFor=
"let validation of validation_messages.email"
>
<div
class=
"error-message"
*
ngIf=
"matching_email_group.get('email').hasError(validation.type) && (matching_email_group.get('email').dirty
|| matching_email_group.get('email').touched)"
>
{{ validation.message }}
</div>
</ng-container>
<ng-container
*
ngFor=
"let validation of validation_messages.newpassword"
>
<div
class=
"error-message"
*
ngIf=
"matching_email_group.get('newpassword').hasError(validation.type) && (matching_email_group.get('newpassword').dirty
|| matching_email_group.get('newpassword').touched)"
>
{{ validation.message }}
</div>
</ng-container>
<ng-container
*
ngFor=
"let validation of validation_messages.newpasswordbis"
>
<div
class=
"error-message"
*
ngIf=
"matching_email_group.get('newpasswordbis').hasError(validation.type) && (matching_email_group.get('newpasswordbis').dirty
|| matching_email_group.get('newpasswordbis').touched)"
>
{{ validation.message }}
</div>
</ng-container>
<ng-container
*
ngFor=
"let validation of validation_messages.newpasswordbis"
>
<div
class=
"error-message"
*
ngIf=
"matching_email_group.hasError('areEqual')"
>
{{ validation.message }}
</div>
</ng-container>
</div>
</ion-row>
</ion-grid>
...
...
src/app/auth/pages/registrazione/registrazione.page.ts
View file @
5c1f5ba8
...
...
@@ -100,7 +100,7 @@ export class RegistrazionePage implements OnInit {
],
'email'
:
[
{
type
:
'required'
,
message
:
'Email e
\'
richiesta.'
},
{
type
:
'
pattern'
,
message
:
'Deve essere composta da numeri e lettere
'
}
{
type
:
'
email'
,
message
:
'Deve essere un indirizzo email valido
'
}
],
'cellulare'
:
[
{
type
:
'pattern'
,
message
:
'Deve essere composto da numeri'
}
...
...
src/app/pages/home/home.page.ts
View file @
5c1f5ba8
...
...
@@ -13,6 +13,7 @@ import { environment } from '../../../environments/environment';
import
{
Struttura
}
from
'src/app/interface/struttura'
;
import
{
ParereResponse
}
from
'src/app/interface/parere-response'
;
import
{
EventsService
}
from
'src/app/service/events.service'
;
import
{
AppVersion
}
from
'@awesome-cordova-plugins/app-version/ngx'
;
@
Component
({
selector
:
'app-home'
,
...
...
@@ -27,9 +28,29 @@ export class HomePage {
public
menuCtrl
:
MenuController
,
private
utilService
:
UtilService
,
public
translate
:
TranslateService
,
public
platform
:
Platform
public
platform
:
Platform
,
private
appVersion
:
AppVersion
)
{
this
.
caricaDati
(
true
);
this
.
getVersion
();
}
async
getVersion
()
{
if
(
UtilService
.
getVersion
)
return
;
let
version
=
await
this
.
appVersion
.
getVersionNumber
();
this
.
utilService
.
getVersion
().
subscribe
((
lastVersion
:
String
)
=>
{
var
numeri
=
lastVersion
.
split
(
'.'
);
for
(
let
i
:
number
=
0
;
i
<
numeri
.
length
;
i
++
)
{
Number
.
parseInt
(
numeri
[
i
]);
}
if
(
version
!=
lastVersion
)
{
this
.
utilService
.
presentAlert
(
"Avviso"
,
""
,
"E' presente una nuova versione dell'app sullo store ("
+
lastVersion
+
"), aggiorna la app"
,
[
"OK"
]);
}
UtilService
.
getVersion
=
true
;
});
}
caricaDati
(
startUp
:
boolean
)
...
...
src/app/service/util.service.ts
View file @
5c1f5ba8
...
...
@@ -124,6 +124,26 @@ export class UtilService {
public
static
pushRegistrationId
:
string
;
public
static
redirectToNotifiche
:
boolean
=
false
;
public
startup
:
boolean
=
true
;
public
static
getVersion
:
boolean
=
false
;
getVersion
()
{
var
piattaforma
=
this
.
platform
.
is
(
"android"
)?
"android"
:
"ios;"
var
param
=
UtilService
.
encodeBody
({
app
:
environment
.
struttura
,
piattaforma
:
piattaforma
});
return
this
.
httpClient
.
post
<
String
>
(
this
.
httpClientDataService
.
BASE_ADDRESS
+
'/intranet/ultimaVersione.do'
,
param
,
this
.
httpClientDataService
.
httpOptions
)
.
pipe
(
catchError
(
this
.
handleError
),
tap
(
(
res
:
String
)
=>
{
if
(
res
!=
null
&&
res
!=
""
)
{
return
res
;
}
else
{
return
null
;
}
})
);
}
static
setStruttura
(
id
:
number
)
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment