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

5.0.0 pre release #1262

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
18 commits
Select commit Hold shift + click to select a range
31e26e2
4.4.1-develop initial
VitaliyBoyko Sep 12, 2022
f268ef6
1135: Fixed issues with incorrect generation of resolver class
Sep 16, 2022
2ddeeb6
1135: Minor code style fixes
bohdan-harniuk Sep 16, 2022
8cf8401
Merge pull request #1192 from makzef/1135-resolver-class-generation-i…
bohdan-harniuk Sep 16, 2022
1b9eede
Merge branch '4.4.0-develop' of github.com:magento/magento2-phpstorm-…
bohdan-harniuk Sep 19, 2022
02f8189
Merge pull request #1198 from bohdan-harniuk/merge-4.4.0-develop-into…
VitaliyBoyko Sep 19, 2022
79a0572
1195: Changed Magento icons to GraphQL icons for GraphQL related actions
anzin Sep 20, 2022
6ea5de7
Merge pull request #1201 from anzin/1195-change-magento-icons-to-grap…
bohdan-harniuk Sep 20, 2022
b51c8ff
1224: Fixed compatibility issues by updating icon constants
Oct 13, 2022
df89d54
Merge pull request #1230 from makzef/1224-compatibility-issues
bohdan-harniuk Oct 14, 2022
7394739
686: add possibility to set custom coming version in UCT
Nov 18, 2022
841008e
686: fix uct upgrade command related to module path
Nov 24, 2022
b0a8088
Merge remote-tracking branch 'origin/4.4.1-develop' into 5.0.0-develo…
VitaliyBoyko Dec 12, 2022
ce5e860
5.0.0-pre-release
VitaliyBoyko Dec 12, 2022
f4e5b6b
Merge pull request #1251 from makzef/uct-custom-coming-versions
VitaliyBoyko Dec 12, 2022
f869620
Merge remote-tracking branch 'origin/4.4.1-develop' into 5.0.0-pre-re…
Dec 12, 2022
9299700
Merge branch '5.0.0-develop' into 5.0.0-pre-release
VitaliyBoyko Dec 13, 2022
817dea7
5.0.0 updated CHANGELOG.md
VitaliyBoyko Dec 13, 2022
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
19 changes: 19 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,25 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0).

## 5.0.0

### Added

