Changes in / [8eb1e21:6e6f04b]


Ignore:
Location:
Farmatiko/ClientApp/src/app
Files:
8 edited

Legend:

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

    r8eb1e21 r6e6f04b  
    5656                <tr *ngFor="let head of heads">
    5757                  <td><a (click)="openPharmacyHeadDialog(head)">{{head.Name}}</a> | {{head.Email}}</td>
    58                   <td><a (click)="deletePharmacyHead(head)">Delete</a> | <a (click)="openEditPharmacyHeadDialog(head)">Change</a></td>
     58                  <td><a (click)="deletePharmacyHead(head)" *ngIf="head.Name !== 'Admin'">Delete</a><span *ngIf="head.Name == 'Admin'">Can't delete Admin</span> | <a (click)="openEditPharmacyHeadDialog(head)">Change</a></td>
    5959                </tr>
    6060              </tbody>
  • Farmatiko/ClientApp/src/app/admin/admin.component.ts

    r8eb1e21 r6e6f04b  
    5656  createHead() {
    5757    this.dataService.insertPharmacyHead(this.head)
    58         .subscribe((cHead: IPharmacyHead) => {
    59           if(cHead) {
     58        .subscribe((cHead) => {
    6059            this.heads.push(cHead);
    6160            this.openSnackBar("New head created!","OK");
    62           }
    6361        },
    6462        (err: any) => console.log(err),
     
    7977        },
    8078        (err: any) => console.log(err),
    81         () => console.log("PharmacyHead deleted"));
     79        () => {
     80          console.log("PharmacyHead deleted");
     81          location.reload();
     82        });
    8283  }
    8384
     
    8889    });
    8990    dialogRef.afterClosed().subscribe((editedHead: IPharmacyHead) => {
    90       if(editedHead){
    91         console.log(editedHead);
    92         this.heads = this.heads.filter(x => x !== eHead);
    93         this.heads.push(editedHead);
    94         this.dataService.updatePharmacyHead(editedHead)
    95             .subscribe((hd: IPharmacyHead) => {
    96               if(hd) {
    97                 this.openSnackBar("Success! PharmacyHead edited", "OK").onAction().subscribe(() => {
    98                   window.location.reload();
    99                 });
    100               }
    101               else {
    102                 this.openSnackBar("PharmacyHead edit failed", "Try again");
    103               }
    104             },
    105             (err: any) => console.log(err),
    106             () => console.log('PharmacyHead data updated'));
     91      if(editedHead) {
     92          console.log(editedHead);
     93          this.heads = this.heads.filter(x => x !== eHead);
     94          this.heads.push(editedHead);
     95          this.dataService.updatePharmacyHead(editedHead)
     96              .subscribe((hd: IPharmacyHead) => {
     97                  this.openSnackBar("Success! PharmacyHead edited", "OK").onAction().subscribe(() => {
     98                    location.reload();
     99                  });
     100              },
     101              (err: any) => console.log(err),
     102              () => console.log('PharmacyHead data updated'));
    107103      }
    108104    });
     
    127123        .subscribe((status: boolean) => {
    128124          if(status) {
    129             this.openSnackBar("Request rejected!","OK");
    130           }
    131           else {
    132             this.openSnackBar("Something went wrong","Try again");
     125            this.openSnackBar("Request processed!","OK");
    133126          }
    134127        },
    135128        (err: any) => console.log(err),
    136         () => console.log("PharmacyHeadRequest deleted"));
     129        () => {
     130          console.log("PharmacyHeadRequest deleted");
     131          location.reload();
     132        });
    137133  }
    138134
     
    148144        },
    149145        (err: any) => console.log(err),
    150         () => console.log("PharmacyHead updated"))
     146        () => {
     147          console.log("PharmacyHead updated");
     148          location.reload();
     149        })
    151150    }
    152151  }
  • Farmatiko/ClientApp/src/app/counter/counter.component.ts

    r8eb1e21 r6e6f04b  
    8383    }
    8484    facils.forEach((facil) => {
    85       this.http.get<any>('https://nominatim.openstreetmap.org/search/?country=Macedonia&city='+facil.municipality+'&street='+facil.address+'&format=json').subscribe(obj => {
     85      this.http.get<any>('https://jankuloski.xyz:8080/https://nominatim.openstreetmap.org/search/?country=Macedonia&city='+facil.municipality+'&street='+facil.address+'&format=json').subscribe(obj => {
    8686        console.log(obj); 
    8787        if(obj.length) {
  • Farmatiko/ClientApp/src/app/dashboard/dashboard.component.ts

    r8eb1e21 r6e6f04b  
    6060            .subscribe((req) => {
    6161              if(req) {
    62                 this.openSnackBar("Claiming request sent!", "OK");
    63               }
    64               else {
    65                 this.openSnackBar("Unable to send a request", "Try again");
     62                this.openSnackBar("Request sent!", "OK");
    6663              }
    6764            },
     
    7875            .subscribe((req) => {
    7976              if(req) {
    80                 this.openSnackBar("Claiming request sent!", "OK");
    81               }
    82               else {
    83                 this.openSnackBar("Unable to send a request", "Try again");
     77                this.openSnackBar("Request sent!", "OK");
    8478              }
    8579            },
     
    9892  saveDeletedMedicines() {
    9993    this.dataService.updatePharmacyHead(this.head)
    100       .subscribe((hd) => {
    101         if(hd) {
    102           this.openSnackBar("Success! Medicine deleted", "OK");
     94      .subscribe(() => {
     95          this.openSnackBar("Success!", "OK");
    10396          this.editedMedicine = false;
    104         }
    105         else {
    106           this.openSnackBar("Unable to delete Medicine", "Try again");
    107         }
    10897      },
    109       (err: any) => console.log(err),
     98      (err: any) => {
     99        console.log(err);
     100        this.openSnackBar("Failed!", "Try again");
     101      },
    110102      () => console.log('Update sent!'));
    111103  }
     
    132124          this.editedMedicine = true;
    133125        }
    134         this.openSnackBar("Success! Medicine added, please save changes now", "OK");
    135       }
    136       else {
    137         this.openSnackBar("Failed! Please try again", "OK");
     126        this.openSnackBar("Success!", "OK");
    138127      }
    139128    }, () => this.openSnackBar("Failed! Please try again", "OK"));
     
    160149          this.editedMedicine = true;
    161150        }
    162         this.openSnackBar("Success! Medicines added, please save changes now", "OK");
    163       }
    164       else {
    165         this.openSnackBar("Failed! Please try again", "OK");
     151        this.openSnackBar("Success!", "OK");
    166152      }
    167153    }, () => this.openSnackBar("Failed! Please try again", "OK"));
     
    215201        this.head.Pharmacy.push(editedPharmacy);
    216202        this.dataService.updatePharmacyHead(this.head)
    217             .subscribe((hd: IPharmacyHead) => {
    218               if(hd) {
    219                 this.openSnackBar("Success! Pharmacy edited", "OK").onAction().subscribe(() => {
     203            .subscribe((hd) => {
     204                this.openSnackBar("Success!", "OK").onAction().subscribe(() => {
    220205                  window.location.reload();
    221206                });
    222               }
    223               else {
    224                 this.openSnackBar("Pharmacy edit failed", "Try again");
    225               }
    226207            },
    227208            (err: any) => console.log(err),
  • Farmatiko/ClientApp/src/app/dialogs/facility-dialog/facility-dialog.component.ts

    r8eb1e21 r6e6f04b  
    3232
    3333  addMarkers() {
    34     this.http.get<any>('https://nominatim.openstreetmap.org/search/?country=Macedonia&city='+this.facility?.municipality+'&street='+this.facility?.address+'&format=json').subscribe(obj => {
     34    this.http.get<any>('https://jankuloski.xyz:8080/https://nominatim.openstreetmap.org/search/?country=Macedonia&city='+this.facility?.municipality+'&street='+this.facility?.address+'&format=json').subscribe(obj => {
    3535      console.log(obj); 
    3636      if(obj.length) {
  • Farmatiko/ClientApp/src/app/dialogs/pharmacy-dialog/pharmacy-dialog.component.ts

    r8eb1e21 r6e6f04b  
    3232
    3333  addMarkers() {
    34     this.http.get<any>('https://nominatim.openstreetmap.org/search/?country=Macedonia&city='+this.pharmacy?.location+'&street='+this.pharmacy?.address+'&format=json').subscribe(obj => {
     34    this.http.get<any>('https://jankuloski.xyz:8080/https://nominatim.openstreetmap.org/search/?country=Macedonia&city='+this.pharmacy?.location+'&street='+this.pharmacy?.address+'&format=json').subscribe(obj => {
    3535      console.log(obj); 
    3636      if(obj.length) {
  • Farmatiko/ClientApp/src/app/home/home.component.ts

    r8eb1e21 r6e6f04b  
    8282    }
    8383    pharmas.forEach((pharmacy) => {
    84       this.http.get<any>('https://nominatim.openstreetmap.org/search/?country=Macedonia&city='+pharmacy.location+'&street='+pharmacy.address+'&format=json').subscribe(obj => {
     84      this.http.get<any>('https://jankuloski.xyz:8080/https://nominatim.openstreetmap.org/search/?country=Macedonia&city='+pharmacy.location+'&street='+pharmacy.address+'&format=json').subscribe(obj => {
    8585        console.log(obj); 
    8686        if(obj.length) {
  • Farmatiko/ClientApp/src/app/shared/interfaces.ts

    r8eb1e21 r6e6f04b  
    6464    PharmacyHead?: IPharmacyHead;
    6565    Pharmacy?: IPharmacy;
    66 } 
     66}
Note: See TracChangeset for help on using the changeset viewer.