Skip to content

Commit

Permalink
Merge pull request #11 from spryker-eco/feature/cc-34041/dev-quick-si…
Browse files Browse the repository at this point in the history
…ght-mvp

CC-34041 Backoffice: Analytics powered by Amazon QuickSight
  • Loading branch information
spryker-release-bot authored Oct 21, 2024
2 parents 47a376d + c54bcca commit 59f717d
Show file tree
Hide file tree
Showing 125 changed files with 11,556 additions and 0 deletions.
13 changes: 13 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
; This file is for unifying the coding style for different editors and IDEs.
; More information at https://editorconfig.org
root = true

[*]
indent_style = space
indent_size = 4
end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = true

[*.bat]
end_of_line = crlf
36 changes: 36 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# Define the line ending behavior of the different file extensions
# Set the default behavior, in case people don't have core.autocrlf set.
* text text=auto eol=lf

*.php diff=php

# Denote all files that are truly binary and should not be modified.
*.png binary
*.jpg binary
*.gif binary
*.jpeg binary
*.zip binary
*.phar binary
*.ttf binary
*.woff binary
*.woff2 binary
*.eot binary
*.ico binary
*.mo binary
*.pdf binary
*.xsd binary
*.exe binary

# Remove files for archives generated using `git archive`
dependency.json export-ignore
phpstan.json export-ignore
phpstan.neon export-ignore
psalm-report.json export-ignore linguist-generated=true
tooling.yml export-ignore
.coveralls.yml export-ignore
.travis.yml export-ignore
.editorconfig export-ignore
.gitattributes export-ignore
.gitignore export-ignore
.github/ export-ignore
architecture-baseline.json export-ignore
58 changes: 58 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
name: CI

on:
push:
branches:
- 'master'
pull_request:
workflow_dispatch:

jobs:
validation:
name: Validation
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.3'
extensions: mbstring, intl, bcmath
coverage: none

- name: Composer Install
run: composer install --prefer-dist --no-interaction --profile

- name: Run validation
run: composer validate

- name: Syntax check
run: find ./src -path src -prune -o -type f -name '*.php' -print0 | xargs -0 -n1 -P4 php -l -n | (! grep -v "No syntax errors detected" )

- name: Run CodeStyle checks
run: composer cs-check

- name: Run PHPStan
run: composer stan

lowest:
name: Prefer Lowest
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.2'
extensions: mbstring, intl, bcmath
coverage: none

- name: Composer Install
run: composer install --prefer-dist --no-interaction --profile

- name: Composer Update
run: composer update --prefer-lowest --prefer-dist --no-interaction --profile -vvv
36 changes: 36 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# IDE
.idea/
.project/
nbproject/
.buildpath/
.settings/
*.sublime-*

# OS
.DS_Store
*.AppleDouble
*.AppleDB
*.AppleDesktop

# grunt stuff
.grunt
.sass-cache
/node_modules/

# tooling
vendor/
composer.lock
.phpunit.result.cache

# built client resources
src/*/Zed/*/Static/Public
src/*/Zed/*/Static/Assets/sprite