- Code generation of a Data Patch Boilerplate file [#1188](https://github.com/magento/magento2-phpstorm-plugin/pull/1188)
- Code generation of an Observer from the context menu [#1200](https://github.com/magento/magento2-phpstorm-plugin/pull/1200)
- Code generation of events.xml file [#1189](https://github.com/magento/magento2-phpstorm-plugin/pull/1189)
- Config Scope directory inspection [#1261](https://github.com/magento/magento2-phpstorm-plugin/pull/1261)

### Changed

- EAV attributes code generators: Added default values of the group property [#1259](https://github.com/magento/magento2-phpstorm-plugin/pull/1259)
- All code generators: Added constants visibility and class property types [#1260](https://github.com/magento/magento2-phpstorm-plugin/pull/1260)
- UCT custom coming versions [#1251](https://github.com/magento/magento2-phpstorm-plugin/pull/1251)

### Fixed

- Fixed wrong director(y|ies) generation for GraphQL resolver class [#1192](https://github.com/magento/magento2-phpstorm-plugin/pull/1192)
- Fixed IndexOutOfBoundsException: CreateResolverClassQuickFix.applyFix(CreateResolverClassQuickFix.java:43) [#1192](https://github.com/magento/magento2-phpstorm-plugin/pull/1192)
- Index out of range [#1239](https://github.com/magento/magento2-phpstorm-plugin/pull/1239)

## 4.4.0

### Added
Expand Down
11 changes: 11 additions & 0 deletions resources/icons/graphql.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 4 additions & 1 deletion resources/magento2/inspection.properties
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ inspection.plugin.duplicateInSameFile=The plugin name already used in this file.
inspection.plugin.duplicateInOtherPlaces=The plugin name "{0}" for targeted "{1}" class is already used in the module "{2}" ({3} scope). For more details see Inspection Description.
inspection.plugin.disabledPluginDoesNotExist=This plugin does not exist to be disabled.
inspection.graphql.resolver.mustImplement=Class must implements any of the following interfaces: \\Magento\\Framework\\GraphQl\\Query\\ResolverInterface, \\Magento\\Framework\\GraphQl\\Query\\Resolver\\BatchResolverInterface, \\Magento\\Framework\\GraphQl\\Query\\Resolver\\BatchServiceContractResolverInterface
inspection.graphql.resolver.notExist=Resolver class do not exist
inspection.graphql.resolver.notExist=The GraphQL resolver class do not exist
inspection.graphql.resolver.fix.family=Implement Resolver interface
inspection.graphql.resolver.fix.title=Select one of the following interface
inspection.graphql.schema.resolver.fix.family=Create GraphQL Resolver
Expand All @@ -41,3 +41,6 @@ inspection.warning.method.should.have.public.access=The method "{0}" should have
inspection.warning.method.should.have.public.access.fix=Change the method access
inspection.displayName.ModuleScopeInspection=Module Configuration Scope Inspection
inspection.config.wrong.area = The area of this config file is wrong. Please check the spelling of the parent directory, it should be equal to one of the following: adminhtml, frontend, crontab, webapi_rest, webapi_soap, graphql.
inspection.warning.class.invalidFormat=The class "{0}" has invalid format
inspection.error.graphqlResolverClass.tooShortFormat=The target GraphQL resolver class format is incorrect.\nThe fully qualified name "{0}" should contain at least 3 parts.
inspection.error.graphqlResolverClass.tooShortFormatTitle=The GraphQL resolver class format is incorrect
1 change: 1 addition & 0 deletions src/com/magento/idea/magento2plugin/MagentoIcons.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,5 @@ public class MagentoIcons {
IconLoader.getIcon("/icons/pluginIcon16x16.svg", MagentoIcons.class);
public static final Icon PLUGIN_ICON_MEDIUM =
IconLoader.getIcon("/icons/pluginIcon64x64.svg", MagentoIcons.class);
public static final Icon GRAPHQL = IconLoader.getIcon("/icons/graphql.svg", MagentoIcons.class);
}
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
import com.magento.idea.magento2plugin.magento.packages.Package;
import com.magento.idea.magento2plugin.project.Settings;
import com.magento.idea.magento2plugin.util.magento.GetMagentoModuleUtil;
import javax.swing.Icon;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;

Expand Down Expand Up @@ -51,6 +52,24 @@ public AbstractContextAction(
this.moduleFile = moduleFile;
}

/**
* Abstract context action constructor.
*
* @param title String
* @param description String
* @param moduleFile ModuleFileInterface
* @param icon Icon
*/
public AbstractContextAction(
final @NotNull String title,
final @NotNull String description,
final @NotNull ModuleFileInterface moduleFile,
final @Nullable Icon icon
) {
super(title, description, icon);
this.moduleFile = moduleFile;
}

@Override
@SuppressWarnings({"PMD.CyclomaticComplexity", "PMD.NPathComplexity"})
public void update(final @NotNull AnActionEvent event) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import com.intellij.ide.fileTemplates.actions.AttributesDefaults;
import com.intellij.psi.PsiDirectory;
import com.intellij.psi.PsiFile;
import com.magento.idea.magento2plugin.MagentoIcons;
import com.magento.idea.magento2plugin.actions.context.AbstractContextAction;
import com.magento.idea.magento2plugin.magento.files.SchemaGraphQLsFile;
import com.magento.idea.magento2plugin.magento.packages.ComponentType;
Expand All @@ -25,7 +26,12 @@ public class NewGraphQLSchemaAction extends AbstractContextAction {
* New schema.graphqls file action constructor.
*/
public NewGraphQLSchemaAction() {
super(ACTION_NAME, ACTION_DESCRIPTION, SchemaGraphQLsFile.getInstance());
super(
ACTION_NAME,
ACTION_DESCRIPTION,
SchemaGraphQLsFile.getInstance(),
MagentoIcons.GRAPHQL
);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ public class NewGraphQlResolverAction extends AnAction {
public static final String ACTION_DESCRIPTION = "Create a new Magento 2 GraphQL Resolver";

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

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
import com.magento.idea.magento2plugin.bundles.ValidatorBundle;
import com.magento.idea.magento2plugin.indexes.ModuleIndex;
import com.magento.idea.magento2plugin.magento.files.GraphQlResolverPhp;
import com.magento.idea.magento2plugin.magento.packages.File;
import com.magento.idea.magento2plugin.magento.packages.MagentoPhpClass;
import com.magento.idea.magento2plugin.util.GetFirstClassOfFile;
import com.magento.idea.magento2plugin.util.GetPhpClassByFQN;
Expand All @@ -34,6 +33,7 @@
import org.jetbrains.annotations.NotNull;

public class ModuleGraphQlResolverClassGenerator extends FileGenerator {

private final GraphQlResolverFileData graphQlResolverFileData;
private final Project project;
private final ValidatorBundle validatorBundle;
Expand Down Expand Up @@ -132,15 +132,15 @@ private PhpClass createGraphQlResolverClass(final String actionName) {
if (parentDirectory == null) {
return null;
}
final String[] graphQlResolverDirectories = graphQlResolverFileData
.getGraphQlResolverDirectory().split(File.separator);
for (final String graphQlResolverDirectory: graphQlResolverDirectories) {
parentDirectory = directoryGenerator.findOrCreateSubdirectory(
final String graphQlResolverDirectory = graphQlResolverFileData
.getGraphQlResolverDirectory();

if (!graphQlResolverDirectory.isBlank()) {
parentDirectory = directoryGenerator.findOrCreateSubdirectories(
parentDirectory,
graphQlResolverDirectory
);
}

final Properties attributes = getAttributes();
final PsiFile graphQlResolverFile = fileFromTemplateGenerator.generate(
GraphQlResolverPhp.getInstance(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,36 +2,37 @@
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/

package com.magento.idea.magento2plugin.completion.provider;

import com.intellij.codeInsight.completion.CompletionParameters;
import com.intellij.codeInsight.completion.CompletionProvider;
import com.intellij.codeInsight.completion.CompletionResultSet;
import com.intellij.codeInsight.lookup.LookupElementBuilder;
import com.intellij.icons.AllIcons;
import com.intellij.psi.PsiElement;
import com.intellij.util.ProcessingContext;
import com.jetbrains.php.PhpIcons;
import com.magento.idea.magento2plugin.indexes.LayoutIndex;
import com.magento.idea.magento2plugin.stubs.indexes.BlockNameIndex;
import org.jetbrains.annotations.NotNull;

import java.util.Collection;
import org.jetbrains.annotations.NotNull;

public class LayoutBlockCompletionContributor extends CompletionProvider<CompletionParameters> {

@Override
protected void addCompletions(@NotNull CompletionParameters parameters,
ProcessingContext context,
@NotNull CompletionResultSet result) {
PsiElement position = parameters.getPosition().getOriginalElement();
protected void addCompletions(final @NotNull CompletionParameters parameters,
final ProcessingContext context,
final @NotNull CompletionResultSet result) {
final PsiElement position = parameters.getPosition().getOriginalElement();
if (position == null) {
return;
}

Collection<String> keys = LayoutIndex.getAllKeys(BlockNameIndex.KEY, position.getProject());
for (String key: keys) {
final Collection<String> keys
= LayoutIndex.getAllKeys(BlockNameIndex.KEY, position.getProject());
for (final String key: keys) {
result.addElement(
LookupElementBuilder.create(key).withIcon(PhpIcons.XML_TAG_ICON)
LookupElementBuilder.create(key).withIcon(AllIcons.Nodes.Tag)
);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,36 +2,37 @@
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/

package com.magento.idea.magento2plugin.completion.provider;

import com.intellij.codeInsight.completion.CompletionParameters;
import com.intellij.codeInsight.completion.CompletionProvider;
import com.intellij.codeInsight.completion.CompletionResultSet;
import com.intellij.codeInsight.lookup.LookupElementBuilder;
import com.intellij.icons.AllIcons;
import com.intellij.psi.PsiElement;
import com.intellij.util.ProcessingContext;
import com.jetbrains.php.PhpIcons;
import com.magento.idea.magento2plugin.indexes.LayoutIndex;
import com.magento.idea.magento2plugin.stubs.indexes.ContainerNameIndex;
import org.jetbrains.annotations.NotNull;

import java.util.Collection;
import org.jetbrains.annotations.NotNull;

public class LayoutContainerCompletionContributor extends CompletionProvider<CompletionParameters> {

@Override
protected void addCompletions(@NotNull CompletionParameters parameters,
ProcessingContext context,
@NotNull CompletionResultSet result) {
PsiElement position = parameters.getPosition().getOriginalElement();
protected void addCompletions(final @NotNull CompletionParameters parameters,
final ProcessingContext context,
final @NotNull CompletionResultSet result) {
final PsiElement position = parameters.getPosition().getOriginalElement();
if (position == null) {
return;
}

Collection<String> keys = LayoutIndex.getAllKeys(ContainerNameIndex.KEY, position.getProject());
for (String key: keys) {
final Collection<String> keys
= LayoutIndex.getAllKeys(ContainerNameIndex.KEY, position.getProject());
for (final String key: keys) {
result.addElement(
LookupElementBuilder.create(key).withIcon(PhpIcons.XML_TAG_ICON)
LookupElementBuilder.create(key).withIcon(AllIcons.Nodes.Tag)
);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,39 +2,40 @@
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/

package com.magento.idea.magento2plugin.completion.provider;

import com.intellij.codeInsight.completion.CompletionParameters;
import com.intellij.codeInsight.completion.CompletionProvider;
import com.intellij.codeInsight.completion.CompletionResultSet;
import com.intellij.codeInsight.lookup.LookupElementBuilder;
import com.intellij.icons.AllIcons;
import com.intellij.psi.PsiElement;
import com.intellij.psi.xml.XmlFile;
import com.intellij.util.ProcessingContext;
import com.jetbrains.php.PhpIcons;
import com.magento.idea.magento2plugin.indexes.LayoutIndex;
import java.util.List;
import org.jetbrains.annotations.NotNull;

import java.util.List;

public class LayoutUpdateCompletionContributor extends CompletionProvider<CompletionParameters> {

@Override
protected void addCompletions(@NotNull CompletionParameters parameters,
ProcessingContext context,
@NotNull CompletionResultSet result) {
PsiElement position = parameters.getPosition().getOriginalElement();
protected void addCompletions(final @NotNull CompletionParameters parameters,
final ProcessingContext context,
final @NotNull CompletionResultSet result) {
final PsiElement position = parameters.getPosition().getOriginalElement();
if (position == null) {
return;
}

List<XmlFile> targets = LayoutIndex.getLayoutFiles(position.getProject());
if (targets.size() > 0) {
for (XmlFile file : targets) {
final List<XmlFile> targets = LayoutIndex.getLayoutFiles(position.getProject());
if (!targets.isEmpty()) {
for (final XmlFile file : targets) {
result.addElement(
LookupElementBuilder
LookupElementBuilder
.create(file.getVirtualFile().getNameWithoutExtension())
.withIcon(PhpIcons.XML_TAG_ICON)
.withIcon(AllIcons.Nodes.Tag)
);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@
import com.intellij.codeInsight.completion.CompletionProvider;
import com.intellij.codeInsight.completion.CompletionResultSet;
import com.intellij.codeInsight.lookup.LookupElementBuilder;
import com.intellij.icons.AllIcons;
import com.intellij.psi.PsiElement;
import com.intellij.psi.xml.XmlFile;
import com.intellij.util.ProcessingContext;
import com.jetbrains.php.PhpIcons;
import com.magento.idea.magento2plugin.indexes.UIComponentIndex;
import java.util.List;
import org.jetbrains.annotations.NotNull;
Expand All @@ -34,7 +34,7 @@ protected void addCompletions(@NotNull final CompletionParameters parameters,
for (final XmlFile file : targets) {
result.addElement(LookupElementBuilder
.create(file.getVirtualFile().getNameWithoutExtension())
.withIcon(PhpIcons.XML_TAG_ICON)
.withIcon(AllIcons.Nodes.Tag)
);
}
}
Expand Down
Loading