fixed API-Docs-Btn and hide paging if paging not neccessary
MODIFY
src/app/components/api-card-list/api-card-list.component.html
src/app/components/api-card-list/api-card-list.component.html
type="search"
[placeholder]="'MPLACE.SEARCH' | translate"
class="search-input"
+ value="{{this.searchTerm}}"
(input)="OnInput($event)"
/>
</mat-form-field>
</div>
+<ng-container *ngIf="totalSize === 0">
+ <h2 class="align">
+ {{'COMMON.NO_DATA_FOUND' | translate}}
+ </h2>
+</ng-container>
<ng-container *ngIf="ready">
<div id="grid">
<app-api-card
></app-api-card>
</div>
</ng-container>
-<div *ngIf="listType === 'api'" class="align">
+<div *ngIf="listType === 'api' && totalSize > searchCriteria.paging.pageSize" class="align">
<mat-paginator
[length]="totalSize"
[pageSize]="searchCriteria.paging.pageSize"

MODIFY
src/app/components/api-card-list/api-card-list.component.ts
src/app/components/api-card-list/api-card-list.component.ts
@@ -21,6 +21,7 @@ export class ApiCardListComponent implements OnInit {
apis: IApiSummary[] = [];
totalSize = 0;
ready = false;
+ searchTerm = '';
searchCriteria: ISearchCriteria = {
filters: [
{
@@ -46,6 +47,7 @@ export class ApiCardListComponent implements OnInit {
ngOnInit(): void {
this.apis = [];
+ this.searchTerm = '';
this.handleQueryParams();
}
@@ -54,18 +56,27 @@ export class ApiCardListComponent implements OnInit {
.subscribe((params) => {
if (params.page) {
this.searchCriteria.paging.page = params.page;
+ } else {
+ this.searchCriteria.paging.page = 1;
}
if (params.pageSize) {
this.searchCriteria.paging.pageSize = params.pageSize;
+ } else {
+ this.searchCriteria.paging.pageSize = 8;
}
if (params.searchTerm) {
+ this.searchTerm = params.searchTerm.replaceAll('*', '');
this.searchCriteria.filters[0].value = params.searchTerm;
+ } else{
+ this.searchTerm = '';
+ this.searchCriteria.filters[0].value = '*';
}
this.getApiList();
})
}
OnInput(event: any): void {
+ this.searchTerm = event.target.value;
this.router.navigate(['/marketplace'],
{
queryParams: {
@@ -131,7 +142,6 @@ export class ApiCardListComponent implements OnInit {
tap((apiVersion) => (api.latestVersion = apiVersion.version)),
switchMap((apiVersion) => {
return of(
- apiVersion.status === 'Published' &&
apiVersion.definitionType !== null &&
apiVersion.definitionType !== 'None'
);

MODIFY
src/app/components/api-card/api-card.component.html
src/app/components/api-card/api-card.component.html
mat-raised-button
color="primary"
class="api-card-button"
- *ngIf="!api.docsAvailable"
+ *ngIf="api.docsAvailable"
[routerLink]="[
'/swagger',
api.organizationId,

MODIFY
src/app/components/marketplace-api-description/marketplace-api-description.component.html
src/app/components/marketplace-api-description/marketplace-api-description.component.html
mat-raised-button
id="docs-button"
color="primary"
- [disabled]="
- !(api.definitionType !== null && api.definitionType !== 'None')
+ *ngIf="
+ (api.definitionType !== null && api.definitionType !== 'None')
"
[routerLink]="[
'/swagger',

fixed API-Docs-Btn and hide paging if paging not neccessary