Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[AAE-3200] Attach button of content node selector becomes enabled when selecting a folder #5946

Merged
merged 2 commits into from
Aug 4, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 0 additions & 4 deletions e2e/protractor.excludes.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,6 @@
"C362241": "Include once ADF starts using ACS 7, https://issues.alfresco.com/jira/browse/ADF-5182",
"C362242": "Include once ADF starts using ACS 7, https://issues.alfresco.com/jira/browse/ADF-5182",
"C362265": "Include once ADF starts using ACS 7, https://issues.alfresco.com/jira/browse/ADF-5182",
"C311287": "https://issues.alfresco.com/jira/browse/AAE-3200",
"C260140": "https://issues.alfresco.com/jira/browse/AAE-3200",
"C261160": "https://issues.alfresco.com/jira/browse/AAE-3200",
"C246534": "https://issues.alfresco.com/jira/browse/AAE-3200",
"C310358": "Include once process storage services removed, https://issues.alfresco.com/jira/browse/AAE-3177",
"C311290": "Include once process storage services removed, https://issues.alfresco.com/jira/browse/AAE-3177"
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ <h2>{{title}}</h2>
</button>

<button mat-button
[disabled]="!chosenNode"
[disabled]="!hasNodeSelected()"
class="adf-choose-action"
(click)="onClick()"
data-automation-id="content-node-selector-actions-choose">{{ buttonActionName | translate }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,22 @@ describe('ContentNodeSelectorDialogComponent', () => {
const actionButton = fixture.debugElement.query(By.css('[data-automation-id="content-node-selector-actions-choose"]'));
expect(actionButton.nativeElement.disabled).toBeFalsy();
});

it('should be disabled when no node chosen', () => {
component.onSelect([new Node({ id: 'fake' })]);
fixture.detectChanges();

const actionButtonWithNodeSelected = fixture.debugElement.query(By.css('[data-automation-id="content-node-selector-actions-choose"]'));

expect(actionButtonWithNodeSelected.nativeElement.disabled).toBe(false);

component.onSelect([]);
fixture.detectChanges();

const actionButtonWithoutNodeSelected = fixture.debugElement.query(By.css('[data-automation-id="content-node-selector-actions-choose"]'));

expect(actionButtonWithoutNodeSelected.nativeElement.disabled).toBe(true);
});
});

describe('Title', () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,4 +82,8 @@ export class ContentNodeSelectorComponent {
onError(error) {
this.notificationService.showError(error);
}

hasNodeSelected(): boolean {
return this.chosenNode?.length > 0;
}
}