# Propel classes
src/*/Zed/*/Persistence/Propel/Base/*
src/*/Zed/*/Persistence/Propel/Map/*

# tests
tests/**/_generated/
tests/_output/*
!tests/_output/.gitkeep
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# AmazonQuicksight Changelog

[Release Changelog](https://github.com/spryker-eco/amazon-quicksight/releases)
28 changes: 28 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
SPRYKER - LICENSE AGREEMENT FOR EVALUATION OF AND EARLY ACCESS TO SOFTWARE

SPRYKER SYSTEMS GMBH, HEIDESTRASSE 9-10, 10557 BERLIN, GERMANY (“WE” OR ”SPRYKER”) GRANTS YOU (“LICENSEE”) THE RIGHT TO USE THE SOFTWARE (AS DEFINED BELOW) UNDER THE PROVISIONS OF THIS LICENSE AGREEMENT FOR EVALUATION AND EARLY ACCESS (THE “AGREEMENT”).

For the purposes of this Agreement, the “Software” includes any software, which is owned and made available by Spryker (i) for evaluation purposes or (ii) as part of Spryker’s early access program under this Agreement. In case Licensee has a dedicated paid license agreement with Spryker on a part of the Software only, this Agreement still applies to all other parts of the Software not paid for and/or covered by such license agreement.

Spryker grants to Licensee, (i) during the 45-calendar-day period (the “Evaluation Period”) following the first download of the Software or (ii) during the period it makes available a feature, module or functionality as part of its early access program (the “Early Access Period”), the non-transferable, non-exclusive limited, free of charge license (for (i) the “Evaluation License” or for (ii) the “Early Access License”, as applicable, both a “License”) to permit Licensee and/or Licensee’s employees to internally use the Software to test and evaluate the Software. In case of the Evaluation License, Licensee will not be granted the license under this Agreement for one particular piece of the Software more than once.

Under the License granted in this Agreement, Licensee shall not (i) use the Software to set up a production live system, for development purposes or any other purposes apart from evaluating and testing the Software; (ii) copy any part of the Software except to make one copy for back-up purposes; (iii) distribute, disclose, market, rent, lease, or transfer the Software or act as a service bureau with respect to the Software; (iv) export the Software or install it in multiple locations; (v) disclose any confidential information provided by Spryker; (vi) modify or make derivative works of the Software; or (vii) allow others to make or obtain copies of the Software.

The use of the Software in a production environment, to the extent permitted at all, requires prior conclusion of a separate agreement between Spryker and Licensee. Spryker will not support any versions of the Software being provided for evaluation purposes or as part of Spryker’s early access program. The provision of the Software as part of Spryker’s early access program does not necessarily mean it will be released as part of Spryker’s products in the future.

The Software may contain elements of open source components, to which different license terms apply respectively. Licensee may need to install these open source components separately.

THE SOFTWARE IS PROVIDED “AS-IS” AND WITHOUT WARRANTY OF ANY KIND. SPRYKER DISCLAIMS ALL WARRANTIES, EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, TITLE, NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE. SPRYKER WILL NOT BE LIABLE FOR ANY DAMAGES ASSOCIATED WITH THE SOFTWARE, INCLUDING WITHOUT LIMITATION ORDINARY, INCIDENTAL, INDIRECT, OR CONSEQUENTIAL DAMAGES OF ANY KIND, INCLUDING BUT NOT LIMITED TO DAMAGES RELATING TO LOST DATA OR LOST PROFITS, EVEN IF SPRYKER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.

Licensee can provide input, suggestions, suggest or recommend changes or enhancements of the Software (“Feedback”). Any Feedback provided by Licensee is not considered confidential information and is received and treated by Spryker on a non-confidential and unrestricted basis. Licensee grants Spryker a sub-licenseable right to use, distribute, disclose and/or incorporate it into the Software or other products of Spryker, free of charge and without restriction as to time and place.

Licensee's License to use the Software under this Agreement shall terminate on the earlier of (i) the expiration of the Evaluation Period or the Early Access Period (as applicable), or (ii) the date both parties enter into a definitive agreement for the provision by Spryker to Licensee of a full non-evaluation license to Spryker’s software.

Upon termination of the License as provided under this Agreement, Licensee shall promptly destroy the Software and any back-up copy of the Software made during the Evaluation Period or Early Access Period if Spryker and Licensee have not agreed a non-evaluation license to Spryker’s software.

This Agreement shall be governed by the laws of Germany to the exclusion of IPR (International Law) and the United Nations Convention on Contracts for the International Sale of Goods (CISG). The parties consent to the jurisdiction of the courts in Berlin (Germany).

This Agreement and/or the License is not assignable or transferable by Licensee and any attempt to do so is null and void.

This Agreement constitutes the entire agreement between the parties concerning Licensee’s use of the Software. This Agreement supersedes any prior verbal understanding between the parties. This Agreement may be amended only in a writing signed by an authorized officer of Spryker.

17 changes: 17 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# AmazonQuicksight Module
[![CI](https://github.com/spryker-eco/amazon-quicksight/workflows/CI/badge.svg?branch=master)](https://github.com/spryker-eco/amazon-quicksight/actions?query=workflow%3ACI+branch%3Amaster)
[![Latest Stable Version](https://poser.pugx.org/spryker-eco/amazon-quicksight/v/stable.svg)](https://packagist.org/packages/spryker-eco/amazon-quicksight)
[![License](https://img.shields.io/github/license/spryker-eco/amazon-quicksight.svg?b=master)](https://github.com/spryker-eco/amazon-quicksight)
[![Minimum PHP Version](https://img.shields.io/badge/php-%3E%3D%208.2-8892BF.svg)](https://php.net/)

AmazonQuicksight module allows the Spryker project to connect to the Amazon QuickSight service.

## Installation

```
composer require spryker-eco/amazon-quicksight
```

## Documentation

[Spryker Documentation](https://docs.spryker.com)
16 changes: 16 additions & 0 deletions architecture-baseline.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
[
{
"fileName": "src/SprykerEco/Zed/AmazonQuicksight/Dependency/Facade/AmazonQuicksightToMessengerFacadeBridge.php",
"description": "Bridges: Method `addErrorMessage()` must have `public function create<DomainEntity>Collection(<DomainEntity>CollectionRequestTransfer): <DomainEntity>CollectionResponseTransfer` signature.",
"rule": "BridgeFacadeMethodsRule",
"ruleset": "Spryker",
"priority": "2"
},
{
"fileName": "src/SprykerEco/Zed/AmazonQuicksight/Dependency/Facade/AmazonQuicksightToMessengerFacadeBridge.php",
"description": "Bridges: Method `addInfoMessage()` must have `public function create<DomainEntity>Collection(<DomainEntity>CollectionRequestTransfer): <DomainEntity>CollectionResponseTransfer` signature.",
"rule": "BridgeFacadeMethodsRule",
"ruleset": "Spryker",
"priority": "2"
}
]
62 changes: 62 additions & 0 deletions assets/Zed/js/modules/quicksight-analytics.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
/**
* Copyright (c) 2017-present Spryker Systems GmbH. All rights reserved.
* Use of this software requires acceptance of the Evaluation License Agreement. See LICENSE file.
*/

