Skip to content
This repository has been archived by the owner on Mar 6, 2024. It is now read-only.

WIP: Initial move of the certificate chain tree rendered with compact… #413

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft
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
77 changes: 73 additions & 4 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 7 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,9 @@
"@ngrx/store": "10.1.2",
"@ngx-formly/core": "5.6.1",
"@stackblitz/sdk": "1.3.0",
"@types/asn1js": "2.0.2",
"@types/pkijs": "0.0.12",
"@types/pvutils": "1.0.1",
"@types/yargs": "17.0.5",
"@vcd/angular-client": "0.0.2-alpha.1",
"@vcd/bindings": "9.1.1",
Expand All @@ -58,16 +61,20 @@
"@webcomponents/webcomponentsjs": "2.0.0",
"@wessberg/ts-evaluator": "0.0.25",
"angular-cli-ghpages": "0.6.2",
"asn1": "0.2.6",
"classlist.js": "1.1.20150312",
"codecov.io": "0.1.6",
"copyfiles": "^2.4.1",
"dayjs": "1.10.7",
"karma-coverage": "2.0.2",
"lit-html": "1.1.2",
"messageformat": "1.0.2",
"mkdirp": "^1.0.4",
"mousetrap": "1.6.5",
"pkijs": "2.2.2",
"prismjs": "1.25.0",
"properties": "1.2.1",
"pvutils": "1.1.2",
"rbradford-compodoc": "1.1.11",
"rxjs": "6.5.5",
"systemjs": "0.20.19",
Expand Down
3 changes: 2 additions & 1 deletion projects/components/src/assets/resources/en.properties
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@

#
# Copyright 2020-2021 VMware, Inc. All rights reserved. VMware Confidential
# Copyright 2020-2022 VMware, Inc. All rights reserved. VMware Confidential
#

vcd.cc.no.info=-
vcd.cc.select.all=Select All
vcd.cc.submit=Submit
vcd.cc.add=Add
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<div class="chain-tree-compact-details">
<div class="chain-tree">
<vcd-certificate-chain-tree
[certificate]="certificate"
[selectionEnabled]="true"
[preselectionMode]="preselectionMode"
(certificateSelected)="onCertificateSelected($event)"
>
</vcd-certificate-chain-tree>
</div>

<vcd-certificate-details-compact [humanCertificate]="selectedCertificate"></vcd-certificate-details-compact>
</div>
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
.chain-tree {
margin-bottom: 1rem;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
/*!
* Copyright 2021 VMware, Inc.
* SPDX-License-Identifier: BSD-2-Clause
*/
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
/*!
* Copyright 2022 VMware, Inc.
* SPDX-License-Identifier: BSD-2-Clause
*/
import { Component, EventEmitter, Input, Output } from '@angular/core';
import { PRESELECTION_MODE_LEAF } from '../utils/certificate/certificate-util';
import { HumanCertificate } from '../utils/certificate/human-certificate';

@Component({
selector: 'vcd-certificate-chain-tree-details-compact',
templateUrl: 'certificate-chain-tree-details-compact.component.html',
styleUrls: ['certificate-chain-tree-details-compact.component.scss'],
})
export class CertificateChainTreeDetailsCompactComponent {
/**
* Certificate chain data in pem format.
*/
@Input() public certificate: string;

/**
* Optional. Which node to preselect initially - root or leaf.
*/
@Input() public preselectionMode: number = PRESELECTION_MODE_LEAF;

/**
* Emits the currently selected by the user certificate in the tree.
*/
@Output()
public certificateSelected: EventEmitter<HumanCertificate> = new EventEmitter<HumanCertificate>();

selectedCertificate: HumanCertificate;

onCertificateSelected($event: HumanCertificate): void {
this.selectedCertificate = $event;
this.certificateSelected.emit(this.selectedCertificate);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
/*!
* Copyright 2022 VMware, Inc.
* SPDX-License-Identifier: BSD-2-Clause
*/

import { CommonModule } from '@angular/common';
import { NgModule } from '@angular/core';
import { ClarityModule } from '@clr/angular';
import { I18nModule } from '@vcd/i18n';
import { VcdErrorBannerModule } from '../common/error';
import { VcdLoadingIndicatorModule } from '../common/loading';
import { PipesModule } from '../common/pipes/pipes.module';
import { CertificateProcessingService } from '../utils/certificate/certificate-processing.service';
import { CertificateChainTreeDetailsCompactComponent } from './certificate-chain-tree-details-compact.component';
import { CertificateDetailsCompactComponent } from './certificate-details/certificate-details-compact.component';
import { CertificateChainTreeComponent } from './certificate-chain-tree/certificate-chain-tree.component';

@NgModule({
declarations: [
CertificateChainTreeComponent,
CertificateChainTreeDetailsCompactComponent,
CertificateDetailsCompactComponent,
],

imports: [CommonModule, ClarityModule, I18nModule, PipesModule, VcdLoadingIndicatorModule, VcdErrorBannerModule],
entryComponents: [
CertificateChainTreeDetailsCompactComponent,
CertificateChainTreeComponent,
CertificateDetailsCompactComponent,
],
exports: [
CertificateChainTreeDetailsCompactComponent,
CertificateChainTreeComponent,
CertificateDetailsCompactComponent,
],
providers: [CertificateProcessingService],
})
export class CertificateChainTreeDetailsModule {}
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
:host ::ng-deep vcd-error-banner .alert {
margin: 0;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
/*!
* Copyright 2021 VMware, Inc.
* SPDX-License-Identifier: BSD-2-Clause
*/
Loading