Skip to content

Commit

Permalink
Merge pull request #88 from mansurskTarento/marketplace-provider-ui
Browse files Browse the repository at this point in the history
adding in progress ui to content upload
  • Loading branch information
vishnubansaltarento authored Nov 18, 2024
2 parents d881c33 + ce4a84c commit 460440f
Show file tree
Hide file tree
Showing 4 changed files with 56 additions and 25 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ export class ConfigureMarketplaceProvidersComponent implements OnInit {

widgetData = {
titles: [
{ title: 'Marketplace Providers', url: 'none' },
{ title: 'Marketplace Providers', url: 'app/home/marketplace-providers' },
{ title: 'Onboard Provider', url: 'none' },
{ title: 'Configure', url: 'app/home/marketplace-providers/onboard-partner' },
{ title: 'Configure', url: 'none' },
],
}
routerParams: any
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,8 @@ export class ContentUploadComponent implements OnInit, OnChanges {
})
.map((element: any) => {
return {
status: element.status === 'success' ? 'Live' : 'Failed',
status: element.status === 'success' ? 'Live' :
element.status === 'InProgress' ? 'In Progress' : 'Failed',
name: element.fileName,
intiatedOn: this.datePipe.transform(new Date(element.initiatedOn), 'dd MMM yyyy hh:mm a'),
completedOn: this.datePipe.transform(new Date(element.completedOn), 'dd MMM yyyy hh:mm a'),
Expand Down Expand Up @@ -419,6 +420,11 @@ export class ContentUploadComponent implements OnInit, OnChanges {
this.downloadLog(event.rows.gcpfileName, event.rows.name)
}
break
case 'refresh':
this.getContentList()
this.getUnPublishedCoursesList()
this.getPublishedCoursesList()
break
}
}

Expand All @@ -436,7 +442,7 @@ export class ContentUploadComponent implements OnInit, OnChanges {
const successMsg = 'Additional details updated successfully.'
this.showSnackBar(successMsg)
this.sendDetailsUpdateEvent()
}, 1000)
}, 1000)
}
},
error: (error: HttpErrorResponse) => {
Expand Down Expand Up @@ -485,7 +491,7 @@ export class ContentUploadComponent implements OnInit, OnChanges {
this.getContentList()
this.getUnPublishedCoursesList()
this.getPublishedCoursesList()
}, 1000)
}, 1000)
}
},
error: (error: HttpErrorResponse) => {
Expand Down Expand Up @@ -541,7 +547,7 @@ export class ContentUploadComponent implements OnInit, OnChanges {
this.showSnackBar(msg)
setTimeout(() => {
this.getUnPublishedCoursesList()
}, 2000)
}, 2000)
}
},
error: (error: HttpErrorResponse) => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,10 @@
<mat-header-cell *matHeaderCellDef mat-sort-heade class="table-header-text" r> {{col.displayName}}
</mat-header-cell>
<mat-cell *matCellDef="let element">
<div class="flex justify-center items-center"
[ngClass]="element[col.key] === 'Live' ? 'statusLive' : 'statusFailed'">
<div class="flex justify-center items-center" [ngClass]="{
'statusLive': element[col.key] === 'Live',
'statusFailed': element[col.key] === 'Failed',
'statusPending': element[col.key] === 'In Progress'}">
{{element[col.key]}}
</div>
</mat-cell>
Expand All @@ -97,23 +99,29 @@
<img src="/assets/icons/folder_icon.svg" alt="">
</mat-header-cell>
<mat-cell *matCellDef="let element" class="justify-center table-menu-column">
<mat-icon mat-icon-button i18n-aria-label aria-label="action items" [matMenuTriggerFor]="cardMenu"
class="horizontalMenu"> more_horiz
</mat-icon>
<mat-menu #cardMenu="matMenu">
<ng-template matMenuContent>
<ng-container *ngFor="let item of menuItems">
<div mat-menu-item [ngClass]="{'disableMenu': element['disableMenu']}"
[disabled]="element['disableMenu'] === true" (click)="buttonClick(item.action, element)">
<button class="flex item-btn items-center" mat-icon-button i18n-aria-label
aria-label="Analytics">
<mat-icon *ngIf="item.icon" class="menu-item-icon">{{item.icon}}</mat-icon>
{{item.btnText}}
</button>
</div>
</ng-container>
</ng-template>
</mat-menu>
<ng-container *ngIf="element['status'] === 'In Progress'; else menuBtn">
<mat-icon matTooltip="Refresh" class="refreshIcon"
(click)="buttonClick('refresh', element)">refresh</mat-icon>
</ng-container>
<ng-template #menuBtn>
<mat-icon mat-icon-button i18n-aria-label aria-label="action items" [matMenuTriggerFor]="cardMenu"
class="horizontalMenu"> more_horiz
</mat-icon>
<mat-menu #cardMenu="matMenu">
<ng-template matMenuContent>
<ng-container *ngFor="let item of menuItems">
<div mat-menu-item [ngClass]="{'disableMenu': element['disableMenu']}"
[disabled]="element['disableMenu'] === true" (click)="buttonClick(item.action, element)">
<button class="flex item-btn items-center" mat-icon-button i18n-aria-label
aria-label="Analytics">
<mat-icon *ngIf="item.icon" class="menu-item-icon">{{item.icon}}</mat-icon>
{{item.btnText}}
</button>
</div>
</ng-container>
</ng-template>
</mat-menu>
</ng-template>
</mat-cell>
</ng-container>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,23 @@
color: #D13924;
}

.statusPending {
height: 33px;
border-radius: 4px;
background-color: #fad8b4;
padding: 0px 16px;
/* stylelint-enable */
font: 700 14px Lato;
/* stylelint-disable */
color: #fb8400;
}

.refreshIcon {
color: #1B4CA1;
margin-left: 5px;
cursor: pointer;
}

.horizontalMenu {
color: #00000099;
cursor: pointer;
Expand Down

0 comments on commit 460440f

Please sign in to comment.