'use strict';

const QuickSightEmbedding = require("amazon-quicksight-embedding-sdk");

$(document).ready(function () {
const embedConsole = async(embedElement, embedUrl) => {
const {
createEmbeddingContext,
} = QuickSightEmbedding;

const embeddingContext = await createEmbeddingContext({
onChange: (changeEvent, metadata) => {
console.log('Context received a change', changeEvent, metadata);
},
});

const frameOptions = {
url: embedUrl,
container: embedElement,
height: '700px',
width: '100%',
onChange: (changeEvent, metadata) => {
switch (changeEvent.eventName) {
case 'FRAME_MOUNTED': {
console.log("Experience frame is mounted.");
break;
}
case 'FRAME_LOADED': {
console.log("Experience frame is loaded.");
break;
}
}
},
};

const contentOptions = {
onMessage: async (messageEvent, experienceMetadata) => {
switch (messageEvent.eventName) {
case 'ERROR_OCCURRED': {
console.log("Embedded experience failed loading.");
break;
}
}
}
};
const embeddedConsoleExperience = await embeddingContext.embedConsole(frameOptions, contentOptions);
};

const initQuicksight = () => {
const embedElement = document.getElementById('experience-container');
const embedUrl = embedElement.dataset.embedUrl;

embedConsole(embedElement, embedUrl);
};

initQuicksight();
});
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
/**
* Copyright (c) 2017-present Spryker Systems GmbH. All rights reserved.
* Use of this software requires acceptance of the Evaluation License Agreement. See LICENSE file.
*/

'use strict';

