├── babel.config.js ├── src ├── assets │ ├── logo.png │ ├── hedgedoc.png │ └── tab-illo.png ├── components │ ├── ErrorScreen │ │ ├── index.js │ │ └── ErrorScreen.vue │ ├── KaratekFooter │ │ ├── index.js │ │ └── KaratekFooter.vue │ ├── KaratekHeader │ │ ├── index.js │ │ └── KaratekHeader.vue │ ├── InfoSection │ │ ├── index.js │ │ ├── InfoSection.vue │ │ └── InfoCard.vue │ ├── ServiceSection │ │ ├── index.js │ │ ├── ServiceSection.vue │ │ └── ServiceCard.vue │ └── HelloWorld.vue ├── views │ ├── LandingPage │ │ ├── index.js │ │ ├── _mixins.scss │ │ └── LandingPage.vue │ ├── NotFoundPage │ │ ├── index.js │ │ └── NotFoundPage.vue │ ├── Write │ │ ├── Stylusauth │ │ │ ├── index.js │ │ │ └── Stylusauth.vue │ │ └── Introduction │ │ │ ├── index.js │ │ │ └── WriteIntroduction.vue │ ├── AboutView.vue │ └── HomeView.vue ├── styles │ ├── _carbon-utils.scss │ ├── _screens.scss │ ├── _carbon-fixes.scss │ └── _carbon.scss ├── mixins │ └── titleMixin.js ├── App.vue ├── router │ └── index.js ├── main.js └── router.js ├── vue.config.js ├── jsconfig.json ├── .gitignore ├── index.html ├── tests └── unit │ └── example.spec.js ├── README.md ├── public └── index.html └── package.json /babel.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | presets: ["@vue/cli-plugin-babel/preset"], 3 | }; 4 | -------------------------------------------------------------------------------- /src/assets/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KaratekHD/school-cloud/main/src/assets/logo.png -------------------------------------------------------------------------------- /src/assets/hedgedoc.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KaratekHD/school-cloud/main/src/assets/hedgedoc.png -------------------------------------------------------------------------------- /src/assets/tab-illo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KaratekHD/school-cloud/main/src/assets/tab-illo.png -------------------------------------------------------------------------------- /src/components/ErrorScreen/index.js: -------------------------------------------------------------------------------- 1 | import ErrorScreen from "./ErrorScreen"; 2 | export { ErrorScreen }; 3 | -------------------------------------------------------------------------------- /src/views/LandingPage/index.js: -------------------------------------------------------------------------------- 1 | import LandingPage from "./LandingPage"; 2 | export default LandingPage; 3 | -------------------------------------------------------------------------------- /src/views/NotFoundPage/index.js: -------------------------------------------------------------------------------- 1 | import NotFoundPage from "./NotFoundPage"; 2 | export default NotFoundPage; 3 | -------------------------------------------------------------------------------- /src/views/Write/Stylusauth/index.js: -------------------------------------------------------------------------------- 1 | import Stylusauth from "./Stylusauth"; 2 | export default Stylusauth; 3 | -------------------------------------------------------------------------------- /src/components/KaratekFooter/index.js: -------------------------------------------------------------------------------- 1 | import KaratekFooter from "./KaratekFooter"; 2 | export default KaratekFooter; 3 | -------------------------------------------------------------------------------- /src/components/KaratekHeader/index.js: -------------------------------------------------------------------------------- 1 | import KaratekHeader from "./KaratekHeader"; 2 | export default KaratekHeader; 3 | -------------------------------------------------------------------------------- /src/views/AboutView.vue: -------------------------------------------------------------------------------- 1 | 6 | -------------------------------------------------------------------------------- /src/views/Write/Introduction/index.js: -------------------------------------------------------------------------------- 1 | import WriteIntroduction from "@/views/Write/Introduction/WriteIntroduction"; 2 | export default WriteIntroduction; 3 | -------------------------------------------------------------------------------- /src/components/InfoSection/index.js: -------------------------------------------------------------------------------- 1 | import InfoSection from "./InfoSection"; 2 | import InfoCard from "./InfoCard"; 3 | 4 | export { InfoSection, InfoCard }; 5 | -------------------------------------------------------------------------------- /vue.config.js: -------------------------------------------------------------------------------- 1 | const { defineConfig } = require("@vue/cli-service"); 2 | module.exports = defineConfig({ 3 | transpileDependencies: true, 4 | lintOnSave: false, 5 | }); 6 | -------------------------------------------------------------------------------- /src/components/ServiceSection/index.js: -------------------------------------------------------------------------------- 1 | import ServiceCard from "./ServiceCard"; 2 | import ServiceSection from "./ServiceSection"; 3 | 4 | export { ServiceCard, ServiceSection }; 5 | -------------------------------------------------------------------------------- /jsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "target": "es5", 4 | "module": "esnext", 5 | "baseUrl": "./", 6 | "moduleResolution": "node", 7 | "paths": { 8 | "@/*": ["src/*"] 9 | }, 10 | "lib": ["esnext", "dom", "dom.iterable", "scripthost"] 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /src/styles/_carbon-utils.scss: -------------------------------------------------------------------------------- 1 | @import "carbon-components/scss/globals/scss/vendor/@carbon/type/scss/font-family.scss"; 2 | @import "carbon-components/scss/globals/scss/vendor/@carbon/layout/scss/breakpoint.scss"; 3 | @import "carbon-components/scss/globals/scss/typography.scss"; 4 | @import "carbon-components/scss/globals/scss/vars.scss"; 5 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | node_modules 3 | /dist 4 | dist.tar.gz 5 | 6 | # local env files 7 | .env.local 8 | .env.*.local 9 | 10 | # Log files 11 | npm-debug.log* 12 | yarn-debug.log* 13 | yarn-error.log* 14 | pnpm-debug.log* 15 | 16 | # Editor directories and files 17 | .idea 18 | .vscode 19 | *.suo 20 | *.ntvs* 21 | *.njsproj 22 | *.sln 23 | *.sw? 24 | -------------------------------------------------------------------------------- /src/mixins/titleMixin.js: -------------------------------------------------------------------------------- 1 | function getTitle(vm) { 2 | const { title } = vm.$options; 3 | if (title) { 4 | return typeof title === "function" ? title.call(vm) : title; 5 | } 6 | } 7 | export default { 8 | created() { 9 | const title = getTitle(this); 10 | if (title) { 11 | document.title = title + " - " + "Karatek School Cloud"; 12 | } 13 | }, 14 | }; 15 | -------------------------------------------------------------------------------- /src/components/ServiceSection/ServiceSection.vue: -------------------------------------------------------------------------------- 1 | 6 | 7 | 12 | 13 | 20 | -------------------------------------------------------------------------------- /index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | Sai Development Server 8 | 9 | 10 |
11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /tests/unit/example.spec.js: -------------------------------------------------------------------------------- 1 | import { shallowMount } from "@vue/test-utils"; 2 | import HelloWorld from "@/components/HelloWorld.vue"; 3 | 4 | describe("HelloWorld.vue", () => { 5 | it("renders props.msg when passed", () => { 6 | const msg = "new message"; 7 | const wrapper = shallowMount(HelloWorld, { 8 | propsData: { msg }, 9 | }); 10 | expect(wrapper.text()).toMatch(msg); 11 | }); 12 | }); 13 | -------------------------------------------------------------------------------- /src/views/HomeView.vue: -------------------------------------------------------------------------------- 1 | 7 | 8 | 19 | -------------------------------------------------------------------------------- /src/views/LandingPage/_mixins.scss: -------------------------------------------------------------------------------- 1 | @mixin landing-page-background() { 2 | background-color: $ui-01; 3 | position: relative; 4 | 5 | &::before { 6 | content: ""; 7 | position: absolute; 8 | left: -$spacing-06; 9 | top: 0; 10 | right: -$spacing-06; 11 | bottom: 0; 12 | background: $ui-01; 13 | } 14 | 15 | > * { 16 | /* lift above position absolute */ 17 | position: relative; 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /src/views/NotFoundPage/NotFoundPage.vue: -------------------------------------------------------------------------------- 1 | 8 | 9 | 16 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # carbon-landing 2 | 3 | ## Project setup 4 | 5 | ``` 6 | yarn install 7 | ``` 8 | 9 | ### Compiles and hot-reloads for development 10 | 11 | ``` 12 | yarn serve 13 | ``` 14 | 15 | ### Compiles and minifies for production 16 | 17 | ``` 18 | yarn build 19 | ``` 20 | 21 | ### Run your unit tests 22 | 23 | ``` 24 | yarn test:unit 25 | ``` 26 | 27 | ### Lints and fixes files 28 | 29 | ``` 30 | yarn lint 31 | ``` 32 | 33 | ### Customize configuration 34 | 35 | See [Configuration Reference](https://cli.vuejs.org/config/). 36 | -------------------------------------------------------------------------------- /src/App.vue: -------------------------------------------------------------------------------- 1 | 13 | 14 | 23 | 24 | 27 | -------------------------------------------------------------------------------- /src/styles/_screens.scss: -------------------------------------------------------------------------------- 1 | @mixin lg-screen { 2 | @media only screen and (max-width: 1170px) { 3 | @content; 4 | } 5 | } 6 | 7 | //Medium Screen - 768 to 992 screen size 8 | @mixin md-screen { 9 | @media only screen and (max-width: 992px) { 10 | @content; 11 | } 12 | } 13 | 14 | //Medium Screen - 575 to 767 screen size 15 | @mixin sm-screen { 16 | @media only screen and (max-width: 767px) { 17 | @content; 18 | } 19 | } 20 | 21 | //Medium Screen - below 575 screen size 22 | @mixin xs-screen { 23 | @media only screen and (max-width: 575px) { 24 | @content; 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /src/styles/_carbon-fixes.scss: -------------------------------------------------------------------------------- 1 | // Remove overrides once Carbon bugs are fixed upstream. 2 | 3 | /// Need grid option to not add page gutters at large viewports, to also use when nesting grids 4 | /// @link https://github.com/carbon-design-system/carbon/issues/2792 5 | @media (min-width: 42rem) { 6 | .bx--grid--no-gutter { 7 | padding-left: 1rem; 8 | padding-right: 1rem; 9 | } 10 | } 11 | 12 | /// Padding was introduced in 10.3.0, needs an option to let grid set the viewport gutter 13 | /// @link https://github.com/carbon-design-system/carbon/issues/3010 14 | .bx--content { 15 | padding: 0; 16 | } 17 | -------------------------------------------------------------------------------- /src/components/InfoSection/InfoSection.vue: -------------------------------------------------------------------------------- 1 | 9 | 10 | 18 | 19 | 27 | -------------------------------------------------------------------------------- /src/router/index.js: -------------------------------------------------------------------------------- 1 | import Vue from "vue"; 2 | import VueRouter from "vue-router"; 3 | import HomeView from "../views/HomeView.vue"; 4 | 5 | Vue.use(VueRouter); 6 | 7 | const routes = [ 8 | { 9 | path: "/", 10 | name: "home", 11 | component: HomeView, 12 | }, 13 | { 14 | path: "/about", 15 | name: "about", 16 | // route level code-splitting 17 | // this generates a separate chunk (about.[hash].js) for this route 18 | // which is lazy-loaded when the route is visited. 19 | component: () => 20 | import(/* webpackChunkName: "about" */ "../views/AboutView.vue"), 21 | }, 22 | ]; 23 | 24 | const router = new VueRouter({ 25 | routes, 26 | }); 27 | 28 | export default router; 29 | -------------------------------------------------------------------------------- /src/main.js: -------------------------------------------------------------------------------- 1 | import CarbonComponentsVue from "@carbon/vue"; 2 | import titleMixin from "./mixins/titleMixin"; 3 | Vue.use(CarbonComponentsVue); 4 | import Vue from "vue"; 5 | import App from "./App.vue"; 6 | import router from "./router"; 7 | import VueKeyCloak from "@dsb-norge/vue-keycloak-js"; 8 | 9 | let keycloak_config = { 10 | config: { 11 | realm: process.env.VUE_APP_KEYCLOAK_REALM, 12 | url: process.env.VUE_APP_KEYCLOAK_URL, 13 | clientId: process.env.VUE_APP_KEYCLOAK_CLIENT_ID, 14 | }, 15 | init: { 16 | onLoad: "check-sso", 17 | }, 18 | logout: { 19 | redirectUri: process.env.VUE_APP_KEYCLOAK_LOGOUT_REDIRECT_URL, 20 | }, 21 | }; 22 | 23 | Vue.use(VueKeyCloak, keycloak_config); 24 | Vue.mixin(titleMixin); 25 | new Vue({ 26 | router, 27 | render: (h) => h(App), 28 | }).$mount("#app"); 29 | -------------------------------------------------------------------------------- /src/views/Write/Introduction/WriteIntroduction.vue: -------------------------------------------------------------------------------- 1 | 19 | 20 | 25 | 26 | 41 | -------------------------------------------------------------------------------- /src/styles/_carbon.scss: -------------------------------------------------------------------------------- 1 | // We can use this in developement 2 | //@import 'carbon-components/scss/globals/scss/styles'; 3 | //$feature-flags: ( 4 | // grid-columns-16: true, 5 | //); 6 | // Feature flags 7 | $css--font-face: true; 8 | $css--plex: true; 9 | 10 | // Global styles 11 | @import "carbon-components/scss/globals/scss/css--font-face"; 12 | @import "carbon-components/scss/globals/grid/grid"; 13 | 14 | // Carbon components 15 | @import "carbon-components/scss/components/breadcrumb/breadcrumb"; 16 | @import "carbon-components/scss/components/button/button"; 17 | @import "carbon-components/scss/components/link/link"; 18 | @import "carbon-components/scss/components/ui-shell/ui-shell"; 19 | @import "carbon-components/scss/components/tile/tile"; 20 | @import "carbon-components/scss/components/notification/toast-notification"; 21 | @import "carbon-components/scss/components/notification/inline-notification"; 22 | @import "carbon-components/scss/components/data-table/data-table"; 23 | @import "carbon-components/scss/components/pagination/pagination"; 24 | @import "carbon-components/scss/components/modal/modal"; 25 | @import "carbon-components/scss/components/code-snippet/code-snippet"; 26 | @import "carbon-components/scss/components/copy-button/copy-button"; 27 | @import "carbon-components/scss/components/form/form"; 28 | @import "carbon-components/scss/components/inline-loading/inline-loading"; 29 | @import "./carbon-fixes"; 30 | 31 | /* 32 | 33 | */ 34 | -------------------------------------------------------------------------------- /public/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | <%= htmlWebpackPlugin.options.title %> 9 | 10 | 27 | 28 | 29 | 30 | 37 |
38 | 39 | 40 | 41 | -------------------------------------------------------------------------------- /src/router.js: -------------------------------------------------------------------------------- 1 | import Vue from "vue"; 2 | import Router from "vue-router"; 3 | import LandingPage from "./views/LandingPage"; 4 | 5 | Vue.use(Router); 6 | 7 | const router = new Router({ 8 | mode: "history", 9 | routes: [ 10 | { 11 | path: "/", 12 | name: "home", 13 | component: LandingPage, 14 | }, 15 | { 16 | path: "/write/auth", 17 | name: "stylusauth", 18 | component: () => import("./views/Write/Stylusauth"), 19 | meta: { 20 | requiresAuth: true, 21 | }, 22 | }, 23 | /*{ 24 | path: "/write", 25 | name: "write", 26 | component: () => import("./views/Write/Introduction"), 27 | }, 28 | */ 29 | { 30 | path: "*", 31 | name: "404", 32 | component: () => import("./views/NotFoundPage"), 33 | }, 34 | ], 35 | }); 36 | function sleep(ms) { 37 | return new Promise((resolve) => setTimeout(resolve, ms)); 38 | } 39 | 40 | router.beforeEach(async (to, from, next) => { 41 | if (to.matched.some((record) => record.meta.requiresAuth)) { 42 | // We wait for Keycloak init, then we can call all methods safely 43 | while (router.app.$keycloak.createLoginUrl === null) { 44 | await sleep(100); 45 | } 46 | if (router.app.$keycloak.authenticated) { 47 | next(); 48 | } else { 49 | router.app.$keycloak.login({ 50 | redirectUri: window.location.origin + to.path, 51 | }); 52 | //const loginUrl = router.app.$keycloak.createLoginUrl(); 53 | //window.location.replace(loginUrl); 54 | } 55 | } else { 56 | next(); 57 | } 58 | }); 59 | 60 | export default router; 61 | -------------------------------------------------------------------------------- /src/components/ServiceSection/ServiceCard.vue: -------------------------------------------------------------------------------- 1 | 19 | 20 | 40 | 41 | 81 | -------------------------------------------------------------------------------- /src/components/InfoSection/InfoCard.vue: -------------------------------------------------------------------------------- 1 | 11 | 12 | 30 | 31 | 85 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "carbon-landing", 3 | "version": "0.1.0", 4 | "private": true, 5 | "scripts": { 6 | "serve": "vue-cli-service serve", 7 | "build": "vue-cli-service build", 8 | "test:unit": "vue-cli-service test:unit", 9 | "lint": "vue-cli-service lint", 10 | "dev": "vite" 11 | }, 12 | "dependencies": { 13 | "@carbon/icon-helpers": "^10.28.0", 14 | "@carbon/icons-vue": "^10.47.0", 15 | "@carbon/vue": "^2.40.0", 16 | "@dsb-norge/vue-keycloak-js": "^2.1.3-beta", 17 | "carbon-components": "^10.54.0", 18 | "core-js": "^3.8.3", 19 | "keycloak-js": "^17.0.0", 20 | "vue": "^2.6.14", 21 | "vue-keycloak": "^0.0.11", 22 | "vue-meta": "^2.4.0", 23 | "vue-router": "^3.5.1", 24 | "vuejs-logger": "^1.5.5" 25 | }, 26 | "devDependencies": { 27 | "@babel/core": "^7.12.16", 28 | "@babel/eslint-parser": "^7.12.16", 29 | "@vitejs/plugin-vue": "1.0.0", 30 | "@vue/cli-plugin-babel": "~5.0.0", 31 | "@vue/cli-plugin-eslint": "~5.0.0", 32 | "@vue/cli-plugin-router": "~5.0.0", 33 | "@vue/cli-plugin-unit-jest": "~5.0.0", 34 | "@vue/cli-service": "~5.0.0", 35 | "@vue/compiler-sfc": "3.0.4", 36 | "@vue/test-utils": "^1.1.3", 37 | "@vue/vue2-jest": "^27.0.0-alpha.2", 38 | "babel-jest": "^27.0.6", 39 | "eslint": "^7.32.0", 40 | "eslint-config-prettier": "^8.3.0", 41 | "eslint-plugin-prettier": "^4.0.0", 42 | "eslint-plugin-vue": "^8.0.3", 43 | "jest": "^27.0.5", 44 | "prettier": "^2.4.1", 45 | "sass": "^1.32.7", 46 | "sass-loader": "^12.0.0", 47 | "vite": "2.2.4", 48 | "vue-template-compiler": "^2.6.14" 49 | }, 50 | "eslintConfig": { 51 | "root": true, 52 | "env": { 53 | "node": true 54 | }, 55 | "extends": [ 56 | "plugin:vue/essential", 57 | "eslint:recommended", 58 | "plugin:prettier/recommended" 59 | ], 60 | "parserOptions": { 61 | "parser": "@babel/eslint-parser" 62 | }, 63 | "rules": {}, 64 | "overrides": [ 65 | { 66 | "files": [ 67 | "**/__tests__/*.{j,t}s?(x)", 68 | "**/tests/unit/**/*.spec.{j,t}s?(x)" 69 | ], 70 | "env": { 71 | "jest": true 72 | } 73 | } 74 | ] 75 | }, 76 | "browserslist": [ 77 | "> 1%", 78 | "last 2 versions", 79 | "not dead" 80 | ], 81 | "jest": { 82 | "preset": "@vue/cli-plugin-unit-jest" 83 | } 84 | } 85 | -------------------------------------------------------------------------------- /src/components/ErrorScreen/ErrorScreen.vue: -------------------------------------------------------------------------------- 1 | 11 | 12 | 22 | 23 | 100 | -------------------------------------------------------------------------------- /src/components/HelloWorld.vue: -------------------------------------------------------------------------------- 1 | 104 | 105 | 113 | 114 | 115 | 131 | -------------------------------------------------------------------------------- /src/components/KaratekFooter/KaratekFooter.vue: -------------------------------------------------------------------------------- 1 | 101 | 102 | 129 | 130 | 137 | -------------------------------------------------------------------------------- /src/views/LandingPage/LandingPage.vue: -------------------------------------------------------------------------------- 1 | 71 | 72 | 90 | 126 | 127 | 130 | -------------------------------------------------------------------------------- /src/views/Write/Stylusauth/Stylusauth.vue: -------------------------------------------------------------------------------- 1 | 103 | 104 | 137 | 138 | 191 | -------------------------------------------------------------------------------- /src/components/KaratekHeader/KaratekHeader.vue: -------------------------------------------------------------------------------- 1 | 168 | 169 | 190 | --------------------------------------------------------------------------------