How to remove steps from checkout in Sylius - symfony

I'm using sylius/sylius 1.3.9 with symfony/framework-bundle 4.2.4. Regarding the doc to remove states from checkout you have to replace the whole configuration of the Sylius core bundle.
I put my configuration into src/Resources/SyliusCoreBundle/config/app/state_machine/sylius_order_checkout.yml:
winzou_state_machine:
sylius_order_checkout:
class: '%sylius.model.order.class%'
property_path: checkoutState
graph: sylius_order_checkout
state_machine_class: '%sylius.state_machine.class%'
states:
cart: ~
addressed: ~
completed: ~
transitions:
address:
from: [cart, addressed]
to: addressed
complete:
from: [addressed]
to: completed
callbacks:
after:
sylius_process_cart:
on: [address]
do: ['#sylius.order_processing.order_processor', process]
args: [object]
sylius_create_order:
on: [complete]
do: ['#sm.callback.cascade_transition', apply]
args: [object, event, create, sylius_order]
sylius_save_checkout_completion_date:
on: [complete]
do: [object, completeCheckout]
args: [object]
After that I execute:
php bin/console cache:clear -e dev
[...]
php bin/console debug:winzou:state-machine sylius_order_checkout -e dev
+--------------------+
| Configured States: |
+--------------------+
| cart |
| addressed |
| shipping_selected |
| shipping_skipped |
| payment_skipped |
| payment_selected |
| completed |
+--------------------+
[...]
Nothing changed. When I follow the link in the doc it says:
Bundle inheritance was removed in Symfony 4.0 [...]
So is it still possible with Symfony 4.2 to replace a whole configuration file of a bundle like suggested by the docs or is this a regression in Sylius 1.3 and what would be a possible solution if I did nothing wrong?

You can try to create state_machine directory in config/packages, put your YAML file and add this line in configureContainer() method into src/Kernel:
protected function configureContainer(ContainerBuilder $container, LoaderInterface $loader): void
{
...
$loader->load($confDir.'/state_machine/*'.self::CONFIG_EXTS, 'glob');
}

Related

How can I define local dependencies between roles in a collection in ansible?

