Skip to content

Commit c92546b

Browse files
authored
Merge branch '2.1.0-develop' into feature/issue-288-add-description-for-template
2 parents f23ab6f + 1e3e171 commit c92546b

File tree

29 files changed

+571
-147
lines changed

29 files changed

+571
-147
lines changed

.github/workflows/gradle.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ name: Run automated tests
55

66
on:
77
pull_request:
8-
branches: [ master, 2.0.1-develop, 2.1.0-develop ]
8+
branches: [ master, 2.1.0-develop ]
99

1010
jobs:
1111
build-linux:

CHANGELOG.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,19 @@ All notable changes to this project will be documented in this file.
44

55
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0).
66

7+
## 2.0.2
8+
9+
### Added
10+
11+
- PWA pure function Live Template
12+
13+
### Fixed
14+
15+
- Library root for object manager autocomplete
16+
- Line marker for interface plugin target
17+
- Allowed theme override of non-magento composer themes
18+
- Issue with `Magento Module Ui Grid Collection Data Provider Php`
19+
720
## 2.0.1
821

922
### Fixed

README.md

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,19 @@
44
[![Downloads](http://phpstorm.espend.de/badge/8024/downloads)](https://plugins.jetbrains.com/plugin/8024)
55
[![Downloads last month](http://phpstorm.espend.de/badge/8024/last-month)](https://plugins.jetbrains.com/plugin/8024)
66

7-
This is a plugin for Magento 2 development in the PhpStorm IDE. It is available via the [JetBrains Plugin Repository](https://plugins.jetbrains.com/plugin/8024)
7+
This is a PhpStorm IDE plugin for a better Magento 2 development workflow. It is available via the [JetBrains Plugin Repository](https://plugins.jetbrains.com/plugin/8024)
8+
89
## Installation
910

1011
1. Go to `Settings > Preferences` in the PhpStorm IDE
1112
2. Navigate to `Plugins`
1213
3. Click the `Browse repositories...` button and search for "Magento PhpStorm"
1314
4. Install the plugin and restart PhpStorm
1415
5. Go to `Settings > Preferences > Languages & Frameworks > PHP > Frameworks > Magento` in the PhpStorm IDE
15-
6. Check `Enable` and `OK` button.
16+
6. Check `Enable` and click the `OK` button
1617

1718
## Works with
19+
1820
* PhpStorm >= 2020.1.1
1921
* JRE >= 1.8
2022

@@ -48,11 +50,12 @@ This is a plugin for Magento 2 development in the PhpStorm IDE. It is available
4850
- **Enhancement** - Know how to improve existing functionality? Open an issue describe how to enhance the plugin.
4951
- **New feature proposal** - Know how to make a killer feature? Do not hesitate to submit your proposal.
5052
3) The issue will appear in the `Ready for Grooming` column of the [Community Backlog](https://github.com/magento/magento2-phpstorm-plugin/projects/2). Once it will be discussed and approved the issue will be ready for development.
53+
4) Refer to the [Contributing Guide](https://github.com/magento/magento2-phpstorm-plugin/blob/2.1.0-develop/.github/CONTRIBUTING.md) for more information on how to contribute.
5154

52-
### <img src="https://upload.wikimedia.org/wikipedia/commons/7/76/Slack_Icon.png" width="20"> Join [#phpstorm-plugin](https://magentocommeng.slack.com/archives/C010C2LUCEA) Slack channel for more details.
53-
55+
### <img src="https://upload.wikimedia.org/wikipedia/commons/7/76/Slack_Icon.png" width="20"> Join the [#phpstorm-plugin](https://magentocommeng.slack.com/archives/C010C2LUCEA) Slack channel to get more involved
5456

5557
## License
58+
5659
Each Magento source file included in this distribution is licensed under OSL-3.0 license.
5760

58-
Please see [LICENSE.txt](https://github.com/magento/magento2-phpstorm-plugin/blob/master/LICENSE.txt) for the full text of the [Open Software License v. 3.0 (OSL-3.0)](http://opensource.org/licenses/osl-3.0.php).
61+
Please read the [LICENSE.txt](https://github.com/magento/magento2-phpstorm-plugin/blob/master/LICENSE.txt) for the full text of the [Open Software License v. 3.0 (OSL-3.0)](http://opensource.org/licenses/osl-3.0.php).

resources/META-INF/plugin.xml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,7 @@
100100
<projectService serviceImplementation="com.magento.idea.magento2plugin.project.Settings"/>
101101

102102
<completion.contributor language="XML" implementationClass="com.magento.idea.magento2plugin.completion.xml.XmlCompletionContributor" id="xml" />
103+
<completion.contributor language="PHP" implementationClass="com.magento.idea.magento2plugin.completion.php.PhpCompletionContributor" id="php" />
103104

104105
<psi.referenceContributor language="XML" implementation="com.magento.idea.magento2plugin.reference.xml.XmlReferenceContributor"/>
105106
<psi.referenceContributor language="PHP" implementation="com.magento.idea.magento2plugin.reference.php.PhpReferenceContributor"/>
@@ -187,8 +188,6 @@
187188
enabledByDefault="true" level="ERROR"
188189
implementationClass="com.magento.idea.magento2plugin.inspections.xml.AclResourceXmlInspection"/>
189190

190-
<libraryRoot id=".phpstorm.meta.php" path=".phpstorm.meta.php/" runtime="false"/>
191-
192191
<internalFileTemplate name="Magento Module Composer"/>
193192
<internalFileTemplate name="Magento Module Registration Php"/>
194193
<internalFileTemplate name="Magento Module Xml"/>
@@ -205,20 +204,22 @@
205204
<internalFileTemplate name="Magento Module Controller Frontend Class"/>
206205
<internalFileTemplate name="Magento Module Cron Groups Xml"/>
207206
<internalFileTemplate name="Magento Module UI Component Grid Xml"/>
208-
<internalFileTemplate name="Magento Module Ui Grid Collection Data Provider Php"/>
209207
<internalFileTemplate name="Magento Module Ui Custom Data Provider Php"/>
210208
<internalFileTemplate name="Magento Module UI Component Form Xml"/>
211209
<internalFileTemplate name="Magento Php Form Button Block Class"/>
212210
<internalFileTemplate name="Magento Routes Xml"/>
213211
<internalFileTemplate name="Magento Module Layout Xml"/>
214212
<internalFileTemplate name="Magento Module ACL XML"/>
215213

214+
<defaultLiveTemplates file="/liveTemplates/MagentoPWA.xml"/>
215+
216216
<postStartupActivity implementation="com.magento.idea.magento2plugin.project.startup.CheckIfMagentoPathIsValidActivity"/>
217217
</extensions>
218218

219219
<extensions defaultExtensionNs="com.jetbrains.php">
220220
<frameworkProjectConfigurableProvider implementation="com.magento.idea.magento2plugin.project.ConfigurableProvider"/>
221221
<frameworkUsageProvider implementation="com.magento.idea.magento2plugin.project.UsagesProvider"/>
222+
<libraryRoot id="phpstorm.meta.php" path="/phpstorm.meta.php/" runtime="false"/>
222223
</extensions>
223224

224225
</idea-plugin>

resources/fileTemplates/internal/Magento Php Form Button Block Class.php.html

Lines changed: 26 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,30 @@
55
*/
66
-->
77
<html lang="en">
8-
<body>
9-
<p face="verdana" size="-1">
10-
The <a href="https://devdocs.magento.com/guides/v2.3/ui_comp_guide/components/ui-listing-grid.html">Form component</a> configuration.
11-
</p>
12-
13-
<table width="100%" border="0" cellpadding="5" cellspacing="0" style="border-collapse: collapse">
14-
<tr>
15-
<td colspan="3"><font face="verdana" size="-1">Template's predefined variables:</font></td>
16-
</tr>
17-
</table>
18-
</body>
8+
<body>
9+
<table width="100%" border="0" cellpadding="5" cellspacing="0" style="border-collapse: collapse">
10+
<tr>
11+
<td>
12+
<font face="verdana" size="-1">
13+
A Magento 2 <a href="https://devdocs.magento.com/guides/v2.4/ui_comp_guide/components/ui-form.html">UI Component Form</a> can have buttons to perform actions on the form such as "Back" or "Save" for example.
14+
</font><br>
15+
</td>
16+
</tr>
17+
</table>
18+
<table width="100%" border="0" cellpadding="5" cellspacing="0" style="border-collapse: collapse">
19+
<tr>
20+
<td colspan="3"><font face="verdana" size="-1">Predefined variables will take the following values:</font></td>
21+
</tr>
22+
<tr>
23+
<td valign="top"><nobr><font face="verdana" size="-2"><b>${NAMESPACE}</b></font></nobr></td>
24+
<td width="10">&nbsp;</td>
25+
<td width="100%" valign="top"><font face="verdana" size="-1">Namespace for the UI Component Form button class</font></td>
26+
</tr>
27+
<tr>
28+
<td valign="top"><nobr><font face="verdana" size="-2"><b>${CLASS_NAME}</b></font></nobr></td>
29+
<td width="10">&nbsp;</td>
30+
<td width="100%" valign="top"><font face="verdana" size="-1">Class name for the UI Component Form button class</font></td>
31+
</tr>
32+
</table>
33+
</body>
1934
</html>
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<templateSet group="MagentoPWA">
3+
<template name="pwac" value="import React from 'react';&#10;import {mergeClasses} from '@magento/venia-ui/lib/classify';&#10;import { shape, string } from 'prop-types';&#10;&#10;import defaultClasses from './$CSS_FILENAME_BASE$.css';&#10;&#10;const $TM_FILENAME_BASE$ = props =&gt; {&#10; const classes = mergeClasses(defaultClasses, props.classes);&#10; return (&lt;div className={classes.root}&gt;$END$&lt;/div&gt;);&#10;}&#10;&#10;$TM_FILENAME_BASE$.propTypes = {&#10; classes: shape({root: string})&#10;};&#10;$TM_FILENAME_BASE$.defaultProps = {};&#10;export default $TM_FILENAME_BASE$;" description="Creates a PWA Studio pure function component" toReformat="true" toShortenFQNames="true">
4+
<variable name="CSS_FILENAME_BASE" expression="decapitalize(camelCase(fileNameWithoutExtension()))" defaultValue="" alwaysStopAt="true" />
5+
<variable name="TM_FILENAME_BASE" expression="capitalize(camelCase(fileNameWithoutExtension()))" defaultValue="" alwaysStopAt="true" />
6+
<context>
7+
<option name="JAVA_SCRIPT" value="true" />
8+
<option name="TypeScript" value="true" />
9+
</context>
10+
</template>
11+
</templateSet>

resources/magento2/inspection.properties

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
inspection.plugin.duplicateInSameFile=The plugin name already used in this file. For more details see Inspection Description.
22
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.
3+
inspection.plugin.disabledPluginDoesNotExist=This plugin does not exist to be disabled.
34
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
45
inspection.graphql.resolver.notExist=Resolver class do not exist
56
inspection.graphql.resolver.fix.family=Implement Resolver interface
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
<?php
2+
3+
namespace PHPSTORM_META {
4+
override(\Magento\Framework\ObjectManagerInterface::get(0), map(['' => '@']));
5+
override(\Magento\Framework\ObjectManagerInterface::create(0), map(['' => '@']));
6+
}
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
/**
2+
* Copyright © Magento, Inc. All rights reserved.
3+
* See COPYING.txt for license details.
4+
*/
5+
6+
package com.magento.idea.magento2plugin.completion.php;
7+
8+
import com.intellij.codeInsight.completion.CompletionContributor;
9+
import com.intellij.codeInsight.completion.CompletionType;
10+
import com.magento.idea.magento2plugin.completion.provider.ModuleNameCompletionProvider;
11+
import com.magento.idea.magento2plugin.util.php.PhpPatternsHelper;
12+
13+
@SuppressWarnings({
14+
"PMD.CallSuperInConstructor",
15+
})
16+
public class PhpCompletionContributor extends CompletionContributor {
17+
18+
/**
19+
* Constructor.
20+
*/
21+
public PhpCompletionContributor() {
22+
/*
23+
'modules' => [
24+
'Vendor_Module' => 1
25+
]
26+
*/
27+
extend(
28+
CompletionType.BASIC,
29+
PhpPatternsHelper.CONFIGPHP_COMPLETION,
30+
new ModuleNameCompletionProvider()
31+
);
32+
}
33+
}

src/com/magento/idea/magento2plugin/indexes/ModuleIndex.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ public List<String> getEditableModuleNames() {
5353
}
5454

5555
public List<String> getEditableThemeNames() {
56-
return getThemeNames("/" + Package.vendor + "/|/tests/|/test/", true);
56+
return getThemeNames("/" + Package.vendor + "/magento/|/tests/|/test/", true);
5757
}
5858

5959
public List<String> getModuleNames() {

0 commit comments

Comments
 (0)