File

ecosystem/applications/application-plugins/application-plugins.component.ts

Implements

OnInit OnDestroy

Metadata

Index

Properties
Methods

Constructor

constructor(activatedRoute: ActivatedRoute, ecosystemService: EcosystemService, bsModalService: BsModalService, modal: ModalService, translateService: TranslateService, pluginsService: PluginsService, alertService: AlertService, gainsightService: GainsightService)
Parameters :
Name Type Optional
activatedRoute ActivatedRoute No
ecosystemService EcosystemService No
bsModalService BsModalService No
modal ModalService No
translateService TranslateService No
pluginsService PluginsService No
alertService AlertService No
gainsightService GainsightService No

Methods

getBulkActionControls
getBulkActionControls()
Async installPlugins
installPlugins()
Returns : any
Async loadData
loadData()
Returns : any
ngOnDestroy
ngOnDestroy()
Returns : void
ngOnInit
ngOnInit()
Returns : void
refresh
refresh()
Returns : void
Async removePlugins
removePlugins(plugins: string[])
Parameters :
Name Type Optional
plugins string[] No
Returns : any

Properties

allAvailablePlugins$
Type : BehaviorSubject<ApplicationPlugin[]>
Default value : new BehaviorSubject([])
app
Type : IApplication
bulkActionControls
Type : BulkActionControl[]
Default value : this.getBulkActionControls()
columns
Type : Column[]
Default value : [ { name: 'name', header: gettext('Plugin name'), path: 'name', filterable: true }, { name: 'Version', header: gettext('Version'), path: 'version', filterable: false }, { name: 'description', header: gettext('Description'), path: 'description', filterable: false, cellCSSClassName: 'small' }, { name: 'contextPath', header: gettext('Source'), path: 'contextPath', filterable: false, cellRendererComponent: LabelCellRendererComponent } ]
CURRENT_LOCATION
Default value : location.href
dataGrid
Type : DataGridComponent
Decorators :
@ViewChild(DataGridComponent, {static: false})
displayOptions
Type : DisplayOptions
Default value : { bordered: false, striped: true, filter: true, gridHeader: true }
exportedPlugins$
Type : BehaviorSubject<ApplicationPlugin[]>
Default value : new BehaviorSubject([])
installedPlugins$
Type : Observable<ApplicationPlugin[]>
Default value : combineLatest([ this.remotePlugins$.pipe(map(remotes => this.convertInstalledRemotesToIds(remotes))), this.allAvailablePlugins$ ]).pipe( map(([remotePlugins, allPlugins]) => allPlugins.filter(p => remotePlugins.includes(p.id))), shareReplay(1) )
isLoading
Type : boolean
loadingItemsLabel
Type : string
Default value : gettext('Loading packages')
loadMoreItemsLabel
Type : string
Default value : gettext('Load more packages')
pagination
Type : Pagination
Default value : { pageSize: 10, currentPage: 1 }
PRODUCT_EXPERIENCE
Default value : PRODUCT_EXPERIENCE
remotePlugins$
Type : BehaviorSubject<ApplicationRemotePlugins>
Default value : new BehaviorSubject({})
title
Type : string
Default value : gettext('Installed plugins')
<c8y-title>{{ app | humanizeAppName | async }}</c8y-title>

<c8y-breadcrumb>
  <c8y-breadcrumb-item [icon]="'c8y-atom'" [label]="'Ecosystem' | translate"></c8y-breadcrumb-item>
  <c8y-breadcrumb-item
    [icon]="'c8y-modules'"
    [label]="'Applications' | translate"
    [path]="'ecosystem/applications'"
  ></c8y-breadcrumb-item>
  <c8y-breadcrumb-item
    [icon]="'c8y-modules'"
    [label]="'All applications' | translate"
    [path]="'ecosystem/applications'"
  ></c8y-breadcrumb-item>
  <c8y-breadcrumb-item [label]="app | humanizeAppName | async"></c8y-breadcrumb-item>
  <c8y-breadcrumb-item [label]="'Plugins' | translate"></c8y-breadcrumb-item>
</c8y-breadcrumb>

<c8y-action-bar-item [placement]="'right'">
  <button
    (click)="installPlugins()"
    [ngClass]="{ 'btn-pending': isLoading }"
    class="btn btn-link"
    title="{{ 'Install plugins' | translate }}"
  >
    <i c8yIcon="plus-circle"></i>
    {{ 'Install plugins' | translate }}
  </button>
</c8y-action-bar-item>

<div class="content-fullpage d-flex d-col">
  <c8y-data-grid
    [title]="title"
    [loadMoreItemsLabel]="loadMoreItemsLabel"
    [loadingItemsLabel]="loadingItemsLabel"
    [displayOptions]="displayOptions"
    [columns]="columns"
    [rows]="installedPlugins$ | async"
    [pagination]="pagination"
    [selectable]="true"
    [actionControls]="[]"
    [bulkActionControls]="bulkActionControls"
    (onReload)="refresh()"
    class="d-contents"
  >
    <!-- No search/filtered results empty state -->
    <c8y-ui-empty-state
      *ngIf="(installedPlugins$ | async)?.length"
      [icon]="'search'"
      [title]="'No plugins to display.' | translate"
      [subtitle]="'Refine your search terms or check your spelling.' | translate"
      [horizontal]="true"
    >
    </c8y-ui-empty-state>
    <!-- No installed plugins empty state -->
    <c8y-ui-empty-state
      *ngIf="!(installedPlugins$ | async)?.length && !isLoading"
      [icon]="'plugin'"
      [title]="'No plugins installed.' | translate"
      [subtitle]="'This application doesn\'t have any plugin. Click below to install.' | translate"
      [horizontal]="true"
    >
      <div class="fit-w p-t-16">
        <button
        c8yProductExperience
          [actionName]="PRODUCT_EXPERIENCE.APPLICATIONS.EVENTS.INSTALLED_PLUGINS"
          [actionData]="{
            component: PRODUCT_EXPERIENCE.APPLICATIONS.COMPONENTS.APPLICATION_PLUGINS,
            action: PRODUCT_EXPERIENCE.APPLICATIONS.ACTIONS.INSTALL_PLUGINS,
            url: CURRENT_LOCATION
          }"
          (click)="installPlugins()"
          [ngClass]="{ 'btn-pending': isLoading }"
          class="btn btn-primary btn-sm"
          title="{{ 'Install plugins' | translate }}"
          translate
        >
          Install plugins
        </button>
      </div>
    </c8y-ui-empty-state>
  </c8y-data-grid>
</div>

results matching ""

    No results matching ""