require('./modules/quicksight-analytics');
8 changes: 8 additions & 0 deletions assets/Zed/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"private": true,
"name": "spryker-zed-quicksight-analytics",
"version": "0.1.0",
"dependencies": {
"amazon-quicksight-embedding-sdk": "2.7.0"
}
}
14 changes: 14 additions & 0 deletions codeception.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
namespace: AmazonQuicksight
include:
- tests/SprykerEcoTest/Zed/AmazonQuicksight
paths:
tests: tests/
output: tests/_output/
data: tests/_data/
support: tests/_support/
envs: tests/_envs/
settings:
suite_class: \PHPUnit\Framework\TestSuite
colors: true
memory_limit: 1024M
log: true
55 changes: 55 additions & 0 deletions composer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
{
"name": "spryker-eco/amazon-quicksight",
"type": "library",
"description": "AmazonQuicksight module",
"license": "proprietary",
"require": {
"aws/aws-sdk-php": "^3.90.0",
"php": ">=8.2",
"spryker/analytics-gui-extension": "^1.0.0",
"spryker/kernel": "^3.30.0",
"spryker/messenger": "^3.0.0",
"spryker/propel-orm": "^1.0.0",
"spryker/symfony": "^3.0.0",
"spryker/twig": "^3.0.0",
"spryker/user": "^3.16.0",
"spryker/user-extension": "^1.5.0",
"spryker/util-encoding": "^2.0.0",
"spryker/uuid-behavior": "^1.0.0"
},
"require-dev": {
"phpstan/phpstan": "*",
"spryker/code-sniffer": "*",
"spryker/container": "*",
"spryker/propel": "*",
"spryker/testify": "*"
},
"autoload": {
"psr-4": {
"SprykerEco\\": "src/SprykerEco/"
}
},
"autoload-dev": {
"psr-4": {
"SprykerEcoTest\\": "tests/SprykerEcoTest/"
}
},
"minimum-stability": "dev",
"prefer-stable": true,
"scripts": {
"cs-check": "phpcs -p -s --standard=vendor/spryker/code-sniffer/SprykerStrict/ruleset.xml src/ tests/",
"cs-fix": "phpcbf -p --standard=vendor/spryker/code-sniffer/SprykerStrict/ruleset.xml src/ tests/",
"stan": "phpstan analyse -c phpstan.neon -l 6 src/"
},
"extra": {
"branch-alias": {
"dev-master": "1.0.x-dev"
}
},
"config": {
"sort-packages": true,
"allow-plugins": {
"dealerdirect/phpcodesniffer-composer-installer": true
}
}
}
14 changes: 14 additions & 0 deletions data/translation/Zed/de_DE.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
"Author: A user who can create data sources, datasets, analyses, and dashboards. <br/>Reader: A user who has read-only access to dashboards.","Autor: Ein Benutzer, der Datenquellen, Datensätze, Analysen und Dashboards erstellen kann. <br/>Leser: Ein Benutzer, der nur Lesezugriff auf Dashboards hat."
"Select user role","Benutzerrolle auswählen"
Analytics,Analytics
"The user role for Analytics could not be set. Please try again later.","Die Benutzerrolle für Analytics konnte nicht eingerichtet werden. Bitte versuchen Sie es später noch einmal."
"The user role for Analytics could not be reset. Please contact your Spryker Success Manager.","Die Benutzerrolle für Analytics konnte nicht zurückgesetzt werden. Bitte kontaktieren Sie Ihren Spryker Success Manager."
"Please be aware that you will be the owner of all default assets (dashboards, analyses, datasets and data sources).","Bitte beachten Sie, dass Sie als Eigentümer aller Standard-Assets (Dashboards, Analysen, Datensätzen und Datenquellen) eingetragen werden."
"Please be aware that all Analytics dashboards and configurations, including your changes, will be reset and replaced with the default data. Also, all users will be detached from assets upon reset process. Owner of default assets will be replaced with the user who initiated the reset process by clicking this button.","Bitte beachten Sie, dass alle Dashboards und Konfigurationen, einschließlich Ihrer Änderungen, zurückgesetzt und durch die Analytics-Standarddaten ersetzt werden. Also, all users will be detached from assets upon reset process. Owner of default assets will be replaced with the user who initiated the reset process by clicking this button."
"An error occurred during the Analytics activation. Please try again by clicking the ""Enable Analytics"" button.","Bei der Aktivierung von Analytics ist ein Fehler aufgetreten. Bitte versuchen Sie es erneut, indem Sie auf die Taste ""Analytics aktivieren"" klicken."
"An error occurred during the Analytics reset. Please try again by clicking the ""Reset Analytics"" button.","Beim Zurücksetzen von Analytics ist ein Fehler aufgetreten. Bitte versuchen Sie es erneut, indem Sie auf die Taste ""Analytics zurücksetzen"" klicken."
"Spryker Analytics is not enabled yet","Spryker Analytics ist noch nicht eingeschaltet"
"You can enable Spryker Analytics to view and modify default dashboards with the ability to share them with other users.","Schalten Sie Spryker Analytics ein, um Standard-Dashboards anzuzeigen, zu bearbeiten und mit anderen Benutzern zu teilen."
"Enable Analytics","Analytics einschalten"
"Reset Analytics","Analytics zurücksetzen"
"Spryker Analytics is being activated. Please wait 4-5 minutes and reload the page.","Spryker Analytics wird aktiviert. Bitte warten Sie 4-5 Minuten und laden Sie die Seite neu."
Loading

0 comments on commit 59f717d

Please sign in to comment.