Skip to content

Commit

Permalink
Fixed errors reported by linter
Browse files Browse the repository at this point in the history
  • Loading branch information
aweber1 committed Jan 18, 2019
1 parent 632d2b1 commit 101ee1d
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 22 deletions.
7 changes: 4 additions & 3 deletions samples/vue/src/components/GraphQL/GraphQL-ConnectedDemo.vue
Original file line number Diff line number Diff line change
Expand Up @@ -87,13 +87,14 @@ export default {
apollo: {
queryData: {
query: ConnectedDemoQuery,
variables() {const defaultValue = '{00000000-0000-0000-0000-000000000000}';
variables() {
const defaultValue = '{00000000-0000-0000-0000-000000000000}';
const variables = {
contextItem: (this.$jss) ? this.$jss.sitecoreContext().itemId : defaultValue,
contextItem: this.$jss ? this.$jss.sitecoreContext().itemId : defaultValue,
datasource: (this.rendering && this.rendering.dataSource) || defaultValue,
};

if(!variables.contextItem) variables.contextItem = defaultValue;
if (!variables.contextItem) variables.contextItem = defaultValue;

return variables;
},
Expand Down
10 changes: 5 additions & 5 deletions samples/vue/src/components/GraphQL/GraphQL-SSRDemo.vue
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@
</template>

<script>
import { Text, Link } from '@sitecore-jss/sitecore-jss-vue';
import { Text } from '@sitecore-jss/sitecore-jss-vue';
import { ConnectedDemoQuery } from './GraphQL-ConnectedDemo.query.graphql';

export default {
Expand All @@ -71,7 +71,6 @@ export default {
},
components: {
ScText: Text,
ScLink: Link,
},
data() {
return {
Expand All @@ -93,11 +92,11 @@ export default {
variables() {
const defaultValue = '{00000000-0000-0000-0000-000000000000}';
const variables = {
contextItem: (this.$jss) ? this.$jss.sitecoreContext().itemId : defaultValue,
contextItem: this.$jss ? this.$jss.sitecoreContext().itemId : defaultValue,
datasource: defaultValue,
};

if(!variables.contextItem) variables.contextItem = defaultValue;
if (!variables.contextItem) variables.contextItem = defaultValue;

return variables;
},
Expand Down Expand Up @@ -130,7 +129,8 @@ export default {
prefetch: ({ route, state }) => {
return {
contextItem:
(state && state.sitecore && state.sitecore.route && state.sitecore.route.itemId) || '{00000000-0000-0000-0000-000000000000}',
(state && state.sitecore && state.sitecore.route && state.sitecore.route.itemId) ||
'{00000000-0000-0000-0000-000000000000}',
datasource: '{00000000-0000-0000-0000-000000000000}',
};
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,20 +12,24 @@
So we can use the .map() array function to traverse them. Ensure a `key` attribute is set
on each element to make React's DOM updating happy:
-->
<div v-for="(listItem, index) in fields.sharedContentList" :key="`sharedListItem-${index}`" v-if="fields.sharedContentList">
<!-- The referenced item's fields can be rendered and edited using normal helper components: -->
<p>
Field: <sc-text :field="listItem.fields.textField" />
</p>
</div>
<template v-if="fields.sharedContentList">
<div v-for="(listItem, index) in fields.sharedContentList" :key="`sharedListItem-${index}`" >
<!-- The referenced item's fields can be rendered and edited using normal helper components: -->
<p>
Field: <sc-text :field="listItem.fields.textField" />
</p>
</div>
</template>

<h5>Local Content List</h5>
<div v-for="(listItem, index) in fields.localContentList" :key="`localListItem-${index}`" v-if="fields.localContentList">
<!-- The referenced item's fields can be rendered and edited using normal helper components: -->
<p>
Field: <sc-text :field="listItem.fields.textField" />
</p>
</div>
<template v-if="fields.localContentList">
<div v-for="(listItem, index) in fields.localContentList" :key="`localListItem-${index}`">
<!-- The referenced item's fields can be rendered and edited using normal helper components: -->
<p>
Field: <sc-text :field="listItem.fields.textField" />
</p>
</div>
</template>
</styleguide-specimen>
</template>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@

<script>
import { Text, RichText } from '@sitecore-jss/sitecore-jss-vue';
import StyleguideSpecimen from './Styleguide-Specimen';

export default {
name: 'Styleguide-Layout-Tabs-Tab',
Expand All @@ -25,7 +24,6 @@ export default {
},
},
components: {
StyleguideSpecimen,
ScText: Text,
ScRichText: RichText,
},
Expand Down

0 comments on commit 101ee1d

Please sign in to comment.