Skip to content

OpenProject is the leading open source project management software for product, project and portfolio management. A powerful Jira alternative with agile planning, issue tracking, roadmaps, Gantt charts, time tracking, collaboration features, and more. Available on premises or in the cloud. ⭐ Star us on GitHub

2.0 KB
Raw Blame
<form
  class="spot-modal"
  [formGroup]="projectAndTypeForm"
  (ngSubmit)="onSubmit($event)"
  >
  <div id="spotModalTitle" class="spot-modal--header">{{text.title}}</div>

  <div class="spot-divider"></div>

  <div class="spot-modal--body spot-container">
    <spot-form-field
      [label]="text.project.label"
      required
      >
      <op-project-autocompleter slot="input"
        formControlName="project"
        [filters]="APIFiltersForProjects"
        [mapResultsFn]="projectFilterFn.bind(this)"
        appendTo=".spot-modal-overlay"
       />

      @if (projectControl.errors?.lackingPermission) {
        <div
          slot="action"
          >
          {{ text.project.lackingPermissionInfo }}
        </div>
      }

      @if (projectControl.errors?.required) {
        <div
          slot="errors"
          class="spot-form-field--error"
          >
          {{ text.project.required }}
        </div>
      }

      @if (projectControl.errors?.lackingPermission) {
        <div
          slot="errors"
          class="spot-form-field--error"
          >
          {{ text.project.lackingPermission }}
        </div>
      }
    </spot-form-field>

    <spot-form-field>
      <op-option-list [options]="typeOptions"
        formControlName="type"
        slot="input"
       />

      @if (projectAndTypeForm?.dirty && typeControl?.invalid) {
        <div
          class="spot-form-field--errors"
          slot="errors"
          >
          <div class="spot-form-field--error">
            {{ text.type.required }}
          </div>
        </div>
      }
    </spot-form-field>
  </div>

  <div class="spot-action-bar">
    <div class="spot-action-bar--right">
      <button
        type="button"
        class="button spot-action-bar--action spot-modal--cancel-button"
        (click)="close.emit()"
        [textContent]="text.cancelButton"
      ></button>
      <button
        type="submit"
        class="button -primary spot-action-bar--action"
        [textContent]="text.nextButton"
      ></button>
    </div>
  </div>
</form>