<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[EcoLogic - Medium]]></title>
        <description><![CDATA[Short and longer posts on coding with Angular and asp .net core — https://www.ecologic.ch - Medium]]></description>
        <link>https://medium.com/ecologic?source=rss----33ece60c41d4---4</link>
        <image>
            <url>https://cdn-images-1.medium.com/proxy/1*TGH72Nnw24QL3iV9IOm4VA.png</url>
            <title>EcoLogic - Medium</title>
            <link>https://medium.com/ecologic?source=rss----33ece60c41d4---4</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Fri, 13 Nov 2026 16:54:51 GMT</lastBuildDate>
        <atom:link href="https://medium.com/feed/ecologic" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Complex Configuration in Cypress.io]]></title>
            <link>https://medium.com/ecologic/complex-configuration-in-cypress-io-4f61a47840a9?source=rss----33ece60c41d4---4</link>
            <guid isPermaLink="false">https://medium.com/p/4f61a47840a9</guid>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[testing]]></category>
            <category><![CDATA[cypress]]></category>
            <category><![CDATA[cypress-io]]></category>
            <category><![CDATA[e2e-testing]]></category>
            <dc:creator><![CDATA[magbeat]]></dc:creator>
            <pubDate>Tue, 26 Feb 2019 17:42:33 GMT</pubDate>
            <atom:updated>2019-02-26T17:42:00.357Z</atom:updated>
            <content:encoded><![CDATA[<h3>Work in Progress</h3><p>In our setup, multiple sites are deployed with the same code base. So it would make sense to reuse a lot of the testing code for all sites. To achieve this we decided to reuse the same Docker container and provide the needed configuration variables via the entrypoint script.</p><p>We have a config Folder in the cypress Folder and are building the final configuration file together from all the pieces.</p><p>To do so we use the index.js file in the pluginsfolder:</p><p>(we also installed the merge-json npm package)</p><pre>const fs = require<em>(</em>&#39;fs-extra&#39;<em>)</em>;<br>const mergeJSON = require<em>(</em>&#39;merge-json&#39;<em>)</em>;<br>const path = require<em>(</em>&#39;path&#39;<em>)</em>;<br><br><br>async function getConfigurationByFile<em>(</em>division, environment, locale<em>) {<br><br><br>    </em>let defaultConfig = <em>{<br>        </em>&quot;env&quot;: <em>{</em>&quot;localePrefix&quot;: locale<em>}<br>    }</em>;<em><br><br>    </em>const filePaths = <em>[<br>        </em>path.resolve<em>(</em>`cypress/config/$<em>{</em>division<em>}</em>`, &#39;defaults.json&#39;<em>)</em>,<br>        path.resolve<em>(</em>`cypress/config/$<em>{</em>division<em>}</em>`, &#39;pages.json&#39;<em>)</em>,<br>        path.resolve<em>(</em>`cypress/config/$<em>{</em>division<em>}</em>`, &#39;seo.json&#39;<em>)</em>,<br>        path.resolve<em>(</em>`cypress/config/$<em>{</em>division<em>}</em>`, `env-$<em>{</em>environment<em>}</em>.json`<em>)<br>    ]</em>;<br><br>    for <em>(</em>let filePath of filePaths<em>) {<br>        </em>const config = await fs.readJson<em>(</em>filePath<em>)</em>;<br>        if <em>(</em>config.env<em>) {<br>            </em>Object.keys<em>(</em>config.env<em>)</em>.forEach<em>((</em>key<em>) </em>=&gt; <em>{<br>                </em>config.env<em>[</em>key<em>] </em>= JSON.stringify<em>(</em>config.env<em>[</em>key<em>])</em>;<br>            <em>})</em>;<br>            defaultConfig = mergeJSON.merge<em>(</em>defaultConfig, config<em>)</em>;<br>        <em>}<br>    }<br><br>    </em>return new Promise<em>((</em>resolve, reject<em>) </em>=&gt; <em>{<br>        </em>resolve<em>(<br>            </em>defaultConfig<br>        <em>)</em>;<br>    <em>})<br>}<br><br></em>module.exports = <em>(</em>on, config<em>) </em>=&gt; <em>{<br>    </em>const division = config.env.division;<br>    const environment = config.env.environment;<br>    const locale = config.env.locale;<br><br>    return getConfigurationByFile<em>(</em>division, environment, locale<em>)</em>;<br><em>}</em>;</pre><p>Cypress does only allow to store key / value pairs env of the config. Therefore we apply JSON.stringify() on them and later on in the spec file we parse them back to JSON objects JSON.parse(Cypress.env(&#39;&lt;env_key&gt;&#39;))</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4f61a47840a9" width="1" height="1" alt=""><hr><p><a href="https://medium.com/ecologic/complex-configuration-in-cypress-io-4f61a47840a9">Complex Configuration in Cypress.io</a> was originally published in <a href="https://medium.com/ecologic">EcoLogic</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Create a DatoCMS Plugin using Angular]]></title>
            <link>https://medium.com/ecologic/create-a-datocms-plugin-using-angular-4679b558a56d?source=rss----33ece60c41d4---4</link>
            <guid isPermaLink="false">https://medium.com/p/4679b558a56d</guid>
            <category><![CDATA[datocms]]></category>
            <category><![CDATA[angular]]></category>
            <category><![CDATA[javascript]]></category>
            <dc:creator><![CDATA[magbeat]]></dc:creator>
            <pubDate>Wed, 07 Nov 2018 08:22:56 GMT</pubDate>
            <atom:updated>2018-11-07T08:23:44.398Z</atom:updated>
            <content:encoded><![CDATA[<h3>Example: DatoCMS Multiselect Plugin</h3><p><a href="https://github.com/EcoLogicAG/datocms-plugin-multiselect">EcoLogicAG/datocms-plugin-multiselect</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/681/1*gda2IP8v0wYQqEGVf1DCAQ.png" /></figure><h3>The Beginning</h3><pre>ng new datocms-plugin-&lt;purpose&gt;<br>npm install --save datocms-plugins-sdk</pre><p>You won’t need a router for the plugin.</p><p>Add the DatoCMS CSS to index.html</p><pre>&lt;head&gt;<br>   ...<br>   &lt;link <em>href=</em>&quot;https://unpkg.com/datocms-plugins-sdk/dist/sdk.css&quot; <em>media=</em>&quot;all&quot; <em>rel=</em>&quot;stylesheet&quot;/&gt;<br>   ...<br>&lt;/head&gt;</pre><p><a href="https://github.com/EcoLogicAG/datocms-plugin-multiselect/blob/master/src/index.html">https://github.com/EcoLogicAG/datocms-plugin-multiselect/blob/master/src/index.html</a></p><p>Import the SDK in app.component.ts</p><pre><em>import </em>DatoCmsPlugin <em>from </em>&#39;datocms-plugins-sdk&#39;;</pre><pre>...</pre><pre>export class AppComponent implements OnInit {</pre><pre>   ...</pre><pre>   ngOnInit(): void {<br>      DatoCmsPlugin.init((plugin) =&gt; {<br>         <br>         ...</pre><pre>      });<br>   }<br>}</pre><p><a href="https://github.com/EcoLogicAG/datocms-plugin-multiselect/blob/master/src/app/app.component.ts">https://github.com/EcoLogicAG/datocms-plugin-multiselect/blob/master/src/app/app.component.ts</a></p><p>Do your stuff with the template and the component.</p><p><a href="https://www.datocms.com/docs/plugins/sdk-reference/">https://www.datocms.com/docs/plugins/sdk-reference/</a></p><p>For development and testing you can serve the app on <a href="http://localhost:4200/">http://localhost:4200</a> as usual. Then create a new private plugin over at DatoCMS and use <a href="http://localhost:4200/">http://localhost:4200</a> as the “Entry point URL”. (You have to allow unsafe content in the browser for testing)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/906/1*J2ot-9RJTntsq0iSP7DX3w.png" /></figure><h3>Publish</h3><p><a href="https://www.datocms.com/docs/plugins/publishing/">https://www.datocms.com/docs/plugins/publishing/</a></p><h3>What Went Wrong</h3><p>The plugins are served on unpkg.com from a subdirectory, eg. <a href="https://unpkg.com/@ecologic/datocms-plugin-multiselect@0.0.7/dist/index.html">https://unpkg.com/@ecologic/datocms-plugin-multiselect@0.0.7/dist/index.html</a></p><p>For this to work with Angular we need to adapt the &lt;base href=”/”&gt; path in index.html. The easiest way to do this is using the package.json file:</p><pre>{</pre><pre>...<br>   &quot;version&quot;: &quot;0.0.7&quot;,<br>   ...<br>   &quot;scripts&quot;: {<br>      &quot;build&quot;: &quot;ng build --prod --configuration production --base-href https://unpkg.com/@ecologic/datocms-plugin-multiselect@$npm_package_version/dist/ --output-path dist&quot;<br>   }<br>}</pre><p><a href="https://github.com/EcoLogicAG/datocms-plugin-multiselect/blob/master/package.json">EcoLogicAG/datocms-plugin-multiselect</a></p><p>Then build and publish your plugin an you should be fine.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4679b558a56d" width="1" height="1" alt=""><hr><p><a href="https://medium.com/ecologic/create-a-datocms-plugin-using-angular-4679b558a56d">Create a DatoCMS Plugin using Angular</a> was originally published in <a href="https://medium.com/ecologic">EcoLogic</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Four things you should know when updating to RxJS 6]]></title>
            <link>https://medium.com/ecologic/four-things-you-should-know-when-updating-to-rxjs-6-4eae480aabb0?source=rss----33ece60c41d4---4</link>
            <guid isPermaLink="false">https://medium.com/p/4eae480aabb0</guid>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[rxjs]]></category>
            <category><![CDATA[software-engineering]]></category>
            <dc:creator><![CDATA[M. Langhard]]></dc:creator>
            <pubDate>Tue, 08 May 2018 07:35:52 GMT</pubDate>
            <atom:updated>2018-08-24T15:44:33.955Z</atom:updated>
            <content:encoded><![CDATA[<p>There are a lot of things to consider when updating your RxJS dependency from 5.x.x to 6.x.x. This article describes the first four pitfalls I have encountered.</p><h3>do is now named tap</h3><p>The reason for this change is, that <strong>do</strong> is a reserved keyword in javascript.</p><h3>.pipe(…) is used to chain operators</h3><p><strong>Before</strong></p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/6188e17d2c1f4b30f02fa46df94b087d/href">https://medium.com/media/6188e17d2c1f4b30f02fa46df94b087d/href</a></iframe><p><strong>Now</strong></p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/9bc9990fd225d0046afa4e2e44705988/href">https://medium.com/media/9bc9990fd225d0046afa4e2e44705988/href</a></iframe><h3>imports are simpler</h3><p>There are now only two locations where we need to import from:</p><pre>// operators<br>import { map, tap, filter } from &#39;rxjs/operators&#39;;</pre><pre>// helpers, schedulers, types, …<br>import { BehaviorSubject } from &#39;rxjs&#39;;</pre><h3>creating obseravbles</h3><p>Before RxJS 6 we had many ways to create an observable (.create, of, …). Now there is only <strong>of</strong>:</p><pre>import { of } from &#39;rxjs&#39;;</pre><pre>of([ 1, 2, 3 ])<br> .subscribe(val =&gt; //…)<br></pre><h3>whats more?</h3><p>There is a lot more! Head over to <a href="https://github.com/ReactiveX/rxjs/blob/master/MIGRATION.md">https://github.com/ReactiveX/rxjs/blob/master/MIGRATION.md</a> for the full migration guide.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4eae480aabb0" width="1" height="1" alt=""><hr><p><a href="https://medium.com/ecologic/four-things-you-should-know-when-updating-to-rxjs-6-4eae480aabb0">Four things you should know when updating to RxJS 6</a> was originally published in <a href="https://medium.com/ecologic">EcoLogic</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Simplified Image Dialog for TinyMCE in Directus]]></title>
            <link>https://medium.com/ecologic/simplified-image-dialog-for-tinymce-in-directus-aca5c00380af?source=rss----33ece60c41d4---4</link>
            <guid isPermaLink="false">https://medium.com/p/aca5c00380af</guid>
            <category><![CDATA[tinymce]]></category>
            <category><![CDATA[directus]]></category>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[software-engineering]]></category>
            <dc:creator><![CDATA[magbeat]]></dc:creator>
            <pubDate>Fri, 16 Feb 2018 16:51:07 GMT</pubDate>
            <atom:updated>2018-08-24T15:44:48.608Z</atom:updated>
            <content:encoded><![CDATA[<p>For one of our customers we have created a <a href="https://github.com/EcoLogicAG/tiny-images">simplified image dialog</a> when using the full WYSIWYG editor in the <a href="https://getdirectus.com/">Directus</a> backend.</p><p>Our customer is not interested in inserting external images to a text but wants to chose from the images already uploaded to Directus. There is an image list which can be enabled in the column settings of the table. Go to the column settings -&gt; interface options and scroll down.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/601/1*u1RGT9hFBUZqkihw55pwhw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/451/1*g8x_b6Qtc9yWn2Ld2bOMtA.png" /></figure><p>Unfortunately this basic image list does only show a list of titles. Our customer wants to see thumbnails for images. So we replaced the standard image plugin of the bundled tinyMce editor with a custom one. This plugin looks like this:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*etk97QxvxUZD4V5LbGPEPQ.png" /></figure><p>When you click on an image it gets sent to the editor:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/779/1*cBxE3iHr6iuEOoTlWNLRDQ.png" /></figure><p>To use the custom plugin, simply copy over plugin.min.js and styles.css from <a href="https://github.com/EcoLogicAG/tiny-images">github</a> to assets/js/vendor/tinymce/plugins/image. Enable the ‘image’ plugin in app/core/interfaces/wysiwyg_full/interface.js. Thats it.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/953/1*2xtX4uIpvmcJVssl0xvViQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/277/1*GA7OjhplQ0z8vHXcdoeq7A.png" /></figure><p>Thats it. The repository is <a href="https://github.com/EcoLogicAG/tiny-images">https://github.com/EcoLogicAG/tiny-images</a></p><p>To use the plugin as an additional plugin one could rename the plugin (and the button and menu identifier) and add it as an new plugin in app/core/interfaces/wysiwyg_full/interface.js (Needs to be added to the plugins and the toolbar properties.)</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=aca5c00380af" width="1" height="1" alt=""><hr><p><a href="https://medium.com/ecologic/simplified-image-dialog-for-tinymce-in-directus-aca5c00380af">Simplified Image Dialog for TinyMCE in Directus</a> was originally published in <a href="https://medium.com/ecologic">EcoLogic</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Using Localization in AutoMapper with .NET Core]]></title>
            <link>https://medium.com/ecologic/using-localization-in-automapper-with-net-core-47e6d1ea8c0b?source=rss----33ece60c41d4---4</link>
            <guid isPermaLink="false">https://medium.com/p/47e6d1ea8c0b</guid>
            <category><![CDATA[aspnet]]></category>
            <category><![CDATA[software-engineering]]></category>
            <category><![CDATA[microsoft]]></category>
            <dc:creator><![CDATA[magbeat]]></dc:creator>
            <pubDate>Mon, 20 Mar 2017 08:37:43 GMT</pubDate>
            <atom:updated>2018-08-24T15:45:03.312Z</atom:updated>
            <content:encoded><![CDATA[<p>The author of AutoMapper Jimmy Bogard wrote a nice blog post on how he integrated AutoMapper in the new Dependency Injection framework of .NET Core.</p><p><a href="https://lostechies.com/jimmybogard/2016/07/20/integrating-automapper-with-asp-net-core-di/">Integrating AutoMapper with ASP.NET Core DI</a></p><p>To use localization in AutoMapper we had to basically change three lines of code in Startup.cs and install the AutoMapper.Extensions.Microsoft.DependencyInjection NuGet package.</p><pre>var config = new MapperConfiguration(cfg =&gt; { cfg.AddProfile(new AutoMapperConfig()); });<br>services.AddSingleton(sp =&gt; config.CreateMapper());</pre><p>Becomes:</p><pre>services.AddMvc();<br>services.AddAutoMapper(typeof(Startup));</pre><p>It is important to note that `services.AddAutoMapper()` has to be called after `services.AddMvc()`.</p><p>You don’t need to supply AutoMapper with your profiles anymore. AutoMapper will search the assemblies to initialize itself. All resolvers will be registered in the DI container of .NET Core by AutoMapper.</p><p>You can now use the localizer in your profile:</p><pre>public class AutoMapperConfig : Profile<br>{<br>    public AutoMapperConfig()<br>    {<br>        CreateMap&lt;Model, ViewModel&gt;()<br>            .ForMember(dest =&gt; dest.Titel, opt =&gt; opt.ResolveUsing&lt;TranslateResolver, string&gt;(src =&gt; src.Titel));<br>    }</pre><pre>public class TranslateResolver : IMemberValueResolver&lt;object, object, string, string&gt;<br>    {<br>        private readonly IStringLocalizer&lt;TranslateResolver&gt; _localizer;</pre><pre>public TranslateResolver(IStringLocalizer&lt;TranslateResolver&gt; localizer)<br>        {<br>            _localizer = localizer;<br>        }<br>        <br>        public string Resolve(object source, object destination, string sourceMember, string destMember,<br>            ResolutionContext context)<br>        {<br>            return _localizer[sourceMember];<br>        }<br>    }<br>}</pre><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=47e6d1ea8c0b" width="1" height="1" alt=""><hr><p><a href="https://medium.com/ecologic/using-localization-in-automapper-with-net-core-47e6d1ea8c0b">Using Localization in AutoMapper with .NET Core</a> was originally published in <a href="https://medium.com/ecologic">EcoLogic</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>