@fishawack/lab-velocity 2.0.0-beta.2 → 2.0.0-beta.21
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +439 -37
- package/_Build/vue/components/basic/Button.vue +1 -1
- package/_Build/vue/components/form/Select.vue +2 -2
- package/_Build/vue/components/form/Spinner.vue +5 -0
- package/_Build/vue/components/layout/Alert.vue +5 -5
- package/_Build/vue/{modules/AuthModule/components/VBreadcrumbs.vue → components/layout/Breadcrumbs.vue} +5 -4
- package/_Build/vue/{modules/AuthModule/components → components/layout}/Chips.vue +2 -2
- package/_Build/vue/components/layout/Footer.vue +11 -10
- package/_Build/vue/{modules/AuthModule/components/VFormFooter.vue → components/layout/FormFooter.vue} +13 -7
- package/_Build/vue/{modules/AuthModule/components → components/layout}/FormRole.vue +9 -7
- package/_Build/vue/components/layout/Layout.vue +76 -0
- package/_Build/vue/components/layout/Navigation.vue +77 -0
- package/_Build/vue/{modules/AuthModule/components/VPageHeader.vue → components/layout/PageHeader.vue} +7 -2
- package/_Build/vue/components/layout/SideBar.vue +26 -0
- package/_Build/vue/{modules/AuthModule/components/VTable.vue → components/layout/Table.vue} +19 -17
- package/_Build/vue/{modules/AuthModule/components/VTableSorter.vue → components/layout/TableSorter.vue} +35 -25
- package/_Build/vue/components/layout/pageTitle.vue +1 -1
- package/_Build/vue/components/navigation/MenuItem.vue +7 -2
- package/_Build/vue/components/navigation/MenuItemGroup.vue +7 -2
- package/_Build/vue/modules/AuthModule/js/axios.js +19 -0
- package/_Build/vue/modules/AuthModule/js/router.js +21 -89
- package/_Build/vue/modules/AuthModule/js/store.js +15 -6
- package/_Build/vue/modules/AuthModule/{adminRoutes/PCompanies/Children/partials → routes/PCompanies}/form.vue +32 -17
- package/_Build/vue/modules/AuthModule/routes/PCompanies/resource.js +168 -0
- package/_Build/vue/modules/AuthModule/{adminRoutes/PUsers/Children/partials → routes/PUsers}/form.vue +30 -18
- package/_Build/vue/modules/AuthModule/routes/PUsers/resource.js +202 -0
- package/_Build/vue/modules/AuthModule/routes/account-exists.vue +3 -3
- package/_Build/vue/modules/AuthModule/routes/change-password.vue +23 -24
- package/_Build/vue/modules/AuthModule/routes/container.vue +2 -11
- package/_Build/vue/modules/AuthModule/routes/expired-reset.vue +6 -6
- package/_Build/vue/modules/AuthModule/routes/expired-verification.vue +11 -10
- package/_Build/vue/modules/AuthModule/routes/force-reset.vue +24 -28
- package/_Build/vue/modules/AuthModule/routes/forgot.vue +6 -6
- package/_Build/vue/modules/AuthModule/routes/login.vue +9 -13
- package/_Build/vue/modules/AuthModule/routes/logincallback.vue +2 -4
- package/_Build/vue/modules/AuthModule/routes/loginsso.vue +9 -11
- package/_Build/vue/modules/AuthModule/routes/logout.vue +1 -3
- package/_Build/vue/modules/AuthModule/routes/logoutheadless.vue +1 -3
- package/_Build/vue/modules/AuthModule/routes/register.vue +19 -21
- package/_Build/vue/modules/AuthModule/routes/reset.vue +14 -13
- package/_Build/vue/modules/AuthModule/routes/success-forgot.vue +10 -9
- package/_Build/vue/modules/AuthModule/routes/success-reset.vue +3 -3
- package/_Build/vue/modules/AuthModule/routes/success-verify.vue +2 -4
- package/_Build/vue/modules/AuthModule/routes/verify.vue +13 -16
- package/_Build/vue/modules/resource/Children/create.vue +76 -0
- package/_Build/vue/modules/resource/Children/edit.vue +110 -0
- package/_Build/vue/modules/resource/Children/index.vue +47 -0
- package/_Build/vue/modules/resource/Children/partials/form.vue +57 -0
- package/_Build/vue/modules/resource/Children/show.vue +97 -0
- package/_Build/vue/modules/resource/index.js +280 -0
- package/_Build/vue/modules/resource/parent.vue +41 -0
- package/_base.scss +0 -1
- package/_defaults.scss +2 -13
- package/_variables.scss +9 -4
- package/components/_alert.scss +5 -0
- package/components/_auth.scss +163 -0
- package/components/_basic.scss +55 -0
- package/components/_breadcrumbs.scss +39 -0
- package/components/_button.scss +304 -0
- package/components/_cascader.scss +12 -0
- package/components/_checkbox.scss +41 -0
- package/components/_chip.scss +24 -0
- package/components/_collapse.scss +24 -0
- package/components/_datepicker.scss +52 -0
- package/components/_descriptions.scss +2 -0
- package/components/_footer.scss +47 -0
- package/components/_form.scss +24 -0
- package/components/_header.scss +30 -0
- package/components/_icon.scss +25 -0
- package/components/_inputNumber.scss +22 -0
- package/components/_layout.scss +56 -0
- package/components/_link.scss +44 -0
- package/components/_loader.scss +43 -0
- package/components/_menu.scss +112 -0
- package/components/_modal.scss +24 -0
- package/components/_pageTitle.scss +8 -0
- package/components/_permissionLegend.scss +18 -0
- package/components/_select.scss +29 -0
- package/components/_sidebar.scss +41 -0
- package/components/_switch.scss +14 -0
- package/components/_table.scss +20 -0
- package/components/_tooltip.scss +4 -0
- package/components/_typography.scss +162 -0
- package/components/_upload.scss +15 -0
- package/components/_wysiwyg.scss +7 -0
- package/components/_wysiwyg2.scss +142 -0
- package/index.js +7 -1
- package/package.json +4 -2
- package/vendor.scss +0 -1
- package/_Build/vue/components/layout/sideBar.vue +0 -25
- package/_Build/vue/modules/AuthModule/adminRoutes/PCompanies/Children/Upload/upload.vue +0 -251
- package/_Build/vue/modules/AuthModule/adminRoutes/PCompanies/Children/create.vue +0 -62
- package/_Build/vue/modules/AuthModule/adminRoutes/PCompanies/Children/edit.vue +0 -98
- package/_Build/vue/modules/AuthModule/adminRoutes/PCompanies/Children/index.vue +0 -90
- package/_Build/vue/modules/AuthModule/adminRoutes/PCompanies/Children/show.vue +0 -262
- package/_Build/vue/modules/AuthModule/adminRoutes/PCompanies/parent.vue +0 -36
- package/_Build/vue/modules/AuthModule/adminRoutes/PUsers/Children/create.vue +0 -112
- package/_Build/vue/modules/AuthModule/adminRoutes/PUsers/Children/edit.vue +0 -103
- package/_Build/vue/modules/AuthModule/adminRoutes/PUsers/Children/index.vue +0 -112
- package/_Build/vue/modules/AuthModule/adminRoutes/PUsers/Children/show.vue +0 -120
- package/_Build/vue/modules/AuthModule/adminRoutes/PUsers/parent.vue +0 -36
- /package/_Build/vue/{modules/AuthModule/components → components/layout}/AuthModal.vue +0 -0
- /package/_Build/vue/{modules/AuthModule/components → components/layout}/Chip.vue +0 -0
- /package/_Build/vue/{modules/AuthModule/components/VPasswordValidation.vue → components/layout/PasswordValidation.vue} +0 -0
- /package/_Build/vue/{modules/AuthModule/components/VRoleLegend.vue → components/layout/RoleLegend.vue} +0 -0
|
@@ -0,0 +1,162 @@
|
|
|
1
|
+
@import "@fishawack/lab-ui/_typography.scss";
|
|
2
|
+
/* Primary font
|
|
3
|
+
-------------------------------------------------- */
|
|
4
|
+
@font-face {
|
|
5
|
+
font-family: $primaryFont;
|
|
6
|
+
font-weight: 400;
|
|
7
|
+
font-style: normal;
|
|
8
|
+
|
|
9
|
+
src:
|
|
10
|
+
resolve($primaryFontRegular + ".woff2") format("woff2"),
|
|
11
|
+
resolve($primaryFontRegular + ".woff") format("woff");
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
@font-face {
|
|
15
|
+
font-family: $primaryFont;
|
|
16
|
+
font-weight: 100;
|
|
17
|
+
font-style: normal;
|
|
18
|
+
|
|
19
|
+
src:
|
|
20
|
+
resolve($primaryFontThin + ".woff2") format("woff2"),
|
|
21
|
+
resolve($primaryFontThin + ".woff") format("woff");
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
@font-face {
|
|
25
|
+
font-family: $primaryFont;
|
|
26
|
+
font-weight: 200;
|
|
27
|
+
font-style: normal;
|
|
28
|
+
|
|
29
|
+
src:
|
|
30
|
+
resolve($primaryFontExtraLight + ".woff2") format("woff2"),
|
|
31
|
+
resolve($primaryFontExtraLight + ".woff") format("woff");
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
@font-face {
|
|
35
|
+
font-family: $primaryFont;
|
|
36
|
+
font-weight: 300;
|
|
37
|
+
font-style: normal;
|
|
38
|
+
|
|
39
|
+
src:
|
|
40
|
+
resolve($primaryFontLight + ".woff2") format("woff2"),
|
|
41
|
+
resolve($primaryFontLight + ".woff") format("woff");
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
@font-face {
|
|
45
|
+
font-family: $primaryFont;
|
|
46
|
+
font-weight: 500;
|
|
47
|
+
font-style: normal;
|
|
48
|
+
|
|
49
|
+
src:
|
|
50
|
+
resolve($primaryFontMedium + ".woff2") format("woff2"),
|
|
51
|
+
resolve($primaryFontMedium + ".woff") format("woff");
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
@font-face {
|
|
55
|
+
font-family: $primaryFont;
|
|
56
|
+
font-weight: 600;
|
|
57
|
+
font-style: normal;
|
|
58
|
+
|
|
59
|
+
src:
|
|
60
|
+
resolve($primaryFontSemiBold + ".woff2") format("woff2"),
|
|
61
|
+
resolve($primaryFontSemiBold + ".woff") format("woff");
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
@font-face {
|
|
65
|
+
font-family: $primaryFont;
|
|
66
|
+
font-weight: 700;
|
|
67
|
+
font-style: normal;
|
|
68
|
+
|
|
69
|
+
src:
|
|
70
|
+
resolve($primaryFontBold + ".woff2") format("woff2"),
|
|
71
|
+
resolve($primaryFontBold + ".woff2") format("woff2");
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
@font-face {
|
|
75
|
+
font-family: $secondaryFont;
|
|
76
|
+
font-weight: 500;
|
|
77
|
+
font-style: normal;
|
|
78
|
+
|
|
79
|
+
src: resolve($secondaryFontMedium + ".ttf") format("truetype");
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
h1,
|
|
83
|
+
.h1 {
|
|
84
|
+
font-size: get-ratio(48px);
|
|
85
|
+
line-height: get-ratio(56px);
|
|
86
|
+
font-family: $primaryFont;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
h2,
|
|
90
|
+
.h2 {
|
|
91
|
+
font-size: get-ratio(36px);
|
|
92
|
+
line-height: get-ratio(48px);
|
|
93
|
+
font-family: $secondaryFont;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
h3,
|
|
97
|
+
.h3 {
|
|
98
|
+
font-size: get-ratio(32px);
|
|
99
|
+
line-height: get-ratio(42px);
|
|
100
|
+
font-family: $primaryFont;
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
h4,
|
|
104
|
+
.h4 {
|
|
105
|
+
font-size: get-ratio(24px);
|
|
106
|
+
line-height: get-ratio(32px);
|
|
107
|
+
font-family: $primaryFont;
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
h5,
|
|
111
|
+
.h5 {
|
|
112
|
+
font-size: get-ratio(20px);
|
|
113
|
+
line-height: get-ratio(24px);
|
|
114
|
+
font-weight: 700;
|
|
115
|
+
font-family: $primaryFont;
|
|
116
|
+
}
|
|
117
|
+
h1,
|
|
118
|
+
.h1,
|
|
119
|
+
h2,
|
|
120
|
+
.h2,
|
|
121
|
+
h3,
|
|
122
|
+
.h3,
|
|
123
|
+
h4,
|
|
124
|
+
.h4,
|
|
125
|
+
h5,
|
|
126
|
+
.h5 {
|
|
127
|
+
font-weight: 500;
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
// may be project specific
|
|
131
|
+
|
|
132
|
+
.font-secondary {
|
|
133
|
+
font-family: $secondaryFont;
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
.font-primary {
|
|
137
|
+
font-family: $primaryFont;
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
.text-10 {
|
|
141
|
+
font-size: get-ratio(10px);
|
|
142
|
+
line-height: get-ratio(16px);
|
|
143
|
+
}
|
|
144
|
+
.text-12 {
|
|
145
|
+
font-size: get-ratio(12px);
|
|
146
|
+
line-height: get-ratio(18px);
|
|
147
|
+
}
|
|
148
|
+
.text-14 {
|
|
149
|
+
font-size: get-ratio(14px);
|
|
150
|
+
line-height: get-ratio(20px);
|
|
151
|
+
}
|
|
152
|
+
.font-16 {
|
|
153
|
+
font-size: get-ratio(16px);
|
|
154
|
+
line-height: get-ratio(24px);
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
.text-60 {
|
|
158
|
+
font-size: get-ratio(60px);
|
|
159
|
+
line-height: get-ratio(68px);
|
|
160
|
+
font-weight: 500;
|
|
161
|
+
font-family: $primaryFont;
|
|
162
|
+
}
|
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
@import "element-plus/theme-chalk/el-dropdown";
|
|
2
|
+
@import "element-plus/theme-chalk/el-dropdown-item";
|
|
3
|
+
@import "element-plus/theme-chalk/el-dialog";
|
|
4
|
+
@import "./button.scss";
|
|
5
|
+
|
|
6
|
+
.vel-wysiwyg__controls {
|
|
7
|
+
background-color: $color0;
|
|
8
|
+
display: flex;
|
|
9
|
+
flex-grow: 1;
|
|
10
|
+
border: solid $color5 2px;
|
|
11
|
+
border-bottom: none;
|
|
12
|
+
// margin-bottom: .5 * $spacing;
|
|
13
|
+
font-size: get-ratio(14px);
|
|
14
|
+
padding: 0 0.5 * $spacing;
|
|
15
|
+
> * {
|
|
16
|
+
padding: 0.5 * $spacing;
|
|
17
|
+
padding-right: $spacing;
|
|
18
|
+
--el-font-size-base: get-ratio(14px);
|
|
19
|
+
&:not(:last-child) {
|
|
20
|
+
border-right: solid 1px $color5;
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
button {
|
|
25
|
+
// border: solid 1px $color1;
|
|
26
|
+
background-color: transparent;
|
|
27
|
+
cursor: pointer;
|
|
28
|
+
min-width: 28px;
|
|
29
|
+
padding: 3px 5px;
|
|
30
|
+
line-height: 1;
|
|
31
|
+
border: none;
|
|
32
|
+
&.is-active,
|
|
33
|
+
&:hover {
|
|
34
|
+
background-color: $color5;
|
|
35
|
+
}
|
|
36
|
+
svg {
|
|
37
|
+
height: 90%;
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
.el-dropdown {
|
|
41
|
+
line-height: 1.15;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
.ql-stroke {
|
|
45
|
+
fill: none;
|
|
46
|
+
stroke: #444;
|
|
47
|
+
stroke-linecap: round;
|
|
48
|
+
stroke-linejoin: round;
|
|
49
|
+
stroke-width: 2;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
.ql-stroke-miter {
|
|
53
|
+
fill: none;
|
|
54
|
+
stroke: #444;
|
|
55
|
+
stroke-miterlimit: 10;
|
|
56
|
+
stroke-width: 2;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
.ql-fill,
|
|
60
|
+
.ql-stroke.ql-fill {
|
|
61
|
+
fill: #444;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
.ql-empty {
|
|
65
|
+
fill: none;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
.ql-even {
|
|
69
|
+
fill-rule: evenodd;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
.ql-thin,
|
|
73
|
+
.ql-stroke.ql-thin {
|
|
74
|
+
stroke-width: 1;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
.ql-transparent {
|
|
78
|
+
opacity: 0.4;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
~ div {
|
|
82
|
+
// margin-top: $spacing;
|
|
83
|
+
border: solid $color5 2px;
|
|
84
|
+
background-color: $color0;
|
|
85
|
+
> div {
|
|
86
|
+
padding: 2 * $spacing;
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
.vel-wysiwyg__button {
|
|
91
|
+
// border: solid 1px $color1;
|
|
92
|
+
background-color: transparent;
|
|
93
|
+
// cursor: pointer;
|
|
94
|
+
|
|
95
|
+
&.is-active,
|
|
96
|
+
&:hover {
|
|
97
|
+
background-color: $color5;
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
.vel-wysiwyg {
|
|
102
|
+
// border: solid $color1 1px;
|
|
103
|
+
// padding: $spacing * 1.5;
|
|
104
|
+
|
|
105
|
+
table,
|
|
106
|
+
td,
|
|
107
|
+
th {
|
|
108
|
+
border: solid 0.5px $color1;
|
|
109
|
+
}
|
|
110
|
+
th {
|
|
111
|
+
background-color: $color5;
|
|
112
|
+
}
|
|
113
|
+
hr {
|
|
114
|
+
height: 1px;
|
|
115
|
+
background-color: $color1;
|
|
116
|
+
}
|
|
117
|
+
a {
|
|
118
|
+
text-decoration: underline;
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
.lab-table,
|
|
123
|
+
.lab-table-cell,
|
|
124
|
+
.lab-table-header {
|
|
125
|
+
border: solid 0.5px $color1;
|
|
126
|
+
}
|
|
127
|
+
.lab-table-header {
|
|
128
|
+
background-color: $color5;
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
.lab-table {
|
|
132
|
+
a {
|
|
133
|
+
text-decoration: underline;
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
.lab-table-cell {
|
|
137
|
+
&:active,
|
|
138
|
+
&:focus-within,
|
|
139
|
+
&.selectedCell {
|
|
140
|
+
background-color: transparentize($color: $color5, $amount: 0.8);
|
|
141
|
+
}
|
|
142
|
+
}
|
package/index.js
CHANGED
|
@@ -8,6 +8,8 @@ export const Auth = {
|
|
|
8
8
|
Store,
|
|
9
9
|
};
|
|
10
10
|
|
|
11
|
+
export { default as Resource } from "./_Build/vue/modules/resource/index.js";
|
|
12
|
+
|
|
11
13
|
export { default as Button } from "./_Build/vue/components/basic/Button.vue";
|
|
12
14
|
export { default as Link } from "./_Build/vue/components/basic/link.vue";
|
|
13
15
|
|
|
@@ -24,9 +26,13 @@ export { default as Wysiwyg2 } from "./_Build/vue/components/form/Wysiwyg2.vue";
|
|
|
24
26
|
export { default as Upload } from "./_Build/vue/components/form/Upload.vue";
|
|
25
27
|
export { default as InputNumber } from "./_Build/vue/components/form/InputNumber.vue";
|
|
26
28
|
|
|
27
|
-
export { default as
|
|
29
|
+
export { default as Chip } from "./_Build/vue/components/layout/Chip.vue";
|
|
30
|
+
export { default as Chips } from "./_Build/vue/components/layout/Chips.vue";
|
|
31
|
+
export { default as SideBar } from "./_Build/vue/components/layout/SideBar.vue";
|
|
28
32
|
export { default as Footer } from "./_Build/vue/components/layout/Footer.vue";
|
|
29
33
|
export { default as Header } from "./_Build/vue/components/layout/Header.vue";
|
|
34
|
+
export { default as Layout } from "./_Build/vue/components/layout/Layout.vue";
|
|
35
|
+
export { default as Navigation } from "./_Build/vue/components/layout/Navigation.vue";
|
|
30
36
|
export { default as PageTitle } from "./_Build/vue/components/layout/pageTitle.vue";
|
|
31
37
|
export { default as Alert } from "./_Build/vue/components/layout/Alert.vue";
|
|
32
38
|
export { default as Tooltip } from "./_Build/vue/components/layout/Tooltip.vue";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fishawack/lab-velocity",
|
|
3
|
-
"version": "2.0.0-beta.
|
|
3
|
+
"version": "2.0.0-beta.21",
|
|
4
4
|
"description": "Avalere Health branded style system",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"setup": "npm ci || npm i && npm run content",
|
|
@@ -62,8 +62,10 @@
|
|
|
62
62
|
},
|
|
63
63
|
"files": [
|
|
64
64
|
"*.scss",
|
|
65
|
+
"components",
|
|
65
66
|
"_Build/vue/components",
|
|
66
|
-
"_Build/vue/modules/AuthModule"
|
|
67
|
+
"_Build/vue/modules/AuthModule",
|
|
68
|
+
"_Build/vue/modules/resource"
|
|
67
69
|
],
|
|
68
70
|
"main": "index.js",
|
|
69
71
|
"release": {
|
package/vendor.scss
CHANGED
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<div class="vel-side-bar" :class="{ active: active }">
|
|
3
|
-
<div>
|
|
4
|
-
<slot name="navigation" />
|
|
5
|
-
</div>
|
|
6
|
-
|
|
7
|
-
<div class="vel-side-bar__bottom">
|
|
8
|
-
<button class="vel-side-bar__button" @click="active = !active">
|
|
9
|
-
<slot name="expand"> > </slot>
|
|
10
|
-
</button>
|
|
11
|
-
</div>
|
|
12
|
-
</div>
|
|
13
|
-
</template>
|
|
14
|
-
|
|
15
|
-
<script>
|
|
16
|
-
export default {
|
|
17
|
-
name: "SideBar",
|
|
18
|
-
|
|
19
|
-
data() {
|
|
20
|
-
return {
|
|
21
|
-
active: true,
|
|
22
|
-
};
|
|
23
|
-
},
|
|
24
|
-
};
|
|
25
|
-
</script>
|
|
@@ -1,251 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<VBreadcrumbs :items="breadcrumbs" class="mb-8" container-classes="m-0" />
|
|
3
|
-
|
|
4
|
-
<div class="container px-6 tablet:px-4 mobile:px-2 mb-8 ml-0 mr-0">
|
|
5
|
-
<div class="grid__1/2">
|
|
6
|
-
<div class="grid__1/1 grid justify-between mb-4 items-end">
|
|
7
|
-
<h2 class="h1">User import</h2>
|
|
8
|
-
<div>
|
|
9
|
-
<el-button
|
|
10
|
-
tag="a"
|
|
11
|
-
type="secondary"
|
|
12
|
-
href="/media/content/files/example.csv"
|
|
13
|
-
download
|
|
14
|
-
>
|
|
15
|
-
<GIcon
|
|
16
|
-
class="fill-1 mr-0.5"
|
|
17
|
-
name="icon-download"
|
|
18
|
-
embed
|
|
19
|
-
artboard
|
|
20
|
-
/>
|
|
21
|
-
Download example file
|
|
22
|
-
</el-button>
|
|
23
|
-
</div>
|
|
24
|
-
</div>
|
|
25
|
-
<div class="grid__1/1">
|
|
26
|
-
<el-select
|
|
27
|
-
v-model="form.roles"
|
|
28
|
-
placeholder="Select"
|
|
29
|
-
multiple
|
|
30
|
-
name="roles"
|
|
31
|
-
:error="form.errors"
|
|
32
|
-
label="Roles"
|
|
33
|
-
:options="[
|
|
34
|
-
{
|
|
35
|
-
label: 'Administrator',
|
|
36
|
-
value: '1',
|
|
37
|
-
},
|
|
38
|
-
{
|
|
39
|
-
label: 'Subscriber',
|
|
40
|
-
value: '2',
|
|
41
|
-
},
|
|
42
|
-
]"
|
|
43
|
-
/>
|
|
44
|
-
|
|
45
|
-
<el-select
|
|
46
|
-
v-if="form.roles && form.roles.length"
|
|
47
|
-
v-model="form.permissions"
|
|
48
|
-
placeholder="Select"
|
|
49
|
-
multiple
|
|
50
|
-
name="permissions"
|
|
51
|
-
:error="form.errors"
|
|
52
|
-
label="Permissions"
|
|
53
|
-
:options="[
|
|
54
|
-
{
|
|
55
|
-
label: `Inherit Permissions`,
|
|
56
|
-
value: null,
|
|
57
|
-
},
|
|
58
|
-
//{ // temporarily disabled as not used yet
|
|
59
|
-
// label: "Approve Content",
|
|
60
|
-
// value: "2"
|
|
61
|
-
//},
|
|
62
|
-
{
|
|
63
|
-
label: 'View content',
|
|
64
|
-
value: '3',
|
|
65
|
-
},
|
|
66
|
-
{
|
|
67
|
-
label: 'Write content',
|
|
68
|
-
value: '4',
|
|
69
|
-
disabled: !form.roles.includes(1),
|
|
70
|
-
},
|
|
71
|
-
{
|
|
72
|
-
label: 'Delete content',
|
|
73
|
-
value: '5',
|
|
74
|
-
disabled: !form.roles.includes(1),
|
|
75
|
-
},
|
|
76
|
-
]"
|
|
77
|
-
/>
|
|
78
|
-
</div>
|
|
79
|
-
<div class="grid__1/1">
|
|
80
|
-
<hr class="my-3 hr-muted" />
|
|
81
|
-
|
|
82
|
-
<el-upload
|
|
83
|
-
ref="upload"
|
|
84
|
-
v-model="form.files"
|
|
85
|
-
name="files"
|
|
86
|
-
label="Upload spreadsheet"
|
|
87
|
-
:auto-upload="false"
|
|
88
|
-
:limit="1"
|
|
89
|
-
:on-exceed="handleExceed"
|
|
90
|
-
>
|
|
91
|
-
<template #trigger>
|
|
92
|
-
<el-button
|
|
93
|
-
class="mt"
|
|
94
|
-
type="primary"
|
|
95
|
-
:disabled="form.processing || form.files.length"
|
|
96
|
-
>Select file</el-button
|
|
97
|
-
>
|
|
98
|
-
</template>
|
|
99
|
-
|
|
100
|
-
<el-button
|
|
101
|
-
class="ml relative button--spinner"
|
|
102
|
-
type="success"
|
|
103
|
-
:disabled="form.processing || !form.files.length"
|
|
104
|
-
@click="submitUpload"
|
|
105
|
-
>
|
|
106
|
-
<span :class="{ active: !form.processing }"
|
|
107
|
-
>Upload</span
|
|
108
|
-
>
|
|
109
|
-
<GSpinner :class="{ active: form.processing }" />
|
|
110
|
-
</el-button>
|
|
111
|
-
|
|
112
|
-
<small class="block my color-muted"
|
|
113
|
-
>Upload one spreadsheet with a size less than
|
|
114
|
-
50MB</small
|
|
115
|
-
>
|
|
116
|
-
</el-upload>
|
|
117
|
-
</div>
|
|
118
|
-
</div>
|
|
119
|
-
</div>
|
|
120
|
-
</template>
|
|
121
|
-
|
|
122
|
-
<script>
|
|
123
|
-
"use strict";
|
|
124
|
-
|
|
125
|
-
import Form from "form-backend-validation";
|
|
126
|
-
import { ElMessageBox, genFileId } from "element-plus";
|
|
127
|
-
|
|
128
|
-
export default {
|
|
129
|
-
name: "Create",
|
|
130
|
-
|
|
131
|
-
components: {
|
|
132
|
-
VBreadcrumbs: require("../../../../components/VBreadcrumbs.vue")
|
|
133
|
-
.default,
|
|
134
|
-
},
|
|
135
|
-
|
|
136
|
-
data() {
|
|
137
|
-
return {
|
|
138
|
-
id: null,
|
|
139
|
-
breadcrumbs: [
|
|
140
|
-
{
|
|
141
|
-
href: {
|
|
142
|
-
name: "index",
|
|
143
|
-
},
|
|
144
|
-
text: "Home",
|
|
145
|
-
},
|
|
146
|
-
],
|
|
147
|
-
form: new Form(
|
|
148
|
-
{
|
|
149
|
-
step: 0,
|
|
150
|
-
files: [],
|
|
151
|
-
roles: [2],
|
|
152
|
-
permissions: [null],
|
|
153
|
-
company_id: null,
|
|
154
|
-
},
|
|
155
|
-
{
|
|
156
|
-
http: window.axios,
|
|
157
|
-
},
|
|
158
|
-
),
|
|
159
|
-
};
|
|
160
|
-
},
|
|
161
|
-
|
|
162
|
-
watch: {
|
|
163
|
-
"form.roles": {
|
|
164
|
-
handler(newVal) {
|
|
165
|
-
const subscriptions = [
|
|
166
|
-
3, // view content
|
|
167
|
-
4, // write content
|
|
168
|
-
5, // delete content
|
|
169
|
-
];
|
|
170
|
-
|
|
171
|
-
if (!newVal.includes(1)) {
|
|
172
|
-
this.form.permissions = this.form.permissions.filter(
|
|
173
|
-
(item) => subscriptions.includes(item),
|
|
174
|
-
);
|
|
175
|
-
|
|
176
|
-
if (!newVal.includes(2)) {
|
|
177
|
-
this.form.permissions = this.form.permissions.filter(
|
|
178
|
-
(item) => !subscriptions.includes(item),
|
|
179
|
-
);
|
|
180
|
-
}
|
|
181
|
-
}
|
|
182
|
-
},
|
|
183
|
-
},
|
|
184
|
-
},
|
|
185
|
-
|
|
186
|
-
async mounted() {
|
|
187
|
-
this.id = this.$route.params.id;
|
|
188
|
-
this.form.company_id = this.id;
|
|
189
|
-
window.axios.get(`/api/companies/${this.id}`).then((res) => {
|
|
190
|
-
const company = res.data.data;
|
|
191
|
-
this.breadcrumbs.push(
|
|
192
|
-
{
|
|
193
|
-
href: {
|
|
194
|
-
name: "companies.show",
|
|
195
|
-
param: this.id,
|
|
196
|
-
},
|
|
197
|
-
text: company.name,
|
|
198
|
-
},
|
|
199
|
-
{
|
|
200
|
-
href: {
|
|
201
|
-
name: "companies.pload",
|
|
202
|
-
},
|
|
203
|
-
text: "User upload",
|
|
204
|
-
},
|
|
205
|
-
);
|
|
206
|
-
});
|
|
207
|
-
},
|
|
208
|
-
|
|
209
|
-
methods: {
|
|
210
|
-
submitUpload() {
|
|
211
|
-
this.form.post(`/api/users/import`).then(({ data }) => {
|
|
212
|
-
this.open(data);
|
|
213
|
-
});
|
|
214
|
-
},
|
|
215
|
-
|
|
216
|
-
handleExceed(files) {
|
|
217
|
-
this.$refs.upload.clearFiles();
|
|
218
|
-
|
|
219
|
-
const file = files[0];
|
|
220
|
-
file.uid = genFileId();
|
|
221
|
-
|
|
222
|
-
this.$refs.upload.handleStart(file);
|
|
223
|
-
},
|
|
224
|
-
|
|
225
|
-
open(data) {
|
|
226
|
-
let html = "Succesfully imported all users";
|
|
227
|
-
|
|
228
|
-
if (data.length > 0) {
|
|
229
|
-
html =
|
|
230
|
-
"Errors detected on upload following emails were not added to the system<table>";
|
|
231
|
-
for (let x = 0; x < data.length; x++) {
|
|
232
|
-
html += `<tr><td>${data[x].email}</td></tr>`;
|
|
233
|
-
}
|
|
234
|
-
html += "</table>";
|
|
235
|
-
}
|
|
236
|
-
|
|
237
|
-
ElMessageBox.alert(html, {
|
|
238
|
-
confirmButtonText: "Ok",
|
|
239
|
-
dangerouslyUseHTMLString: true,
|
|
240
|
-
})
|
|
241
|
-
.then(() => {
|
|
242
|
-
this.$router.replace({
|
|
243
|
-
name: "companies.show",
|
|
244
|
-
params: { id: this.id },
|
|
245
|
-
});
|
|
246
|
-
})
|
|
247
|
-
.catch(() => {});
|
|
248
|
-
},
|
|
249
|
-
},
|
|
250
|
-
};
|
|
251
|
-
</script>
|