Skip to content
Permalink
Browse files
refactor: clean up jsDocs and delete deprecated methods (DEV-741) (#722)
* refactor(message): use correct version

* refactor(form): resetForm is no longer needed as we have a cancel button

* refactor(message): use correct version

* refactor(search): filterbyproject is deprecated, use limitToProject instead

* refactor(results): delete deprecated outputs

* refactor(jsDocs): delete @ignore; it was a doc setup for the ui-lib
  • Loading branch information
kilchenmann committed May 4, 2022
1 parent 0c2a43d commit 84571196dfe22af624b315aae9c47cbcaf335aeb
Show file tree
Hide file tree
Showing 19 changed files with 27 additions and 175 deletions.
@@ -5,8 +5,7 @@ import { ApiResponseError } from '@dasch-swiss/dsp-js';
import { StatusMsg } from 'src/assets/http/statusMsg';

/**
* @ignore
* Data type for messages
* data type for messages
*/
export class AppMessageData {
status: number;
@@ -19,9 +18,6 @@ export class AppMessageData {
url?: string;
}

/**
* @deprecated Will be replaced by notification service with material snackbar
*/
@Component({
selector: 'app-message',
templateUrl: './message.component.html',
@@ -50,20 +46,6 @@ export class MessageComponent implements OnInit {
*/
@Input() size: 'short' | 'medium' | 'long' = 'long';

/**
* @deprecated
* @param short Show short message only
* A small message box to notify the user an event has occured.
*/
@Input() short = (this.size === 'short');

/**
* @deprecated
* @param medium Show medium message
* A message box without footnote or links.
*/
@Input() medium = (this.size === 'medium');

/**
* @param duration How long should the message be displayed
*/
@@ -79,7 +61,7 @@ export class MessageComponent implements OnInit {
disable = false;

/**
* @ignore
* default link list, which will be used in message content to give a user some possibilities
* what he can do in the case of an error
*
@@ -113,12 +95,6 @@ export class MessageComponent implements OnInit {
) { }

ngOnInit() {
// temporary solution as long we have to support the deprecated inputs "short" and "medium"
if (this.short || this.medium) {
this.size = (this.short ? 'short' : 'medium');
}


if (this.apiError) {
this.message.status = this.apiError.status;
}
@@ -68,8 +68,6 @@ export class SortButtonComponent implements OnInit {
}

/**
* @ignore
*
* @param key a string to sort by
*/
sortBy(key: string) {
@@ -133,8 +133,6 @@ export class StringLiteralInputComponent implements OnInit, OnChanges {
}

/**
* @ignore
*
* emit data to parent on any change on the input field
*/
onValueChanged() {
@@ -157,10 +155,8 @@ export class StringLiteralInputComponent implements OnInit, OnChanges {
}

/**
* @ignore
*
* Set the language after selecting;
* This updates the array of StringLiterals: adds item with the selected language if it doesn't exist
* set the language after selecting;
* this updates the array of StringLiterals: adds item with the selected language if it doesn't exist
*/
setLanguage(lang: string) {

@@ -176,9 +172,7 @@ export class StringLiteralInputComponent implements OnInit, OnChanges {
}

/**
* @ignore
*
* Switch focus to input field after selecting a language
* switch focus to input field after selecting a language
*/
switchFocus() {
// close the menu
@@ -193,9 +187,7 @@ export class StringLiteralInputComponent implements OnInit, OnChanges {
}

/**
* @ignore
*
* Switch focus to input field after closing the menu by clicking anywhere outside of it
* switch focus to input field after closing the menu by clicking anywhere outside of it
*/
menuClosed() {
if (!this.disabled) {
@@ -205,9 +197,7 @@ export class StringLiteralInputComponent implements OnInit, OnChanges {
}

/**
* @ignore
*
* Set the value in the input field
* set the value in the input field
*/
updateFormField(value: string) {
if (!value) {
@@ -220,9 +210,7 @@ export class StringLiteralInputComponent implements OnInit, OnChanges {
}

/**
* @ignore
*
* Update the array of StringLiterals depending on value / empty value add or remove item from array.
* update the array of StringLiterals depending on value / empty value add or remove item from array.
*/
updateStringLiterals(lang: string, value?: string) {
const index = this.value.findIndex(i => i.language === lang);
@@ -249,9 +237,7 @@ export class StringLiteralInputComponent implements OnInit, OnChanges {
}

/**
* @ignore
*
* In case of strange array of StringLiterals, this method will reset to a API-conform array. This means an array without empty values.
* in case of strange array of StringLiterals, this method will reset to a API-conform array. This means an array without empty values.
*/
resetValues() {
const length: number = this.value.length;
@@ -277,9 +263,7 @@ export class StringLiteralInputComponent implements OnInit, OnChanges {
}

/**
* @ignore
*
* Get the value from array of StringLiterals for the selected language
* get the value from array of StringLiterals for the selected language
*/
getValueFromStringLiteral(lang: string): string {
// get index for this language
@@ -1,7 +1,4 @@
/* eslint-disable max-len */
/**
* @ignore
*/
export class AdminImageConfig {

/**
@@ -27,27 +27,20 @@ export class AdminImageDirective implements OnChanges {


/**
* @ignore
* image source
*/
source: string;


/**
* @ignore
* in case of an error
*/
onError: string = AdminImageConfig.defaultNotFound;


/**
* @ignore
*/
constructor(private _renderer: Renderer2,
private _ele: ElementRef
) { }

/**
* @ignore
*/
ngOnChanges() {

this.source = this.image;
@@ -7,18 +7,11 @@ import { Validators, AbstractControl, ValidatorFn } from '@angular/forms';
})
export class ExistingNameDirective implements Validators, OnChanges {

/**
* @ignore
*/
@Input() existingName: string;

/**
* @ignore
*/
private _valFn = Validators.nullValidator;

/**
* @ignore
* @param changes
*/
ngOnChanges(changes: SimpleChanges): void {
@@ -33,7 +26,6 @@ export class ExistingNameDirective implements Validators, OnChanges {
}

/**
* @ignore
* @param control
*/
validate(control: AbstractControl): { [key: string]: any } {
@@ -91,8 +83,6 @@ export function existingNamesValidator(valArrayRegexp: [RegExp]): ValidatorFn {
}

/**
* @ignore
*
* @param {RegExp} pattern
* @param {string} regType
* @returns ValidatorFn
@@ -38,7 +38,6 @@ class TestHostHeaderComponent {
})
class TestSearchPanelComponent {
@Input() projectfilter?: boolean = false;
@Input() filterbyproject?: string;
@Input() limitToProject?: string;
@Input() advanced?: boolean = false;
@Input() expert?: boolean = false;
@@ -528,21 +528,4 @@ export class ProjectFormComponent implements OnInit {
);
}

/**
* @deprecated Maybe we can reactivate later.
*
* Reset the form
*/
resetForm(ev: Event, project?: ReadProject) {
ev.preventDefault();

project = (project ? project : new ReadProject());
this.description = project.description;

this.buildForm(project);

// --> TODO fix "set value" for keywords field
// this.form.controls['keywords'].setValue(this.keywords);
}

}
@@ -1 +1 @@
<app-message [message]="message" [medium]="true"></app-message>
<app-message [message]="message" [size]="'medium'"></app-message>
@@ -5,7 +5,7 @@
<div *ngIf="!loading">

<!-- message after updating: success message or error message if something went wrong -->
<app-message *ngIf="showResponse" [message]="showResponse" [short]="true"
<app-message *ngIf="showResponse" [message]="showResponse" [size]="'short'"
(click)="closeMessage(showResponse.status)">
</app-message>

@@ -3,7 +3,7 @@
<app-progress-indicator *ngIf="loading"></app-progress-indicator>

<!-- success message after updating -->
<app-message *ngIf="success" [message]="successMessage" [short]="true"></app-message>
<app-message *ngIf="success" [message]="successMessage" [size]="'short'"></app-message>

<!-- content -->
<form *ngIf="!loading" [formGroup]="form" class="form-content user-data" (ngSubmit)="submitData()">
@@ -457,15 +457,4 @@ export class UserFormComponent implements OnInit, OnChanges {
}
}

/**
* reset the form
*/
resetForm(ev: Event, user?: ReadUser) {
ev.preventDefault();

user = user ? user : new ReadUser();

this.buildForm(user);
}

}
@@ -57,8 +57,8 @@ class TestProgressIndicatorComponent {
*/
@Component({
template: `
<app-list-view #listViewFulltext [search]="fulltext" (resourceSelected)="openResource($event)"></app-list-view>
<app-list-view #listViewGravsearch [search]="gravsearch" (resourceSelected)="openResource($event)"></app-list-view>`
<app-list-view #listViewFulltext [search]="fulltext" (selectedResources)="openResource($event)"></app-list-view>
<app-list-view #listViewGravsearch [search]="gravsearch" (selectedResources)="openResource($event)"></app-list-view>`
})
class TestParentComponent implements OnInit {

@@ -76,30 +76,6 @@ export class ListViewComponent implements OnChanges {
*/
@Output() selectedResources: EventEmitter<FilteredResources> = new EventEmitter<FilteredResources>();

/**
* @deprecated Use selectedResources instead
*
* Click on checkbox will emit the resource info
*
* @param {EventEmitter<FilteredResources>} resourcesSelected
*/
@Output() multipleResourcesSelected?: EventEmitter<FilteredResources> = new EventEmitter<FilteredResources>();

/**
* @deprecated Use selectedResources instead
*
* Click on an item will emit the resource iri
*
* @param {EventEmitter<string>} singleResourceSelected
*/
@Output() singleResourceSelected?: EventEmitter<string> = new EventEmitter<string>();

/**
* @deprecated Use selectedResources instead.
* Click on an item will emit the resource iri
*/
@Output() resourceSelected: EventEmitter<string> = new EventEmitter<string>();

resources: ReadResourceSequence;

selectedResourceIdx: number[] = [];
@@ -87,8 +87,7 @@ export class AdvancedSearchComponent implements OnInit, OnDestroy, AfterViewChec
}

/**
* @ignore
* Gets all available ontologies for the search form.
* gets all available ontologies for the search form.
* @returns void
*/
initializeOntologies(): void {
@@ -167,8 +166,7 @@ export class AdvancedSearchComponent implements OnInit, OnDestroy, AfterViewChec
}

/**
* @ignore
* Validates form and returns its status (boolean).
* validates form and returns its status (boolean).
*/
private _validateForm(): boolean {

@@ -126,26 +126,23 @@ export class ResourceAndPropertySelectionComponent implements OnInit, OnChanges
}

/**
* @ignore
* Add a property to the search form.
* add a property to the search form.
* @returns void
*/
addProperty(): void {
this.activeProperties.push(true);
}

/**
* @ignore
* Remove the last property from the search form.
* remove the last property from the search form.
* @returns void
*/
removeProperty(): void {
this.activeProperties.splice(-1, 1);
}

/**
* @ignore
* Resets the form (selected resource class and specified properties) preserving the active ontology.
* resets the form (selected resource class and specified properties) preserving the active ontology.
*/
resetForm() {
if (this.activeOntology !== undefined) {

0 comments on commit 8457119

Please sign in to comment.