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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Lint with eslint vue/recommended settings #104

Merged
merged 2 commits into from
Feb 27, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,17 @@ module.exports = {
node: true
},
extends: [
'plugin:vue/essential',
'plugin:vue/recommended',
'@vue/standard'
],
rules: {
'no-console': process.env.NODE_ENV === 'production' ? 'error' : 'off',
'no-debugger': process.env.NODE_ENV === 'production' ? 'error' : 'off',
indent: ['error', 4],
'space-before-function-paren': ['warn', 'never']
'space-before-function-paren': ['warn', 'never'],
'vue/require-default-prop': 'off',
'vue/no-v-html': 'off',
'vue/html-indent': ['error', 4]
},
parserOptions: {
parser: 'babel-eslint'
Expand Down
31 changes: 19 additions & 12 deletions src/App.vue
Original file line number Diff line number Diff line change
@@ -1,25 +1,32 @@
<template>
<div id="app">
<Header :title="$t('app.title')"/>
<div class="container" id="site-container">
<Header :title="$t('app.title')" />
<div
id="site-container"
class="container"
>
<div class="page-head">
<div class="select-license-column">
<h2 class="vocab h2a ha">{{$t('select-license.heading')}}</h2>
<p class="stepper-instructions vocab-body body-bigger">{{$t('select-license.instructions')}}</p>
<h2 class="vocab h2a ha">
{{ $t('select-license.heading') }}
</h2>
<p class="stepper-instructions vocab-body body-bigger">
{{ $t('select-license.instructions') }}
</p>
</div>
<LocaleChooser />
</div>
<div class="columns">
<Stepper v-model="currentStepId" />
<div class="column" >
<div class="column">
<div class="fixed-right-column">
<SelectedLicenseCard
v-if="showLicense"
/>
<LicenseUseCard
v-if="showLicenseUse"
/>
<HelpSection />
<SelectedLicenseCard
v-if="showLicense"
/>
<LicenseUseCard
v-if="showLicenseUse"
/>
<HelpSection />
</div>
</div>
</div>
Expand Down
24 changes: 18 additions & 6 deletions src/components/AttributionDetailsStep.vue
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
<template>
<div class="step-actions" v-if="this.status==='current'">
<p class="attribution-details-instructions">{{$t('stepper.AD.instructions')}}</p>
<div
v-if="status==='current'"
class="step-actions"
>
<p class="attribution-details-instructions">
{{ $t('stepper.AD.instructions') }}
</p>
<form class="attribution-details-form">
<b-field :label="this.$t('stepper.AD.form.creator-name.label')">
<b-input
Expand All @@ -27,17 +32,21 @@
/>
</b-field>
</form>
</div>
</div>
</template>

<script>
import { mapMutations, mapState } from 'vuex'

export default {
name: 'AttributionDetails',
props: ['status'],
methods: {
...mapMutations(['setCreatorName', 'setCreatorProfileUrl', 'setWorkTitle', 'setWorkUrl'])
props: {
status: {
type: String,
validator(value) {
return ['current', 'previous', 'inactive'].includes(value)
}
}
},
computed: {
...mapState(['attributionDetails']),
Expand Down Expand Up @@ -65,6 +74,9 @@ export default {
this.setWorkUrl(newVal)
}
}
},
methods: {
...mapMutations(['setCreatorName', 'setCreatorProfileUrl', 'setWorkTitle', 'setWorkUrl'])
}

}
Expand Down
31 changes: 23 additions & 8 deletions src/components/CopyrightWaiverStep.vue
Original file line number Diff line number Diff line change
@@ -1,16 +1,26 @@
<template>
<div>
<div class="step-description vocab-body body-normal"
v-if="this.status==='previous'">
<p class="vocab-body body-normal">{{$t('stepper.CW.selected')}}</p>
<div
v-if="status==='previous'"
class="step-description vocab-body body-normal"
>
<p class="vocab-body body-normal">
{{ $t('stepper.CW.selected') }}
</p>
</div>
<div class="step-actions" v-else-if="this.status==='current'">
<div
v-else-if="status==='current'"
class="step-actions"
>
<b-checkbox v-model="copyrightWaiverAgreed">
{{$t('stepper.CW.copyright-waive-agreement')}}
{{ $t('stepper.CW.copyright-waive-agreement') }}
</b-checkbox>
<textarea :value="this.$t('cc0-waiver.text')" :class="'waiver-textarea'" />
<textarea
:value="this.$t('cc0-waiver.text')"
:class="'waiver-textarea'"
/>
<b-checkbox v-model="copyrightWaiverConfirmed">
{{$t("stepper.CW.copyright-waive-confirmation")}}
{{ $t("stepper.CW.copyright-waive-confirmation") }}
</b-checkbox>
</div>
</div>
Expand All @@ -23,7 +33,12 @@ export default {
stepId: Number,
stepName: String,
selected: Boolean,
status: String
status: {
type: String,
validator(value) {
return ['current', 'previous', 'inactive'].includes(value)
}
}
},
data() {
return {
Expand Down
30 changes: 20 additions & 10 deletions src/components/DropdownStep.vue
Original file line number Diff line number Diff line change
@@ -1,13 +1,18 @@
<template>
<div>
<div class="step-description" v-if="this.status==='previous'">
{{cardText}}
<div
v-if="status==='previous'"
class="step-description"
>
{{ cardText }}
</div>
<div class="step-actions" v-else-if="this.status==='current'">
<div
v-else-if="status==='current'"
class="step-actions"
>
<LicenseDropdown @input="updateSelected" />
</div>
</div>

</template>

<script>
Expand All @@ -17,19 +22,24 @@ export default {
name: 'DropdownStep',
components: { LicenseDropdown },
props: {
status: String,
status: {
type: String,
validator(value) {
return ['current', 'previous', 'inactive'].includes(value)
}
},
stepId: Number
},
methods: {
updateSelected() {
this.$emit('input', 'DD', this.$props.stepId, true)
}
},
computed: {
...mapGetters(['fullName']),
cardText() {
return this.fullName
}
},
methods: {
updateSelected() {
this.$emit('input', 'DD', this.$props.stepId, true)
}
}
}
</script>
Expand Down
11 changes: 7 additions & 4 deletions src/components/Feedback.vue
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
<template>
<div id="feedback">
<p>
The new Creative Commons License Chooser is still in active development, and we would like to know what you think!
</p>
<b>Please give us your feedback by <a href="https://docs.google.com/forms/d/e/1FAIpQLSfF7MCKxlPsPuMn17v_sLYWMkxBkudQSPXCXoJKjh5GCtx63g/viewform" class="anim_link-underline">filling out this short Google Form</a>!</b>
<p>
The new Creative Commons License Chooser is still in active development, and we would like to know what you think!
</p>
<b>Please give us your feedback by <a
href="https://docs.google.com/forms/d/e/1FAIpQLSfF7MCKxlPsPuMn17v_sLYWMkxBkudQSPXCXoJKjh5GCtx63g/viewform"
class="anim_link-underline"
>filling out this short Google Form</a>!</b>
</div>
</template>
<script>
Expand Down
44 changes: 33 additions & 11 deletions src/components/FirstStep.vue
Original file line number Diff line number Diff line change
@@ -1,19 +1,41 @@
<template>
<div>
<p class="step-description vocab-body body-normal" v-if="this.status==='previous'">
{{$t(cardText)}}
<p
v-if="status==='previous'"
class="step-description vocab-body body-normal"
>
{{ $t(cardText) }}
</p>
<div class="step-actions" v-else-if="this.status==='current'">
<div class="field" :class="yesSelected">
<b-radio v-model="radio"
native-value="yes">
<span class="vocab-body body-normal" v-html="$t(yesText)" />
<div
v-else-if="status==='current'"
class="step-actions"
>
<div
class="field"
:class="yesSelected"
>
<b-radio
v-model="radio"
native-value="yes"
>
<span
class="vocab-body body-normal"
v-html="$t(yesText)"
/>
</b-radio>
</div>
<div class="field" :class="noSelected">
<b-radio v-model="radio"
native-value="no">
<span class="vocab-body body-normal" v-html="$t(noText)" />
<div
class="field"
:class="noSelected"
>
<b-radio
v-model="radio"
native-value="no"
>
<span
class="vocab-body body-normal"
v-html="$t(noText)"
/>
</b-radio>
</div>
</div>
Expand Down
40 changes: 31 additions & 9 deletions src/components/Footer.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2,23 +2,45 @@
<footer class="footer chooser-footer">
<div class="container chooser-footer-container">
<section class="cc-info-column">
<img src="../assets/cc-logo_white.png" :alt="$t('alt.cc-logo')" class="footer-cc-logo">
<p class="vocab-body-normal no-bottom-margin">Creative Commons</p>
<p class="vocab-body-normal">PO Box 1866, Mountain View, CA 94042</p>
<p class="vocab-body-normal"><a href="mailto:info@creativecommons.org">info@creativecommons.org</a></p>
<p class="vocab-body-normal"><a href="tel:+1-415-429-6753">+1-415-429-6753</a></p>
<img
src="../assets/cc-logo_white.png"
:alt="$t('alt.cc-logo')"
class="footer-cc-logo"
>
<p class="vocab-body-normal no-bottom-margin">
Creative Commons
</p>
<p class="vocab-body-normal">
PO Box 1866, Mountain View, CA 94042
</p>
<p class="vocab-body-normal">
<a href="mailto:info@creativecommons.org">info@creativecommons.org</a>
</p>
<p class="vocab-body-normal">
<a href="tel:+1-415-429-6753">+1-415-429-6753</a>
</p>
</section>
<section class="middle-column">
<p class="footer-licensing-text" v-html="$t('footer.licensing.text')" />
<p
class="footer-licensing-text"
v-html="$t('footer.licensing.text')"
/>
<p class="footer-license-icons">
<img src="../assets/license-icons/icon-cc_white.png">
<img src="../assets/license-icons/icon-by-white.png">
</p>
<p class="footer-contribute-link" v-html="$t('footer.contribute')" />
<p
class="footer-contribute-link"
v-html="$t('footer.contribute')"
/>
</section>
<section class="donation-column">
<h4 class="vocab ha h4a">{{$t('footer.donation.header')}}</h4>
<p class="vocab-body-normal">{{$t('footer.donation.call')}}</p>
<h4 class="vocab ha h4a">
{{ $t('footer.donation.header') }}
</h4>
<p class="vocab-body-normal">
{{ $t('footer.donation.call') }}
</p>
</section>
</div>
</footer>
Expand Down
11 changes: 7 additions & 4 deletions src/components/Header.vue
Original file line number Diff line number Diff line change
@@ -1,20 +1,23 @@
<template>
<b-navbar wrapperClass="container">
<b-navbar wrapper-class="container">
<template slot="brand">
<b-navbar-item>
<img
src="https://creativecommons.org/wp-content/uploads/2016/05/cc-site-icon-300x300.png"
alt="Creative Commons License chooser"
>
<h1 class="app-heading">{{$t('app.title')}}</h1>
<h1 class="app-heading">
{{ $t('app.title') }}
</h1>
</b-navbar-item>
</template>
<template slot="end">
<b-navbar-item
href="https://docs.google.com/forms/d/e/1FAIpQLSfF7MCKxlPsPuMn17v_sLYWMkxBkudQSPXCXoJKjh5GCtx63g/viewform"
title="Feedback"
:class="'navbar-item-feedback'">
{{$t('header.nav-feedback')}}
:class="'navbar-item-feedback'"
>
{{ $t('header.nav-feedback') }}
</b-navbar-item>
</template>
</b-navbar>
Expand Down
Loading