LocationBasedServices/smartguide/pipeline/pr-dev There was a failure building this commit
441 lines
16 KiB
HTML
441 lines
16 KiB
HTML
<div class="content">
|
|
<!-- Tabs and Extract Button -->
|
|
<mat-tab-group
|
|
[selectedIndex]="selectedTabIndex()"
|
|
(selectedIndexChange)="onTabChange($event)">
|
|
<mat-tab label="URL">
|
|
<div class="tab-content">
|
|
<mat-form-field appearance="outline" class="full-width">
|
|
<mat-label>Füge eine URL ein, um Keywords zu extrahieren</mat-label>
|
|
<input
|
|
matInput
|
|
placeholder="https://example.com/article"
|
|
[formControl]="form.controls.urlInput"
|
|
(keydown.enter)="
|
|
onExtractKeywordsClick(); $event.preventDefault()
|
|
" />
|
|
</mat-form-field>
|
|
<button
|
|
mat-flat-button
|
|
type="button"
|
|
class="extract-btn"
|
|
[disabled]="!form.controls.urlInput.value"
|
|
[color]="isExtracting() ? 'warn' : 'primary'"
|
|
(click)="onExtractKeywordsClick()">
|
|
<mat-icon>
|
|
{{ isExtracting() ? 'close' : 'troubleshoot' }}
|
|
</mat-icon>
|
|
{{ isExtracting() ? 'Abbrechen' : 'Keywords extrahieren' }}
|
|
</button>
|
|
</div>
|
|
</mat-tab>
|
|
|
|
<mat-tab label="Text">
|
|
<div class="tab-content">
|
|
<mat-form-field appearance="outline" class="full-width">
|
|
<mat-label>Schreibe einen Text, um Keywords zu extrahieren</mat-label>
|
|
<textarea
|
|
matInput
|
|
rows="10"
|
|
placeholder="Large language models are transforming innovation scouting..."
|
|
[formControl]="form.controls.textInput"></textarea>
|
|
</mat-form-field>
|
|
<div class="actions">
|
|
<button
|
|
mat-flat-button
|
|
type="button"
|
|
[disabled]="!form.controls.textInput.value"
|
|
[color]="isExtracting() ? 'warn' : 'primary'"
|
|
class="extract-btn"
|
|
(click)="onExtractKeywordsClick()">
|
|
<mat-icon>
|
|
{{ isExtracting() ? 'close' : 'troubleshoot' }}
|
|
</mat-icon>
|
|
{{ isExtracting() ? 'Abbrechen' : 'Keywords extrahieren' }}
|
|
</button>
|
|
</div>
|
|
</div>
|
|
</mat-tab>
|
|
<mat-tab label="Datei">
|
|
<div class="tab-content">
|
|
<app-file-upload
|
|
[requiredFileType]="'text/plain,application/pdf'"
|
|
[maxFileSize]="5 * 1024 * 1024"
|
|
[maxFiles]="3"
|
|
[uploadedFiles]="uploadedFiles()"
|
|
(filesChange)="onFilesSelected($event)">
|
|
</app-file-upload>
|
|
<div class="actions">
|
|
<button
|
|
mat-flat-button
|
|
type="button"
|
|
[color]="isExtracting() ? 'warn' : 'primary'"
|
|
[disabled]="uploadedFiles().length === 0"
|
|
class="extract-btn"
|
|
(click)="onExtractKeywordsClick()">
|
|
<mat-icon>
|
|
{{ isExtracting() ? 'close' : 'troubleshoot' }}
|
|
</mat-icon>
|
|
{{ isExtracting() ? 'Abbrechen' : 'Keywords extrahieren' }}
|
|
</button>
|
|
<!-- Add this inside your form or section -->
|
|
</div>
|
|
</div>
|
|
</mat-tab>
|
|
</mat-tab-group>
|
|
<!-- Extraction Table -->
|
|
<mat-card
|
|
class="keyword-card progress-container"
|
|
[class.loading]="isExtracting()">
|
|
<mat-card-content>
|
|
<!-- View toggle: Topic Mapping vs. LLM Keywords -->
|
|
<div class="keywords-toolbar">
|
|
@if (topicLegendGroups.length > 0) {
|
|
<app-topic-legend
|
|
[groups]="topicLegendGroups"
|
|
[visible]="subfieldLegendVisible()"
|
|
[expanded]="subfieldLegendExpanded()"
|
|
[collapsedGroupLimit]="3"
|
|
variant="default"
|
|
(visibleChange)="onSubfieldLegendVisibleChange($event)"
|
|
(expandedChange)="onSubfieldLegendExpandedChange($event)">
|
|
</app-topic-legend>
|
|
}
|
|
|
|
<!-- Manual input is ALWAYS available, independent of extraction state -->
|
|
<div class="toolbar-wrapper">
|
|
<div class="toolbar-controls thick-border">
|
|
<div class="toolbar-group toolbar-group--view">
|
|
@if (areAllSelected()) {
|
|
<button
|
|
mat-stroked-button
|
|
color="primary"
|
|
(click)="deselectAll()"
|
|
[disabled]="isExtracting()"
|
|
matTooltip="Alle extrahierten Keywords abwählen">
|
|
<mat-icon>select_all</mat-icon>
|
|
<span>Alle abwählen</span>
|
|
</button>
|
|
} @else {
|
|
<button
|
|
mat-stroked-button
|
|
color="primary"
|
|
[disabled]="isExtracting()"
|
|
(click)="selectAll()"
|
|
matTooltip="Alle extrahierten Keywords auswählen">
|
|
<mat-icon>select_all</mat-icon>
|
|
<span>Alle auswählen</span>
|
|
</button>
|
|
}
|
|
<button
|
|
mat-stroked-button
|
|
color="warn"
|
|
[disabled]="isExtracting()"
|
|
(click)="clearKeywords()"
|
|
matTooltip="Alle extrahierten Keywords löschen">
|
|
<mat-icon>delete_outline</mat-icon>
|
|
<span>Alle löschen</span>
|
|
</button>
|
|
</div>
|
|
<div class="toolbar-divider"></div>
|
|
<div class="toolbar-group toolbar-group--view">
|
|
<mat-button-toggle-group
|
|
[value]="keywordView()"
|
|
(change)="onViewToggleChange($event.value)"
|
|
aria-label="Keyword Ansicht wählen">
|
|
<mat-button-toggle
|
|
[disabled]="isExtracting()"
|
|
value="llm"
|
|
matTooltip="Extrahierte Keywords">
|
|
<mat-icon>text_fields</mat-icon>
|
|
<span>Extrahierte Keywords</span>
|
|
</mat-button-toggle>
|
|
<mat-button-toggle
|
|
[disabled]="isExtracting()"
|
|
value="topic"
|
|
matTooltip="Die Abbildung der extrahierten Keywords auf die bekannten Themenbereiche">
|
|
<mat-icon>account_tree</mat-icon>
|
|
<span>Ähnliche Themen</span>
|
|
</mat-button-toggle>
|
|
</mat-button-toggle-group>
|
|
</div>
|
|
<div class="toolbar-divider"></div>
|
|
</div>
|
|
|
|
<div class="spacer toolbar-controls manual-input-controls">
|
|
<app-topic-autocomplete
|
|
label="z. B. Knowledge Graphs"
|
|
placeholder="Thema suchen oder eintippen..."
|
|
(topicSelected)="addKeywordFromInput($event)" />
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- ===== Reusable chip stack templates ===== -->
|
|
<ng-template
|
|
#keywordChipStack
|
|
let-keywords="keywords"
|
|
let-emptyText="emptyText">
|
|
@if (keywords.length > 0) {
|
|
<div class="keyword-chip-stack">
|
|
@for (keyword of keywords; track keyword.llm_keyword.keyword) {
|
|
<app-topic-chip
|
|
[label]="getChipLabel(keyword)"
|
|
[count]="
|
|
keywordView() === 'topic' ? getChipCount(keyword) : null
|
|
"
|
|
[description]="getChipDescription(keyword)"
|
|
[subfieldName]="getChipSubfieldName(keyword)"
|
|
[fieldName]="getChipFieldName(keyword)"
|
|
[domainName]="getChipDomainName(keyword)"
|
|
[color]="getTopicColor(keyword.topic_mapping?.topic)"
|
|
[active]="isKeywordSelected(keyword)"
|
|
countIcon="article"
|
|
descriptionTooltipTarget="button"
|
|
(chipClick)="toggleKeywordSelection(keyword)">
|
|
</app-topic-chip>
|
|
}
|
|
</div>
|
|
} @else {
|
|
<p class="empty-state small">{{ emptyText }}</p>
|
|
}
|
|
</ng-template>
|
|
|
|
<ng-template #manualChipStack>
|
|
<div class="keyword-chip-stack manual-stack">
|
|
@if (manualKeywords().length > 0) {
|
|
@for (
|
|
keyword of manualKeywords();
|
|
track keyword.llm_keyword.keyword
|
|
) {
|
|
<div class="manual-chip-row">
|
|
<app-topic-chip
|
|
[label]="getChipLabel(keyword)"
|
|
[count]="
|
|
keywordView() === 'topic' ? getChipCount(keyword) : null
|
|
"
|
|
[description]="getChipDescription(keyword)"
|
|
[subfieldName]="getChipSubfieldName(keyword)"
|
|
[fieldName]="getChipFieldName(keyword)"
|
|
[domainName]="getChipDomainName(keyword)"
|
|
[color]="getTopicColor(keyword.topic_mapping?.topic)"
|
|
[active]="isKeywordSelected(keyword)"
|
|
countIcon="article"
|
|
descriptionTooltipTarget="button"
|
|
(chipClick)="toggleKeywordSelection(keyword)">
|
|
</app-topic-chip>
|
|
<button
|
|
mat-icon-button
|
|
type="button"
|
|
color="warn"
|
|
aria-label="Manuelles Keyword entfernen"
|
|
(click)="removeManualKeyword(keyword)">
|
|
<mat-icon>cancel</mat-icon>
|
|
</button>
|
|
</div>
|
|
}
|
|
} @else {
|
|
<p class="empty-state small">Nichts hinzugefügt</p>
|
|
}
|
|
@if (loadingNewKeyword()) {
|
|
<div class="manual-chip-row">
|
|
<app-topic-chip [label]="'Neues Keyword wird hinzugefügt...'">
|
|
</app-topic-chip>
|
|
<button mat-icon-button></button>
|
|
</div>
|
|
}
|
|
</div>
|
|
</ng-template>
|
|
|
|
<!-- ===== Desktop / tablet table view ===== -->
|
|
@if (!isMobile()) {
|
|
<div class="keyword-table">
|
|
<div class="table-head">
|
|
<div class="head-cell sub-cell broad-sub">Breite Keywords</div>
|
|
<div class="head-cell sub-cell coarse-sub">Coarse Keywords</div>
|
|
<div class="head-cell sub-cell fine-sub thick-border">
|
|
Fine Keywords
|
|
</div>
|
|
<div class="head-cell sub-cell manual-sub">Eigene Keywords</div>
|
|
</div>
|
|
|
|
<div class="table-body">
|
|
<div class="table-col broad-col">
|
|
@if (isExtracting() && broadKeywords().length === 0) {
|
|
<app-loading icon="manage_search" [size]="60" [diameter]="60" />
|
|
} @else {
|
|
<ng-container
|
|
*ngTemplateOutlet="
|
|
keywordChipStack;
|
|
context: {
|
|
keywords: broadKeywords(),
|
|
emptyText: 'Nichts extrahiert',
|
|
}
|
|
"></ng-container>
|
|
}
|
|
</div>
|
|
|
|
<div class="table-col coarse-col">
|
|
@if (isExtracting() && coarseKeywords().length === 0) {
|
|
<app-loading icon="manage_search" [size]="60" [diameter]="60" />
|
|
} @else {
|
|
<ng-container
|
|
*ngTemplateOutlet="
|
|
keywordChipStack;
|
|
context: {
|
|
keywords: coarseKeywords(),
|
|
emptyText: 'Nichts extrahiert',
|
|
}
|
|
"></ng-container>
|
|
}
|
|
</div>
|
|
|
|
<div class="table-col fine-col thick-border">
|
|
@if (isExtracting() && fineKeywords().length === 0) {
|
|
<app-loading icon="manage_search" [size]="60" [diameter]="60" />
|
|
} @else {
|
|
<ng-container
|
|
*ngTemplateOutlet="
|
|
keywordChipStack;
|
|
context: {
|
|
keywords: fineKeywords(),
|
|
emptyText: 'Nichts extrahiert',
|
|
}
|
|
"></ng-container>
|
|
}
|
|
</div>
|
|
|
|
<div class="table-col own-col">
|
|
<ng-container *ngTemplateOutlet="manualChipStack"></ng-container>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
} @else {
|
|
<!-- ===== Mobile: tabbed view instead of squashed columns ===== -->
|
|
<mat-tab-group class="mobile-keyword-tabs" animationDuration="150ms">
|
|
<mat-tab>
|
|
<ng-template mat-tab-label>
|
|
<span>Breit</span>
|
|
<span class="tab-count">{{ broadKeywords().length }}</span>
|
|
</ng-template>
|
|
<div class="mobile-tab-panel">
|
|
@if (isExtracting() && broadKeywords().length === 0) {
|
|
<app-loading icon="manage_search" [size]="60" [diameter]="60" />
|
|
} @else {
|
|
<ng-container
|
|
*ngTemplateOutlet="
|
|
keywordChipStack;
|
|
context: {
|
|
keywords: broadKeywords(),
|
|
emptyText: 'Nichts extrahiert',
|
|
}
|
|
"></ng-container>
|
|
}
|
|
</div>
|
|
</mat-tab>
|
|
|
|
<mat-tab>
|
|
<ng-template mat-tab-label>
|
|
<span>Coarse</span>
|
|
<span class="tab-count">{{ coarseKeywords().length }}</span>
|
|
</ng-template>
|
|
<div class="mobile-tab-panel">
|
|
@if (isExtracting() && coarseKeywords().length === 0) {
|
|
<app-loading icon="manage_search" [size]="60" [diameter]="60" />
|
|
} @else {
|
|
<ng-container
|
|
*ngTemplateOutlet="
|
|
keywordChipStack;
|
|
context: {
|
|
keywords: coarseKeywords(),
|
|
emptyText: 'Nichts extrahiert',
|
|
}
|
|
"></ng-container>
|
|
}
|
|
</div>
|
|
</mat-tab>
|
|
|
|
<mat-tab>
|
|
<ng-template mat-tab-label>
|
|
<span>Fine</span>
|
|
<span class="tab-count">{{ fineKeywords().length }}</span>
|
|
</ng-template>
|
|
<div class="mobile-tab-panel">
|
|
@if (isExtracting() && fineKeywords().length === 0) {
|
|
<app-loading icon="manage_search" [size]="60" [diameter]="60" />
|
|
} @else {
|
|
<ng-container
|
|
*ngTemplateOutlet="
|
|
keywordChipStack;
|
|
context: {
|
|
keywords: fineKeywords(),
|
|
emptyText: 'Nichts extrahiert',
|
|
}
|
|
"></ng-container>
|
|
}
|
|
</div>
|
|
</mat-tab>
|
|
|
|
<mat-tab>
|
|
<ng-template mat-tab-label>
|
|
<span>Eigene</span>
|
|
<span class="tab-count">{{ manualKeywords().length }}</span>
|
|
</ng-template>
|
|
<div class="mobile-tab-panel">
|
|
<ng-container *ngTemplateOutlet="manualChipStack"></ng-container>
|
|
</div>
|
|
</mat-tab>
|
|
</mat-tab-group>
|
|
}
|
|
</mat-card-content>
|
|
<!-- @if (isExtracting() && !keywordsExist()) {
|
|
<app-loading
|
|
text="{{ statusMessage() }}"
|
|
icon="manage_search"
|
|
[size]="200"
|
|
[diameter]="200" />
|
|
} -->
|
|
<!-- Source content display -->
|
|
@if (sourceContent().length > 0) {
|
|
<mat-divider></mat-divider>
|
|
<mat-expansion-panel class="source-expansion">
|
|
<mat-expansion-panel-header>
|
|
<mat-panel-title>Quellentext: {{ sourceUrl() }}</mat-panel-title>
|
|
</mat-expansion-panel-header>
|
|
<div class="source-text" [innerHTML]="highlightedSourceContent()"></div>
|
|
</mat-expansion-panel>
|
|
}
|
|
</mat-card>
|
|
|
|
@if (isExtracting()) {
|
|
<div class="status-message">{{ statusMessage() }}</div>
|
|
}
|
|
</div>
|
|
|
|
@if (keywordsExist()) {
|
|
<!-- Search buttons -->
|
|
<div class="search-container">
|
|
<div class="search-actions">
|
|
<button
|
|
mat-flat-button
|
|
color="primary"
|
|
class="search-btn"
|
|
[disabled]="isSearchDisabled()"
|
|
(click)="search()">
|
|
<mat-icon>search</mat-icon>
|
|
Suchen
|
|
</button>
|
|
|
|
<button
|
|
mat-flat-button
|
|
color="accent"
|
|
class="visualize-btn"
|
|
[disabled]="isSearchDisabled()"
|
|
(click)="visualize()">
|
|
<mat-icon>show_chart</mat-icon>
|
|
Visualisierung
|
|
</button>
|
|
</div>
|
|
</div>
|
|
}
|