latest updates @APR 20, 2022

This commit is contained in:
pritesh 2022-04-20 11:15:19 +05:30 committed by Pranav
parent 90b15f5e00
commit a0bdbc7c55
1657 changed files with 301942 additions and 0 deletions

View file

@ -0,0 +1,32 @@
<h4>Shared Users<button mdTooltip="close" (click)="onNoClick(null)"style=" cursor: pointer;
float: right; border:1px solid transparent; background-color: transparent;padding-top:2%"><md-icon style="float: right;width:30px;height:30px;">close
</md-icon></button></h4><hr>
<p ><b>Device Name: </b>{{dname}}</p>
<table class="table table-striped table-hover " style="overflow-y: hidden;
overflow-x: hidden;">
<thead>
<tr>
<th>Name</th>
<th>Remove Sharing</th>
</tr>
</thead>
<tbody>
<tr *ngFor="let device of foods">
<td >{{device.name}}</td>
<td>
<p><button md-tooltip="Remove Shared Device" style="border:1px solid transparent; background-color: transparent;"(click)="deleteshare(device.userid)">
<md-icon> remove_circle_outline</md-icon></button></p>
</td>
</tr>
</tbody>
</table>
<flash-messages></flash-messages>

View file

@ -0,0 +1,25 @@
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
import { ShareUserComponent } from './share-user.component';
describe('ShareUserComponent', () => {
let component: ShareUserComponent;
let fixture: ComponentFixture<ShareUserComponent>;
beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [ ShareUserComponent ]
})
.compileComponents();
}));
beforeEach(() => {
fixture = TestBed.createComponent(ShareUserComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});
it('should be created', () => {
expect(component).toBeTruthy();
});
});

View file

@ -0,0 +1,80 @@
import { Component, OnInit,Inject } from '@angular/core';
import {MdDialog, MdDialogRef, MD_DIALOG_DATA} from '@angular/material';
import {Device} from '../../device';
import {ContactService} from '../../contact.service';
import { FlashMessagesService } from 'angular2-flash-messages';
import { SidebarComponent } from '../../sidebar/sidebar.component';
@Component({
selector: 'app-share-user',
templateUrl: './share-user.component.html',
styleUrls: ['./share-user.component.scss'],
providers: [ContactService,SidebarComponent]
})
export class ShareUserComponent implements OnInit {
//shrdeviceOwner
d :any;
dname:any;
did :any;
devv:any;
deleteshare(uid){
this.contactService.deldevshr( this.d,uid)
.subscribe(
data => {
this.devv = data
window.localStorage['DataUpdate'] = 'True'
this.sidebar.sidebarData()
this.onNoClick("OKK")
});
}
constructor(public dialogRef: MdDialogRef<ShareUserComponent>,
@Inject(MD_DIALOG_DATA) public data: any,private contactService: ContactService,private _flashMessagesService: FlashMessagesService,private sidebar: SidebarComponent) {
this.d =data.name;
this.dname = data.dname;
this.did = data.did;
}
onNoClick(a): void {
console.log(a);
this.dialogRef.close(a);
}
devicess:any;
final:any;
foods = []
ngOnInit() {
this.contactService.shrdeviceOwner(this.d).subscribe(
data => {
this.devicess = data
for(let p=0;p<this.devicess.length;p++){
this.devicess[p];
let fs = this.devicess[p].first_name;
let ls = this.devicess[p].last_name;
let na = fs + " " + ls;
let xz ={
"name" : na,
"userid" : this.devicess[p]._id
}
this.foods.push(xz);
}
}, (err: any) => {;
console.log(err);
if(err.status != 200)
{
/* this._flashMessagesService.show( "This Device is Not Shared to anyOne", { cssClass: 'alert-danger', timeout: 1000 }
);
*/
this.onNoClick("No_Dev")
}});
}
}