[ACS-5645]removed unwanted code

This commit is contained in:
Yasa-Nataliya
2023-08-29 19:35:31 +05:30
committed by Anukriti Singh
parent 4f0c15603b
commit 309ff171ed
14 changed files with 16 additions and 113 deletions

View File

@@ -38,10 +38,6 @@ describe('permissions', () => {
COMMENTS_TAB: 'COMMENTS', COMMENTS_TAB: 'COMMENTS',
PROPERTY_TAB: 'PROPERTIES', PROPERTY_TAB: 'PROPERTIES',
DEFAULT_ASPECT: 'Properties', DEFAULT_ASPECT: 'Properties',
MORE_INFO_BUTTON: 'More information',
LESS_INFO_BUTTON: 'Less information',
ARROW_DOWN: 'keyboard_arrow_down',
ARROW_UP: 'keyboard_arrow_up',
EDIT_BUTTON_TOOLTIP: 'Edit' EDIT_BUTTON_TOOLTIP: 'Edit'
}; };

View File

@@ -37,10 +37,6 @@ describe('CardView Component - properties', () => {
COMMENTS_TAB: 'COMMENTS', COMMENTS_TAB: 'COMMENTS',
PROPERTY_TAB: 'PROPERTIES', PROPERTY_TAB: 'PROPERTIES',
DEFAULT_ASPECT: 'Properties', DEFAULT_ASPECT: 'Properties',
MORE_INFO_BUTTON: 'More information',
LESS_INFO_BUTTON: 'Less information',
ARROW_DOWN: 'keyboard_arrow_down',
ARROW_UP: 'keyboard_arrow_up',
EDIT_BUTTON_TOOLTIP: 'Edit' EDIT_BUTTON_TOOLTIP: 'Edit'
}; };

View File

@@ -40,10 +40,6 @@ describe('Metadata component', () => {
COMMENTS_TAB: 'COMMENTS', COMMENTS_TAB: 'COMMENTS',
PROPERTY_TAB: 'PROPERTIES', PROPERTY_TAB: 'PROPERTIES',
DEFAULT_ASPECT: 'General info', DEFAULT_ASPECT: 'General info',
MORE_INFO_BUTTON: 'More information',
LESS_INFO_BUTTON: 'Less information',
ARROW_DOWN: 'keyboard_arrow_down',
ARROW_UP: 'keyboard_arrow_up',
EDIT_BUTTON_TOOLTIP: 'Edit' EDIT_BUTTON_TOOLTIP: 'Edit'
}; };

View File

