Commit 11f54f7a authored by Marcel Nellesen's avatar Marcel Nellesen
Browse files

Merge branch 'Topic/607-editProjectPage' into 'Product/584-editProjectPage'

New: Implement a project edit page

See merge request coscine/app/projectedit!1
parents 75ac6d54 2bad7dd4
.DS_Store
node_modules
/dist
package-lock.json
# local env files
.env.local
......
......@@ -4,6 +4,7 @@ stages:
- docs
- publish
- release
- pre_release
before_script:
- npm install
......@@ -54,5 +55,17 @@ release:
only:
- tags
pre_release:
stage: pre_release
script:
- npm run build
artifacts:
paths:
- dist
when: manual
except:
- tags
- master
after_script:
- Cmd /C "rmdir /S /Q node_modules"
\ No newline at end of file
MIT License
Copyright (c) 2019 RWTH Aachen University
Copyright (c) 2020 RWTH Aachen University
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
......
module.exports = {
presets: [
'@vue/app'
]
'@vue/app',
["@babel/preset-env",
{
"targets": {
"ie": "11"
}
}]
],
}
This diff is collapsed.
{
"name": "ts-vue-template",
"version": "1.0.0",
"name": "@coscine/projectedit",
"version": "0.0.1",
"private": true,
"directories": {
"doc": "docs"
......@@ -12,30 +12,46 @@
"test:unit": "vue-cli-service test:unit"
},
"dependencies": {
"vue": "^2.6.6"
"@coscine/api-connection": "^1.6.0",
"@coscine/app-util": "^1.1.0",
"@coscine/project-creation": "^1.3.1",
"@itcenter-layout/bootstrap": "^1.5.5",
"@itcenter-layout/masterpage": "^1.2.9",
"@types/jquery": "^3.3.31",
"@types/vuelidate": "^0.7.10",
"@voerro/vue-tagsinput": "^2.1.0",
"bootstrap-vue": "^2.3.0",
"jquery": "^3.4.1",
"vue": "^2.6.11",
"vue-i18n": "^8.15.3",
"vue-material-design-icons": "^4.4.0",
"vue-runtime-helpers": "^1.1.2",
"vuejs-datepicker": "^1.6.2",
"vuelidate": "^0.7.5"
},
"devDependencies": {
"@semantic-release/commit-analyzer": "^6.1.0",
"@semantic-release/git": "^7.0.5",
"@semantic-release/gitlab": "^3.0.5",
"@semantic-release/npm": "^5.1.1",
"@semantic-release/release-notes-generator": "^7.1.4",
"@types/chai": "^4.1.0",
"@types/mocha": "^5.2.4",
"@vue/cli-plugin-babel": "^3.5.0",
"@vue/cli-plugin-typescript": "^3.5.0",
"@vue/cli-plugin-unit-mocha": "^3.5.0",
"@vue/cli-service": "^3.5.0",
"@vue/test-utils": "1.0.0-beta.29",
"chai": "^4.1.2",
"typescript": "^3.2.1",
"vue-template-compiler": "^2.5.21",
"semantic-release": "^15.12.0",
"semantic-release-gitlab": "^7.1.0"
"@babel/preset-env": "^7.8.3",
"@semantic-release/commit-analyzer": "^8.0.0",
"@semantic-release/git": "^9.0.0",
"@semantic-release/gitlab": "^6.0.0",
"@semantic-release/npm": "^7.0.0",
"@semantic-release/release-notes-generator": "^9.0.0",
"@types/chai": "^4.2.7",
"@types/mocha": "^5.2.7",
"@vue/cli-plugin-babel": "^4.1.2",
"@vue/cli-plugin-typescript": "^4.1.2",
"@vue/cli-plugin-unit-mocha": "^4.1.2",
"@vue/cli-service": "^4.1.2",
"@vue/test-utils": "1.0.0-beta.31",
"chai": "^4.2.0",
"semantic-release": "^17.0.1",
"@hutson/semantic-delivery-gitlab": "^9.0.8",
"typescript": "^3.7.5",
"vue-template-compiler": "^2.6.11"
},
"repository": {
"type": "git",
"url": "https://git.rwth-aachen.de/coscine/templates/vue-template.git"
"url": "https://git.rwth-aachen.de/coscine/app/projectedit.git"
},
"license": "ISC"
"license": "MIT"
}
......@@ -5,13 +5,18 @@
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width,initial-scale=1.0">
<link rel="icon" href="<%= BASE_URL %>favicon.ico">
<title>ts-template</title>
<title>Project Edit</title>
</head>
<body>
<noscript>
<strong>We're sorry but ts-template doesn't work properly without JavaScript enabled. Please enable it to continue.</strong>
<strong>We're sorry but project edit doesn't work properly without JavaScript enabled. Please enable it to continue.</strong>
</noscript>
<div id="app"></div>
<script>
var coscine = coscine || {};
coscine.authorization = coscine.authorization || {};
coscine.authorization.bearer = "";
</script>
<projectedit></projectedit>
<!-- built files will be auto injected -->
</body>
</html>
<template>
<div id="app">
<img alt="Vue logo" src="./assets/logo.png">
<HelloWorld msg="Welcome to Your Vue.js + TypeScript App"/>
<div id="projectedit" class="container">
<h4 style="text-align: left;">{{ $t('headline') }}:</h4>
<component
:is="currentComponent"
v-bind:projectId="selectedProjectId"
v-bind:languageLocale="language"
:saveHandler="saveHandler"
/>
</div>
</template>
<script lang="ts">
import Vue from 'vue';
import HelloWorld from './components/HelloWorld.vue';
import CreateProject from '@coscine/project-creation';
import { LanguageUtil } from '@coscine/app-util';
Vue.use(CreateProject);
function getProjectId() {
const baseUrl = (_spPageContextInfo as any).siteAbsoluteUrl;
const splitUrl = baseUrl.split('/');
const projectUri = splitUrl[splitUrl.length - 1];
return projectUri;
}
export default Vue.extend({
name: 'app',
components: {
HelloWorld,
name: 'projectedit',
data() {
return {
currentComponent: 'CreateProject',
selectedProjectId: getProjectId(),
language: LanguageUtil.getLanguage(),
savedProject: '',
};
},
methods: {
saveHandler(projectObj: { id: string }) {
this.savedProject = projectObj.id;
},
},
});
</script>
<style>
#app {
font-family: 'Avenir', Helvetica, Arial, sans-serif;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
text-align: center;
color: #2c3e50;
margin-top: 60px;
#project h4 {
color: #000;
font-family: "Avenir", Helvetica, Arial, sans-serif;
}
</style>
<template>
<div class="hello">
<h1>{{ msg }}</h1>
<p>
For a guide and recipes on how to configure / customize this project,<br>
check out the
<a href="https://cli.vuejs.org" target="_blank" rel="noopener">vue-cli documentation</a>.
</p>
<h3>Installed CLI Plugins</h3>
<ul>
<li><a href="https://github.com/vuejs/vue-cli/tree/dev/packages/%40vue/cli-plugin-babel" target="_blank" rel="noopener">babel</a></li>
<li><a href="https://github.com/vuejs/vue-cli/tree/dev/packages/%40vue/cli-plugin-typescript" target="_blank" rel="noopener">typescript</a></li>
<li><a href="https://github.com/vuejs/vue-cli/tree/dev/packages/%40vue/cli-plugin-unit-mocha" target="_blank" rel="noopener">unit-mocha</a></li>
</ul>
<h3>Essential Links</h3>
<ul>
<li><a href="https://vuejs.org" target="_blank" rel="noopener">Core Docs</a></li>
<li><a href="https://forum.vuejs.org" target="_blank" rel="noopener">Forum</a></li>
<li><a href="https://chat.vuejs.org" target="_blank" rel="noopener">Community Chat</a></li>
<li><a href="https://twitter.com/vuejs" target="_blank" rel="noopener">Twitter</a></li>
<li><a href="https://news.vuejs.org" target="_blank" rel="noopener">News</a></li>
</ul>
<h3>Ecosystem</h3>
<ul>
<li><a href="https://router.vuejs.org" target="_blank" rel="noopener">vue-router</a></li>
<li><a href="https://vuex.vuejs.org" target="_blank" rel="noopener">vuex</a></li>
<li><a href="https://github.com/vuejs/vue-devtools#vue-devtools" target="_blank" rel="noopener">vue-devtools</a></li>
<li><a href="https://vue-loader.vuejs.org" target="_blank" rel="noopener">vue-loader</a></li>
<li><a href="https://github.com/vuejs/awesome-vue" target="_blank" rel="noopener">awesome-vue</a></li>
</ul>
</div>
</template>
<script lang="ts">
import Vue from 'vue';
export default Vue.extend({
name: 'HelloWorld',
props: {
msg: String,
},
});
</script>
<!-- Add "scoped" attribute to limit CSS to this component only -->
<style scoped>
h3 {
margin: 40px 0 0;
}
ul {
list-style-type: none;
padding: 0;
}
li {
display: inline-block;
margin: 0 10px;
}
a {
color: #42b983;
}
</style>
declare var coscine: {
authorization: {
bearer: string,
}
};
declare var _spPageContextInfo: any;
declare module '@itcenter-layout/bootstrap'
\ No newline at end of file
export default {
headline: 'Projekt Editieren',
};
export default {
headline: 'Edit Project',
};
import de from './de';
import en from './en';
export default {
de,
en,
};
import jQuery from 'jquery';
import BootstrapVue from 'bootstrap-vue';
import '@itcenter-layout/bootstrap/dist/css/rwth-theme.css';
import '@itcenter-layout/bootstrap/dist/css/material-icons.css';
import '@itcenter-layout/masterpage/dist/css/itcenter-masterdesign-masterpage.css';
import Vue from 'vue';
import App from './App.vue';
import locales from './locale/locales';
import VueI18n from 'vue-i18n';
import { LanguageUtil } from '@coscine/app-util';
Vue.config.productionTip = false;
Vue.use(BootstrapVue);
Vue.use(VueI18n);
new Vue({
render: (h) => h(App),
}).$mount('#app');
jQuery(() => {
const i18n = new VueI18n({
locale: LanguageUtil.getLanguage(), // set locale
messages: locales, // set locale messages
silentFallbackWarn: true,
});
new Vue({
render: (h) => h(App),
i18n,
}).$mount('projectedit');
});
......@@ -2,3 +2,12 @@ declare module '*.vue' {
import Vue from 'vue';
export default Vue;
}
declare module '@coscine/api-connection';
declare module '@coscine/project-creation';
declare module '@coscine/app-util';
declare module "*.png" {
const value: any;
export default value;
}
\ No newline at end of file
import { expect } from 'chai';
import { shallowMount } from '@vue/test-utils';
import HelloWorld from '@/components/HelloWorld.vue';
describe('HelloWorld.vue', () => {
it('renders props.msg when passed', () => {
const msg = 'new message';
const wrapper = shallowMount(HelloWorld, {
propsData: { msg },
});
expect(wrapper.text()).to.include(msg);
});
});
module.exports = {
devServer: {
disableHostCheck: true,
},
publicPath: './',
configureWebpack: {
devtool: 'source-map',
devServer: {
port: 9272,
}
},
filenameHashing: false,
chainWebpack: config => {
config.optimization.delete('splitChunks')
},
css: {
extract: false,
},
}
\ No newline at end of file
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment