This repository has been archived by the owner on Oct 5, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 9176a0a
Showing
27 changed files
with
375 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
/src/Resources/public/ | ||
/node_modules/ | ||
/vendor/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
module.exports = { | ||
'env': { | ||
'browser': true, | ||
'es2021': true, | ||
}, | ||
'extends': [ | ||
'google', | ||
], | ||
'parserOptions': { | ||
'ecmaVersion': 12, | ||
'sourceType': 'module', | ||
}, | ||
'rules': { | ||
'require-jsdoc': 0, | ||
}, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
/.github/ export-ignore | ||
/.eslintignore export-ignore | ||
/.eslintrc.js export-ignore | ||
/.gitattributes export-ignore | ||
/.gitignore export-ignore | ||
/package.json export-ignore | ||
/README.md export-ignore |
Validating CODEOWNERS rules …
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
/ @bpesch |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
name: Greetings | ||
|
||
on: [ pull_request, issues ] | ||
|
||
jobs: | ||
greeting: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/first-interaction@v1 | ||
with: | ||
repo-token: ${{ secrets.GITHUB_TOKEN }} | ||
issue-message: '🥳 Congratulations on creating your first issue!' | ||
pr-message: '🥳 Congratulations on creating your first pull request!' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
name: Quality analysis | ||
|
||
on: [ push ] | ||
|
||
jobs: | ||
composer_normalize: | ||
name: composer.json normalizer | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Setup PHP | ||
uses: shivammathur/setup-php@v2 | ||
with: | ||
php-version: 7.4 | ||
extensions: gd | ||
|
||
- name: Checkout code | ||
uses: actions/checkout@v2 | ||
|
||
- name: Install dependencies | ||
run: make install | ||
|
||
- name: composer normalize | ||
run: composer normalize --dry-run | ||
|
||
eslint: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v2 | ||
|
||
- name: Install modules | ||
run: npm install | ||
|
||
- name: Run ESLint | ||
run: npx eslint ./ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
name: Release Plugin | ||
|
||
on: | ||
push: | ||
tags: | ||
- '*' | ||
|
||
env: | ||
PLUGIN_NAME: ${{ github.event.repository.name }} | ||
PLUGIN_UPLOADER_VERSION: 0.3.16 | ||
|
||
jobs: | ||
release: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Set up Git repository | ||
uses: actions/checkout@v2 | ||
with: | ||
path: ${{ env.PLUGIN_NAME }} | ||
|
||
- name: Fix permissions | ||
run: mkdir $(pwd)/${PLUGIN_NAME}/src/Resources/public && chmod -R 777 $(pwd)/${PLUGIN_NAME}/src/Resources/public | ||
|
||
- name: Build JavaScript | ||
run: sudo docker run --rm -e BUILD_PLUGIN=${PLUGIN_NAME} -v $(pwd)/${PLUGIN_NAME}:/var/www/html/custom/plugins/${PLUGIN_NAME} dockware/dev:latest | ||
|
||
- name: Install Plugin Uploader | ||
run: wget 'https://github.com/FriendsOfShopware/FroshPluginUploader/releases/download/${{ env.PLUGIN_UPLOADER_VERSION }}/frosh-plugin-upload.phar' -O frosh-plugin-upload.phar | ||
|
||
- name: Build Zip | ||
run: php frosh-plugin-upload.phar ext:zip ${PLUGIN_NAME} | ||
|
||
- name: Release | ||
uses: softprops/action-gh-release@v1 | ||
with: | ||
files: ${{ env.PLUGIN_NAME }}*.zip |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
name: Mark stale issues and pull requests | ||
|
||
on: | ||
schedule: | ||
- cron: "30 1 * * *" | ||
|
||
jobs: | ||
stale: | ||
runs-on: ubuntu-latest | ||
permissions: | ||
issues: write | ||
pull-requests: write | ||
steps: | ||
- uses: actions/stale@v3 | ||
with: | ||
repo-token: ${{ secrets.GITHUB_TOKEN }} | ||
stale-issue-message: 'Stale issue message' | ||
stale-pr-message: 'Stale pull request message' | ||
stale-issue-label: 'no-issue-activity' | ||
stale-pr-label: 'no-pr-activity' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
/node_modules/ | ||
/vendor/ | ||
/src/Resources/public/ | ||
/composer.lock | ||
/package-lock.json |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
MIT License | ||
|
||
Copyright (c) 2021 bpesch | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
in the Software without restriction, including without limitation the rights | ||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
copies of the Software, and to permit persons to whom the Software is | ||
furnished to do so, subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in all | ||
copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
SOFTWARE. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
.DEFAULT_GOAL := help | ||
|
||
.PHONY: help | ||
help: ## display command overview | ||
@grep -E '^[a-zA-Z0-9_-]+:.*?## .*$$' $(MAKEFILE_LIST) | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[35m%-30s\033[0m %s\n", $$1, $$2}' | ||
|
||
install: ## install dependencies | ||
composer update --no-interaction --no-progress --no-ansi | ||
npm install | ||
|
||
clean: ## cleanup installed dependencies and lockfiles | ||
rm -rf composer.lock | ||
rm -rf vendor | ||
rm -rf package-lock.json | ||
rm -rf node_modules | ||
|
||
.PHONY: cs | ||
cs: ## enforce code style | ||
npx eslint --fix ./ | ||
composer normalize |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
<h1 align="center"> | ||
<img src="assets/logo.svg" width="512px"> | ||
</h1> | ||
|
||
# Dashboard Joke | ||
|
||
Lighten up your work day with a fresh joke every time you open the dashboard! | ||
|
||
<img src="assets/joke.png" width="512px"> | ||
|
||
## Usage requirements | ||
|
||
<p float="left"> | ||
<a href="http://shopware.com"><img src="assets/shopware.png" alt="shopware" width="32"/></a> | ||
</p> | ||
|
||
## Development requirements | ||
|
||
<p float="left"> | ||
<a href="https://git-scm.com"><img src="assets/git.png" alt="git" width="32"/></a> | ||
<a href="https://cmake.org"><img src="assets/cmake.png" alt="cmake" width="32"/></a> | ||
<a href="https://www.docker.com"><img src="assets/docker.png" alt="docker" width="32"/></a> | ||
</p> | ||
|
||
## Usage | ||
|
||
Install and activate the plugin in your Shopware instance. | ||
|
||
``` | ||
composer require family-office/dashboard-joke | ||
``` | ||
|
||
``` | ||
bin/console plugin:refresh && bin/console plugin:install FamilyOfficeDashboardJoke --activate | ||
``` | ||
|
||
The only thing that's left to do for the plugin to work is to link your shops hidden service via the plugin configuration. | ||
|
||
## Development | ||
|
||
Clone the project into your Shopware installation | ||
|
||
```shell | ||
git clone git@github.com:Family-Office-Company/FamilyOfficeDashboardJoke.git | ||
``` | ||
|
||
```shell | ||
cd FamilyOfficeDashboardJoke | ||
``` | ||
|
||
Install the development dependencies | ||
|
||
```shell | ||
make install | ||
``` | ||
|
||
..and start developing! 🥳 | ||
|
||
## Acknowledgements | ||
|
||
Thanks to [Freepik](https://www.freepik.com) from [www.flaticon.com](https://www.flaticon.com/) | ||
for providing the plugin icon. | ||
|
||
We also thank [jokeapi.dev](https://jokeapi.dev) for providing the jokes via an easy-to-use REST API. | ||
|
||
## License | ||
|
||
This project is licensed under the [MIT](LICENSE) license. | ||
Feel free to do whatever you want with the code! |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
{ | ||
"name": "family-office/dashboard-joke", | ||
"type": "shopware-platform-plugin", | ||
"description": "Displays a random joke on Shopware 6's administration dashboard.", | ||
"keywords": [ | ||
"shopware-platform-plugin", | ||
"jokes", | ||
"dashboard" | ||
], | ||
"homepage": "https://github.com/Family-Office-Company/FamilyOfficeDashboardJoke", | ||
"readme": "README.md", | ||
"version": "1.0.0", | ||
"license": "MIT", | ||
"authors": [ | ||
{ | ||
"name": "Family Office", | ||
"email": "contact@family-office.holdings", | ||
"homepage": "https://github.com/Family-Office-Company", | ||
"role": "Manufacturer" | ||
} | ||
], | ||
"require": { | ||
"shopware/storefront": "^6.4" | ||
}, | ||
"require-dev": { | ||
"ergebnis/composer-normalize": "^2.15", | ||
"roave/security-advisories": "dev-latest" | ||
}, | ||
"extra": { | ||
"description": { | ||
"de-DE": "Displays a random joke on Shopware 6's administration dashboard.", | ||
"en-GB": "Displays a random joke on Shopware 6's administration dashboard." | ||
}, | ||
"label": { | ||
"de-DE": "Dashboard Witz", | ||
"en-GB": "Dashboard Joke" | ||
}, | ||
"manufacturerLink": { | ||
"de-DE": "https://github.com/Family-Office-Company", | ||
"en-GB": "https://github.com/Family-Office-Company" | ||
}, | ||
"shopware-plugin-class": "FamilyOffice\\DashboardJoke\\FamilyOfficeDashboardJoke" | ||
}, | ||
"autoload": { | ||
"psr-4": { | ||
"FamilyOffice\\DashboardJoke\\": "src/" | ||
} | ||
}, | ||
"support": { | ||
"issues": "https://github.com/Family-Office-Company/FamilyOfficeDashboardJoke/issues" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
{ | ||
"devDependencies": { | ||
"eslint": "^7.32.0", | ||
"eslint-config-google": "^0.14.0" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace FamilyOffice\DashboardJoke; | ||
|
||
use Shopware\Core\Framework\Plugin; | ||
|
||
final class FamilyOfficeDashboardJoke extends Plugin | ||
{ | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
import './module/sw-dashboard/page/sw-dashboard-index'; | ||
import './service/jokeClient.service'; |
26 changes: 26 additions & 0 deletions
26
src/Resources/app/administration/src/module/sw-dashboard/page/sw-dashboard-index/index.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
import template from './sw-dashboard-index.html.twig'; | ||
|
||
Shopware.Component.override('sw-dashboard-index', { | ||
template, | ||
|
||
inject: ['jokeClient'], | ||
|
||
data() { | ||
return { | ||
joke: null, | ||
}; | ||
}, | ||
|
||
methods: { | ||
createdComponent() { | ||
this.fetchJoke(); | ||
this.$super('createdComponent'); | ||
}, | ||
|
||
fetchJoke() { | ||
this.jokeClient.getJoke().then((joke) => { | ||
this.joke = joke; | ||
}); | ||
}, | ||
}, | ||
}); |
7 changes: 7 additions & 0 deletions
7
...ministration/src/module/sw-dashboard/page/sw-dashboard-index/sw-dashboard-index.html.twig
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
{% block sw_dashboard_index_content_intro_welcome_message %} | ||
<p class="sw-dashboard-index__welcome-message"> | ||
{{ joke.setup }} | ||
<br> | ||
{{ joke.delivery }} | ||
</p> | ||
{% endblock %} |
16 changes: 16 additions & 0 deletions
16
src/Resources/app/administration/src/service/jokeClient.service.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
const ApiService = Shopware.Classes.ApiService; | ||
|
||
class JokeClient extends ApiService { | ||
getJoke() { | ||
return this.httpClient.get( | ||
'https://v2.jokeapi.dev/joke/Any?blacklistFlags=nsfw,religious,political,racist,sexist,explicit', | ||
).then((response) => { | ||
return ApiService.handleResponse(response); | ||
}); | ||
} | ||
} | ||
|
||
Shopware.Application.addServiceProvider('jokeClient', (container) => { | ||
const initContainer = Shopware.Application.getContainer('init'); | ||
return new JokeClient(initContainer.httpClient, container.loginService); | ||
}); |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
<?xml version="1.0" ?> | ||
|
||
<container xmlns="http://symfony.com/schema/dic/services" | ||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:schemaLocation="http://symfony.com/schema/dic/services http://symfony.com/schema/dic/services/services-1.0.xsd"> | ||
<services> | ||
</services> | ||
</container> |