@@ -35,9 +35,6 @@ export class MetadataViewPage {
titleProperty = $(`span[data-automation-id='card-textitem-value-properties.cm:title'] span`); titleProperty = $(`span[data-automation-id='card-textitem-value-properties.cm:title'] span`);
editIcon = $(`button[data-automation-id='meta-data-card-toggle-edit']`); editIcon = $(`button[data-automation-id='meta-data-card-toggle-edit']`);
editIconGeneral = $(`button[data-automation-id='meta-data-general-info-edit']`); editIconGeneral = $(`button[data-automation-id='meta-data-general-info-edit']`);
informationButton = $(`button[data-automation-id='meta-data-card-toggle-expand']`);
informationSpan = $(`span[data-automation-id='meta-data-card-toggle-expand-label']`);
informationIcon = $(`span[data-automation-id='meta-data-card-toggle-expand-label'] ~ mat-icon`);
displayEmptySwitch = $(`#adf-metadata-empty`); displayEmptySwitch = $(`#adf-metadata-empty`);
readonlySwitch = $(`#adf-metadata-readonly`); readonlySwitch = $(`#adf-metadata-readonly`);
multiSwitch = $(`#adf-metadata-multi`); multiSwitch = $(`#adf-metadata-multi`);
@@ -121,26 +118,6 @@ export class MetadataViewPage {
await BrowserActions.click(this.editIconGeneral); await BrowserActions.click(this.editIconGeneral);
} }
async informationButtonIsDisplayed(): Promise<void> {
await BrowserVisibility.waitUntilElementIsClickable(this.informationButton);
}
async informationButtonIsNotDisplayed(): Promise<void> {
await BrowserVisibility.waitUntilElementIsNotVisible(this.informationButton);
}
async clickOnInformationButton(): Promise<void> {
await BrowserActions.click(this.informationButton);
}
async getInformationButtonText(): Promise<string> {
return BrowserActions.getText(this.informationSpan);
}
async getInformationIconText(): Promise<string> {
return BrowserActions.getText(this.informationIcon);
}
async clickOnPropertiesTab(): Promise<void> { async clickOnPropertiesTab(): Promise<void> {
const propertiesTab = element(by.cssContainingText(`.adf-info-drawer-layout-content div.mat-tab-labels div .mat-tab-label-content`, `Properties`)); const propertiesTab = element(by.cssContainingText(`.adf-info-drawer-layout-content div.mat-tab-labels div .mat-tab-label-content`, `Properties`));
await BrowserActions.click(propertiesTab); await BrowserActions.click(propertiesTab);
@@ -325,8 +302,4 @@ export class MetadataViewPage {
async clickSaveGeneralMetadata(): Promise<void> { async clickSaveGeneralMetadata(): Promise<void> {
await BrowserActions.click(this.saveGeneralMetadataButton); await BrowserActions.click(this.saveGeneralMetadataButton);
} }
async generalSaveIconDisplayed(): Promise<void> {
await BrowserVisibility.waitUntilElementIsNotVisible(this.saveGeneralMetadataButton);
}
} }

View File

@@ -7,7 +7,6 @@
autocomplete="off" autocomplete="off"
[formControl]="categoryNameControl" [formControl]="categoryNameControl"
(keyup.enter)="addCategory()" (keyup.enter)="addCategory()"
aria-labelledby="adf-category-name-input-label"
placeholder="{{'CATEGORIES_MANAGEMENT.INPUT_PLACEHOLDER' | translate }}" placeholder="{{'CATEGORIES_MANAGEMENT.INPUT_PLACEHOLDER' | translate }}"
adf-auto-focus adf-auto-focus
/> />

View File

@@ -205,16 +205,6 @@ export class CategoriesManagementComponent implements OnInit, OnDestroy {
return this.managementMode === CategoriesManagementMode.CRUD; return this.managementMode === CategoriesManagementMode.CRUD;
} }
/**
* Hides and emits categoryNameControl and hides existing categories panel.
*/
hideNameInput() {
this.categoryNameControlVisible = false;
this.categoryNameControlVisibleChange.emit(false);
this._existingCategoriesPanelVisible = false;
this.clearCategoryNameInput();
}
/** /**
* Adds category that has been typed to a categoryNameControl and hides it afterwards. * Adds category that has been typed to a categoryNameControl and hides it afterwards.
*/ */

View File

@@ -115,15 +115,6 @@ export class ContentMetadataCardComponent implements OnChanges {
this.expanded = !this._displayDefaultProperties; this.expanded = !this._displayDefaultProperties;
} }
toggleEdit(): void {
this.editable = !this.editable;
this.editableChange.emit(this.editable);
}
toggleExpanded(): void {
this.expanded = !this.expanded;
}
hasAllowableOperations() { hasAllowableOperations() {
return this.contentService.hasAllowableOperations(this.node, AllowableOperationsEnum.UPDATE); return this.contentService.hasAllowableOperations(this.node, AllowableOperationsEnum.UPDATE);
} }

View File

