Skip to content

Commit

Permalink
refactor: selectors all start with app- instead of dasch-swiss (#2060)
Browse files Browse the repository at this point in the history
  • Loading branch information
derschnee68 authored Jan 27, 2025
1 parent 847c75e commit 3dc5364
Show file tree
Hide file tree
Showing 65 changed files with 156 additions and 185 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import { ListItemService } from '../list-item/list-item.service';
<div style="flex: 1">
<div (mouseenter)="mouseEnter()" (mouseleave)="mouseLeave()" style="position: relative">
<dasch-swiss-multi-language-input
<app-multi-language-input
[placeholder]="node.labels | appStringifyStringLiteral: 'all' | appTruncate: 128"
[editable]="false"
[formArray]="readOnlyFormArray"
Expand All @@ -36,7 +36,7 @@ import { ListItemService } from '../list-item/list-item.service';
</div>
</div>
`,
styles: [':host ::ng-deep dasch-swiss-multi-language-input .mat-mdc-form-field-bottom-align { display: none;}'],
styles: [':host ::ng-deep app-multi-language-input .mat-mdc-form-field-bottom-align { display: none;}'],
})
export class ListItemElementComponent implements OnInit, OnChanges {
@Input() node: ListNode;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import { ListItemService } from '../list-item/list-item.service';
selector: 'app-list-item-form',
template: `
<form [formGroup]="form" style="display: flex" (ngSubmit)="createChildNode()">
<dasch-swiss-multi-language-input
<app-multi-language-input
style="flex: 1"
[formArray]="form.controls.labels"
[placeholder]="placeholder"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@ import { ListItemForm } from './list-item-form.type';
@Component({
selector: 'app-reusable-list-item-form',
template: `
<dasch-swiss-multi-language-input
<app-multi-language-input
placeholder="Child node label"
[formArray]="form.controls.labels"
[validators]="labelsValidators"
[isRequired]="true" />
<dasch-swiss-multi-language-textarea
<app-multi-language-textarea
placeholder="Child node description"
[formArray]="form.controls.comments"
[validators]="commentsValidators"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<div *ngIf="!disableContent">
<dasch-swiss-app-progress-indicator *ngIf="isListsLoading$ | async"></dasch-swiss-app-progress-indicator>
<app-progress-indicator *ngIf="isListsLoading$ | async"></app-progress-indicator>

<!-- display only when loading is finished and project member has value -->
<div *ngIf="(isListsLoading$ | async) === false">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import { ListInfoForm } from './list-info-form.type';
@Component({
selector: 'app-create-list-info-page',
template: `
<dasch-swiss-centered-layout>
<app-centered-layout>
<app-reusable-list-info-form
[formData]="{
labels: [],
Expand All @@ -32,7 +32,7 @@ import { ListInfoForm } from './list-info-form.type';
{{ 'form.action.submit' | translate }}
</button>
</div>
</dasch-swiss-centered-layout>
</app-centered-layout>
`,
})
export class CreateListInfoPageComponent {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,13 @@ import { ListInfoForm } from './list-info-form.type';
@Component({
selector: 'app-reusable-list-info-form',
template: `
<dasch-swiss-multi-language-input
<app-multi-language-input
[formArray]="form.controls.labels"
placeholder="Controlled vocabulary label"
[isRequired]="true"
data-cy="labels-input" />
<dasch-swiss-multi-language-textarea
<app-multi-language-textarea
[formArray]="form.controls.comments"
placeholder="Controlled vocabulary description"
[isRequired]="true"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,7 @@
</div>
<!-- container with search results -->
<div class="list-view-container">
<dasch-swiss-app-pager (pageIndexChanged)="doSearch($event)" [numberOfAllResults]="numberOfAllResults">
</dasch-swiss-app-pager>
<app-pager (pageIndexChanged)="doSearch($event)" [numberOfAllResults]="numberOfAllResults"> </app-pager>
<div *ngIf="numberOfAllResults > 0 && resources">
<app-resource-list
[withMultipleSelection]="true"
Expand All @@ -28,7 +27,7 @@
*ngIf="!loading && (!(resources?.resources) || resources?.resources?.length === 0)">
<!-- Case A: user did a fulltext search -->
<div *ngIf="search.mode === 'fulltext'">
<p>Your search - <strong> {{search.query}}</strong> - did not match any documents.</p>
<p>Your search - <strong> {{ search.query }}</strong> - did not match any documents.</p>
<p>Suggestions:</p>
<ul>
<li *ngIf="numberOfAllResults > 0">
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<div *ngIf="!disableContent">
<dasch-swiss-app-progress-indicator *ngIf="isLoading$ | async"></dasch-swiss-app-progress-indicator>
<app-progress-indicator *ngIf="isLoading$ | async"></app-progress-indicator>

<!-- main content: overview shows resource classes of ontology -->
<div *ngIf="(isLoading$ | async) === false && currentOntology$ | async" class="ontology-editor">
Expand Down Expand Up @@ -137,7 +137,7 @@
*ngFor="let prop of ontoProperties?.properties; trackBy: trackByPropertyDefinitionFn; let odd = odd"
[class.odd]="odd">
<!-- display only properties with guiOrder and if they exist in list of properties;
if objectType is a linkValue hide it (otherwise we have the property twice) -->
if objectType is a linkValue hide it (otherwise we have the property twice) -->
<app-property-info
[propDef]="(currentOntology$ | async)?.properties[prop.id]"
[projectUuid]="projectUuid"
Expand All @@ -153,9 +153,9 @@
</mat-sidenav-content>
</mat-sidenav-container>

<dasch-swiss-app-progress-indicator
<app-progress-indicator
*ngIf="(isOntologiesLoading$ | async) === true && (isProjectsLoading$ | async) === false && view !== 'graph'">
</dasch-swiss-app-progress-indicator>
</app-progress-indicator>
</div>
</div>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,14 @@ import { ResourceClassForm } from './resource-class-form.type';
[validatorErrors]="[{ errorKey: 'pattern', message: 'This pattern is not supported' }]"
prefixIcon="fingerprint" />
<dasch-swiss-multi-language-input
<app-multi-language-input
data-cy="label-input"
placeholder="Label"
[formArray]="form.controls.labels"
[validators]="labelsValidators"
[isRequired]="true" />
<dasch-swiss-multi-language-textarea
<app-multi-language-textarea
data-cy="comment-textarea"
placeholder="Comment"
[formArray]="form.controls.comments"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,7 @@ export interface CardinalityInfo {
"></app-dialog-header>
<mat-dialog-content>
<div class="cando-headline">
<dasch-swiss-app-progress-indicator
*ngIf="canSetCardinality === undefined"
[status]="0"></dasch-swiss-app-progress-indicator>
<app-progress-indicator *ngIf="canSetCardinality === undefined" [status]="0"></app-progress-indicator>
<div *ngIf="canSetCardinality === false" class="mat-headline-6">Changing the cardinality is not possible.</div>
</div>
<div *ngIf="canSetCardinality === false">
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<dasch-swiss-app-progress-indicator *ngIf="isProjectsLoading$ | async"></dasch-swiss-app-progress-indicator>
<app-progress-indicator *ngIf="isProjectsLoading$ | async"></app-progress-indicator>

<div *ngIf="(isProjectsLoading$ | async) === false">
<div *ngIf="isCurrentProjectAdminOrSysAdmin$ | async" class="content large middle">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import { ProjectForm } from './reusable-project-form/project-form.type';
@Component({
selector: 'app-create-project-form-page',
template: `
<dasch-swiss-centered-layout>
<app-centered-layout>
<app-reusable-project-form
[formData]="{
shortcode: '',
Expand Down Expand Up @@ -40,7 +40,7 @@ import { ProjectForm } from './reusable-project-form/project-form.type';
{{ 'form.action.submit' | translate }}
</button>
</div>
</dasch-swiss-centered-layout>
</app-centered-layout>
`,
})
export class CreateProjectFormPageComponent {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<dasch-swiss-app-progress-indicator *ngIf="isLoading$ | async"></dasch-swiss-app-progress-indicator>
<app-progress-indicator *ngIf="isLoading$ | async"></app-progress-indicator>
<div *ngIf="(readProject$ | async) as project" class="content large middle">
<div>
<p>Project Description</p>
Expand Down Expand Up @@ -34,7 +34,7 @@ <h3 class="mat-body subtitle">Project {{ project.shortcode }} | {{ project.short
<!-- description -->
<div class="description-rm">
<div>
<p class="project-longname">{{project.longname}}</p>
<p class="project-longname">{{ project.longname }}</p>
</div>
<section class="project description" *ngFor="let desc of sortedDescriptions$ | async">
<div [innerHtml]="desc.value"></div>
Expand All @@ -45,7 +45,7 @@ <h3 class="mat-body subtitle">Project {{ project.shortcode }} | {{ project.short
<!-- keywords -->
<section class="project keywords">
<mat-chip-listbox>
<mat-chip *ngFor="let k of project.keywords">{{k}}</mat-chip>
<mat-chip *ngFor="let k of project.keywords">{{ k }}</mat-chip>
</mat-chip-listbox>
</section>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import { ProjectForm } from './reusable-project-form/project-form.type';

@Component({
selector: 'app-edit-project-form-page',
template: ` <dasch-swiss-centered-layout>
template: ` <app-centered-layout>
<app-reusable-project-form
*ngIf="formData$ | async as formData"
[formData]="formData"
Expand All @@ -32,7 +32,7 @@ import { ProjectForm } from './reusable-project-form/project-form.type';
{{ 'form.action.submit' | translate }}
</button>
</div>
</dasch-swiss-centered-layout>`,
</app-centered-layout>`,
})
export class EditProjectFormPageComponent {
form: ProjectForm;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ import { shortcodeExistsValidator } from './shortcode-exists.validator';
[control]="form.controls.longname"
data-cy="longname-input" />
<dasch-swiss-multi-language-textarea
<app-multi-language-textarea
[placeholder]="'form.project.general.description' | translate"
[formArray]="form.controls.description"
[validators]="descriptionValidators"
Expand Down
14 changes: 3 additions & 11 deletions libs/vre/pages/search/advanced-search/.eslintrc.json
Original file line number Diff line number Diff line change
@@ -1,13 +1,5 @@
{
"extends": ["../../../../../.eslintrc-angular.json"],
"rules": {
"@angular-eslint/component-selector": [
"error",
{
"type": "element",
"prefix": "dasch-swiss",
"style": "kebab-case"
}
]
}
"extends": [
"../../../../../.eslintrc-angular.json"
]
}
Original file line number Diff line number Diff line change
Expand Up @@ -30,21 +30,21 @@
resourcesSearchNoResults: resourcesSearchNoResults$ | async,
orderByButtonDisabled: orderByButtonDisabled$ | async,
} as asyncData">
<dasch-swiss-order-by
<app-order-by
[orderByList]="asyncData.propertiesOrderByList"
[orderByDisabled]="asyncData.orderByButtonDisabled"
(emitPropertyOrderByChanged)="handlePropertyOrderByChanged($event)">
</dasch-swiss-order-by>
<dasch-swiss-ontology-resource-form
</app-order-by>
<app-ontology-resource-form
[ontologies]="asyncData.ontologies"
[ontologiesLoading]="asyncData.ontologiesLoading"
[resourceClasses]="asyncData.resourceClasses"
[resourceClassesLoading]="asyncData.resourceClassesLoading"
[selectedOntology]="asyncData.selectedOntology"
[selectedResourceClass]="asyncData.selectedResourceClass"
(emitSelectedOntology)="handleSelectedOntology($event)"
(emitSelectedResourceClass)="handleSelectedResourceClass($event)"></dasch-swiss-ontology-resource-form>
<dasch-swiss-property-form
(emitSelectedResourceClass)="handleSelectedResourceClass($event)"></app-ontology-resource-form>
<app-property-form
*ngFor="let propertyForm of asyncData.propertyFormList"
[matchResourceClassesLoading]="asyncData.matchResourceClassesLoading"
[resourcesSearchResultsLoading]="asyncData.resourcesSearchResultsLoading"
Expand All @@ -67,14 +67,14 @@
(emitRemoveChildPropertyForm)="handleRemoveChildPropertyForm($event)"
(emitChildSelectedPropertyChanged)="handleChildSelectedPropertyChanged($event)"
(emitChildSelectedOperatorChanged)="handleChildSelectedOperatorChanged($event)"
(emitChildValueChanged)="handleChildValueChanged($event)"></dasch-swiss-property-form>
<dasch-swiss-form-actions
(emitChildValueChanged)="handleChildValueChanged($event)"></app-property-form>
<app-form-actions
[addButtonDisabled]="asyncData.addButtonDisabled"
[resetButtonDisabled]="asyncData.resetButtonDisabled"
[searchButtonDisabled]="asyncData.searchButtonDisabled"
(emitAddPropertyForm)="handleAddPropertyForm()"
(emitResetButtonClicked)="handleResetButtonClicked()"
(emitSearchButtonClicked)="handleSearchButtonClicked()">
</dasch-swiss-form-actions>
</app-form-actions>
</div>
</div>
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ export interface QueryObject {
}

@Component({
selector: 'dasch-swiss-advanced-search',
selector: 'app-advanced-search',
standalone: true,
imports: [
CommonModule,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { MatButtonModule } from '@angular/material/button';
import { MatIconModule } from '@angular/material/icon';

@Component({
selector: 'dasch-swiss-form-actions',
selector: 'app-form-actions',
standalone: true,
imports: [CommonModule, MatButtonModule, MatIconModule],
templateUrl: './form-actions.component.html',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { MatSelect, MatSelectModule } from '@angular/material/select';
import { ApiData } from '../../data-access/advanced-search-service/advanced-search.service';

@Component({
selector: 'dasch-swiss-ontology-resource-form',
selector: 'app-ontology-resource-form',
standalone: true,
imports: [CommonModule, FormsModule, ReactiveFormsModule, MatSelectModule],
templateUrl: './ontology-resource-form.component.html',
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { CdkDragDrop, CdkDrag, CdkDragHandle, CdkDropList, moveItemInArray } from '@angular/cdk/drag-drop';
import { CdkDrag, CdkDragDrop, CdkDragHandle, CdkDropList, moveItemInArray } from '@angular/cdk/drag-drop';
import { OverlayModule } from '@angular/cdk/overlay';
import { CommonModule } from '@angular/common';
import { ChangeDetectionStrategy, Component, EventEmitter, Input, Output, ViewChild } from '@angular/core';
Expand All @@ -9,7 +9,7 @@ import { MatTooltipModule } from '@angular/material/tooltip';
import { OrderByItem } from '../../data-access/advanced-search-store/advanced-search-store.service';

@Component({
selector: 'dasch-swiss-order-by',
selector: 'app-order-by',
standalone: true,
imports: [
CommonModule,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
name="properties"
[compareWith]="compareObjects">
<mat-option [value]="resourceLabelObj">{{ resourceLabelObj.label }}</mat-option>
<mat-option *ngFor="let prop of properties" [value]="prop"> {{ prop.label }} </mat-option>
<mat-option *ngFor="let prop of properties" [value]="prop"> {{ prop.label }}</mat-option>
</mat-select>
</mat-form-field>
</div>
Expand All @@ -38,7 +38,7 @@
"
class="value-container">
<!-- choose correct component based on objectType -->
<dasch-swiss-property-form-value
<app-property-form-value
#propertyFormValue
*ngIf="
!item.selectedProperty?.isLinkedResourceProperty &&
Expand All @@ -47,15 +47,15 @@
[objectType]="item.selectedProperty?.objectType"
[value]="item.searchValue"
(emitValueChanged)="onValueChanged($event, i)" />
<dasch-swiss-property-form-list-value
<app-property-form-list-value
*ngIf="
item.selectedProperty?.objectType === constants.ListValue
"
[list]="item.list"
[value]="item.searchValue"
(emitValueChanged)="onValueChanged($event, i)">
</dasch-swiss-property-form-list-value>
<dasch-swiss-property-form-link-value
</app-property-form-list-value>
<app-property-form-link-value
*ngIf="item.selectedProperty?.isLinkedResourceProperty"
[value]="item.searchValue"
[label]="item.searchValueLabel"
Expand All @@ -67,7 +67,7 @@
onResourceSearchValueChanged($event, i)
"
(emitLoadMoreSearchResults)="onLoadMoreSearchResults($event, i)"
(emitResourceSelected)="onValueChanged($event, i)"></dasch-swiss-property-form-link-value>
(emitResourceSelected)="onValueChanged($event, i)"></app-property-form-link-value>
</div>
</div>
<div class="side-container">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ import { PropertyFormListValueComponent } from '../property-form-list-value/prop
import { PropertyFormValueComponent } from '../property-form-value/property-form-value.component';

@Component({
selector: 'dasch-swiss-property-form-link-match-property',
selector: 'app-property-form-link-match-property',
standalone: true,
imports: [
CommonModule,
Expand Down
Loading

0 comments on commit 3dc5364

Please sign in to comment.