This is the codeAbility Sharing Platform! Learn more about the codeAbility Sharing Platform.

Skip to content
Snippets Groups Projects
Commit b04608cc authored by Daniel Rainer's avatar Daniel Rainer
Browse files

Delete old, unused metadata component

parent 931a2adb
Branches
Tags
2 merge requests!17Initial Merge to Prepare Release 1.0.0,!3Component refactoring
// unused
/*
// The code in this file and the files using this file is partially taken from
// https://stackoverflow.com/questions/46487255/pass-observable-data-from-parent-component-to-a-child-component-created-with-com
import { Injectable } from '@angular/core';
import { Subject, Observable } from 'rxjs';
import { IMetadataSelection, MetadataSelection } from 'app/search/metadata/metadata-selection.component';
@Injectable()
export class MetadataMessageService {
filterSelection$: Observable<IMetadataSelection>;
private filterSelectionSubject: Subject<IMetadataSelection> = new Subject<IMetadataSelection>();
constructor() {
this.filterSelection$ = this.filterSelectionSubject.asObservable();
}
public updateFilterSelection(metadataCategory: string, value: string): void {
this.filterSelectionSubject.next(new MetadataSelection(metadataCategory, value));
}
}
*/
// unused
/*
export interface IMetadataSelection {
category: string;
value: string;
}
export class MetadataSelection implements IMetadataSelection {
constructor(public category: string, public value: string) {}
}
*/
<div class="solid" [hidden]="frequencies == null">
<span class="meta" jhiTranslate="search.metadata.{{parameter}}">file format</span>
<span class="clear" float="right" jhiTranslate="search.metadata.clearLocalFilters"
(click)="clearFilters()">clear all</span>
<li class="unselected" *ngFor="let frequency of frequencies"
(click)="toggleSelection(frequency.key)"
[ngClass]="isSelected(frequency.key) ? 'selected' : 'unselected'">
<div>
<a class="meta">{{frequency.key}}
<span class="count">{{frequency.value}}</span>
</a>
</div>
</li>
</div>
// unused
/*
import { Component, Input } from '@angular/core';
import { IFrequency } from 'app/shared/model/frequency.model';
import { MetadataMessageService } from 'app/search/metadata/metadata-message.service';
@Component({
selector: 'jhi-home-metadata',
templateUrl: './metadata.component.html',
styleUrls: ['./metadata.scss'],
})
export class MetadataComponent {
@Input() frequencies!: IFrequency<string>[] | undefined;
@Input() parameter!: string;
testString = '';
selectedItems = new Set<string>();
constructor(public messageService: MetadataMessageService) {}
toggleSelection(name: string): void {
this.messageService.updateFilterSelection(this.parameter, name);
if (this.selectedItems.has(name)) {
this.selectedItems.delete(name);
} else {
this.selectedItems.add(name);
}
}
isSelected(name: string): boolean {
return this.selectedItems.has(name);
}
clearFilters(): void {
for (const selectedItem of this.selectedItems) {
this.messageService.updateFilterSelection(this.parameter, selectedItem);
}
this.selectedItems = new Set<string>();
}
}
*/
// unused
/*
li.meta:hover {
background-color: #cacaca;
}
li.meta {
list-style-type: none;
padding-left: 20px;
padding-right: 20px;
}
a.meta {
font-weight: normal;
}
span.meta {
font-weight: bold;
margin-bottom: 50px;
}
span.count {
float: right;
}
div.solid {
border-style: solid;
border-width: 1pt;
padding: 10px;
border-color: rgb(223, 226, 230);
margin-bottom: 20px;
}
span.clear {
float: right;
padding-left: 10px;
padding-right: 10px;
cursor: pointer;
font-size: 0.9em;
}
span.clear:hover {
background-color: rgba(0, 0, 0, 0.1);
}
li.selected {
list-style-type: none;
padding-left: 20px;
padding-right: 20px;
background-color: rgb(200, 200, 200);
}
li.unselected {
list-style-type: none;
padding-left: 20px;
padding-right: 20px;
}
*/
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment