@enso-ui/monitored-emails 1.0.0 → 1.1.0

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@enso-ui/monitored-emails",
3
- "version": "1.0.0",
3
+ "version": "1.1.0",
4
4
  "description": "Frontend package for monitoring emails",
5
5
  "main": "src/bulma/pages/userGroups/Index.vue",
6
6
  "scripts": {
@@ -39,4 +39,4 @@
39
39
  "eslint-import-resolver-alias": "^1.1.2",
40
40
  "eslint-plugin-vue": "^8.0.3"
41
41
  }
42
- }
42
+ }
@@ -6,14 +6,8 @@
6
6
  </div>
7
7
  </template>
8
8
 
9
- <script>
9
+ <script setup>
10
10
  import { EnsoForm } from '@enso-ui/forms/bulma';
11
-
12
- export default {
13
- name: 'Create',
14
-
15
- components: { EnsoForm },
16
- };
17
11
  </script>
18
12
 
19
13
  <style lang="scss">
@@ -1,19 +1,55 @@
1
1
  <template>
2
2
  <div class="columns is-centered">
3
3
  <div class="column is-three-quarters-desktop is-full-touch">
4
- <enso-form class="box form-box has-background-light raises-on-hover"/>
4
+ <enso-form class="box form-box has-background-light raises-on-hover">
5
+ <template #actions-left>
6
+ <div class="level-item">
7
+ <a class="button is-primary"
8
+ @click="testMail">
9
+ <span class="is-hidden-mobile">
10
+ {{ i18n('Test') }}
11
+ </span>
12
+ <span class="icon">
13
+ <fa icon="check-double"/>
14
+ </span>
15
+ <span class="is-hidden-mobile"/>
16
+ </a>
17
+ </div>
18
+ </template>
19
+ </enso-form>
5
20
  </div>
6
21
  </div>
7
22
  </template>
8
23
 
9
- <script>
24
+ <script setup>
25
+ import { inject } from 'vue';
26
+ import { useRoute } from 'vue-router';
10
27
  import { EnsoForm } from '@enso-ui/forms/bulma';
28
+ import { FontAwesomeIcon as Fa } from '@fortawesome/vue-fontawesome';
29
+ import { library } from '@fortawesome/fontawesome-svg-core';
30
+ import { faCheckDouble } from '@fortawesome/free-solid-svg-icons';
11
31
 
12
- export default {
13
- name: 'Edit',
32
+ library.add(faCheckDouble);
33
+
34
+ const http = inject('http');
35
+ const i18n = inject('i18n');
36
+ const errorHandler = inject('errorHandler');
37
+ const route = inject('route');
38
+ const toastr = inject('toastr');
39
+
40
+ const currentRoute = useRoute();
41
+
42
+ console.log(currentRoute.params.monitoredEmail);
43
+ const testRoute = route('administration.monitoredEmails.testEmail', { monitoredEmail: currentRoute.params.monitoredEmail });
44
+
45
+ const testMail = () => http.get(testRoute)
46
+ .then(({ data }) => {
47
+ if(data.status)
48
+ toastr.success(data.message);
49
+ else toastr.error(data.message);
50
+ })
51
+ .catch(errorHandler);
14
52
 
15
- components: { EnsoForm },
16
- };
17
53
  </script>
18
54
 
19
55
  <style lang="scss">
@@ -3,14 +3,8 @@
3
3
  id="monitoredEmails"/>
4
4
  </template>
5
5
 
6
- <script>
6
+ <script setup>
7
7
  import { EnsoTable } from '@enso-ui/tables/bulma';
8
-
9
- export default {
10
- name: 'Index',
11
-
12
- components: { EnsoTable },
13
- };
14
8
  </script>
15
9
 
16
10
  <style lang="scss">
@@ -0,0 +1,8 @@
1
+ import routeImporter from '@enso-ui/ui/src/modules/importers/routeImporter';
2
+
3
+ const routes = routeImporter(require.context('./administration', false, /.*\.js$/));
4
+
5
+ export default {
6
+ path: '/administration',
7
+ children: routes,
8
+ };