import { Component, Inject } from '@angular/core';
import { MAT_DIALOG_DATA } from '@angular/material/dialog';
import * as i0 from "@angular/core";
import * as i1 from "../core";
import * as i2 from "@angular/material/dialog";
import * as i3 from "@angular/common";
import * as i4 from "@angular/material/button";
import * as i5 from "@angular/flex-layout/flex";
/**
 * Controller used to explore a User
 *
 * @author Saravana Kumar
 * @since 20190813
 */
export class UserExploreComponent {
    constructor(http, dialogRef, data) {
        this.http = http;
        this.dialogRef = dialogRef;
        this.data = data;
        this.isWorking = false;
        this.modules = [];
        this.user = this.data;
    }
    ngOnInit() {
        this.loadData();
    }
    loadData() {
        this.isWorking = true;
        this.filters = {};
        this.filters.not_in_user_id = this.user.id;
        this.http.get('api/modules', { params: this.filters }).toPromise().then((response) => {
            this.modules = response.data;
            this.isWorking = false;
        });
    }
    /**Method to close dialog box */
    closeDialog() {
        this.dialogRef.close();
    }
    static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: UserExploreComponent, deps: [{ token: i1.HttpService }, { token: i2.MatDialogRef }, { token: MAT_DIALOG_DATA }], target: i0.ɵɵFactoryTarget.Component }); }
    static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.2.13", type: UserExploreComponent, selector: "user-explore", ngImport: i0, template: "<div fxLayout=\"column\">\n    <div mat-dialog-title class=\"text-center\">\n        <div>Explore User</div>\n    </div>\n    <div mat-dialog-content fxLayout=\"column\">\n\n        <div class=\"form-group row\">\n            <label class=\"col-3 control-label\">Entry ID:</label>\n            <div class=\"col-9\">{{user.id}}</div>\n        </div>\n\n        <div class=\"form-group row\">\n            <label class=\"col-3 control-label\">Name:</label>\n            <div class=\"col-9\">{{user.name}}</div>\n        </div>\n\n        <div class=\"form-group row\">\n            <label class=\"col-3 control-label\">Email:</label>\n            <div class=\"col-9\">{{user.email}}</div>\n        </div>\n\n        <div class=\"form-group row\">\n            <label class=\"col-3 control-label\">Not Involed Modules: </label>\n            <div class=\"col-9\">\n                <ng-container *ngFor=\"let module of modules\">\n                    {{ module?.name }}, <br />\n                </ng-container>\n            </div>\n        </div>\n\n        <button mat-raised-button (click)=\"closeDialog()\">\n            Cancel\n        </button>\n\n    </div>\n\n</div>", dependencies: [{ kind: "directive", type: i3.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "component", type: i4.MatButton, selector: "    button[mat-button], button[mat-raised-button], button[mat-flat-button],    button[mat-stroked-button]  ", exportAs: ["matButton"] }, { kind: "directive", type: i2.MatDialogTitle, selector: "[mat-dialog-title], [matDialogTitle]", inputs: ["id"], exportAs: ["matDialogTitle"] }, { kind: "directive", type: i2.MatDialogContent, selector: "[mat-dialog-content], mat-dialog-content, [matDialogContent]" }, { kind: "directive", type: i5.DefaultLayoutDirective, selector: "  [fxLayout], [fxLayout.xs], [fxLayout.sm], [fxLayout.md],  [fxLayout.lg], [fxLayout.xl], [fxLayout.lt-sm], [fxLayout.lt-md],  [fxLayout.lt-lg], [fxLayout.lt-xl], [fxLayout.gt-xs], [fxLayout.gt-sm],  [fxLayout.gt-md], [fxLayout.gt-lg]", inputs: ["fxLayout", "fxLayout.xs", "fxLayout.sm", "fxLayout.md", "fxLayout.lg", "fxLayout.xl", "fxLayout.lt-sm", "fxLayout.lt-md", "fxLayout.lt-lg", "fxLayout.lt-xl", "fxLayout.gt-xs", "fxLayout.gt-sm", "fxLayout.gt-md", "fxLayout.gt-lg"] }] }); }
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: UserExploreComponent, decorators: [{
            type: Component,
            args: [{ selector: 'user-explore', template: "<div fxLayout=\"column\">\n    <div mat-dialog-title class=\"text-center\">\n        <div>Explore User</div>\n    </div>\n    <div mat-dialog-content fxLayout=\"column\">\n\n        <div class=\"form-group row\">\n            <label class=\"col-3 control-label\">Entry ID:</label>\n            <div class=\"col-9\">{{user.id}}</div>\n        </div>\n\n        <div class=\"form-group row\">\n            <label class=\"col-3 control-label\">Name:</label>\n            <div class=\"col-9\">{{user.name}}</div>\n        </div>\n\n        <div class=\"form-group row\">\n            <label class=\"col-3 control-label\">Email:</label>\n            <div class=\"col-9\">{{user.email}}</div>\n        </div>\n\n        <div class=\"form-group row\">\n            <label class=\"col-3 control-label\">Not Involed Modules: </label>\n            <div class=\"col-9\">\n                <ng-container *ngFor=\"let module of modules\">\n                    {{ module?.name }}, <br />\n                </ng-container>\n            </div>\n        </div>\n\n        <button mat-raised-button (click)=\"closeDialog()\">\n            Cancel\n        </button>\n\n    </div>\n\n</div>" }]
        }], ctorParameters: () => [{ type: i1.HttpService }, { type: i2.MatDialogRef }, { type: undefined, decorators: [{
                    type: Inject,
                    args: [MAT_DIALOG_DATA]
                }] }] });
//# sourceMappingURL=data:application/json;base64, 