|
|
@ -1,9 +1,4 @@ |
|
|
|
<form |
|
|
|
class="d-flex flex-column h-100" |
|
|
|
[formGroup]="assetProfileForm" |
|
|
|
(keyup.enter)="assetProfileForm.valid && onSubmit()" |
|
|
|
(ngSubmit)="onSubmit()" |
|
|
|
> |
|
|
|
<div class="d-flex flex-column h-100"> |
|
|
|
<div class="d-flex mb-3"> |
|
|
|
<h1 class="flex-grow-1 m-0" mat-dialog-title> |
|
|
|
{{ assetProfile?.name ?? data.symbol }} |
|
|
@ -91,21 +86,55 @@ |
|
|
|
/> |
|
|
|
|
|
|
|
<div class="row"> |
|
|
|
<div class="col-6 mb-3"> |
|
|
|
<gf-value i18n size="medium" [value]="assetProfile?.symbol" |
|
|
|
>Symbol</gf-value |
|
|
|
> |
|
|
|
</div> |
|
|
|
<div class="col-6 mb-3"> |
|
|
|
<gf-value |
|
|
|
i18n |
|
|
|
size="medium" |
|
|
|
[value]=" |
|
|
|
assetProfile?.dataProviderInfo?.name ?? assetProfile?.dataSource |
|
|
|
" |
|
|
|
>Data Source</gf-value |
|
|
|
> |
|
|
|
</div> |
|
|
|
@if (isEditSymbolMode) { |
|
|
|
<div class="col-12 mb-3"> |
|
|
|
<mat-form-field appearance="outline"> |
|
|
|
<mat-label i18n>Name, symbol or ISIN</mat-label> |
|
|
|
<gf-symbol-autocomplete |
|
|
|
formControlName="searchSymbol" |
|
|
|
[includeIndices]="true" |
|
|
|
/> |
|
|
|
</mat-form-field> |
|
|
|
<button class="mx-1 no-min-width px-2" mat-button type="button"> |
|
|
|
Apply |
|
|
|
</button> |
|
|
|
<button |
|
|
|
class="mx-1 no-min-width px-2" |
|
|
|
mat-button |
|
|
|
type="button" |
|
|
|
(click)="onCancelEditSymboleMode()" |
|
|
|
> |
|
|
|
Cancel |
|
|
|
</button> |
|
|
|
</div> |
|
|
|
} @else { |
|
|
|
<div class="col-6 mb-3"> |
|
|
|
<gf-value i18n size="medium" [value]="assetProfile?.symbol" |
|
|
|
>Symbol</gf-value |
|
|
|
> |
|
|
|
</div> |
|
|
|
<div class="col-4 mb-3"> |
|
|
|
<gf-value |
|
|
|
i18n |
|
|
|
size="medium" |
|
|
|
[value]=" |
|
|
|
assetProfile?.dataProviderInfo?.name ?? assetProfile?.dataSource |
|
|
|
" |
|
|
|
>Data Source</gf-value |
|
|
|
> |
|
|
|
</div> |
|
|
|
<div class="col-1 mb-3"> |
|
|
|
<button |
|
|
|
class="mx-1 no-min-width px-2" |
|
|
|
mat-button |
|
|
|
type="button" |
|
|
|
[disabled]="assetProfileForm.dirty" |
|
|
|
(click)="onSetEditSymboleMode()" |
|
|
|
> |
|
|
|
<ion-icon name="create-outline"></ion-icon> |
|
|
|
</button> |
|
|
|
</div> |
|
|
|
} |
|
|
|
<div class="col-6 mb-3"> |
|
|
|
<gf-value i18n size="medium" [value]="assetProfile?.currency" |
|
|
|
>Currency</gf-value |
|
|
@ -202,230 +231,255 @@ |
|
|
|
} |
|
|
|
} |
|
|
|
</div> |
|
|
|
<div class="mt-3"> |
|
|
|
<mat-form-field appearance="outline" class="w-100 without-hint"> |
|
|
|
<mat-label i18n>Name</mat-label> |
|
|
|
<input formControlName="name" matInput type="text" /> |
|
|
|
</mat-form-field> |
|
|
|
</div> |
|
|
|
@if (assetProfile?.dataSource === 'MANUAL') { |
|
|
|
<form |
|
|
|
[formGroup]="assetProfileForm" |
|
|
|
(keyup.enter)="assetProfileForm.valid && onSubmitAssetProfileForm()" |
|
|
|
(ngSubmit)="onSubmitAssetProfileForm()" |
|
|
|
> |
|
|
|
<div class="mt-3"> |
|
|
|
<mat-form-field appearance="outline" class="w-100 without-hint"> |
|
|
|
<mat-label i18n>Currency</mat-label> |
|
|
|
<gf-currency-selector |
|
|
|
formControlName="currency" |
|
|
|
[currencies]="currencies" |
|
|
|
/> |
|
|
|
<mat-label i18n>Name</mat-label> |
|
|
|
<input formControlName="name" matInput type="text" /> |
|
|
|
</mat-form-field> |
|
|
|
</div> |
|
|
|
} |
|
|
|
<div class="mt-3"> |
|
|
|
<mat-form-field appearance="outline" class="w-100 without-hint"> |
|
|
|
<mat-label i18n>Asset Class</mat-label> |
|
|
|
<mat-select formControlName="assetClass"> |
|
|
|
<mat-option [value]="null" /> |
|
|
|
@for (assetClass of assetClasses; track assetClass) { |
|
|
|
<mat-option [value]="assetClass.id">{{ |
|
|
|
assetClass.label |
|
|
|
}}</mat-option> |
|
|
|
} |
|
|
|
</mat-select> |
|
|
|
</mat-form-field> |
|
|
|
</div> |
|
|
|
<div class="mt-3"> |
|
|
|
<mat-form-field appearance="outline" class="w-100 without-hint"> |
|
|
|
<mat-label i18n>Asset Sub Class</mat-label> |
|
|
|
<mat-select formControlName="assetSubClass"> |
|
|
|
<mat-option [value]="null" /> |
|
|
|
@for (assetSubClass of assetSubClasses; track assetSubClass) { |
|
|
|
<mat-option [value]="assetSubClass.id">{{ |
|
|
|
assetSubClass.label |
|
|
|
}}</mat-option> |
|
|
|
} |
|
|
|
</mat-select> |
|
|
|
</mat-form-field> |
|
|
|
</div> |
|
|
|
<div class="d-flex my-3"> |
|
|
|
<div class="w-50"> |
|
|
|
<mat-checkbox |
|
|
|
color="primary" |
|
|
|
i18n |
|
|
|
[checked]="isBenchmark" |
|
|
|
(change)=" |
|
|
|
isBenchmark |
|
|
|
? onUnsetBenchmark({ |
|
|
|
dataSource: data.dataSource, |
|
|
|
symbol: data.symbol |
|
|
|
}) |
|
|
|
: onSetBenchmark({ |
|
|
|
dataSource: data.dataSource, |
|
|
|
symbol: data.symbol |
|
|
|
}) |
|
|
|
" |
|
|
|
>Benchmark</mat-checkbox |
|
|
|
> |
|
|
|
@if (assetProfile?.dataSource === 'MANUAL') { |
|
|
|
<div class="mt-3"> |
|
|
|
<mat-form-field appearance="outline" class="w-100 without-hint"> |
|
|
|
<mat-label i18n>Currency</mat-label> |
|
|
|
<gf-currency-selector |
|
|
|
formControlName="currency" |
|
|
|
[currencies]="currencies" |
|
|
|
/> |
|
|
|
</mat-form-field> |
|
|
|
</div> |
|
|
|
} |
|
|
|
<div class="mt-3"> |
|
|
|
<mat-form-field appearance="outline" class="w-100 without-hint"> |
|
|
|
<mat-label i18n>Asset Class</mat-label> |
|
|
|
<mat-select formControlName="assetClass"> |
|
|
|
<mat-option [value]="null" /> |
|
|
|
@for (assetClass of assetClasses; track assetClass) { |
|
|
|
<mat-option [value]="assetClass.id">{{ |
|
|
|
assetClass.label |
|
|
|
}}</mat-option> |
|
|
|
} |
|
|
|
</mat-select> |
|
|
|
</mat-form-field> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
<div class="mt-3"> |
|
|
|
<mat-form-field appearance="outline" class="w-100"> |
|
|
|
<mat-label i18n>Symbol Mapping</mat-label> |
|
|
|
<textarea |
|
|
|
cdkTextareaAutosize |
|
|
|
formControlName="symbolMapping" |
|
|
|
matInput |
|
|
|
type="text" |
|
|
|
></textarea> |
|
|
|
</mat-form-field> |
|
|
|
</div> |
|
|
|
@if (assetProfile?.dataSource === 'MANUAL') { |
|
|
|
<div class="mb-3"> |
|
|
|
<mat-accordion class="my-3"> |
|
|
|
<mat-expansion-panel |
|
|
|
class="shadow-none" |
|
|
|
[expanded]=" |
|
|
|
assetProfileForm.controls.scraperConfiguration.controls.selector |
|
|
|
.value !== '' && |
|
|
|
assetProfileForm.controls.scraperConfiguration.controls.url |
|
|
|
.value !== '' |
|
|
|
<div class="mt-3"> |
|
|
|
<mat-form-field appearance="outline" class="w-100 without-hint"> |
|
|
|
<mat-label i18n>Asset Sub Class</mat-label> |
|
|
|
<mat-select formControlName="assetSubClass"> |
|
|
|
<mat-option [value]="null" /> |
|
|
|
@for (assetSubClass of assetSubClasses; track assetSubClass) { |
|
|
|
<mat-option [value]="assetSubClass.id">{{ |
|
|
|
assetSubClass.label |
|
|
|
}}</mat-option> |
|
|
|
} |
|
|
|
</mat-select> |
|
|
|
</mat-form-field> |
|
|
|
</div> |
|
|
|
<div class="d-flex my-3"> |
|
|
|
<div class="w-50"> |
|
|
|
<mat-checkbox |
|
|
|
color="primary" |
|
|
|
i18n |
|
|
|
[checked]="isBenchmark" |
|
|
|
[disabled]="isEditSymbolMode" |
|
|
|
(change)=" |
|
|
|
isBenchmark |
|
|
|
? onUnsetBenchmark({ |
|
|
|
dataSource: data.dataSource, |
|
|
|
symbol: data.symbol |
|
|
|
}) |
|
|
|
: onSetBenchmark({ |
|
|
|
dataSource: data.dataSource, |
|
|
|
symbol: data.symbol |
|
|
|
}) |
|
|
|
" |
|
|
|
(closed)="scraperConfiguationIsExpanded.set(false)" |
|
|
|
(opened)="scraperConfiguationIsExpanded.set(true)" |
|
|
|
>Benchmark</mat-checkbox |
|
|
|
> |
|
|
|
<mat-expansion-panel-header class="p-0"> |
|
|
|
<mat-panel-title i18n>Scraper Configuration</mat-panel-title> |
|
|
|
</mat-expansion-panel-header> |
|
|
|
<div formGroupName="scraperConfiguration"> |
|
|
|
<div class="mt-3"> |
|
|
|
<mat-form-field appearance="outline" class="w-100 without-hint"> |
|
|
|
<mat-label i18n>Default Market Price</mat-label> |
|
|
|
<input |
|
|
|
formControlName="defaultMarketPrice" |
|
|
|
matInput |
|
|
|
type="number" |
|
|
|
/> |
|
|
|
</mat-form-field> |
|
|
|
</div> |
|
|
|
<div class="mt-3"> |
|
|
|
<mat-form-field appearance="outline" class="w-100 without-hint"> |
|
|
|
<mat-label i18n>HTTP Request Headers</mat-label> |
|
|
|
<textarea |
|
|
|
cdkTextareaAutosize |
|
|
|
formControlName="headers" |
|
|
|
matInput |
|
|
|
type="text" |
|
|
|
[matAutocomplete]="auto" |
|
|
|
></textarea> |
|
|
|
</mat-form-field> |
|
|
|
</div> |
|
|
|
<div class="mt-3"> |
|
|
|
<mat-form-field appearance="outline" class="w-100 without-hint"> |
|
|
|
<mat-label i18n>Locale</mat-label> |
|
|
|
<input formControlName="locale" matInput type="text" /> |
|
|
|
</mat-form-field> |
|
|
|
</div> |
|
|
|
<div class="mt-3"> |
|
|
|
<mat-form-field appearance="outline" class="w-100 without-hint"> |
|
|
|
<mat-label i18n>Mode</mat-label> |
|
|
|
<mat-select formControlName="mode"> |
|
|
|
@for (modeValue of modeValues; track modeValue) { |
|
|
|
<mat-option [value]="modeValue.value">{{ |
|
|
|
modeValue.viewValue |
|
|
|
}}</mat-option> |
|
|
|
} |
|
|
|
</mat-select> |
|
|
|
</mat-form-field> |
|
|
|
</div> |
|
|
|
<div class="mt-3"> |
|
|
|
<mat-form-field appearance="outline" class="w-100 without-hint"> |
|
|
|
<mat-label> |
|
|
|
<ng-container i18n>Selector</ng-container>* |
|
|
|
</mat-label> |
|
|
|
<textarea |
|
|
|
cdkTextareaAutosize |
|
|
|
formControlName="selector" |
|
|
|
matInput |
|
|
|
type="text" |
|
|
|
></textarea> |
|
|
|
</mat-form-field> |
|
|
|
</div> |
|
|
|
<div class="mt-3"> |
|
|
|
<mat-form-field appearance="outline" class="w-100 without-hint"> |
|
|
|
<mat-label> |
|
|
|
<ng-container i18n>Url</ng-container>* |
|
|
|
</mat-label> |
|
|
|
<input formControlName="url" matInput type="text" /> |
|
|
|
</mat-form-field> |
|
|
|
</div> |
|
|
|
<div class="my-3 text-right"> |
|
|
|
<button |
|
|
|
color="accent" |
|
|
|
mat-flat-button |
|
|
|
type="button" |
|
|
|
[disabled]=" |
|
|
|
assetProfileForm.controls.scraperConfiguration.controls |
|
|
|
.selector.value === '' || |
|
|
|
assetProfileForm.controls.scraperConfiguration.controls.url |
|
|
|
.value === '' |
|
|
|
" |
|
|
|
(click)="onTestMarketData()" |
|
|
|
> |
|
|
|
<ng-container i18n>Test</ng-container> |
|
|
|
</button> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</mat-expansion-panel> |
|
|
|
</mat-accordion> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
} |
|
|
|
@if (assetProfile?.dataSource === 'MANUAL') { |
|
|
|
<div> |
|
|
|
<div class="mt-3"> |
|
|
|
<mat-form-field appearance="outline" class="w-100"> |
|
|
|
<mat-label i18n>Sectors</mat-label> |
|
|
|
<mat-label i18n>Symbol Mapping</mat-label> |
|
|
|
<textarea |
|
|
|
cdkTextareaAutosize |
|
|
|
formControlName="sectors" |
|
|
|
formControlName="symbolMapping" |
|
|
|
matInput |
|
|
|
type="text" |
|
|
|
></textarea> |
|
|
|
</mat-form-field> |
|
|
|
</div> |
|
|
|
@if (assetProfile?.dataSource === 'MANUAL') { |
|
|
|
<div class="mb-3"> |
|
|
|
<mat-accordion class="my-3"> |
|
|
|
<mat-expansion-panel |
|
|
|
class="shadow-none" |
|
|
|
[expanded]=" |
|
|
|
assetProfileForm.controls.scraperConfiguration.controls.selector |
|
|
|
.value !== '' && |
|
|
|
assetProfileForm.controls.scraperConfiguration.controls.url |
|
|
|
.value !== '' |
|
|
|
" |
|
|
|
(closed)="scraperConfiguationIsExpanded.set(false)" |
|
|
|
(opened)="scraperConfiguationIsExpanded.set(true)" |
|
|
|
> |
|
|
|
<mat-expansion-panel-header class="p-0"> |
|
|
|
<mat-panel-title i18n>Scraper Configuration</mat-panel-title> |
|
|
|
</mat-expansion-panel-header> |
|
|
|
<div formGroupName="scraperConfiguration"> |
|
|
|
<div class="mt-3"> |
|
|
|
<mat-form-field |
|
|
|
appearance="outline" |
|
|
|
class="w-100 without-hint" |
|
|
|
> |
|
|
|
<mat-label i18n>Default Market Price</mat-label> |
|
|
|
<input |
|
|
|
formControlName="defaultMarketPrice" |
|
|
|
matInput |
|
|
|
type="number" |
|
|
|
/> |
|
|
|
</mat-form-field> |
|
|
|
</div> |
|
|
|
<div class="mt-3"> |
|
|
|
<mat-form-field |
|
|
|
appearance="outline" |
|
|
|
class="w-100 without-hint" |
|
|
|
> |
|
|
|
<mat-label i18n>HTTP Request Headers</mat-label> |
|
|
|
<textarea |
|
|
|
cdkTextareaAutosize |
|
|
|
formControlName="headers" |
|
|
|
matInput |
|
|
|
type="text" |
|
|
|
[matAutocomplete]="auto" |
|
|
|
></textarea> |
|
|
|
</mat-form-field> |
|
|
|
</div> |
|
|
|
<div class="mt-3"> |
|
|
|
<mat-form-field |
|
|
|
appearance="outline" |
|
|
|
class="w-100 without-hint" |
|
|
|
> |
|
|
|
<mat-label i18n>Locale</mat-label> |
|
|
|
<input formControlName="locale" matInput type="text" /> |
|
|
|
</mat-form-field> |
|
|
|
</div> |
|
|
|
<div class="mt-3"> |
|
|
|
<mat-form-field |
|
|
|
appearance="outline" |
|
|
|
class="w-100 without-hint" |
|
|
|
> |
|
|
|
<mat-label i18n>Mode</mat-label> |
|
|
|
<mat-select formControlName="mode"> |
|
|
|
@for (modeValue of modeValues; track modeValue) { |
|
|
|
<mat-option [value]="modeValue.value">{{ |
|
|
|
modeValue.viewValue |
|
|
|
}}</mat-option> |
|
|
|
} |
|
|
|
</mat-select> |
|
|
|
</mat-form-field> |
|
|
|
</div> |
|
|
|
<div class="mt-3"> |
|
|
|
<mat-form-field |
|
|
|
appearance="outline" |
|
|
|
class="w-100 without-hint" |
|
|
|
> |
|
|
|
<mat-label> |
|
|
|
<ng-container i18n>Selector</ng-container>* |
|
|
|
</mat-label> |
|
|
|
<textarea |
|
|
|
cdkTextareaAutosize |
|
|
|
formControlName="selector" |
|
|
|
matInput |
|
|
|
type="text" |
|
|
|
></textarea> |
|
|
|
</mat-form-field> |
|
|
|
</div> |
|
|
|
<div class="mt-3"> |
|
|
|
<mat-form-field |
|
|
|
appearance="outline" |
|
|
|
class="w-100 without-hint" |
|
|
|
> |
|
|
|
<mat-label> |
|
|
|
<ng-container i18n>Url</ng-container>* |
|
|
|
</mat-label> |
|
|
|
<input formControlName="url" matInput type="text" /> |
|
|
|
</mat-form-field> |
|
|
|
</div> |
|
|
|
<div class="my-3 text-right"> |
|
|
|
<button |
|
|
|
color="accent" |
|
|
|
mat-flat-button |
|
|
|
type="button" |
|
|
|
[disabled]=" |
|
|
|
assetProfileForm.controls.scraperConfiguration.controls |
|
|
|
.selector.value === '' || |
|
|
|
assetProfileForm.controls.scraperConfiguration.controls |
|
|
|
.url.value === '' |
|
|
|
" |
|
|
|
(click)="onTestMarketData()" |
|
|
|
> |
|
|
|
<ng-container i18n>Test</ng-container> |
|
|
|
</button> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</mat-expansion-panel> |
|
|
|
</mat-accordion> |
|
|
|
</div> |
|
|
|
} |
|
|
|
@if (assetProfile?.dataSource === 'MANUAL') { |
|
|
|
<div> |
|
|
|
<mat-form-field appearance="outline" class="w-100"> |
|
|
|
<mat-label i18n>Sectors</mat-label> |
|
|
|
<textarea |
|
|
|
cdkTextareaAutosize |
|
|
|
formControlName="sectors" |
|
|
|
matInput |
|
|
|
type="text" |
|
|
|
></textarea> |
|
|
|
</mat-form-field> |
|
|
|
</div> |
|
|
|
<div> |
|
|
|
<mat-form-field appearance="outline" class="w-100"> |
|
|
|
<mat-label i18n>Countries</mat-label> |
|
|
|
<textarea |
|
|
|
cdkTextareaAutosize |
|
|
|
formControlName="countries" |
|
|
|
matInput |
|
|
|
type="text" |
|
|
|
></textarea> |
|
|
|
</mat-form-field> |
|
|
|
</div> |
|
|
|
} |
|
|
|
<div> |
|
|
|
<mat-form-field appearance="outline" class="w-100 without-hint"> |
|
|
|
<mat-label i18n>Url</mat-label> |
|
|
|
<input formControlName="url" matInput type="text" /> |
|
|
|
@if (assetProfileForm.get('url').value) { |
|
|
|
<gf-asset-profile-icon |
|
|
|
class="mr-3" |
|
|
|
matSuffix |
|
|
|
[url]="assetProfileForm.get('url').value" |
|
|
|
/> |
|
|
|
} |
|
|
|
</mat-form-field> |
|
|
|
</div> |
|
|
|
<div class="mt-3"> |
|
|
|
<mat-form-field appearance="outline" class="w-100"> |
|
|
|
<mat-label i18n>Countries</mat-label> |
|
|
|
<mat-label i18n>Note</mat-label> |
|
|
|
<textarea |
|
|
|
cdkAutosizeMinRows="2" |
|
|
|
cdkTextareaAutosize |
|
|
|
formControlName="countries" |
|
|
|
formControlName="comment" |
|
|
|
matInput |
|
|
|
type="text" |
|
|
|
(keyup.enter)="$event.stopPropagation()" |
|
|
|
></textarea> |
|
|
|
</mat-form-field> |
|
|
|
</div> |
|
|
|
} |
|
|
|
<div> |
|
|
|
<mat-form-field appearance="outline" class="w-100 without-hint"> |
|
|
|
<mat-label i18n>Url</mat-label> |
|
|
|
<input formControlName="url" matInput type="text" /> |
|
|
|
@if (assetProfileForm.get('url').value) { |
|
|
|
<gf-asset-profile-icon |
|
|
|
class="mr-3" |
|
|
|
matSuffix |
|
|
|
[url]="assetProfileForm.get('url').value" |
|
|
|
/> |
|
|
|
} |
|
|
|
</mat-form-field> |
|
|
|
</div> |
|
|
|
<div class="mt-3"> |
|
|
|
<mat-form-field appearance="outline" class="w-100"> |
|
|
|
<mat-label i18n>Note</mat-label> |
|
|
|
<textarea |
|
|
|
cdkAutosizeMinRows="2" |
|
|
|
cdkTextareaAutosize |
|
|
|
formControlName="comment" |
|
|
|
matInput |
|
|
|
(keyup.enter)="$event.stopPropagation()" |
|
|
|
></textarea> |
|
|
|
</mat-form-field> |
|
|
|
</div> |
|
|
|
</form> |
|
|
|
</div> |
|
|
|
|
|
|
|
<div class="d-flex justify-content-end" mat-dialog-actions> |
|
|
@ -439,4 +493,4 @@ |
|
|
|
<ng-container i18n>Save</ng-container> |
|
|
|
</button> |
|
|
|
</div> |
|
|
|
</form> |
|
|
|
</div> |
|
|
|