@evan.network/ui-angular-core
Version:
The angular-core operates as an global and central library for the evan.network Angular 5 frontend development. Using this project you will be able to to the following things:
327 lines (326 loc) • 11.9 kB
TypeScript
import { ChangeDetectorRef, DomSanitizer, ElementRef, MenuController } from 'angular-libs';
import { AsyncComponent } from '../../classes/AsyncComponent';
import { EvanAddressBookService } from '../../services/bcc/address-book';
import { EvanAlertService } from '../../services/ui/alert';
import { EvanBCCService } from '../../services/bcc/bcc';
import { EvanCoreService } from '../../services/bcc/core';
import { EvanDescriptionService } from '../../services/bcc/description';
import { EvanFileService } from '../../services/ui/files';
import { EvanPictureService } from '../../services//ui/picture';
import { EvanQueue } from '../../services/bcc/queue';
import { EvanTranslationService } from '../../services/ui/translate';
import { EvanVerificationService } from '../../services/bcc/verifications';
/**
* Display a all verifications for a specific topic using the api-blockchain-core verifications service.
*
* @class Component EvanVerificationComponent
*/
export declare class EvanVerificationComponent extends AsyncComponent {
private _DomSanitizer;
private addressBookService;
private alertService;
private bcc;
private core;
private descriptionService;
private element;
private fileService;
private menuController;
private pictureService;
private queue;
private translate;
private verificationService;
ref: ChangeDetectorRef;
/***************** inputs & outpus *****************/
/**
* address that for that the verifications should be checked
*/
address: string;
/**
* the topic to load the verifications for (/test/test2)
*/
topic: string;
/**
* display mode that should be used (minimal, detail, full)
*/
mode: string;
/**
* use computed view and only one verification instead of all possible ones (will display a small verification
* count at the right of the card)
*/
compute: boolean;
/**
* is the component allowed to issue verifications?
*/
enableIssue: boolean;
/**
* should the delete button be shown?
*/
enableDelete: boolean;
/**
* should the delete button be shown?
*/
enableReject: boolean;
/***************** variables *****************/
/**
* available display modes
*/
private availableModes;
/**
* All available verifications for the given topic
*/
private verifications;
/**
* concadinated verification including computed status
*/
private computed;
/**
* Are currently the verifications loading?
*/
private loadingVerifications;
/**
* Function to unsubscribe from queue results.
*/
private queueWatcher;
/**
* account id of the current logged in user
*/
private activeAccount;
/**
* identity contract address of the current user
*/
private activeIdentity;
/**
* identity contract address of the user that gets inspected
*/
private subjectIdentity;
/**
* activate the detail popup when a verification was clicked
*/
private popupVerification;
/**
* current addressbook contact
*/
private addressbook;
/**
* fix for modal scrolling => sometimes, modal does not scroll, change simply the size with an
* delay, so the scrolling will be enabled
*/
private disableScrolling;
/**
* generate a iso string from the current date for the date input fields
*/
private now;
/**
* max date for the date input picker
*/
private maxDate;
/**
* new verification that should be issued
*/
private issueVerification;
/**
* verification that should be rejected
*/
private rejectVerification;
/**
* verification that should be rejected
*/
private editDBCPVerification;
/**
* parent containing ion app contaioner
*/
private closestIonApp;
/**
* for the current profile activated verifications
*/
private profileVerifications;
/**
* Function to unsubscribe from profile verifications watcher queue results.
*/
private profileVerificationsWatcher;
/**
* menu value, when a verification menu entry was clicked
*/
private verificationMenuValue;
/**
* contains all current d3 specific variables
*/
private d3;
/**
* current clicked d3 node, for that the detail should be shown
*/
private activeDetailHover;
/**
* current detail container for auto scroll
*/
evanDetailVerification: any;
/***************** initialization *****************/
constructor(_DomSanitizer: DomSanitizer, addressBookService: EvanAddressBookService, alertService: EvanAlertService, bcc: EvanBCCService, core: EvanCoreService, descriptionService: EvanDescriptionService, element: ElementRef, fileService: EvanFileService, menuController: MenuController, pictureService: EvanPictureService, queue: EvanQueue, translate: EvanTranslationService, verificationService: EvanVerificationService, ref: ChangeDetectorRef);
/**
* Set initial, bind queue watchers and load the verifications.
*/
_ngOnInit(): Promise<void>;
/**
* Copy the modal views into the closest ion-app menu.
*/
_ngAfterViewInit(): Promise<void>;
/**
* Clear watchers.
*/
_ngOnDestroy(): Promise<void>;
/**
* Takes all displayed evan modals of this view and moves it to the next top ion-app, to be
* displayed in the correct height
*/
private moveModalsToClosestIonApp;
/**
* Takes a verification that was passed to specific status variable, renders the modal, shows it and
* moves it to the next ion-app
*
* @param {any} verification the verification that should be opened within a modal
*/
private enableVerificationModal;
/**
* Closes a verification modal using a smooth hide.
*
* @param {any} verification the verification that should be close
* @param {string} type the type of the modal to close (popupVerification, issueVerification, ...)
*/
private removeVerificationModal;
/**
* Load all verifications for the current topic.
*
* @return {Promise<void>} resolved when done
*/
private loadVerifications;
/**
* Issue a new verification the current opened topic and the subject.
*
* @param {any} verification the verification for that the action should be triggerd
* @param {string} type type of the dispatcher (issueDispatcher, acceptDispatcher,
* deleteDispatcher)
* @param {any} $event the click event
* @return {boolean} false to break the event bubbling
*/
private triggerDispatcher;
/**
* Show details for a verification or computed one.
*
* @param {any} verificationToActivate computed / normal verification
*/
private openVerificationPopup;
/**
* Check if a warning for a verification exists
*
* @param {any} verification the verification that should be checked
* @param {any} warning the name of the warning that should be checked
* @return {boolean} True if warning exists, False otherwise
*/
private isWarning;
/**
* Opens the issue verification popup, when the user is able to open the issue verification.
*
* @param {any} verification the verification that should be opened
* @param {any} $event the click event
* @return {false} break the event bubbling
*/
private openIssueVerification;
/**
* Opens the issue verification popup, when the user is able to open the issue verification.
*
* @param {any} verification the verification that should be opened
* @param {any} $event the click event
* @return {false} break the event bubbling
*/
private openRejectVerification;
/**
* Opens the dbcp edit for a specific verification.
*
* @param {any} verification the verification for that the topic description should be updated
*/
private openDBCPEdit;
/**
* Determines if the user is allowed to delete a verification.
*
* @param {any} verification the verification
* @return {boolean} True if able to delete verification, False otherwise
*/
private canDeleteVerification;
/**
* Determines if the user is allowed to delete a verification.
*
* @param {any} verification the verification
* @return {boolean} True if able to delete verification, False otherwise
*/
private canRejectVerification;
/**
* Determines if the user is allowed to accept a verification.
*
* @param {any} verification the verification
* @return {boolean} True if able to accept verification, False otherwise
*/
private canAcceptVerification;
/**
* Determines if the user is allowed to issue a verification. (only allow computed verifications)
*
* @param {any} verification the verification
* @return {boolean} True if able to issue verification, False otherwise
*/
private canIssueVerification;
/**
* Return the amount of interactions that the current user can trigger on a specific verification.
*
* @param {any} verification the verification that should be checked
* @return {number} amount of interactions (0 - 3)
*/
private verificationInteractionCount;
/**
* Returns the name or the account of a account from the addressbook.
*
* @param {string} accountId the account id thath should be checked
* @return {string} The addressbook name
*/
private getAddressbookName;
/**
* Return the verifications array or the parents object of an verification.
*
* @param {any} verification the verification that should be analyzed
* @return {Array<any>} verifications || parents
*/
private getVerificationsOrParents;
/**
* Checks if a form property is touched and invalid.
*
* @param {string} paramName name of the form property that should be checked
* @return {boolean} true if touched and invalid, else false
*/
showError(form: any, paramName: string): any;
/**
* Transform the file input result for the description img into an single value.
*
* @param {any} verification the topic detail for that the img was changed
* @return {<type>} { description_of_the_return_value }
*/
descriptionImgChanged(verification: any): Promise<void>;
/**
* Return the status color for a verification and its taker
*
* @param {any} verification the verification that should be analysed
* @return {string} the class status (status-0, status-1, status-2)
*/
trustTakerStatusClass(verification: any): "status-0" | "status-2" | "status-1";
/**
* Return the status color for a verification and its taker
*
* @param {any} verification the verification that should be analysed
* @return {string} the class status (status-0, status-1, status-2)
*/
trustProviderStatusClass(verification: any): "status-0" | "status-2" | "status-1";
/******************************************** d3.js *********************************************/
/**
* Render the detail svg using d3.js.
*
* @param {any} verification the verification for that the detail should be displayed
*/
private renderDetail;
}