<commit_before><app-page *ngIf="streamDefinitions">

  <app-page-head>
    <app-page-head-title><strong>Streams</strong></app-page-head-title>
    <app-page-head-actions [appRoles]="['ROLE_CREATE']">
      <ng-container *ngIf="appsState$ | async as appsState;">
        <button class="btn btn-primary btn-fa" (click)="createStream()" *ngIf="appsState.streams > 0">
          <span class="fa fa-plus"></span>
          Create stream(s)
        </button>
      </ng-container>
    </app-page-head-actions>
  </app-page-head>

  <div dataflowLayoutType type="full">
    <p>This section lists all the stream definitions and provides the ability to deploy/undeploy or destroy streams.</p>

    <app-list-bar [params]="params" [page]="streamDefinitions" [countSelected]="countSelected()" #listBar
                  (refresh)="refresh()" (search)="search($event)" [actions]="streamsActions()"
                  (action)="applyAction($event.action)">
    </app-list-bar>

    <table *ngIf="streamDefinitions?.items && streamDefinitions.items.length > 0"
           class="table table-hover table-checkbox" id="streamDefinitionsTable">
      <thead>
      <tr>
        <th style="width: 30px" [appRoles]="['ROLE_CREATE']">
          <app-master-checkbox (change)="changeCheckboxes()" *ngIf="form?.checkboxes"
                               [items]="form.checkboxes"></app-master-checkbox>
        </th>
        <th style="width: 70px">
          <app-sort id="sort-name" (change)="applySort($event)" [value]="'DEFINITION_NAME'" [sort]="params">
            Name
          </app-sort>
        <th>
          <div class="head-dsl">

            <div class="dropdown" dropdown>
              <a dropdownToggle class="btn-dropdown" data-toggle="dropdown">
                <span class="fa fa-chevron-down"></span>
                <span class="fa fa-chevron-right"></span>
              </a>
              <ul *dropdownMenu class="dropdown-menu">
                <li><a style="cursor: pointer" (click)="expandPage()">Expand All</a></li>
                <li><a style="cursor: pointer" (click)="collapsePage()">Collapse All</a></li>
              </ul>
            </div>
            <app-sort id="sort-dsl" (change)="applySort($event)" [value]="'DEFINITION'" [sort]="params">
              Definitions
            </app-sort>
          </div>
        </th>
        <th nowrap="" style="width: 120px">
          Status
          <a #childPopover="bs-popover" [popover]="popTemplate" placement="left" [outsideClick]="true"
             title="Available Deployment Statuses" style="cursor: pointer">
            <span class="fa fa-question-circle"></span></a>
        </th>
        <th>&nbsp;</th>
      </tr>
      </thead>
      <tbody>
      <ng-container
        *ngFor="let item of streamDefinitions.items | paginate: streamDefinitions.getPaginationInstance(); index as i">
        <tr>
          <td class="cell-checkbox" [appRoles]="['ROLE_CREATE']">
            <input [appRoles]="['ROLE_CREATE']" type="checkbox" (change)="changeCheckboxes()"
                   [(ngModel)]="form.checkboxes[i]"/>
          </td>
          <td>
            <a style="cursor:pointer" (click)="details(item)">{{ item.name }}</a>
          </td>
          <td>
            <a (click)="toggleExpand(i)" class="link-expand">
              <span *ngIf="form.checkboxesExpand[i]" class="fa fa-chevron-down" tooltip="Hide graph" delay="500"></span>
              <span *ngIf="!form.checkboxesExpand[i]" class="fa fa-chevron-right" tooltip="Show graph"
                    delay="500"></span>
              <app-stream-dsl>{{ item.dslText | truncate: 120 }}</app-stream-dsl>
            </a>
          </td>
          <td *ngIf="canShowDeploymentInfo(item); else deployment_status_only_content">
            <a href="" class="stream-info-toggle" (click)="false" [popover]="stream_info" placement="left"
               triggers="focus"
               containerClass="deployment-info-popup">
              <span class="ico fa fa-info-circle"></span>
              <app-stream-status [streamDefinition]="item"></app-stream-status>
            </a>
          </td>
          <ng-template #deployment_status_only_content>
            <td>
              <app-stream-status [streamDefinition]="item"></app-stream-status>
            </td>
          </ng-template>
          <ng-template #stream_info>
            <app-stream-deployment-properties-info [streamDefinition]="item"></app-stream-deployment-properties-info>
          </ng-template>
          <td class="table-actions" width="10px" nowrap="">
            <app-list-row-actions [actions]="streamActions(item, i)" (action)="applyAction($event.action, $event.args)"
                                  [item]="item">
            </app-list-row-actions>
          </td>
        </tr>
        <tr *ngIf="form.checkboxesExpand[i]">
          <td colspan="5" class="graph" style="padding:0">
            <app-stream-graph-definition [stream]="item" [metrics]="metricsForStream(item.name)">
            </app-stream-graph-definition>
          </td>
        </tr>
      </ng-container>
      </tbody>
    </table>

    <app-list-pagination [page]="streamDefinitions" [params]="params" (changed)="changePaginationPager($event)"
                         [item]="'stream definition'" [items]="'stream definitions'">
    </app-list-pagination>

    <app-list-empty [page]="streamDefinitions" [filters]="[params.q]">
      <p>There is <strong>no stream register</strong>.</p>
      <div *ngIf="appsState$ | async as appsState">
        <p *ngIf="appsState.streams > 0" [appRoles]="['ROLE_CREATE']">
          You can <a (click)="createStream()">Create Streams(s)</a> or <a (click)="refresh()">Refresh</a> the page
        </p>
        <p *ngIf="appsState.streams == 0" [appRoles]="['ROLE_CREATE']">
          To create stream(s), you have to <a (click)="registerApps()">register Apps</a> first.<br/>
          You can <a (click)="refresh()">Refresh</a> the page.
        </p>
      </div>
    </app-list-empty>

    <app-list-no-result [page]="streamDefinitions" [filters]="[params.q]">
      <p>
        No results found for
        <strong>'{{ params.q }}'</strong>
      </p>
      <p>
        You can <a (click)="listBar.clearSearch()">Clear the search</a> or <a (click)="refresh()">Refresh</a> the page.
      </p>
    </app-list-no-result><commit_msg>Fix spelling<commit_after><app-page *ngIf="streamDefinitions">

  <app-page-head>
    <app-page-head-title><strong>Streams</strong></app-page-head-title>
    <app-page-head-actions [appRoles]="['ROLE_CREATE']">
      <ng-container *ngIf="appsState$ | async as appsState;">
        <button class="btn btn-primary btn-fa" (click)="createStream()" *ngIf="appsState.streams > 0">
          <span class="fa fa-plus"></span>
          Create stream(s)
        </button>
      </ng-container>
    </app-page-head-actions>
  </app-page-head>

  <div dataflowLayoutType type="full">
    <p>This section lists all the stream definitions and provides the ability to deploy/undeploy or destroy streams.</p>

    <app-list-bar [params]="params" [page]="streamDefinitions" [countSelected]="countSelected()" #listBar
                  (refresh)="refresh()" (search)="search($event)" [actions]="streamsActions()"
                  (action)="applyAction($event.action)">
    </app-list-bar>

    <table *ngIf="streamDefinitions?.items && streamDefinitions.items.length > 0"
           class="table table-hover table-checkbox" id="streamDefinitionsTable">
      <thead>
      <tr>
        <th style="width: 30px" [appRoles]="['ROLE_CREATE']">
          <app-master-checkbox (change)="changeCheckboxes()" *ngIf="form?.checkboxes"
                               [items]="form.checkboxes"></app-master-checkbox>
        </th>
        <th style="width: 70px">
          <app-sort id="sort-name" (change)="applySort($event)" [value]="'DEFINITION_NAME'" [sort]="params">
            Name
          </app-sort>
        <th>
          <div class="head-dsl">

            <div class="dropdown" dropdown>
              <a dropdownToggle class="btn-dropdown" data-toggle="dropdown">
                <span class="fa fa-chevron-down"></span>
                <span class="fa fa-chevron-right"></span>
              </a>
              <ul *dropdownMenu class="dropdown-menu">
                <li><a style="cursor: pointer" (click)="expandPage()">Expand All</a></li>
                <li><a style="cursor: pointer" (click)="collapsePage()">Collapse All</a></li>
              </ul>
            </div>
            <app-sort id="sort-dsl" (change)="applySort($event)" [value]="'DEFINITION'" [sort]="params">
              Definitions
            </app-sort>
          </div>
        </th>
        <th nowrap="" style="width: 120px">
          Status
          <a #childPopover="bs-popover" [popover]="popTemplate" placement="left" [outsideClick]="true"
             title="Available Deployment Statuses" style="cursor: pointer">
            <span class="fa fa-question-circle"></span></a>
        </th>
        <th>&nbsp;</th>
      </tr>
      </thead>
      <tbody>
      <ng-container
        *ngFor="let item of streamDefinitions.items | paginate: streamDefinitions.getPaginationInstance(); index as i">
        <tr>
          <td class="cell-checkbox" [appRoles]="['ROLE_CREATE']">
            <input [appRoles]="['ROLE_CREATE']" type="checkbox" (change)="changeCheckboxes()"
                   [(ngModel)]="form.checkboxes[i]"/>
          </td>
          <td>
            <a style="cursor:pointer" (click)="details(item)">{{ item.name }}</a>
          </td>
          <td>
            <a (click)="toggleExpand(i)" class="link-expand">
              <span *ngIf="form.checkboxesExpand[i]" class="fa fa-chevron-down" tooltip="Hide graph" delay="500"></span>
              <span *ngIf="!form.checkboxesExpand[i]" class="fa fa-chevron-right" tooltip="Show graph"
                    delay="500"></span>
              <app-stream-dsl>{{ item.dslText | truncate: 120 }}</app-stream-dsl>
            </a>
          </td>
          <td *ngIf="canShowDeploymentInfo(item); else deployment_status_only_content">
            <a href="" class="stream-info-toggle" (click)="false" [popover]="stream_info" placement="left"
               triggers="focus"
               containerClass="deployment-info-popup">
              <span class="ico fa fa-info-circle"></span>
              <app-stream-status [streamDefinition]="item"></app-stream-status>
            </a>
          </td>
          <ng-template #deployment_status_only_content>
            <td>
              <app-stream-status [streamDefinition]="item"></app-stream-status>
            </td>
          </ng-template>
          <ng-template #stream_info>
            <app-stream-deployment-properties-info [streamDefinition]="item"></app-stream-deployment-properties-info>
          </ng-template>
          <td class="table-actions" width="10px" nowrap="">
            <app-list-row-actions [actions]="streamActions(item, i)" (action)="applyAction($event.action, $event.args)"
                                  [item]="item">
            </app-list-row-actions>
          </td>
        </tr>
        <tr *ngIf="form.checkboxesExpand[i]">
          <td colspan="5" class="graph" style="padding:0">
            <app-stream-graph-definition [stream]="item" [metrics]="metricsForStream(item.name)">
            </app-stream-graph-definition>
          </td>
        </tr>
      </ng-container>
      </tbody>
    </table>

    <app-list-pagination [page]="streamDefinitions" [params]="params" (changed)="changePaginationPager($event)"
                         [item]="'stream definition'" [items]="'stream definitions'">
    </app-list-pagination>

    <app-list-empty [page]="streamDefinitions" [filters]="[params.q]">
      <p>There are <strong>no streams registered</strong>, yet.</p>
      <div *ngIf="appsState$ | async as appsState">
        <p *ngIf="appsState.streams > 0" [appRoles]="['ROLE_CREATE']">
          You can <a (click)="createStream()">Create Streams(s)</a> or <a (click)="refresh()">Refresh</a> the page
        </p>
        <p *ngIf="appsState.streams == 0" [appRoles]="['ROLE_CREATE']">
          To create stream(s), you have to <a (click)="registerApps()">register Apps</a> first.<br/>
          You can <a (click)="refresh()">Refresh</a> the page.
        </p>
      </div>
    </app-list-empty>

    <app-list-no-result [page]="streamDefinitions" [filters]="[params.q]">
      <p>
        No results found for
        <strong>'{{ params.q }}'</strong>
      </p>
      <p>
        You can <a (click)="listBar.clearSearch()">Clear the search</a> or <a (click)="refresh()">Refresh</a> the page.
      </p>
    </app-list-no-result>
{'fraction_non_alphanumeric': 0.18172532998114393, 'fraction_numerical': 0.003771213073538655, 'mean_word_length': 2.4062081883864064, 'pattern_counts': {'":': 0, '<': 305, '<?xml version=': 0, '>': 311, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3394942', 'n_tokens_mistral': 4005, 'n_tokens_neox': 3819, 'n_words': 695}