<div class='container'>
    <form [formGroup]="formGroup">
        <mat-form-field [hidden]="is_upload_field_hidden('project')">
            <mat-label>Project</mat-label>
            <mat-select formControlName="project">
                <mat-option
                    *ngFor="let item of basket.projects.length == 0 ? adminDataService.surveyMeta.projects : basket.projects"
                    [value]="item.id">
                    {{ item.name }}
                </mat-option>
            </mat-select>
        </mat-form-field>
        <mat-form-field [hidden]="is_upload_field_hidden('surveyor')">
            <mat-label>Surveyor</mat-label>
            <mat-select formControlName="surveyor">
                <mat-option
                    *ngFor="let item of adminDataService.surveyMeta.surveyors"
                    [value]="item.id">
                    {{ item.name }}
                </mat-option>
            </mat-select>
        </mat-form-field>
        <mat-form-field [hidden]="is_upload_field_hidden('equipment')">
            <mat-label>Equipment</mat-label>
            <mat-select formControlName="equipment">
                <mat-option
                    *ngFor="let item of adminDataService.surveyMeta.equipments"
                    [value]="item.id">
                    {{ item.name }}
                </mat-option>
            </mat-select>
        </mat-form-field>
        <mat-form-field class='store' [hidden]="is_upload_field_hidden('store_line_work')">
            <mat-label>Store</mat-label>
            <mat-select formControlName="store_line_work">
                <mat-option
                    *ngFor="let item of adminDataService.surveyMeta.stores_line_work"
                    [value]="item.name">
                    {{ item.name }}
                </mat-option>
            </mat-select>
        </mat-form-field>
        <mat-form-field class='store' [hidden]="is_upload_field_hidden('store_misc')">
            <mat-label>Store</mat-label>
            <mat-select formControlName="store_misc">
                <mat-option
                    *ngFor="let item of adminDataService.surveyMeta.stores_misc"
                    [value]="item.name">
                    {{ item.name }}
                </mat-option>
            </mat-select>
        </mat-form-field>
        <mat-form-field class='status' [hidden]="is_upload_field_hidden('status')">
            <mat-label>Status</mat-label>
            <mat-select formControlName="status">
                <mat-option
                    *ngFor="let item of adminDataService.surveyMeta.statuses"
                    [value]="item">
                    {{ item }}
                </mat-option>
            </mat-select>
        </mat-form-field>

        <div class='importButtonGroup'>
            <button mat-button (click)="fileInput.click()" [disabled]="!formGroup.valid">
                <mat-icon>file_upload</mat-icon>
                Add file
            </button>
            <mat-checkbox formControlName='autoImport'
                matTooltip='Automatically import the content of the file in the database when its added to the basket'>
                Auto import
            </mat-checkbox>
        </div>
        <input hidden (change)="onFileUpload()" #fileInput type="file" id="file">
    </form>
</div>