@@ -5,8 +5,8 @@
[expanded]="canExpandProperties()" [expanded]="canExpandProperties()"
[attr.data-automation-id]="'adf-metadata-group-properties'" [attr.data-automation-id]="'adf-metadata-group-properties'"
hideToggle hideToggle
(opened)="generalTogglePanelState()" (opened)="handleGeneralInfoPanelState()"
(closed)="generalTogglePanelState()"> (closed)="handleGeneralInfoPanelState()">
<mat-expansion-panel-header> <mat-expansion-panel-header>
<div class="adf-metadata-properties-panel-content"> <div class="adf-metadata-properties-panel-content">
<mat-icon> <mat-icon>

View File

@@ -1,11 +1,5 @@
.adf { .adf {
&-metadata-properties { &-metadata-properties {
.mat-expansion-panel {
border: 1px solid var(--adf-metadata-property-panel-border-color);
border-radius: 12px !important;
margin-bottom: 12px;
mat-expansion-panel-header { mat-expansion-panel-header {
height: 56px; height: 56px;
@@ -15,7 +9,6 @@
padding-left: 12px; padding-left: 12px;
} }
} }
}
.mat-expansion-panel:not([class*='mat-elevation-z']) { .mat-expansion-panel:not([class*='mat-elevation-z']) {
box-shadow: none; box-shadow: none;
@@ -57,7 +50,7 @@
padding: 24px; padding: 24px;
} }
.adf-metadata-no-catagories-added { .adf-metadata-no-categories-added {
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: center; justify-content: center;
@@ -66,7 +59,6 @@
} }
&-tags { &-tags {
&-title { &-title {
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
@@ -76,7 +68,6 @@
} }
adf-tags-creator { adf-tags-creator {
.adf-tags-creation { .adf-tags-creation {
padding-right: 0; padding-right: 0;
} }
@@ -128,14 +119,20 @@
width: 755px; width: 755px;
border: 1px solid var(--adf-metadata-property-panel-border-color); border: 1px solid var(--adf-metadata-property-panel-border-color);
margin: 24px; margin: 24px;
border-radius: 12px !important; border-radius: 12px;
} }
} }
} }
} }
.adf-content-metadata-card { .adf-content-metadata-card {
.mat-card:not([class*=mat-elevation-z]) { .mat-card:not([class*='mat-elevation-z']) {
box-shadow: none; box-shadow: none;
} }
} }
.app-metadata-tab .adf-metadata-properties .mat-expansion-panel {
border: 1px solid var(--adf-metadata-property-panel-border-color);
border-radius: 12px;
margin-bottom: 12px;
}

View File

