This commit is contained in:
Eudes Inácio
2021-06-18 12:06:50 +01:00
17 changed files with 228 additions and 68 deletions
+16
View File
@@ -409,6 +409,22 @@
}
}
},
"@angular-material-components/datetime-picker": {
"version": "6.0.3",
"resolved": "https://registry.npmjs.org/@angular-material-components/datetime-picker/-/datetime-picker-6.0.3.tgz",
"integrity": "sha512-Pc11woDH0leghqhvqRDKy4/bk3sdYV8f7IJO8om50YTeF2/y9+RfQinxL1JTaojdJ/PBeyGTJlsK3wdxjVZ0cA==",
"requires": {
"tslib": "^2.1.0"
}
},
"@angular-material-components/moment-adapter": {
"version": "6.0.0",
"resolved": "https://registry.npmjs.org/@angular-material-components/moment-adapter/-/moment-adapter-6.0.0.tgz",
"integrity": "sha512-YnUfaaYIsK1xeN3D84RGc500ieh7BrgSK1DNh3abneeKGTS9es9FJPkqK3JW9P+8460YQ4hxrMMeerGLG30C5A==",
"requires": {
"tslib": "^2.1.0"
}
},
"@angular/animations": {
"version": "11.2.2",
"resolved": "https://registry.npmjs.org/@angular/animations/-/animations-11.2.2.tgz",
+2
View File
@@ -16,6 +16,8 @@
"@angular-devkit/architect": "^0.1102.1",
"@angular-devkit/core": "^11.2.1",
"@angular-devkit/schematics": "^11.2.1",
"@angular-material-components/datetime-picker": "^6.0.3",
"@angular-material-components/moment-adapter": "^6.0.0",
"@angular/animations": "^11.1.0",
"@angular/cdk": "^11.2.13",
"@angular/common": "^11.2.2",
+12 -1
View File
@@ -33,6 +33,12 @@ import { ChatService } from './services/chat.service';
import {MatDatepickerModule} from '@angular/material/datepicker';
// import { FCM } from 'cordova-plugin-fcm-with-dependecy-updated/ionic/ngx';
import {
NgxMatDatetimePickerModule,
NgxMatNativeDateModule,
NgxMatTimepickerModule
} from '@angular-material-components/datetime-picker';
@NgModule({
declarations: [AppComponent],
@@ -50,7 +56,12 @@ import {MatDatepickerModule} from '@angular/material/datepicker';
HttpClientModule,
// NgbModule,
NoopAnimationsModule,
MatDatepickerModule
MatDatepickerModule,
//
NgxMatDatetimePickerModule,
NgxMatTimepickerModule,
NgxMatNativeDateModule
],
providers: [
StatusBar,
+4 -4
View File
@@ -180,12 +180,12 @@ const routes: Routes = [
path:':folderId',
loadChildren: ()=> import('../pages/publications/view-publications/view-publications.module').then(m => m.ViewPublicationsPageModule)
},
/* {
{
path:'view-publications',
children: [
{
path:':folderId',
loadChildren: ()=> import('../pages/publications/view-publications/view-publications.module').then(m => m.ViewPublicationsPageModule)
path:':folderId/:publicationId',
loadChildren: ()=> import('../pages/publications/view-publications/publication-detail/publication-detail.module').then(m => m.PublicationDetailPageModule)
},
{
path:'publication-detail',
@@ -198,7 +198,7 @@ const routes: Routes = [
},
]
}, */
},
{
path:'new-publication',
loadChildren: ()=> import('../shared/publication/new-publication/new-publication.module').then(m => m.NewPublicationPageModule)
+1 -1
View File
@@ -68,7 +68,7 @@ export class HomePage implements OnInit {
private platform: Platform) {
router.events.subscribe((val) => {
document.querySelectorAll('ion-modal').forEach((e) => e.remove())
// document.querySelectorAll('ion-modal').forEach((e) => e.remove())
});
{
+7 -1
View File
@@ -26,6 +26,7 @@ import { NewEventPage } from './new-event/new-event.page';
import { AuthService } from 'src/app/services/auth.service';
import { User } from 'src/app/models/user.model';
import { letProto } from 'rxjs-compat/operator/let';
import { DateAdapter } from '@angular/material/core';
@Component({
selector: 'app-agenda',
@@ -158,7 +159,12 @@ export class AgendaPage implements OnInit {
private router: Router,
private alertController: AlertService,
private sanitizer: DomSanitizer,
authService: AuthService) {
authService: AuthService,
private dateAdapter: DateAdapter<any>
) {
this.dateAdapter.setLocale('es');
this.locale = 'pt'
this.loggeduser = authService.ValidatedUser;
@@ -35,14 +35,14 @@
<div class="overflow-y-auto">
<div class="middle-content">
<h5 *ngIf="intervenientes">Intervenientes</h5>
<!-- <h5 *ngIf="intervenientes">Intervenientes</h5>
<ion-item class="ion-no-margin ion-no-padding">
<ion-label>
<div *ngFor="let interveniente of intervenientes">
<p>{{interveniente.Name}}</p>
</div>
</ion-label>
</ion-item>
</ion-item> -->
<div *ngIf="cc.length > 0">
<h5>Com conhecimento</h5>
<ion-item class="ion-no-margin ion-no-padding">
@@ -7,13 +7,15 @@ import { IonicModule } from '@ionic/angular';
import { PublicationDetailPageRoutingModule } from './publication-detail-routing.module';
import { PublicationDetailPage } from './publication-detail.page';
import { HeaderPageModule } from 'src/app/shared/header/header.module';
@NgModule({
imports: [
CommonModule,
FormsModule,
IonicModule,
PublicationDetailPageRoutingModule
PublicationDetailPageRoutingModule,
HeaderPageModule,
],
declarations: [PublicationDetailPage]
})
@@ -1,9 +1,12 @@
<ion-header class="ion-no-border">
<app-header></app-header>
</ion-header>
<ion-content>
<div class="content-container">
<div *ngIf="publication.Title != ''">
<div class="title-content px-20" (click)="close()">
<div class="title-content px-20" (click)="goBack()">
<div class="back-icon">
<ion-icon slot="end" src='assets/images/icons-arrow-arrow-left.svg'></ion-icon>
</div>
@@ -1,10 +1,9 @@
import { Component, OnInit } from '@angular/core';
import { AnimationController, ModalController, NavParams } from '@ionic/angular';
import { ActivatedRoute, Router } from '@angular/router';
import { AnimationController, ModalController } from '@ionic/angular';
import { Publication } from 'src/app/models/publication';
import { PublicationsService } from 'src/app/services/publications.service';
import { ToastService } from 'src/app/services/toast.service';
import { BadRequestPage } from 'src/app/shared/popover/bad-request/bad-request.page';
import { SuccessMessagePage } from 'src/app/shared/popover/success-message/success-message.page';
import { ImageModalPage } from '../../gallery/image-modal/image-modal.page';
import { NewPublicationPage } from '../../new-publication/new-publication.page';
@@ -21,13 +20,21 @@ export class PublicationDetailPage implements OnInit {
constructor(
private modalController: ModalController,
private navParams:NavParams,
private publications:PublicationsService,
private animationController: AnimationController,
private toastService: ToastService,
private activatedRoute: ActivatedRoute,
private router: Router,
) {
this.publicationId = this.navParams.get('publicationId');
this.folderId = this.navParams.get('folderId');
this.activatedRoute.paramMap.subscribe(params => {
console.log(params);
if(params["params"]) {
this.folderId = params["params"].folderId;
this.publicationId = params["params"].publicationId;
console.log(params["params"]);
}
});
this.publication = {
DateIndex: null,
DocumentId: '',
@@ -80,6 +87,10 @@ export class PublicationDetailPage implements OnInit {
this.modalController.dismiss();
}
goBack(){
this.router.navigate(['/home/publications', this.folderId]);
}
async deletePost(){
@@ -35,7 +35,7 @@
<!-- [routerLink]="['/home/publications/view-publications/publication-detail', publication.publicationId]" -->
<div class="post-item"
*ngFor="let publication of publicationList"
(click)="viewPublicationDetail(publication.DocumentId)">
(click)="goToPublicationDetail(publication.DocumentId)">
<div *ngIf="publication.FileBase64.length > 30" class="post-img">
<img src="{{publication.FileBase64}}" alt="image">
</div>
@@ -115,6 +115,10 @@ export class ViewPublicationsPage implements OnInit {
});
}
goToPublicationDetail(publicationId:string){
this.router.navigate(['/home/publications/view-publications', this.folderId, publicationId]);
}
async viewPublicationDetail(publicationId:string) {
const modal = await this.modalController.create({
component: PublicationDetailPage,
@@ -8,12 +8,23 @@ import { NewEventPageRoutingModule } from './new-event-routing.module';
import { NewEventPage } from './new-event.page';
import { NgbModule } from '@ng-bootstrap/ng-bootstrap';
import {MatDatepickerModule} from '@angular/material/datepicker';
import {MatInputModule} from '@angular/material/input';
import { MatDatepickerModule } from '@angular/material/datepicker';
import { MatInputModule } from '@angular/material/input';
import { MatNativeDateModule } from '@angular/material/core';
import { MatMomentDateModule, MomentDateAdapter } from "@angular/material-moment-adapter";
import {
NgxMatDatetimePickerModule,
NgxMatNativeDateModule,
NgxMatTimepickerModule
} from '@angular-material-components/datetime-picker';
import { ReactiveFormsModule } from '@angular/forms';
import { MatButtonModule } from '@angular/material/button';
import { MatSelectModule } from '@angular/material/select';
import { NgxMatMomentModule } from '@angular-material-components/moment-adapter';
@NgModule({
imports: [
@@ -25,7 +36,20 @@ import { MatMomentDateModule, MomentDateAdapter } from "@angular/material-moment
MatDatepickerModule,
MatInputModule,
MatNativeDateModule,
//
NgxMatDatetimePickerModule,
NgxMatTimepickerModule,
NgxMatNativeDateModule,
//
NgxMatMomentModule,
// BrowserAnimationsModule,
// BrowserModule,
MatSelectModule,
//MatRadioModule,
//MatCheckboxModule,
MatButtonModule,
ReactiveFormsModule
],
declarations: [NewEventPage],
exports: [NewEventPage]
@@ -13,6 +13,18 @@
<ion-content>
<div class="main-content">
<!-- THIS -->
<!-- <mat-form-field>
<input matInput [ngxMatDatetimePicker]="picker" placeholder="Choose a date" [formControl]="dateControl"
[min]="minDate" [max]="maxDate" [disabled]="disabled">
<mat-datepicker-toggle matSuffix [for]="picker"></mat-datepicker-toggle>
<ngx-mat-datetime-picker #picker [showSpinners]="showSpinners" [showSeconds]="showSeconds"
[stepHour]="stepHour" [stepMinute]="stepMinute" [stepSecond]="stepSecond" [touchUi]="touchUi"
[color]="color" [enableMeridian]="enableMeridian">
</ngx-mat-datetime-picker>
</mat-form-field> -->
<!-- <form class="form-inline">
<div class="form-group">
<div class="input-group">
@@ -102,7 +114,7 @@
>
</ion-datetime>
<input
<!-- <input
class="d-none width-100"
placeholder="Início"
[matDatepicker]="picker"
@@ -110,7 +122,7 @@
(click)="picker.open()"
[(ngModel)]="postEvent.StartDate"
>
<mat-datepicker #picker></mat-datepicker>
<mat-datepicker #picker></mat-datepicker> -->
<!-- <ion-input placeholder="Data início" [(ngModel)]="postData.StartDate"></ion-input> -->
+100 -24
View File
@@ -21,21 +21,29 @@ import {DateAdapter, MAT_DATE_FORMATS, MAT_DATE_LOCALE} from '@angular/material/
import * as _moment from 'moment';
import * as _rollupMoment from 'moment';
import {FormControl} from '@angular/forms';
import { NgxMatDateFormats } from '@angular-material-components/datetime-picker';
import { ThemePalette } from '@angular/material/core';
import { HttpClient } from '@angular/common/http';
import { NgZone, ViewChild } from '@angular/core';
import { FormGroup, Validators } from '@angular/forms';
import { NgxMatDatetimePickerModule, NgxMatTimepickerModule, NGX_MAT_DATE_FORMATS, NgxMatDateAdapter } from '@angular-material-components/datetime-picker';
const moment = _rollupMoment || _moment;
export const MY_FORMATS = {
const CUSTOM_DATE_FORMATS: NgxMatDateFormats = {
parse: {
dateInput: 'LL',
dateInput: "YYYY-MMMM-DD HH:mm"
},
display: {
dateInput: 'LL',
monthYearLabel: 'MMM YYYY',
dateA11yLabel: 'LL',
monthYearA11yLabel: 'MMMM YYYY',
},
};
dateInput: "DD MMM YYYY H:mm",
monthYearLabel: "MMM YYYY",
dateA11yLabel: "LL",
monthYearA11yLabel: "MMMM YYYY"
}
}
@Component({
selector: 'app-new-event',
@@ -45,13 +53,15 @@ export const MY_FORMATS = {
// `MomentDateAdapter` can be automatically provided by importing `MomentDateModule` in your
// application's root module. We provide it at the component level here, due to limitations of
// our example generation script.
{
provide: DateAdapter,
useClass: MomentDateAdapter,
deps: [MAT_DATE_LOCALE, MAT_MOMENT_DATE_ADAPTER_OPTIONS]
},
// {
// provide: DateAdapter,
// useClass: MomentDateAdapter,
// deps: [MAT_DATE_LOCALE, MAT_MOMENT_DATE_ADAPTER_OPTIONS]
// },
{provide: MAT_DATE_FORMATS, useValue: MY_FORMATS},
{ provide: NGX_MAT_DATE_FORMATS, useValue: CUSTOM_DATE_FORMATS },
// { provide: MAT_DATE_LOCALE, useValue: 'pt-br' },
// { provide: LOCALE_ID, useValue: "en-GB" }
]
})
@@ -62,6 +72,20 @@ export class NewEventPage implements OnInit {
eventBody: EventBody;
segment:string = "true";
public date: any;
public disabled = false;
public showSpinners = true;
public showSeconds = false;
public touchUi = false;
public enableMeridian = false;
public minDate: any;
public maxDate: any;
public stepHour = 1;
public stepMinute = 1;
public stepSecond = 1;
public color: ThemePalette = 'primary';
@Input() profile:string;
@Input() selectedSegment: string;
@Input() selectedDate: Date;
@@ -80,12 +104,10 @@ export class NewEventPage implements OnInit {
documents:SearchDocument[] = [];
minDate: string;
// minDate: string;
loggeduser: User;
date = new FormControl(moment());
// serializedDate = new FormControl((new Date()).toISOString());
@ViewChild('picker') picker: any;
constructor(
private modalController: ModalController,
@@ -94,13 +116,17 @@ export class NewEventPage implements OnInit {
private animationController: AnimationController,
private toastService: ToastService,
private userService: AuthService,
private http: HttpClient,
private zone: NgZone,
private dateAdapter: DateAdapter<any>
) {
this.dateAdapter.setLocale('pt');
this.loggeduser = userService.ValidatedUser;
}
ngOnInit() {
if(!this.restoreTemporaryData()){
// clear
@@ -178,6 +204,61 @@ export class NewEventPage implements OnInit {
this.setIntervenientCC.emit(this.taskParticipantsCc);
}
this.date = new Date(2021,9,4,5,6,7);
}
public formGroup = new FormGroup({
date: new FormControl(null, [Validators.required]),
date2: new FormControl(null, [Validators.required])
})
public dateControl = new FormControl(new Date(2021,9,4,5,6,7));
public dateControlMinMax = new FormControl(new Date());
public options = [
{ value: true, label: 'True' },
{ value: false, label: 'False' }
];
public listColors = ['primary', 'accent', 'warn'];
public stepHours = [1, 2, 3, 4, 5];
public stepMinutes = [1, 5, 10, 15, 20, 25];
public stepSeconds = [1, 5, 10, 15, 20, 25];
toggleMinDate(evt: any) {
if (evt.checked) {
this._setMinDate();
} else {
this.minDate = null;
}
}
toggleMaxDate(evt: any) {
if (evt.checked) {
this._setMaxDate();
} else {
this.maxDate = null;
}
}
closePicker() {
this.picker.cancel();
}
private _setMinDate() {
const now = new Date();
this.minDate = new Date();
this.minDate.setDate(now.getDate() - 1);
}
private _setMaxDate() {
const now = new Date();
this.maxDate = new Date();
this.maxDate.setDate(now.getDate() + 1);
}
async getDoc(){
@@ -367,9 +448,4 @@ export class NewEventPage implements OnInit {
window['temp.path:/home/agenda/new-event.component.ts'] = {}
}
}
@@ -1,4 +1,11 @@
:host{
::-webkit-scrollbar {
width: 7px;
height: 7px;
}
background: transparent;
padding: 0!important;
}
@@ -56,15 +63,12 @@
color:#000;
}
.main-content{
width: 100%; /* 400px */
height: 100%;
font-family: Roboto;
margin: 0 auto;
background-color: #fff;
overflow:auto;
padding: 15px 20px 0 20px;
.main-container{
width: 100%;
height: 100% !important;
overflow-y: auto;
}
.content-top{
background: #f3f2f2;
height: 20px;
@@ -73,17 +77,6 @@
border-top-right-radius: 25px;
transform: translate3d(0, 1px, 0);
}
.content-container{
width: 100%;
margin:0 auto;
border-top-left-radius: 25px;
border-top-right-radius: 25px;
background: #ffffff;
height: 100%;
box-shadow: 0px 0px 18px rgba(0, 0, 0, 0.6);
padding: 25px 0px 0 0px;
overflow: auto;
}
.title-content{
margin: 0px auto;
overflow: auto;
+2 -2
View File
@@ -699,10 +699,10 @@ body, .blue-background{ background: #0782C9 !important;}
@media only screen and (min-width: 1365px) {
body{
background: linear-gradient(270deg, #45BAFF 0%, #0782C9 23.44%, rgba(7, 130, 201, 0.9425) 78.13%, #45BAFF 100%);
background: linear-gradient(270deg, #45BAFF 0%, #0782C9 23.44%, rgba(7, 130, 201, 0.9425) 78.13%, #45BAFF 100%) !important;
}
.blue-background {
background: linear-gradient(270deg, #45BAFF 0%, #0782C9 23.44%, rgba(7, 130, 201, 0.9425) 78.13%, #45BAFF 100%);
background: linear-gradient(270deg, #45BAFF 0%, #0782C9 23.44%, rgba(7, 130, 201, 0.9425) 78.13%, #45BAFF 100%) !important;
}
}