Skip to content

872: enhanced new cli command dialog UX #885

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

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
cfd6273
864: Code refactoring
bohdan-harniuk Dec 20, 2021
6b1ff0e
864: Code refactoring
bohdan-harniuk Dec 20, 2021
a741849
864: Enhanced error outputting for new Magento 2 Block generation
bohdan-harniuk Dec 20, 2021
15d9974
867: Code refactoring
bohdan-harniuk Dec 20, 2021
0d85916
867: Enhanced error outputting for new Magento 2 Controller generation
bohdan-harniuk Dec 20, 2021
a6f19bc
868: Code refactoring
bohdan-harniuk Dec 20, 2021
36fc257
868: Code refactoring
bohdan-harniuk Dec 20, 2021
715575e
868: Enhanced error outputting for new Magento 2 Cron Job generation
bohdan-harniuk Dec 20, 2021
abb9b10
868: Enhanced error outputting for new Magento 2 Cron Job generation
bohdan-harniuk Dec 21, 2021
3ca91dc
868: Fixed code style check
bohdan-harniuk Dec 21, 2021
f80dbf2
869: Code refactoring
bohdan-harniuk Dec 21, 2021
e3301a9
869: Enhanced error outputting for new Magento 2 Cron Group generation
bohdan-harniuk Dec 21, 2021
7fee0e8
870: Code refactoring
bohdan-harniuk Dec 21, 2021
6592c20
870: Enhanced error outputting for new Magento 2 View Model generation
bohdan-harniuk Dec 21, 2021
a73037d
870: Code style fix
bohdan-harniuk Dec 21, 2021
0a56b32
871: Code refactoring
bohdan-harniuk Dec 21, 2021
0e5264e
871: Enhanced error outputting for new Magento 2 GraphQl Resolver gen…
bohdan-harniuk Dec 21, 2021
0f1f19b
870: Code style fix
bohdan-harniuk Dec 21, 2021
7f3b781
Merge branch '870-enhance-new-view-model-dialog-ux' into 871-enhance-…
bohdan-harniuk Dec 21, 2021
cd7bcd4
872: Code refactoring
bohdan-harniuk Dec 21, 2021
18a1b2b
872: Enhanced error outputting for new Magento 2 CLI Command generation
bohdan-harniuk Dec 21, 2021
a6ff7b3
871: Code style fix
bohdan-harniuk Dec 21, 2021
953ef3e
Merge branch '871-enhance-new-graphql-resolver-dialog-ux' into 872-en…
bohdan-harniuk Dec 21, 2021
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
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
import org.jetbrains.annotations.NotNull;