@@ -117,7 +117,7 @@ export class ContentMetadataComponent implements OnChanges, OnInit, OnDestroy {
@Input() @Input()
displayCategories = false; displayCategories = false;
/** (optional) This flag sets the metadata in read only mode /** (optional) This flag sets the metadata in read only mode
* preventing changes. * preventing changes.
*/ */
@Input() @Input()
@@ -160,7 +160,7 @@ export class ContentMetadataComponent implements OnChanges, OnInit, OnDestroy {
private tagService: TagService, private tagService: TagService,
private categoryService: CategoryService, private categoryService: CategoryService,
private cdr: ChangeDetectorRef, private cdr: ChangeDetectorRef,
private contentService: ContentService, private contentService: ContentService
) { ) {
this.copyToClipboardAction = this.appConfig.get<boolean>('content-metadata.copy-to-clipboard-action'); this.copyToClipboardAction = this.appConfig.get<boolean>('content-metadata.copy-to-clipboard-action');
this.multiValueSeparator = this.appConfig.get<string>('content-metadata.multi-value-pipe-separator') || DEFAULT_SEPARATOR; this.multiValueSeparator = this.appConfig.get<string>('content-metadata.multi-value-pipe-separator') || DEFAULT_SEPARATOR;
@@ -270,7 +270,6 @@ export class ContentMetadataComponent implements OnChanges, OnInit, OnDestroy {
saveEditChanges(buttonType: string, event: Event, group?: any) { saveEditChanges(buttonType: string, event: Event, group?: any) {
this.saveChanges(event); this.saveChanges(event);
switch (buttonType) { switch (buttonType) {
case 'generalInfo': case 'generalInfo':
this.editable = !this.editable; this.editable = !this.editable;
@@ -286,7 +285,6 @@ export class ContentMetadataComponent implements OnChanges, OnInit, OnDestroy {
group.editable = !group.editable; group.editable = !group.editable;
} }
break; break;
default: default:
break; break;
} }
@@ -329,7 +327,6 @@ export class ContentMetadataComponent implements OnChanges, OnInit, OnDestroy {
cancelEditChanges(buttonType: string, event: Event, group?: any) { cancelEditChanges(buttonType: string, event: Event, group?: any) {
this.cancelChanges(event); this.cancelChanges(event);
switch (buttonType) { switch (buttonType) {
case 'generalInfo': case 'generalInfo':
this.editable = !this.editable; this.editable = !this.editable;
@@ -345,7 +342,6 @@ export class ContentMetadataComponent implements OnChanges, OnInit, OnDestroy {
group.editable = !group.editable; group.editable = !group.editable;
} }
break; break;
default: default:
break; break;
} }
@@ -367,13 +363,13 @@ export class ContentMetadataComponent implements OnChanges, OnInit, OnDestroy {
this.tagsPanelState = true; this.tagsPanelState = true;
} else { } else {
this.tagsPanelState = false; this.tagsPanelState = false;
} }
} }
toggleCategoriesEdit(event: Event): void { toggleCategoriesEdit(event: Event): void {
event.stopPropagation(); event.stopPropagation();
this.editableCategories = !this.editableCategories; this.editableCategories = !this.editableCategories;
this.categoryControlVisible = true this.categoryControlVisible = true;
if (this.editableCategories) { if (this.editableCategories) {
this.categoriesPanelState = true; this.categoriesPanelState = true;
} else { } else {
@@ -389,7 +385,7 @@ export class ContentMetadataComponent implements OnChanges, OnInit, OnDestroy {
} }
} }
generalTogglePanelState() { handleGeneralInfoPanelState() {
this.generalInfoPanelState = !this.generalInfoPanelState; this.generalInfoPanelState = !this.generalInfoPanelState;
this.cdr.detectChanges(); this.cdr.detectChanges();
} }
@@ -403,12 +399,6 @@ export class ContentMetadataComponent implements OnChanges, OnInit, OnDestroy {
this.categoriesPanelState= categoriesPanelState; this.categoriesPanelState= categoriesPanelState;
this.cdr.detectChanges(); this.cdr.detectChanges();
} }
showGroup(group: CardViewGroup): boolean {
const properties = group.properties.filter((property) => !this.isEmpty(property.displayValue));
return properties.length > 0;
}
canExpandTheCard(group: CardViewGroup): boolean { canExpandTheCard(group: CardViewGroup): boolean {
return group.title === this.displayAspect; return group.title === this.displayAspect;
@@ -499,10 +489,6 @@ export class ContentMetadataComponent implements OnChanges, OnInit, OnDestroy {
})); }));
} }
private isEmpty(value: any): boolean {
return value === undefined || value === null || value === '';
}
private loadCategoriesForNode(nodeId: string) { private loadCategoriesForNode(nodeId: string) {
this.assignedCategories = []; this.assignedCategories = [];
this.categoryService.getCategoryLinksForNode(nodeId).subscribe((categoryPaging) => { this.categoryService.getCategoryLinksForNode(nodeId).subscribe((categoryPaging) => {

View File

@@ -148,7 +148,6 @@
"NO_EXISTING_TAGS": "No Existing Tags", "NO_EXISTING_TAGS": "No Existing Tags",
"TITLE": "Create Tags", "TITLE": "Create Tags",
"CREATE_TAG": "Create: {{tag}}", "CREATE_TAG": "Create: {{tag}}",
"NAME": "Name",
"INPUT_PLACEHOLDER": "Add a tag to these items", "INPUT_PLACEHOLDER": "Add a tag to these items",
"ERRORS": { "ERRORS": {
"EXISTING_TAG": "Tag already exists", "EXISTING_TAG": "Tag already exists",
@@ -160,7 +159,6 @@
}, },
"TOOLTIPS": { "TOOLTIPS": {
"DELETE_TAG": "Delete tag", "DELETE_TAG": "Delete tag",
"HIDE_INPUT": "Hide input"
}, },
"TAGS_LOADING": "Tags loading", "TAGS_LOADING": "Tags loading",
"CREATE_TAGS_SUCCESS": "Tags created successfully" "CREATE_TAGS_SUCCESS": "Tags created successfully"
@@ -177,9 +175,7 @@
"SELECT_EXISTING_CATEGORY": "Select an existing Category:", "SELECT_EXISTING_CATEGORY": "Select an existing Category:",
"NO_EXISTING_CATEGORIES": "No existing Categories", "NO_EXISTING_CATEGORIES": "No existing Categories",
"GENERIC_CREATE": "Create: {{name}}", "GENERIC_CREATE": "Create: {{name}}",
"NAME": "Category name",
"LOADING": "Loading", "LOADING": "Loading",
"HIDE_INPUT": "Hide input",
"INPUT_PLACEHOLDER": "Add a categories to these items", "INPUT_PLACEHOLDER": "Add a categories to these items",
"NO_CATEGORIES_ADDED": "There are currently no categories added", "NO_CATEGORIES_ADDED": "There are currently no categories added",
"ERRORS": { "ERRORS": {

View File

@@ -87,7 +87,6 @@ adf-tags-creator {
& + .adf-tag { & + .adf-tag {
margin-top: 8px; margin-top: 8px;
margin-left: 8px;
} }
} }

View File

@@ -243,17 +243,6 @@ export class TagsCreatorComponent implements OnInit, OnDestroy {
return this._existingTagsPanelVisible; return this._existingTagsPanelVisible;
} }
/**
* Hide input for typing name for new tag or for searching. When input is hidden then panel of existing tags is hidden as well.
*/
hideNameInput(): void {
this.tagNameControlVisible = false;
this._existingTagsPanelVisible = false;
this.existingTagsPanelVisibilityChange.emit(this.existingTagsPanelVisible);
this.tagNameControlVisibleChange.emit(this.tagNameControlVisible);
this.clearTagNameInput();
}
/** /**
* Add tags to top list using value which is set in input. Adding tag is not allowed when value in input is invalid * Add tags to top list using value which is set in input. Adding tag is not allowed when value in input is invalid
* or if user is still typing what means that validation for input is not called yet. * or if user is still typing what means that validation for input is not called yet.
@@ -261,7 +250,6 @@ export class TagsCreatorComponent implements OnInit, OnDestroy {
addTag(): void { addTag(): void {
if (!this._typing && !this.tagNameControl.invalid) { if (!this._typing && !this.tagNameControl.invalid) {
this.tags.push(this.tagNameControl.value.trim()); this.tags.push(this.tagNameControl.value.trim());
this.hideNameInput();
this.clearTagNameInput(); this.clearTagNameInput();
this.checkScrollbarVisibility(); this.checkScrollbarVisibility();
this.tagsChange.emit(this.tags); this.tagsChange.emit(this.tags);

View File

@@ -401,10 +401,6 @@
"SIDEBAR": { "SIDEBAR": {
"THUMBNAILS": { "THUMBNAILS": {
"PAGE": "Page {{ pageNum }}" "PAGE": "Page {{ pageNum }}"
},
"METADATA": {
"MORE_INFORMATION": "More information",
"LESS_INFORMATION": "Less information"
} }
}, },
"PDF_DIALOG": { "PDF_DIALOG": {