Skip to content

Commit

Permalink
fix(projects): Disable generate/run buttons when applicable (#763)
Browse files Browse the repository at this point in the history
  • Loading branch information
mrmeku authored Jul 19, 2019
1 parent ed6fd95 commit 9b7ea68
Show file tree
Hide file tree
Showing 6 changed files with 1,057 additions and 1,157 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@
#generateMenuTrigger="matMenuTrigger"
[matMenuTriggerFor]="generateMenu"
[matMenuTriggerData]="{ project: p }"
*ngIf="p.supportsGenerate"
[disabled]="!p.supportsGenerate"
>
Generate
</button>
Expand All @@ -96,7 +96,7 @@
#runMenuTrigger="matMenuTrigger"
[matMenuTriggerFor]="runMenu"
[matMenuTriggerData]="{ project: p }"
*ngIf="p.actions.length"
[disabled]="!p.actions.length"
>
Run
</button>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ export class ProjectsComponent implements OnInit, OnDestroy {
...p,
actions: this.createActions(p),
links$: this.getLinksForProject(p),
supportsGenerate: true
supportsGenerate: !(p.architect || []).find(a => a.name === 'e2e')
};
});
return projects;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,11 +51,7 @@ export function createLinkForSchematic(
name: string,
displayText: string
): ProjectAction | undefined {
if (
(project.projectType === 'application' ||
project.projectType === 'library') &&
!(project.architect || []).find(a => a.name === 'e2e')
) {
{
return {
name,
schematicName,
Expand All @@ -67,8 +63,6 @@ export function createLinkForSchematic(
{ project: project.name }
]
};
} else {
return undefined;
}
}

Expand Down
Loading

0 comments on commit 9b7ea68

Please sign in to comment.