public class NewBlockAction extends AnAction {

public static final String ACTION_NAME = "Magento 2 Block";
public static final String ACTION_DESCRIPTION = "Create a new Magento 2 Block";

Expand All @@ -26,23 +27,24 @@ public NewBlockAction() {
}

@Override
public void actionPerformed(@NotNull final AnActionEvent event) {
public void actionPerformed(final @NotNull AnActionEvent event) {
final DataContext dataContext = event.getDataContext();
final IdeView view = LangDataKeys.IDE_VIEW.getData(dataContext);

if (view == null) {
return;
}

final Project project = CommonDataKeys.PROJECT.getData(dataContext);

if (project == null) {
return;
}

final PsiDirectory directory = view.getOrChooseDirectory();

if (directory == null) {
return;
}

NewBlockDialog.open(project, directory);
}

Expand All @@ -51,4 +53,3 @@ public boolean isDumbAware() {
return false;
}
}

Original file line number Diff line number Diff line change
Expand Up @@ -17,33 +17,33 @@
import com.magento.idea.magento2plugin.actions.generation.dialog.NewCLICommandDialog;
import org.jetbrains.annotations.NotNull;

@SuppressWarnings({"PMD.FieldNamingConventions", "PMD.OnlyOneReturn"})
public class NewCLICommandAction extends AnAction {
public static String ACTION_NAME = "Magento 2 CLI Command";
public static String ACTION_DESCRIPTION = "Create a new Magento 2 CLI Command";

public static final String ACTION_NAME = "Magento 2 CLI Command";
public static final String ACTION_DESCRIPTION = "Create a new Magento 2 CLI Command";

public NewCLICommandAction() {
super(ACTION_NAME, ACTION_DESCRIPTION, MagentoIcons.MODULE);
}

@Override
public void actionPerformed(@NotNull final AnActionEvent event) {
public void actionPerformed(final @NotNull AnActionEvent event) {
final DataContext context = event.getDataContext();
final IdeView view = LangDataKeys.IDE_VIEW.getData(context);

if (view == null) {
return;
}

final Project project = CommonDataKeys.PROJECT.getData(context);

if (project == null) {
return;
}

final PsiDirectory directory = view.getOrChooseDirectory();

if (directory == null) {
return;
}

NewCLICommandDialog.open(project, directory);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@
import com.magento.idea.magento2plugin.MagentoIcons;
import com.magento.idea.magento2plugin.actions.generation.dialog.NewControllerDialog;

@SuppressWarnings({"PMD.OnlyOneReturn", "PMD.FieldNamingConventions"})
public class NewControllerAction extends AnAction {

public static final String ACTION_NAME = "Magento 2 Controller";
public static final String ACTION_DESCRIPTION = "Create a new Magento 2 Controller";

Expand All @@ -36,13 +36,13 @@ public void actionPerformed(final AnActionEvent event) {
if (view == null) {
return;
}

final Project project = CommonDataKeys.PROJECT.getData(dataContext);

if (project == null) {
return;
}

final PsiDirectory directory = view.getOrChooseDirectory();

if (directory == null) {
return;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
import com.magento.idea.magento2plugin.MagentoIcons;
import com.magento.idea.magento2plugin.actions.generation.dialog.NewCronGroupDialog;

@SuppressWarnings({"PMD.OnlyOneReturn"})
public class NewCronGroupAction extends com.intellij.openapi.actionSystem.AnAction {

public static final String ACTION_NAME = "Magento 2 Cron Group";
public static final String ACTION_DESCRIPTION = "Create a new Magento 2 Cron Group";

Expand All @@ -35,18 +35,16 @@ public void actionPerformed(final AnActionEvent event) {
if (view == null) {
return;
}

final Project project = CommonDataKeys.PROJECT.getData(dataContext);

if (project == null) {
return;
}

final PsiDirectory directory = view.getOrChooseDirectory();

if (directory == null) {
return;
}

NewCronGroupDialog.open(project, directory);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@
import com.magento.idea.magento2plugin.actions.generation.dialog.NewCronjobDialog;
import org.jetbrains.annotations.NotNull;

@SuppressWarnings({"PMD.FieldNamingConventions", "PMD.OnlyOneReturn"})
public class NewCronjobAction extends AnAction {
public static String ACTION_NAME = "Magento 2 Cron Job";
public static String ACTION_DESCRIPTION = "Create a new Magento 2 Cron Job";

public static final String ACTION_NAME = "Magento 2 Cron Job";
public static final String ACTION_DESCRIPTION = "Create a new Magento 2 Cron Job";

public NewCronjobAction() {
super(ACTION_NAME, ACTION_DESCRIPTION, MagentoIcons.MODULE);
Expand All @@ -34,17 +34,16 @@ public void actionPerformed(final @NotNull AnActionEvent event) {
if (view == null) {
return;
}

final Project project = CommonDataKeys.PROJECT.getData(dataContext);

if (project == null) {
return;
}

final PsiDirectory directory = view.getOrChooseDirectory();

if (directory == null) {
return;
}

NewCronjobDialog.open(project, directory);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,42 +2,48 @@
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/

package com.magento.idea.magento2plugin.actions.generation;

import com.intellij.ide.IdeView;
import com.intellij.openapi.actionSystem.*;
import com.intellij.openapi.actionSystem.AnAction;
import com.intellij.openapi.actionSystem.AnActionEvent;
import com.intellij.openapi.actionSystem.CommonDataKeys;
import com.intellij.openapi.actionSystem.DataContext;
import com.intellij.openapi.actionSystem.LangDataKeys;
import com.intellij.openapi.project.Project;
import com.intellij.psi.PsiDirectory;
import com.magento.idea.magento2plugin.MagentoIcons;
import com.magento.idea.magento2plugin.actions.generation.dialog.NewGraphQlResolverDialog;
import org.jetbrains.annotations.NotNull;

public class NewGraphQlResolverAction extends AnAction {
public static String ACTION_NAME = "Magento 2 GraphQL Resolver";
public static String ACTION_DESCRIPTION = "Create a new Magento 2 GraphQL Resolver";

NewGraphQlResolverAction() {
public static final String ACTION_NAME = "Magento 2 GraphQL Resolver";
public static final String ACTION_DESCRIPTION = "Create a new Magento 2 GraphQL Resolver";

public NewGraphQlResolverAction() {
super(ACTION_NAME, ACTION_DESCRIPTION, MagentoIcons.MODULE);
}

@Override
public void actionPerformed(@NotNull AnActionEvent e) {
DataContext dataContext = e.getDataContext();
IdeView view = LangDataKeys.IDE_VIEW.getData(dataContext);
public void actionPerformed(final @NotNull AnActionEvent event) {
final DataContext dataContext = event.getDataContext();
final IdeView view = LangDataKeys.IDE_VIEW.getData(dataContext);

if (view == null) {
return;
}
final Project project = CommonDataKeys.PROJECT.getData(dataContext);

Project project = CommonDataKeys.PROJECT.getData(dataContext);
if (project == null) {
return;
}
final PsiDirectory directory = view.getOrChooseDirectory();

PsiDirectory directory = view.getOrChooseDirectory();
if (directory == null) {
return;
}

NewGraphQlResolverDialog.open(project, directory);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,42 +2,48 @@
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/

package com.magento.idea.magento2plugin.actions.generation;

import com.intellij.ide.IdeView;
import com.intellij.openapi.actionSystem.*;
import com.intellij.openapi.actionSystem.AnAction;
import com.intellij.openapi.actionSystem.AnActionEvent;
import com.intellij.openapi.actionSystem.CommonDataKeys;
import com.intellij.openapi.actionSystem.DataContext;
import com.intellij.openapi.actionSystem.LangDataKeys;
import com.intellij.openapi.project.Project;
import com.intellij.psi.PsiDirectory;
import com.magento.idea.magento2plugin.MagentoIcons;
import com.magento.idea.magento2plugin.actions.generation.dialog.NewViewModelDialog;
import org.jetbrains.annotations.NotNull;

public class NewViewModelAction extends AnAction {
public static String ACTION_NAME = "Magento 2 View Model";
public static String ACTION_DESCRIPTION = "Create a new Magento 2 View Model";

NewViewModelAction() {
public static final String ACTION_NAME = "Magento 2 View Model";
public static final String ACTION_DESCRIPTION = "Create a new Magento 2 View Model";

public NewViewModelAction() {
super(ACTION_NAME, ACTION_DESCRIPTION, MagentoIcons.MODULE);
}

@Override
public void actionPerformed(@NotNull AnActionEvent e) {
DataContext dataContext = e.getDataContext();
IdeView view = LangDataKeys.IDE_VIEW.getData(dataContext);
public void actionPerformed(final @NotNull AnActionEvent event) {
final DataContext dataContext = event.getDataContext();
final IdeView view = LangDataKeys.IDE_VIEW.getData(dataContext);

if (view == null) {
return;
}
final Project project = CommonDataKeys.PROJECT.getData(dataContext);

Project project = CommonDataKeys.PROJECT.getData(dataContext);
if (project == null) {
return;
}
final PsiDirectory directory = view.getOrChooseDirectory();

PsiDirectory directory = view.getOrChooseDirectory();
if (directory == null) {
return;
}

NewViewModelDialog.open(project, directory);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
</grid>
</children>
</grid>
<grid id="e3588" layout-manager="GridLayoutManager" row-count="2" column-count="2" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
<grid id="e3588" layout-manager="GridLayoutManager" row-count="4" column-count="2" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
<margin top="0" left="0" bottom="0" right="0"/>
<constraints>
<grid row="0" column="0" row-span="1" col-span="1" vsize-policy="3" hsize-policy="3" anchor="0" fill="3" indent="0" use-parent-layout="false"/>
Expand Down Expand Up @@ -85,7 +85,7 @@
</component>
<component id="fdc52" class="javax.swing.JTextField" binding="blockParentDir">
<constraints>
<grid row="1" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="6" anchor="8" fill="1" indent="0" use-parent-layout="false">
<grid row="2" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="6" anchor="8" fill="1" indent="0" use-parent-layout="false">
<preferred-size width="150" height="-1"/>
</grid>
</constraints>
Expand All @@ -96,7 +96,7 @@
</component>
<component id="be25f" class="javax.swing.JLabel">
<constraints>
<grid row="1" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
<grid row="2" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
</constraints>
<properties>
<labelFor value="fdc52"/>
Expand All @@ -106,6 +106,22 @@
<html.disable class="java.lang.Boolean" value="true"/>
</clientProperties>
</component>
<component id="48e8" class="javax.swing.JLabel" binding="blockNameErrorMessage">
<constraints>
<grid row="1" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
</constraints>
<properties>
<text value=""/>
</properties>
</component>
<component id="340c3" class="javax.swing.JLabel" binding="blockParentDirErrorMessage">
<constraints>
<grid row="3" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
</constraints>
<properties>
<text value=""/>
</properties>
</component>
</children>
</grid>
<grid id="ddd4f" layout-manager="GridLayoutManager" row-count="2" column-count="1" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
Expand Down
Loading