Ignore:
Timestamp:
01/31/21 06:27:26 (4 years ago)
Author:
Mile Jankuloski <mile.jankuloski@…>
Branches:
master
Children:
de9d697
Parents:
7520f88
Message:

Maps, geolocation api, dialogs & more

Location:
Farmatiko/ClientApp/src/app/dashboard
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • Farmatiko/ClientApp/src/app/dashboard/dashboard.component.html

    r7520f88 r28d7d35  
    4444      <tbody>
    4545        <tr *ngFor="let pharmacies of head.Pharmacy">
    46           <td>{{pharmacies.name}}</td>
    47           <td>{{pharmacies.location}}</td>
    48           <td>{{pharmacies.address}}</td>
    49           <td>{{pharmacies.workAllTime}}</td>
     46          <td (click)="openPharmacyDialog(pharmacies)">{{pharmacies.name}}</td>
     47          <td (click)="openPharmacyDialog(pharmacies)">{{pharmacies.location}}</td>
     48          <td (click)="openPharmacyDialog(pharmacies)">{{pharmacies.address}}</td>
     49          <td (click)="openPharmacyDialog(pharmacies)">{{pharmacies.workAllTime}}</td>
    5050          <td><a (click)="openEditPharmacyDialog(pharmacies)">Edit</a></td>
    5151        </tr>
     
    7272      </thead>
    7373      <tbody>
    74         <tr *ngFor="let pharmacy of pharmacies">
    75           <td><a (click)="openPharmacyDialog(pharmacy)">{{ pharmacy.name }}</a></td>
    76           <td>{{ pharmacy.location }}</td>
    77           <td>{{ pharmacy.address }}</td>
    78           <td>{{ pharmacy.workAllTime }}</td>
    79           <td><a (click)="claimPharmacy(pharmacy)">Claim</a></td>
     74        <tr *ngFor="let pharmacy of filteredPharmacies">
     75          <td (click)="openPharmacyDialog(pharmacy)">{{ pharmacy.name }}</td>
     76          <td (click)="openPharmacyDialog(pharmacy)">{{ pharmacy.location }}</td>
     77          <td (click)="openPharmacyDialog(pharmacy)">{{ pharmacy.address }}</td>
     78          <td (click)="openPharmacyDialog(pharmacy)">{{ pharmacy.workAllTime }}</td>
     79          <td><a (click)="claimPharmacy(pharmacy)" *ngIf="!pharmacy.headName">Claim</a> <span *ngIf="pharmacy.headName">Already claimed</span></td>
    8080        </tr>
    8181    </tbody>
     
    114114        <tbody>
    115115          <tr *ngFor="let medicine of filteredMedicines">
    116             <td *ngIf="!medicinesEditMode"><a (click)="openMedicineDialog(medicine)">{{ medicine.name }}</a></td>
     116            <td *ngIf="!medicinesEditMode" (click)="openMedicineDialog(medicine)">{{ medicine.name }}</td>
    117117            <td *ngIf="medicinesEditMode"><mat-form-field appearance="fill"><input matInput [(ngModel)]="medicine.name" name="medname"></mat-form-field></td>
    118             <td *ngIf="!medicinesEditMode">{{ medicine.strength }}</td>
     118            <td *ngIf="!medicinesEditMode" (click)="openMedicineDialog(medicine)">{{ medicine.strength }}</td>
    119119            <td *ngIf="medicinesEditMode"><mat-form-field appearance="fill"><input matInput [(ngModel)]="medicine.strength" name="medstr"></mat-form-field></td>
    120             <td *ngIf="!medicinesEditMode">{{ medicine.form }}</td>
     120            <td *ngIf="!medicinesEditMode" (click)="openMedicineDialog(medicine)">{{ medicine.form }}</td>
    121121            <td *ngIf="medicinesEditMode"><mat-form-field appearance="fill"><input matInput [(ngModel)]="medicine.form" name="medform"></mat-form-field></td>
    122             <td *ngIf="!medicinesEditMode">{{ medicine.wayOfIssuing }}</td>
     122            <td *ngIf="!medicinesEditMode" (click)="openMedicineDialog(medicine)">{{ medicine.wayOfIssuing }}</td>
    123123            <td *ngIf="medicinesEditMode"><mat-form-field appearance="fill"><input matInput [(ngModel)]="medicine.wayOfIssuing" name="medwayOfIssuing"></mat-form-field></td>
    124             <td *ngIf="!medicinesEditMode">{{ medicine.manufacturer }}</td>
     124            <td *ngIf="!medicinesEditMode" (click)="openMedicineDialog(medicine)">{{ medicine.manufacturer }}</td>
    125125            <td *ngIf="medicinesEditMode"><mat-form-field appearance="fill"><input matInput [(ngModel)]="medicine.manufacturer" name="medmanufacturer"></mat-form-field></td>
    126             <td *ngIf="!medicinesEditMode">{{ medicine.price }}</td>
     126            <td *ngIf="!medicinesEditMode" (click)="openMedicineDialog(medicine)">{{ medicine.price }}</td>
    127127            <td *ngIf="medicinesEditMode"><mat-form-field appearance="fill"><input matInput [(ngModel)]="medicine.price" name="medprice"></mat-form-field></td>
    128             <td *ngIf="!medicinesEditMode">{{ medicine.packaging }}</td>
     128            <td *ngIf="!medicinesEditMode" (click)="openMedicineDialog(medicine)">{{ medicine.packaging }}</td>
    129129            <td *ngIf="medicinesEditMode"><mat-form-field appearance="fill"><input matInput [(ngModel)]="medicine.packaging" name="medpackaging"></mat-form-field></td>
    130130            <td>
  • Farmatiko/ClientApp/src/app/dashboard/dashboard.component.ts

    r7520f88 r28d7d35  
    4040    this.dataService.getPharmacies()
    4141        .subscribe((pharmacy: IPharmacy[]) => {
    42           this.pharmacies = pharmacy;
    43           this.head.Pharmacy.forEach((pharma) => {
    44             this.filteredPharmacies = this.pharmacies = this.pharmacies.filter(x => x == pharma);
    45           });
     42          this.pharmacies = this.filteredPharmacies = pharmacy;
     43          // Iskluceno filtriranje na farmacies (Star metod)
     44          // this.head.Pharmacy.forEach((pharma) => {
     45          //   this.filteredPharmacies = this.pharmacies = this.pharmacies.filter(x => x == pharma);
     46          // });
    4647        },
    4748        (err: any) => console.log(err),
     
    147148      if(listMedicines){
    148149        listMedicines.forEach((medicine) => {
    149           this.head.PharmacyMedicines = this.head.PharmacyMedicines.filter(x => x != medicine);
     150          if(this.head.PharmacyMedicines) {
     151            this.head.PharmacyMedicines = this.head.PharmacyMedicines.filter(x => x != medicine);
     152          }
     153          else {
     154            this.head.PharmacyMedicines = [];
     155          }
    150156          this.head.PharmacyMedicines.push(medicine);
    151157          this.filteredMedicines = this.head.PharmacyMedicines;
     
    175181          .subscribe((pharmacy: IPharmacy[]) => {
    176182            this.filteredPharmacies = pharmacy;
    177             this.head.Pharmacy.forEach((pharma) => {
    178               this.filteredPharmacies = this.filteredPharmacies.filter(x => x == pharma);
    179             });
     183            // this.head.Pharmacy.forEach((pharma) => {
     184            //   this.filteredPharmacies = this.filteredPharmacies.filter(x => x == pharma);
     185            // });
    180186          },
    181187          (err: any) => console.log(err),
Note: See TracChangeset for help on using the changeset viewer.