I have a question about dependencies between roles in a collection.
In general, I am concerned if it is possible to define dependencies between roles in a collection - local dependencies like a relative path.
I would like to implement scenarios:
roleB depends on roleA
default scenario of roleC should use roleA in prepare.yml to set up the environment
or
default scenario of roleC should use roleA in converge.yml
I would like to get these dependencies as local dependencies.
For case 2, I tried to use the requriments.yml file
with the appropriate entry in molecule.yml
---
dependency:
name: galaxy
driver:
name: docker
platforms:
.. ...
provisioner:
name: ansible
# env:
# ANSIBLE_ROLES_PATH: "../../roles"
playbooks:
prepare: prepare.yml
config_options:
defaults:
remote_user: ansible
dependency:
name: galaxy
options:
ignore-certs: True
ignore-errors: True
requirements-file: requirements.yml
verifier:
name: ansible
But unfortunately I can't solve the error:
ERROR [1m[0;34mUsing /etc/ansible/ansible.cfg as config file[1m[0m
Starting galaxy role install process
- downloading role from file://../../tool-box
[1m[0;31m [ERROR]: failed to download the file: <urlopen error [Errno 2] No such file or[1m[0m
[1m[0;31mdirectory: '/../tool-box'>[1m[0m
[1m[1;35m[WARNING]: - tool-box was NOT installed successfully.[1m[0m
[1m[0;31mERROR! - you can use --ignore-errors to skip failed roles and finish processing the list.[1m[0m
Structure of collection with roles:
mynamespace
|
|-- mycollection
|
| --roles
|
| -- roleA --
| |--molecule
| |
| |--default
|
| -- roleB --
| |--molecule
| |
| |--default
|
| -- roleC --
| |--molecule
| |
| |--default
Thank you.
Update:
See request issue in ansible/galaxy:
https://github.com/ansible/galaxy/issues/2719
I added this because I don't think there is such functionality.

AWS Amplify API does not exist

I am followng the Automated setup https://docs.amplify.aws/lib/restapi/getting-started/q/platform/js
I have created the Data model using Amplify UI and run
amplify pull --appId XXXX --envName staging
and I got
Successfully generated models. Generated models can be found in /dev/extension/vue-extension/src
Post-pull status:
Current Environment: staging
| Category | Resource name | Operation | Provider plugin |
| -------- | ------------- | --------- | ----------------- |
| Api | my_custom_name | No Change | awscloudformation |
but when I run this code
import Amplify, { API } from 'aws-amplify';
import awsconfig from '#/aws-exports';
Amplify.configure(awsconfig);
API.get('my_custom_name', '/rankings').then(items => console.log(items)).catch(e=> console.log(e ));
I get
API my_custom_name does not exist
You're import awsconfig from '#/aws-exports'; looks incorrect.
Try changing it to import awsconfig from './aws-exports';

webpack-require-http webpack encore symfony - require external js

I tried to add this extension:
https://www.npmjs.com/package/webpack-require-http
to webpack encore:
.addExternals({
'webpack-require-http' :require('webpack-require-http')
})
but I got:
encore dev --watch
Running webpack ...
Invalid configuration object. Webpack has been initialised using a configuration object that does not match the API schema.
- configuration.externals should be one of these:
string | object { <key>: string | object | boolean } | function | RegExp | [string | object { <key>: string | object | boolean } | function | RegExp | [(recursive)]]
-> Specify dependencies that shouldn't be resolved by webpack, but should become dependencies of the resulting bundle. The kind of the dependency depends on `output.libraryTarget`.
Details:
* configuration.externals should be a string.
-> An exact matched dependency becomes external. The same string is used as external dependency.
* configuration.externals['webpack-require-http'] should be a string.
* configuration.externals['webpack-require-http'] should be an object.
* configuration.externals['webpack-require-http'] should be a boolean.
* configuration.externals should be an instance of function
-> `function(context, request, callback(err, result))` The function is called on each dependency.
* configuration.externals should be an instance of RegExp
-> Every matched dependency becomes external.
* configuration.externals should be an array:
[string | object { <key>: string | object | boolean } | function | RegExp | [(recursive)]]
error Command failed with exit code 1.
I want to load the php-generated js to webpack.
In vendor.js add:
require('http://10.2.0.2/vars.js');
This url file is php generated js.

openstack sahara error on dashboard

I'm trying to introduce Sahara to my cloud to utilize Hadoop, and it's not going well. I tried to follow Openstack Documents but it didn't really help me. Now I'm trying to add sahara to my dashboard by command "pip install sahara-dashboard".
Sahara Dashboard is located : /usr/local/lib/python2.7/dist-packages/saharadashboard
original Dashboard is located : /usr/share/openstack-dashboard/openstack-dashboard, and I added
INSTALLED_APPS = [
'openstack_dashboard',
'saharadashboard',
'django.contrib.contenttypes',
'django.contrib.auth',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
'django.contrib.humanize',
'django_pyscss',
'openstack_dashboard.django_pyscss_fix',
'compressor',
'horizon',
'openstack_auth',
]
this to /usr/share/openstack-dashboard/openstack-dashboard/setting.py.
and in : /usr/share/openstack-dashboard/openstack-dashboard/local/local_settings.py , I added
SAHARA_URL='http://localhost:8386/v1.1'
OPENSTACK_API_VERSIONS = {
"data-processing": 1.1,
"identity": 3,
"volume": 2,
"image": 2,
}
"data-processing": 1.1
SAHARA_USE_NEUTRON=True
I can see Sahara managment interface on Dashboard, but I'm getting this error when I try to register image in Image Registry tab of Dashboard. Hope you don't mind Korean in the image. I ought to tell you other things are working fine in my cloud. I searched through all logs related to Sahara, and nothing comes up.
I suspect that thses parts of code are where showing me the error, but don't know how to fix this issue. Please Help!
/usr/local/lib/python2.7/dist-packages/saharadashboard/image_registry/forms.py
glance = importutils.import_any('openstack_dashboard.api.glance',
'horizon.api.glance')
def _get_images(self, request, filter):
try:
images, _more = glance.image_list_detailed(request, filters=filter)
except Exception:
images = []
exceptions.handle(request,
_("Unable to retrieve images with filter %s.") %
filter)
return images
def _get_public_images(self, request):
filter = {"is_public": True,
"status": "active"}
return self._get_images(request, filter)
def _get_tenant_images(self, request):
filter = {"owner": request.user.tenant_id,
"status": "active"}
return self._get_images(request, filter)
UPDATE
glance image-list on controller
+--------------------------------------+------------------------------+
| ID | Name |
+--------------------------------------+------------------------------+
| 28747d2b-c113-4dd3-ad44-908141461e6d | cirros |
| ecb9ac84-7459-4b3b-a832-59329ae1e0ea | github-enterprise-2.6.5 |
| 39ce8087-f95b-4204-bcee-0f084735cba9 | manila-service-image |
| f9a678a8-492f-481e-8c82-5d0c84f69675 | mysqlTest |
| 5ae10b0d-c732-481a-944f-ca3a5a5f4915 | sahara-vanilla-latest-ubuntu |
| f9ea4193-1a92-434d-b247-27b748feb4a1 | Ubuntu Server 14.04 LTS |
+--------------------------------------+------------------------------+
You may have problem with keystone.Did you tried to restart keystone ?

proguard - dupe zip entry ( after upgraded facebook parse UI lib to v4 )

---SOLVED : deleted 2 lines from :app:build.gradle---
compile files('ParseLoginUI/libs/Parse-1.9.1.jar')
compile files('ParseLoginUI/libs/ParseFacebookUtilsV4-1.9.1.jar')
the lib comment here can be interpreted as "you need these 2 statements in your proj.root.build.gradle. Well not true. I had to delete those in order not to get 'dupe zip' errors from proguard.
--Solved--
Upgrade of parseUI library from v3 to v4 went fine til i tried to run proguard within gradle "assembleRelease" task.
Error:
:proguardRelease FAILED
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':proguardRelease'.
> java.io.IOException: Can't write [/home/rob/src/CastVideos-android/build/intermediates/classes-proguard/release/classes.jar]
(Can't read [/home/rob/src/CastVideos-android/build/intermediates/exploded-aar/CastVideos-android/ParseLoginUI/unspecified/libs/Parse-1.9.1.jar(;;;;;;!META-INF/MANIFEST.MF)] (Duplicate zip entry [Parse-1.9.1.jar:com/parse/AnonymousAuthenticationProvider.class]))
I checked proguard faqs for "dupe zip" ...
I tried to figure out how the dependency tree might be handling a dupe of ./libs/Parse-1.9.1.jar in that library.
IM stuck
build.gradle...
packagingOptions {
exclude 'META-INF/LGPL2.1'
exclude 'META-INF/LICENSE'
exclude 'META-INF/NOTICE'
exclude 'META-INF/MANIFEST'
...
buildTypes {
release {
minifyEnabled true
proguardFile 'proguard-android-optimize.txt'
signingConfig signingConfigs.release
}
...
dependencies {
compile files('libs/android-query.0.25.10.jar')
compile files('libs/jackson-core-lgpl-1.9.2.jar')
compile files('libs/jackson-mapper-lgpl-1.9.2.jar')
compile 'com.github.amlcurran.showcaseview:library:5.0.0'
compile group: 'org.apache.httpcomponents' , name: 'httpclient-android' , version: '4.3.5'
// to get around https://code.google.com/p/android/issues/detail?id=52962, we need to
// depend on both debug and release versions of the library
releaseCompile project(path: '..:CastCompanionLibrary-android', configuration: 'release')
debugCompile project(path: '..:CastCompanionLibrary-android', configuration: 'debug')
compile project(':ParseLoginUI')
compile files('ParseLoginUI/libs/Parse-1.9.1.jar')
compile files('ParseLoginUI/libs/ParseFacebookUtilsV4-1.9.1.jar')
compile 'com.facebook.android:facebook-android-sdk:4.0.1'
}
dependency graph for "release"...
...
+--- project :ParseLoginUI
| +--- com.parse.bolts:bolts-android:1.2.0
| \--- com.android.support:support-v4:22.0.0
| \--- com.android.support:support-annotations:22.0.0
+--- com.facebook.android:facebook-android-sdk:4.0.1
| +--- com.android.support:support-v4:[21,22) -> 22.0.0 (*)
| \--- com.parse.bolts:bolts-android:1.1.4 -> 1.2.0
\--- project :..:CastCompanionLibrary-android
+--- com.android.support:appcompat-v7:22.+ -> 22.0.0
| \--- com.android.support:support-v4:22.0.0 (*)
+--- com.android.support:mediarouter-v7:22.+ -> 22.0.0
| \--- com.android.support:appcompat-v7:22.0.0 (*)
\--- com.google.android.gms:play-services-cast:7.+ -> 7.0.0
\--- com.google.android.gms:play-services-base:7.0.0
\--- com.android.support:support-v4:22.0.0 (*)
Under project.root, the only jar files are :
./ParseLoginUI/libs/ParseFacebookUtilsV4-1.9.1.jar
./ParseLoginUI/libs/Parse-1.9.1.jar
proguard config...
-keep class com.facebook.** { *; }
-keep class com.parse.** { *; }
-dontwarn com.parse.**
-dontnote com.parse.**

Resources