Skip to content

Commit cc9c74e

Browse files
authored
Merge pull request #311 from obulat/modals
2 parents 9025192 + 748563f commit cc9c74e

14 files changed

+595
-884
lines changed

README.md

+5-5
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
# chooser
22

3-
The Creative Commons License Chooser is meant to help people learn about CC licenses, and select the license that best fits their needs. The new version in this repo places greater importance on usability and an educational experience of the six CC licenses.
3+
The Creative Commons License Chooser is meant to help people learn about CC licenses, and select the license that best fits their needs. The new version in this repo places greater importance on usability, and an educational experience of the six CC licenses.
44

55
## About
66
Repository containing the source code for the new Creative Commons License Chooser. The new chooser is still in beta, and a beta deployment can be found [here](https://chooser-beta.creativecommons.org/).
77

8-
This site is built using [Vue.js](https://vuejs.org/) (and vue-cli), and [Buefy](https://buefy.org/), among other things.
8+
This site is built using [Vue.js](https://vuejs.org/) (and vue-cli).
99

1010
#### Roadmap
1111

@@ -26,7 +26,7 @@ You should now have the application running and accessible at http://localhost:8
2626
## Contributing
2727
For information on contributing, please see [Creative Commons' Contribution Guidelines](https://opensource.creativecommons.org/contributing-code/)
2828

29-
If you create a PR for your work, but you are not finished yet, please include `WIP:` in the beginning of your PR title. When your work on your PR is completed and you are ready for a final review, please remove the `WIP:` prefix from the title to indicate that your work is done.
29+
If you create a PR for your work, but you are not finished yet, please include `WIP:` in the beginning of your PR title. When your work on your PR is completed, and you are ready for a final review, please remove the `WIP:` prefix from the title to indicate that your work is done.
3030

3131
Here's a [handy link](https://github.com/creativecommons/chooser/issues?utf8=%E2%9C%93&q=is%3Aissue+is%3Aopen+sort%3Aupdated-desc+label%3A%22help+wanted%22+-label%3A%22in+progress%22) that will show you all open issues in this repo that have the `help wanted` tag, but do not have the `in progress` tag.
3232
All issues in this list are up for grabs!
@@ -46,6 +46,6 @@ To run e2e tests, you must have Java installed. [[download Java here](https://ja
4646
The Chooser uses PostCSS plugin for PurgeCSS to make CSS bundle size smaller. It automatically removes unused CSS based on the classes found in the final built bundle. Some styles for dynamic components or dynamically-imported files can also be removed. If you find that the built site misses some styles, you can manually add the necessary classes or Regex expressions to the `safelist` array in the `postcss.config.js` file.
4747

4848
## Deployment
49-
The chooser is deployed to GitHub Pages. The source files for the beta deployment are contained in the `./docs/` dir, and are live. Any changes to this dir's contents will be automatically deployed, so please take care when making modifications to this location.
49+
The chooser is deployed to GitHub Pages. The source files for the beta deployment are contained in the `./docs/` dir, and are live. Any changes to this directory's contents will be automatically deployed, so please take care when making modifications to this location.
5050

51-
To update the dist bundle, run ```$ npm run build```. This and copy the generated files from `./dist/` to `./docs/`, taking care to not delete the CNAME file in `./docs/`.
51+
To update the dist bundle, run ```$ npm run build```. This will also automatically copy the generated files from `./dist/` to `./docs/`.

package.json

+1-3
Original file line numberDiff line numberDiff line change
@@ -22,13 +22,10 @@
2222
"dependencies": {
2323
"@creativecommons/vocabulary": "^2020.11.3",
2424
"@creativecommons/vue-vocabulary": "^2020.11.3",
25-
"@fullhuman/postcss-purgecss": "^3.1.3",
26-
"@linusborg/vue-simple-portal": "^0.1.4",
2725
"@sentry/vue": "^5.29.2",
2826
"bulma": "^0.9.1",
2927
"clipboard": "^2.0.6",
3028
"core-js": "^3.6.5",
31-
"markdown-it": "^12.0.3",
3229
"node-sass": "^4.14.1",
3330
"sass-loader": "^8.0.2",
3431
"vue": "^2.6.10",
@@ -39,6 +36,7 @@
3936
"vuex": "^3.5.1"
4037
},
4138
"devDependencies": {
39+
"@fullhuman/postcss-purgecss": "^3.1.3",
4240
"@vue/cli-plugin-babel": "^4.4.6",
4341
"@vue/cli-plugin-e2e-nightwatch": "^4.4.6",
4442
"@vue/cli-plugin-eslint": "^4.4.6",

src/App.vue

+15-2
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
@restart="restart"
3535
@done="done"
3636
/>
37-
<help-section />
37+
<help-section @change="openChooserModal" />
3838
</div>
3939
<div class="column right-column">
4040
<!-- The right column with the recommended license should be fixed until
@@ -58,13 +58,18 @@
5858
</div>
5959
</div>
6060
<footer-section />
61+
<chooser-modal
62+
:active-modal="openModal"
63+
@close="closeChooserModal"
64+
/>
6165
</div>
6266
</template>
6367

6468
<script>
6569
// TODO Reduce custom styling in favour of Vocabulary styles
6670
import { mapMutations } from 'vuex'
6771
72+
import ChooserModal from './components/ChooserModal'
6873
import HelpSection from './components/HelpSection'
6974
import Stepper from './components/Stepper'
7075
import LicenseUseCard from './components/LicenseUseCard'
@@ -80,11 +85,13 @@ export default {
8085
LicenseDetailsCard,
8186
LicenseUseCard,
8287
HeaderSection,
83-
FooterSection
88+
FooterSection,
89+
ChooserModal
8490
},
8591
data() {
8692
return {
8793
currentStepId: 0,
94+
openModal: null,
8895
showLicense: false,
8996
shouldShake: false,
9097
windowWidth: window.innerWidth
@@ -164,6 +171,12 @@ export default {
164171
},
165172
onResize() {
166173
this.windowWidth = window.innerWidth
174+
},
175+
openChooserModal(modal) {
176+
this.openModal = modal
177+
},
178+
closeChooserModal() {
179+
this.openModal = null
167180
}
168181
}
169182
}

0 commit comments

Comments
 (0)