clean tests & other things

This commit is contained in:
2020-03-25 20:11:29 +01:00
parent 11511039e9
commit 7e5d022aa2
27 changed files with 1497 additions and 187 deletions

63
public/css/app.css vendored
View File

@@ -1,4 +1,4 @@
@import url(https://fonts.googleapis.com/css?family=Nunito);@import url(https://fonts.googleapis.com/css?family=Open+Sans);body {
@import url(https://fonts.googleapis.com/css?family=Open+Sans);body {
margin: 0;
}
@@ -68,6 +68,7 @@ body {
.flex-center {
display: flex;
justify-content: center;
align-items: center;
}
.flex-end {
@@ -435,21 +436,26 @@ body {
}
.btn,
.btn-alert,
.btn-secondary,
.btn-primary {
font-size: 1.6rem;
border: 1px solid transparent;
padding: 0.5rem;
padding: 0.5rem 1rem;
border-radius: 0.5rem;
cursor: pointer;
box-shadow: 1px 1px 2px grey;
text-decoration: none;
transition: background-color 0.2s, color 0.2s;
}
.btn:hover,
.btn-alert:hover,
.btn-secondary:hover,
.btn-primary:hover {
transition: background-color 0.2s, color 0.2s;
background-color: #1F6521;
color: #ffffff;
}
.btn-primary {
@@ -458,35 +464,43 @@ body {
color: #ffffff;
}
.btn-primary:hover {
background-color: #1F2605;
color: #D6CE15;
.btn-primary:visited,
.btn-primary:focus {
color: #ffffff;
}
.btn-secondary {
background-color: #A4A71E;
border-color: #53900F;
border-color: #A4A71E;
color: #1F2605;
}
.btn-secondary:hover {
.btn-alert {
background-color: red;
border-color: red;
color: #ffffff;
}
.btn-alert:hover {
background-color: #1F2605;
color: #D6CE15;
}
label {
display: block;
}
textarea,
input {
width: 100%;
border: 1px solid #D6CE15;
background-color: #eeeeee;
font-size: 1.6rem;
font-family: "Open Sans", sans-serif;
padding: 0.5rem;
border-radius: 0.5rem;
}
textarea:focus,
input:focus {
background-color: #ffffff;
border-color: #1F2605;
@@ -496,6 +510,15 @@ input[type=checkbox] {
width: unset;
}
a {
color: #1F6521;
}
a:focus,
a:visited {
color: #1F2605;
}
body {
overflow: hidden;
height: 100vh;
@@ -603,3 +626,27 @@ aside {
font-weight: bold;
}
.memo-list h1 {
font-size: 2.2rem;
}
.memo-list a {
text-decoration: none;
}
.memo-list:nth-child(even) {
background-color: #D6CE15;
}
.memo-list:hover {
background-color: #A4A71E;
}
.memo-list:hover .memo-date {
opacity: 1;
}
.memo-date {
opacity: 0.6;
}

257
public/js/app.js vendored
View File

@@ -1912,9 +1912,25 @@ __webpack_require__.r(__webpack_exports__);
//
//
//
//
//
//
//
//
/* harmony default export */ __webpack_exports__["default"] = ({
name: "AlertBox",
props: ['type', 'message']
props: {
type: {
type: String,
required: true,
"default": 'success'
},
message: {
type: String,
required: true,
"default": 'message'
}
}
});
/***/ }),
@@ -2247,6 +2263,7 @@ __webpack_require__.r(__webpack_exports__);
//
//
//
//
/* harmony default export */ __webpack_exports__["default"] = ({
name: "CssTesteur"
});
@@ -2535,12 +2552,55 @@ __webpack_require__.r(__webpack_exports__);
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
// import TagBox from "../Tag/TagBox";
var MarkdownIt = __webpack_require__(/*! markdown-it */ "./node_modules/markdown-it/index.js"),
md = new MarkdownIt();
/* harmony default export */ __webpack_exports__["default"] = ({
name: "MemoShow",
name: 'MemoShow',
components: {// TagBox
},
data: function data() {
@@ -2555,30 +2615,30 @@ var MarkdownIt = __webpack_require__(/*! markdown-it */ "./node_modules/markdown
return md.render(this.memo.memo);
}
},
methods: {
destroy: function destroy() {
var _this = this;
axios["delete"]('/api/memos/' + this.$route.params.id).then(function (response) {
_this.$router.push('/memos');
})["catch"](function (error) {
alert('Internal Error, Unable to delete contact.');
});
}
},
mounted: function mounted() {
var _this2 = this;
var _this = this;
axios.get('/api/memos/' + this.$route.params.id).then(function (response) {
_this2.memo = response.data.data;
_this2.loading = false;
})["catch"](function (error) {
_this2.loading = false;
_this.memo = response.data.data;
_this.loading = false;
})["catch"](function (errorRes) {
_this.loading = false;
if (error.response.status === 404) {
_this2.$router.push('/memos');
if (errorRes.response.status === 404) {
_this.$router.push('/memos');
}
});
},
methods: {
destroy: function destroy() {
var _this2 = this;
axios["delete"]('/api/memos/' + this.$route.params.id).then(function (response) {
_this2.$router.push('/memos');
})["catch"](function (errorRes) {
alert('Internal Error, Unable to delete contact.' + errorRes);
});
}
}
});
@@ -2627,12 +2687,43 @@ function _defineProperty(obj, key, value) { if (key in obj) { Object.definePrope
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
/* harmony default export */ __webpack_exports__["default"] = ({
name: "UserAdmin",
name: 'UserAdmin',
components: {
Avatar: _components_Avatar__WEBPACK_IMPORTED_MODULE_1__["default"],
AlertBox: _components_AlertBox__WEBPACK_IMPORTED_MODULE_2__["default"],
@@ -2646,15 +2737,28 @@ function _defineProperty(obj, key, value) { if (key in obj) { Object.definePrope
},
alertType: '',
alertMessage: '',
errors: null
errors: null,
loading: '',
users: null
};
},
computed: _objectSpread({}, Object(vuex__WEBPACK_IMPORTED_MODULE_0__["mapGetters"])({
authUser: 'authUser'
})),
mounted: function mounted() {
var _this = this;
axios.get('/api/users').then(function (response) {
_this.users = response.data.data;
_this.loading = false;
})["catch"](function (error) {
_this.loading = false;
alert('Unable to fetch users.');
});
},
methods: {
addMember: function addMember() {
var _this = this;
var _this2 = this;
console.log('addMember');
@@ -2664,18 +2768,18 @@ function _defineProperty(obj, key, value) { if (key in obj) { Object.definePrope
email: this.form.email
}).then(function (res) {
console.log(res);
_this.form.name = '';
_this.form.email = '';
_this.alertType = 'success';
_this.alertMessage = "".concat(res.data.data.attributes.name, " a bien \xE9t\xE9 cr\xE9\xE9");
_this2.form.name = '';
_this2.form.email = '';
_this2.alertType = 'success';
_this2.alertMessage = "".concat(res.data.data.attributes.name, " a bien \xE9t\xE9 cr\xE9\xE9");
})["catch"](function (errors) {
console.log(errors);
_this.alertType = 'error';
_this.alertMessage = "L'utilisateur n'a pas \xE9t\xE9 cr\xE9\xE9";
_this2.alertType = 'error';
_this2.alertMessage = 'L\'utilisateur n\'a pas été créé';
});
} else {
this.alertType = 'error';
this.alertMessage = "Le formulaire n'est pas correctement renseign\xE9.";
this.alertMessage = 'Le formulaire n\'est pas correctement renseigné.';
}
}
}
@@ -2707,7 +2811,7 @@ function _defineProperty(obj, key, value) { if (key in obj) { Object.definePrope
//
/* harmony default export */ __webpack_exports__["default"] = ({
name: "Profil",
name: 'Profil',
computed: _objectSpread({}, Object(vuex__WEBPACK_IMPORTED_MODULE_0__["mapGetters"])({
authUser: 'authUser'
}))
@@ -29114,7 +29218,7 @@ var render = function() {
var _h = _vm.$createElement
var _c = _vm._self._c || _h
return _c("div", { staticClass: "p-1", class: "alert-" + _vm.type }, [
_vm._v(_vm._s(_vm.message))
_vm._v("\n " + _vm._s(_vm.message) + "\n")
])
}
var staticRenderFns = []
@@ -29662,15 +29766,18 @@ var staticRenderFns = [
var _h = _vm.$createElement
var _c = _vm._self._c || _h
return _c("form", [
_c("label", [_vm._v("Test label")]),
_c("label", { staticClass: "mb-1" }, [_vm._v("Test label")]),
_vm._v(" "),
_c("input", { attrs: { type: "text", placeholder: "Test placeholder" } }),
_c("input", {
staticClass: "mb-1",
attrs: { type: "text", placeholder: "Test placeholder" }
}),
_vm._v(" "),
_c("input", { attrs: { type: "number" } }),
_c("input", { staticClass: "mb-1", attrs: { type: "number" } }),
_vm._v(" "),
_c("input", { attrs: { type: "checkbox" } }),
_c("input", { staticClass: "mb-1", attrs: { type: "checkbox" } }),
_vm._v(" "),
_c("select", [
_c("select", { staticClass: "mb-1" }, [
_c("option", [_vm._v("test 1")]),
_vm._v(" "),
_c("option", [_vm._v("test 2")]),
@@ -29678,7 +29785,13 @@ var staticRenderFns = [
_c("option", [_vm._v("test 3")])
]),
_vm._v(" "),
_c("input", { attrs: { type: "submit" } })
_c(
"textarea",
{ staticClass: "mb-1", attrs: { cols: "30", rows: "10" } },
[_vm._v("Texte exemple")]
),
_vm._v(" "),
_c("input", { staticClass: "mb-1", attrs: { type: "submit" } })
])
}
]
@@ -29961,7 +30074,7 @@ var render = function() {
var _vm = this
var _h = _vm.$createElement
var _c = _vm._self._c || _h
return _c("div", [
return _c("div", { staticClass: "p-2" }, [
_c(
"div",
{ staticClass: "flex-between flex-center mb-1" },
@@ -29969,7 +30082,6 @@ var render = function() {
_c(
"a",
{
staticClass: "link",
attrs: { href: "#" },
on: {
click: function($event) {
@@ -30012,11 +30124,12 @@ var render = function() {
_vm._l(_vm.memos, function(memo) {
return _c(
"div",
{ staticClass: "memo-list" },
[
_c(
"router-link",
{
staticClass: "link-large relative flex-center p-2",
staticClass: "relative flex-center flex-between p-1",
attrs: { to: "/memos/" + memo.data.memo_id }
},
[
@@ -30058,11 +30171,11 @@ var render = function() {
var _vm = this
var _h = _vm.$createElement
var _c = _vm._self._c || _h
return _c("div", [
return _c("div", { staticClass: "p-2" }, [
_vm.loading
? _c("div", [_vm._v("> Loading...")])
? _c("div", [_vm._v("\n > Loading...\n ")])
: _c("div", [
_c("div", { staticClass: "flex-between mb-2" }, [
_c("div", { staticClass: "flex-between flex-center mb-1" }, [
_c(
"a",
{
@@ -30074,7 +30187,7 @@ var render = function() {
}
}
},
[_vm._v("\n < Back\n ")]
[_vm._v("< Back")]
),
_vm._v(" "),
_c(
@@ -30084,10 +30197,10 @@ var render = function() {
_c(
"router-link",
{
staticClass: "btn-success mr-1",
staticClass: "btn-secondary mr-1",
attrs: { to: "/memos/" + _vm.memo.memo_id + "/edit" }
},
[_vm._v("Edit")]
[_vm._v("\n Edit\n ")]
),
_vm._v(" "),
_c(
@@ -30101,7 +30214,7 @@ var render = function() {
}
}
},
[_vm._v("Delete")]
[_vm._v("\n Delete\n ")]
),
_vm._v(" "),
_vm.modal
@@ -30121,7 +30234,7 @@ var render = function() {
}
}
},
[_vm._v("Cancel")]
[_vm._v("\n Cancel\n ")]
),
_vm._v(" "),
_c(
@@ -30130,7 +30243,7 @@ var render = function() {
staticClass: "btn-alert-strong",
on: { click: _vm.destroy }
},
[_vm._v("Delete")]
[_vm._v("\n Delete\n ")]
)
])
])
@@ -30151,10 +30264,12 @@ var render = function() {
: _vm._e()
]),
_vm._v(" "),
_c("p", { staticClass: "title-section pt-3" }, [_vm._v("Memo")]),
_c("p", { staticClass: "title-section pt-3" }, [
_vm._v("\n Memo\n ")
]),
_vm._v(" "),
_c("h1", { staticClass: "memo-title" }, [
_vm._v(_vm._s(_vm.memo.name))
_vm._v("\n " + _vm._s(_vm.memo.name) + "\n ")
]),
_vm._v(" "),
_c("p", {
@@ -30163,7 +30278,11 @@ var render = function() {
}),
_vm._v(" "),
_c("div", { staticClass: "memo-change my-2 p-1" }, [
_vm._v("@last update : " + _vm._s(_vm.memo.last_updated))
_vm._v(
"\n @last update : " +
_vm._s(_vm.memo.last_updated) +
"\n "
)
])
])
])
@@ -30222,7 +30341,9 @@ var render = function() {
? _c(
"div",
[
_c("h2", { staticClass: "mb-1" }, [_vm._v("Ajouter un membre")]),
_c("h2", { staticClass: "mb-1" }, [
_vm._v("\n Ajouter un membre\n ")
]),
_vm._v(" "),
_vm.alertType
? _c("AlertBox", {
@@ -30279,7 +30400,33 @@ var render = function() {
],
1
)
: _vm._e()
: _vm._e(),
_vm._v(" "),
_c("div", [
_c("h2", [_vm._v("Liste des utilisateurs")]),
_vm._v(" "),
_c(
"ul",
[
_vm.loading
? _c("li", [_vm._v("> Loading...")])
: _vm._l(_vm.users, function(user) {
return _c("li", [
_c("a", { attrs: { href: user.links.self } }, [
_vm._v(_vm._s(user.data.attributes.name))
]),
_vm._v(
" - " +
_vm._s(user.data.attributes.email) +
" - " +
_vm._s(user.data.attributes.is_admin)
)
])
})
],
2
)
])
])
}
var staticRenderFns = []

View File

@@ -0,0 +1,22 @@
/*!
* Vue.js v2.6.11
* (c) 2014-2019 Evan You
* Released under the MIT License.
*/
/*! https://mths.be/punycode v1.4.1 by @mathias */
/**
* @license
* Lodash <https://lodash.com/>
* Copyright OpenJS Foundation and other contributors <https://openjsf.org/>
* Released under MIT license <https://lodash.com/license>
* Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
* Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
*/
/**
* vuex v3.1.3
* (c) 2020 Evan You
* @license MIT
*/