Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,6 @@
}
};

.author-table-data {
vertical-align: middle;
font-size: 0.9rem;
font-weight: 400;
img {
border-radius: 50%;
margin-right: 5px;
}
}

.index-table-info {
min-height: 30px;
max-height: 30px;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { FirstReleaseApproval, Review } from 'src/app/_models/review';
styleUrls: ['./index-page.component.scss']
})
export class IndexPageComponent {
review : Review | null = null;
review : Review | undefined = undefined;

/**
* Pass ReviewId to revision component to load revisions
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,12 @@
[diffApiRevisionId]="diffApiRevisionId"
[userProfile]="userProfile"
[review]="review"
(revisionsSidePanel)="showRevisionsPanel($event)"
(pageOptionsEmitter)="handlePageOptionsEmitter($event)"></app-review-info>
<div class="mt-2" style="display: flex;">
<!--<div>
<div>
<p-menu [model]="sideMenu"></p-menu>
</div>-->
<div style="flex-grow: 1; min-width: 0;"> <!-- margin-left: 7px;"> -->
</div>
<div style="flex-grow: 1; min-width: 0; margin-left: 7px;">
<p-splitter
[panelSizes]="panelSizes"
[minSizes]="minSizes"
Expand Down Expand Up @@ -67,7 +66,7 @@
</div>
</div>
</div>
<p-sidebar [(visible)]="revisionSidePanel!" position="right">
Revisions
<p-sidebar [(visible)]="revisionSidePanel!" position="right" [modal]="true" styleClass="revisions-sidebar">
<app-revisions-list [review]="review"></app-revisions-list>
</p-sidebar>
<app-footer></app-footer>
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,6 @@
}
}

.p-sidebar-right {
width: 70dvw;
}

.p-splitter-panel-nested {
display: block;
min-width: 0;
Expand Down Expand Up @@ -39,5 +35,12 @@
.p-menu .p-menuitem > .p-menuitem-content .p-menuitem-link .p-menuitem-icon {
color: var(--base-text-color);;
font-size: x-large;
&:hover, &:active {
color: var(--primary-color);
}
}

.revisions-sidebar {
width: 75dvw;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -103,12 +103,7 @@ export class ReviewPageComponent implements OnInit {
this.sideMenu = [
{
icon: 'bi bi-clock-history',
},
{
icon: 'bi bi-file-diff'
},
{
icon: 'bi bi-chat-left-dots'
command: () => { this.revisionSidePanel = !this.revisionSidePanel; }
}
];
}
Expand Down Expand Up @@ -219,10 +214,6 @@ export class ReviewPageComponent implements OnInit {
});
}

showRevisionsPanel(showRevisionsPanel : any){
this.revisionSidePanel = showRevisionsPanel as boolean;
}

handlePageOptionsEmitter(showPageOptions: boolean) {
this.userProfile!.preferences.hideReviewPageOptions = !showPageOptions;
this.userProfileService.updateUserPrefernece(this.userProfile!.preferences).pipe(takeUntil(this.destroy$)).subscribe({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,106 +74,20 @@
</div>
</ng-template>
</p-table>
<button type="button" (click)="createReviewSidebarVisible = true" class="btn btn-primary" id="create-review-button"><small>CREATE</small><br><i class="fas fa-plus"></i><br><small>REVIEW</small></button>
<p-sidebar [(visible)]="createReviewSidebarVisible" (onHide)="onHideSideBar()" position="right">
<h3>Create Review</h3>
<p>
Select a Language Below to view instructions for creating a Review.
</p>
<form [formGroup]="createReviewForm" (ngSubmit)="createReview()">
<p-dropdown formControlName="selectedCRLanguage" [options]="crLanguages" optionLabel="label" placeholder="Language" (onChange)="onCRLanguageSelectChange()">
<ng-template pTemplate="selectedItem">
<div class="flex align-items-center gap-2" *ngIf="createReviewForm.get('selectedCRLanguage')!.value">
<img src="{{assetsPath}}/images/{{ createReviewForm.get('selectedCRLanguage')!.value!.label | languageNames }}-original.svg" style="width: 25px"/>
<span class="mx-2 mt-1">{{ createReviewForm.get('selectedCRLanguage')!.value!.label }}</span>
</div>
</ng-template>
<ng-template let-crLanguage pTemplate="item">
<div class="flex align-items-center gap-2">
<img src="{{assetsPath}}/images/{{ crLanguage.label | languageNames }}-original.svg" style="width: 25px"/>
<span class="mx-2 mt-1">{{ crLanguage.label }}</span>
</div>
</ng-template>
</p-dropdown>
<div *ngIf="createReviewInstruction && createReviewInstruction!.length > 0" class="card mt-2">
<div class="card-body">
<h5 class="card-title">What to Upload</h5>
<ol *ngIf=" createReviewForm.get('selectedCRLanguage')!.value && createReviewForm.get('selectedCRLanguage')!.value!.label != 'TypeSpec'">
<li *ngFor="let item of createReviewInstruction" [innerHTML]="item"></li>
</ol>
<div *ngIf="createReviewForm.get('selectedCRLanguage')!.value && createReviewForm.get('selectedCRLanguage')!.value!.label == 'TypeSpec'">
TypeSpec review can be generated manually using one of the following options.
<ol>
<li>
<strong>Option 1:</strong> Create API review using a link to TypeSpec project. Provide the URL to project and click Upload.
</li>
<li>
<strong>Option 2:</strong> Create API review file locally using following steps.
<ul>
<li>
Install <code>@azure-tools/typespec-apiview</code>
</li>
<li>
Compile and emit the apiview file: <code>typespec compile .\main.tsp --emit "@azure-tools/typespec-apiview"</code>
</li>
<li>
Select Json as the language option in Create review page.
</li>
<li>
Upload the JSON file that is emitted.
</li>
</ul>
</li>
</ol>
</div>
</div>
</div>
<div class="mt-2">
<p-fileUpload
#reviewCreationFileUpload name="selectedFile"
*ngIf="createReviewForm.get('selectedCRLanguage')!.value != undefined && createReviewForm.get('selectedCRLanguage')!.value!.label != 'TypeSpec'"
chooseLabel="Select {{ acceptedFilesForReviewUpload }} File to Upload" [customUpload]="true"
[customUpload]="true" [showUploadButton]="false" [showCancelButton]="false" [previewWidth]="0"
accept="{{acceptedFilesForReviewUpload}}" class="mt-2" (onSelect)="onFileSelect($event)">
<ng-template pTemplate="content">
<div *ngIf="createReviewForm.get('selectedFile')!.value == null" class="mx-2">or drag and drop files here</div>
</ng-template>
</p-fileUpload>
</div>
<div *ngIf="createReviewForm.get('selectedCRLanguage')!.value != undefined && createReviewForm.get('selectedCRLanguage')!.value!.label == 'TypeSpec'"
class="card flex justify-content-center mt-2">
<input type="text" pInputText formControlName="filePath"
placeholder="Package root e.g https://github.com/Azure/azure-rest-api-specs/specification/cognitiveservices/AnomalyDetector/"/>
</div>
<div *ngIf="createReviewForm.get('selectedCRLanguage')!.value != undefined" class="card flex justify-content-center mt-2">
<input type="text" pInputText formControlName="label" placeholder="Enter a label for the APIRevision"/>
</div>
<div class="d-grid gap-2 mt-2">
<button *ngIf="createReviewForm.get('selectedCRLanguage')!.value != undefined" [disabled]="!createReviewForm.valid"
type="submit" class="btn btn-primary btn-md"><i class="fas fa-cloud-upload-alt"></i> {{ crButtonText }}
<span *ngIf="creatingReview" class="spinner-grow spinner-grow-sm" aria-hidden="true"></span>
</button>
</div>
</form>
</p-sidebar>
<p-sidebar [(visible)]="filterSideBarVisible" position="right">
<p-sidebar [(visible)]="filterSideBarVisible" position="right" styleClass="filters-sidebar">
<h3>Filter Reviews</h3>
<ul class="list-group list-group-flush">
<li class="list-group-item">
<div class="me-auto">
<div class="fw-medium">First Release Aprroval</div>
<div class="d-grid gap-2 mt-2">
<div class="btn-group" role="group" aria-label="First Release Approval Select">
<input type="radio" class="btn-check" name="PendingFRAInput" id="PendingFRA" autocomplete="off" (click)="updateFirstReleaseApproval('Pending')">
<label class="btn btn-outline-primary btn-sm" for="PendingFRA">Pending</label>

<input type="radio" #firstReleaseApprovalAllCheck class="btn-check" name="AllFRAInput" id="AllFRA" autocomplete="off" (click)="updateFirstReleaseApproval('All')" checked>
<label class="btn btn-outline-primary btn-sm" for="AllFRA">All</label>

<input type="radio" class="btn-check" name="ApprovedFRAInput" id="ApprovedFRA" autocomplete="off" (click)="updateFirstReleaseApproval('Approved')">
<label class="btn btn-outline-primary btn-sm" for="ApprovedFRA">Approved</label>
</div>
</div>
<p-selectButton
class="first-release-approval-filter-button"
[options]="firstReleaseApprovalOptions"
[(ngModel)]="firstReleaseApproval"
(onChange)="updateFirstReleaseApproval($event)"
optionLabel="label"
optionValue="value"
[style]="{'margin-top':'8px'}" />
</div>
</li>
</ul>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,24 @@
:host ::ng-deep {
.p-fileupload-row > div:first-child {
display: none;
.first-release-approval-filter-button .p-selectbutton {
display: flex;
justify-content: space-between;
}

.first-release-approval-filter-button .p-selectbutton .p-button {
flex-grow: 1;
text-align: center;
background-color: transparent;
border: 1px solid var(--link-color);
color: var(--link-color);
font-size: 0.85rem;
}

.p-dropdown {
display: flex;
.first-release-approval-filter-button .p-selectbutton .p-button.p-highlight {
color: var(--primary-btn-color);
background-color: var(--link-color);
}

.filters-sidebar {
width: 20dvw;
}
}
Loading