Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

@ or this is not used for named arguments or own properties #25

Open
juliolegrec opened this issue Apr 12, 2023 · 1 comment
Open

@ or this is not used for named arguments or own properties #25

juliolegrec opened this issue Apr 12, 2023 · 1 comment

Comments

@juliolegrec
Copy link

Hi! 馃憢

Firstly, thanks for your work on this project! 馃檪

Today I used patch-package to patch ember-json-viewer@0.7.0 for the project I'm working on.

The issue is that @ or this is not used for named arguments or own properties.

Here is the diff that solved my problem:

diff --git a/node_modules/ember-json-viewer/addon/templates/components/entry-viewer.hbs b/node_modules/ember-json-viewer/addon/templates/components/entry-viewer.hbs
index b799bea..e848d06 100644
--- a/node_modules/ember-json-viewer/addon/templates/components/entry-viewer.hbs
+++ b/node_modules/ember-json-viewer/addon/templates/components/entry-viewer.hbs
@@ -12,7 +12,7 @@
         {{! In order for copy/paste to work, the quoted key (e.g. '"foo": ')
           must be a single text node
         }}
-        {{quotedKey}}
+        {{this.quotedKey}}
       </span>
     </span>
   {{else}}
@@ -20,7 +20,7 @@
       {{! In order for copy/paste to work, the quoted key (e.g. '"foo": ')
         must be a single text node
       }}
-      {{quotedKey}}
+      {{this.quotedKey}}
     </span>
   {{/if}}
   {{value-viewer
diff --git a/node_modules/ember-json-viewer/addon/templates/components/value-viewer.hbs b/node_modules/ember-json-viewer/addon/templates/components/value-viewer.hbs
index 4ff1666..adefb9d 100644
--- a/node_modules/ember-json-viewer/addon/templates/components/value-viewer.hbs
+++ b/node_modules/ember-json-viewer/addon/templates/components/value-viewer.hbs
@@ -12,20 +12,20 @@
       {{this.valueSummary}}
     </span>
   {{else}}
-    <ul class="entries depth-{{depth}}">
+    <ul class="entries depth-{{this.depth}}">
       {{#if this.isObj}}
-        {{#each-in value as |key innerValue|}}
+        {{#each-in this.value as |key innerValue|}}
           {{entry-viewer
             key=key
             value=innerValue
             depth=this.depth
             path=(concat this.path "." key)
             displayOptions=this.displayOptions
-            isLast=(is-last value key)
+            isLast=(is-last this.value key)
           }}
         {{/each-in}}
       {{else}}
-        {{#each value as |innerValue index|}}
+        {{#each this.value as |innerValue index|}}
           <li class="entry">
             {{value-viewer
               value=innerValue
@@ -33,7 +33,7 @@
               path=(concat this.path "[" index "]")
               displayOptions=this.displayOptions
             }}
-            {{#unless (is-last value index)}}
+            {{#unless (is-last this.value index)}}
               {{! In order for copy/paste to work, there cannot be extra whitespace around the delimiter }}
               <span class="entry-delimiter" data-path={{concat this.path "[" index "]" "@" ","}}>,</span>
             {{/unless}}

This issue body was partially generated by patch-package.

@bantic
Copy link
Member

bantic commented Apr 14, 2023

@juliolegrec Thanks for reporting! We'll take a look at fixing this.

bantic added a commit that referenced this issue Apr 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants