@appscode/design-system 1.0.43-alpha.197 → 1.0.43-alpha.199

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": "@appscode/design-system",
3
- "version": "1.0.43-alpha.197",
3
+ "version": "1.0.43-alpha.199",
4
4
  "description": "A design system for Appscode websites and dashboards made using Bulma",
5
5
  "main": "main.scss",
6
6
  "scripts": {
@@ -15,13 +15,14 @@
15
15
  :language="language"
16
16
  :options="{
17
17
  minimap: {
18
- enabled: calcShowMinimap
18
+ enabled: calcShowMinimap,
19
19
  },
20
20
  theme: theme,
21
21
  readOnly: readOnly,
22
22
  wordWrap: wordWrap,
23
- scrollBeyondLastLine: false
23
+ scrollBeyondLastLine: false,
24
24
  }"
25
+ data-testid="monaco-editor-edit-section"
25
26
  />
26
27
  <monaco-editor
27
28
  v-if="activeTab === 'preview'"
@@ -31,15 +32,16 @@
31
32
  :language="language"
32
33
  :options="{
33
34
  minimap: {
34
- enabled: calcShowMinimap
35
+ enabled: calcShowMinimap,
35
36
  },
36
37
  theme: theme,
37
38
  readOnly: true,
38
39
  wordWrap: wordWrap,
39
- scrollBeyondLastLine: false
40
+ scrollBeyondLastLine: false,
40
41
  }"
41
42
  :original="originalEditorContent"
42
43
  :diff-editor="true"
44
+ data-testid="monaco-editor-preview-section"
43
45
  />
44
46
  </div>
45
47
  </template>
@@ -52,59 +54,60 @@ export default defineComponent({
52
54
  props: {
53
55
  modelValue: {
54
56
  type: String,
55
- default: ""
57
+ default: "",
56
58
  },
57
59
  originalValue: {
58
60
  type: String,
59
- default: ""
61
+ default: "",
60
62
  },
61
63
  readOnly: {
62
64
  type: Boolean,
63
- default: false
65
+ default: false,
64
66
  },
65
67
  language: {
66
68
  type: String,
67
- default: "yaml"
69
+ default: "yaml",
68
70
  },
69
71
  showMinimap: {
70
72
  type: Boolean,
71
- default: true
73
+ default: true,
72
74
  },
73
75
  editorHeight: {
74
76
  type: Number,
75
- default: 40
77
+ default: 40,
76
78
  },
77
79
  editorTheme: {
78
80
  type: String,
79
- default: ""
81
+ default: "",
80
82
  },
81
83
  wordWrap: {
82
84
  type: String,
83
- default: "off"
84
- }
85
+ default: "off",
86
+ },
85
87
  },
86
88
 
87
89
  emits: ["update:modelValue"],
88
90
 
89
91
  components: {
90
92
  EditorTabs: defineAsyncComponent(() =>
91
- import("../tabs/EditorTabs.vue").then(module => module.default)
93
+ import("../tabs/EditorTabs.vue").then((module) => module.default)
92
94
  ),
93
95
  MonacoEditor: defineAsyncComponent({
94
- loader: () => import("./MonacoEditor.vue").then(module => module.default),
96
+ loader: () =>
97
+ import("./MonacoEditor.vue").then((module) => module.default),
95
98
 
96
99
  loadingComponent: Preloader,
97
100
  delay: 200,
98
101
  errorComponent: Banner,
99
- timeout: 100000
100
- })
102
+ timeout: 100000,
103
+ }),
101
104
  },
102
105
 
103
106
  data() {
104
107
  return {
105
108
  activeTab: "edit",
106
109
  editorContent: "",
107
- originalEditorContent: ""
110
+ originalEditorContent: "",
108
111
  };
109
112
  },
110
113
 
@@ -120,7 +123,7 @@ export default defineComponent({
120
123
  ? "vs-dark"
121
124
  : "vs")
122
125
  );
123
- }
126
+ },
124
127
  },
125
128
 
126
129
  watch: {
@@ -130,7 +133,7 @@ export default defineComponent({
130
133
  if (this.editorContent !== n) {
131
134
  this.editorContent = n;
132
135
  }
133
- }
136
+ },
134
137
  },
135
138
  originalValue: {
136
139
  immediate: true,
@@ -138,8 +141,8 @@ export default defineComponent({
138
141
  if (this.originalEditorContent !== n) {
139
142
  this.originalEditorContent = n;
140
143
  }
141
- }
142
- }
144
+ },
145
+ },
143
146
  },
144
147
 
145
148
  methods: {
@@ -151,7 +154,7 @@ export default defineComponent({
151
154
  editor.onDidBlurEditorText(() => {
152
155
  this.$emit("update:modelValue", this.editorContent);
153
156
  });
154
- }
155
- }
157
+ },
158
+ },
156
159
  });
157
160
  </script>
@@ -2,19 +2,18 @@
2
2
  <div class="ac-preview is-active is-not-fixed">
3
3
  <div class="ac-preview-inner">
4
4
  <!-- preview body start -->
5
- <div
5
+ <div
6
6
  class="ac-preview-body mt-0 pt-20"
7
- :class="{ 'is-justify-content-center': isYamlsEmpty && !isPreviewLoading }"
7
+ :class="{
8
+ 'is-justify-content-center': isYamlsEmpty && !isPreviewLoading,
9
+ }"
8
10
  >
9
11
  <strong v-if="isYamlsEmpty && !isPreviewLoading">
10
12
  No Data Available
11
13
  <i class="pl-5 fa fa-exclamation-circle" aria-hidden="true"></i>
12
14
  </strong>
13
15
  <template v-else>
14
- <div
15
- v-if="!isPreviewLoading && previewYamls"
16
- class="left-content"
17
- >
16
+ <div v-if="!isPreviewLoading && previewYamls" class="left-content">
18
17
  <div class="ac-files ac-hscrollbar pt-0">
19
18
  <ul v-if="!isPreviewLoading">
20
19
  <li
@@ -22,6 +21,7 @@
22
21
  :key="previewYaml.name + idx"
23
22
  :class="{ 'is-active': activeKey === previewYaml.uid }"
24
23
  :title="previewYaml.name"
24
+ data-testid="filtered-file-editor-file-name"
25
25
  >
26
26
  <a @click.prevent="setActivePreview(previewYaml.uid)">
27
27
  <span>
@@ -37,9 +37,12 @@
37
37
  <sidebar-loader v-else />
38
38
  </div>
39
39
  </div>
40
- <div class="right-content">
40
+ <div class="right-content" data-testid="filtered-file-editor-content">
41
+ >
41
42
  <resource-loader v-if="isPreviewLoading" />
42
- <strong v-else-if="isYamlsNotSelected">Selecet a data from sidebar</strong>
43
+ <strong v-else-if="isYamlsNotSelected"
44
+ >Selecet a data from sidebar</strong
45
+ >
43
46
  <strong v-else-if="hideValue"> *************** </strong>
44
47
  <editor
45
48
  v-else
@@ -64,93 +67,93 @@ export default defineComponent({
64
67
  components: {
65
68
  Editor: defineAsyncComponent({
66
69
  loader: () =>
67
- import("../editor/Editor.vue").then(module => module.default),
70
+ import("../editor/Editor.vue").then((module) => module.default),
68
71
  loadingComponent: Preloader,
69
72
  delay: 200,
70
73
  errorComponent: Banner,
71
- timeout: 100000
74
+ timeout: 100000,
72
75
  }),
73
76
  ResourceLoader: defineAsyncComponent(() =>
74
77
  import("../loaders/ResourceLoader.vue")
75
78
  ),
76
79
  SidebarLoader: defineAsyncComponent(() =>
77
80
  import("../loaders/SidebarLoader.vue")
78
- )
81
+ ),
79
82
  },
80
83
  props: {
81
84
  searchText: {
82
85
  type: String,
83
- default: ""
86
+ default: "",
84
87
  },
85
88
  toggleHideValue: {
86
89
  type: Boolean,
87
- default: true
90
+ default: true,
88
91
  },
89
92
  isPreviewLoading: {
90
93
  type: Boolean,
91
- default: false
94
+ default: false,
92
95
  },
93
96
  isEditorReadOnly: {
94
97
  type: Boolean,
95
- default: false
98
+ default: false,
96
99
  },
97
100
  previewYamls: {
98
101
  type: Array,
99
102
  default: () => {
100
103
  [];
101
- }
104
+ },
102
105
  },
103
106
  showMinimap: {
104
107
  type: Boolean,
105
- default: false
108
+ default: false,
106
109
  },
107
110
  editorHeight: {
108
111
  type: Number,
109
- default: 60
110
- }
112
+ default: 60,
113
+ },
111
114
  },
112
115
  emits: ["setActiveKey"],
113
116
  data() {
114
117
  return {
115
118
  activeKey: "",
116
- hideValue: ""
119
+ hideValue: "",
117
120
  };
118
121
  },
119
122
  computed: {
120
123
  activeFile() {
121
124
  const activeFile = this.filteredYamls.find(
122
- element => element.uid === this.activeKey
125
+ (element) => element.uid === this.activeKey
123
126
  );
124
127
  return activeFile || { content: "", format: "yaml" };
125
128
  },
126
129
  originalValue() {
127
130
  const activeFile = this.filteredYamls.find(
128
- element => element.uid === this.activeKey
131
+ (element) => element.uid === this.activeKey
129
132
  );
130
133
  return (activeFile && activeFile.initContent) || "";
131
134
  },
132
135
  filteredYamls() {
133
136
  if (this.searchText) {
134
137
  return this.previewYamls.filter(
135
- element => JSON.stringify(element).search(this.searchText) > -1
138
+ (element) => JSON.stringify(element).search(this.searchText) > -1
136
139
  );
137
140
  } else return this.previewYamls;
138
141
  },
139
142
  isKeyAvailable() {
140
- const val = this.previewYamls.find(element => {
143
+ const val = this.previewYamls.find((element) => {
141
144
  return element.uid === this.activeKey;
142
145
  });
143
146
  return val === undefined ? false : true;
144
147
  },
145
- isYamlsEmpty(){
146
- return this.filteredYamls.length === 0;
148
+ isYamlsEmpty() {
149
+ return this.filteredYamls.length === 0;
147
150
  },
148
- isYamlsNotSelected(){
149
- const val = this.filteredYamls.find(element => {
151
+ isYamlsNotSelected() {
152
+ const val = this.filteredYamls.find((element) => {
150
153
  return element.uid === this.activeKey;
151
- })
154
+ });
152
155
  return val === undefined;
153
- }
156
+ },
154
157
  },
155
158
  methods: {
156
159
  initActivePreview() {
@@ -164,7 +167,7 @@ export default defineComponent({
164
167
  this.activeKey = uid;
165
168
  this.hideValue = this.activeFile.isSecret;
166
169
  this.$emit("setActiveKey", this.activeKey);
167
- }
170
+ },
168
171
  },
169
172
  watch: {
170
173
  previewYamls: {
@@ -174,11 +177,11 @@ export default defineComponent({
174
177
  if (n.length) {
175
178
  this.initActivePreview();
176
179
  }
177
- }
180
+ },
178
181
  },
179
182
  toggleHideValue(n) {
180
183
  this.hideValue = n;
181
- }
182
- }
184
+ },
185
+ },
183
186
  });
184
187
  </script>
@@ -1,6 +1,7 @@
1
1
  <template>
2
2
  <input
3
3
  class="ac-input"
4
+ data-testid="ac-input"
4
5
  :value="modelValue"
5
6
  @input="$emit('update:modelValue', $event.target.value)"
6
7
  />
@@ -28,7 +28,10 @@
28
28
  <!-- modal header end -->
29
29
 
30
30
  <!-- modal body start -->
31
- <div class="ac-modal-body ac-vscrollbar">
31
+ <div
32
+ class="ac-modal-body ac-vscrollbar"
33
+ data-testid="ac-modal-content-with-scroll"
34
+ >
32
35
  <div class="ac-modal-content">
33
36
  <!-- freedom content start -->
34
37
  <slot />
@@ -38,8 +41,13 @@
38
41
  <!-- modal body end -->
39
42
 
40
43
  <!-- modal footer start -->
41
- <div v-if="!hideActionFooter"
42
- class="ac-modal-footer action-footer is-flex is-align-items-center is-justify-content-space-between"
44
+ <div
45
+ v-if="!hideActionFooter"
46
+ class="
47
+ ac-modal-footer
48
+ action-footer
49
+ is-flex is-align-items-center is-justify-content-space-between
50
+ "
43
51
  >
44
52
  <div>
45
53
  <slot name="modal-footer-left" />
@@ -61,44 +69,44 @@ export default defineComponent({
61
69
  props: {
62
70
  open: {
63
71
  type: Boolean,
64
- default: false
72
+ default: false,
65
73
  },
66
74
  title: {
67
75
  type: String,
68
- default: "Modal"
76
+ default: "Modal",
69
77
  },
70
78
  modifierClasses: {
71
79
  type: String,
72
- default: ""
80
+ default: "",
73
81
  },
74
82
  isCloseOptionDisabled: {
75
83
  type: Boolean,
76
- default: false
84
+ default: false,
77
85
  },
78
86
  ignoreOutsideClick: {
79
87
  type: Boolean,
80
- default: false
88
+ default: false,
81
89
  },
82
90
  hideActionFooter: {
83
91
  type: Boolean,
84
- default: false
85
- }
92
+ default: false,
93
+ },
86
94
  },
87
95
  emits: ["closemodal"],
88
96
 
89
97
  components: {
90
98
  HeaderItems: defineAsyncComponent(() =>
91
- import("../../v2/header/HeaderItems.vue").then(module => module.default)
99
+ import("../../v2/header/HeaderItems.vue").then((module) => module.default)
92
100
  ),
93
101
  HeaderItem: defineAsyncComponent(() =>
94
- import("../../v2/header/HeaderItem.vue").then(module => module.default)
102
+ import("../../v2/header/HeaderItem.vue").then((module) => module.default)
95
103
  ),
96
104
  Buttons: defineAsyncComponent(() =>
97
- import("../../v2/button/Buttons.vue").then(module => module.default)
105
+ import("../../v2/button/Buttons.vue").then((module) => module.default)
98
106
  ),
99
107
  AcButton: defineAsyncComponent(() =>
100
- import("../button/Button.vue").then(module => module.default)
101
- )
108
+ import("../button/Button.vue").then((module) => module.default)
109
+ ),
102
110
  },
103
111
 
104
112
  data() {
@@ -106,7 +114,7 @@ export default defineComponent({
106
114
  showModal: false,
107
115
  crossIcon: import.meta.globEager(
108
116
  "/src/assets/icons/modal/close-icon.svg"
109
- )["/src/assets/icons/modal/close-icon.svg"].default
117
+ )["/src/assets/icons/modal/close-icon.svg"].default,
110
118
  };
111
119
  },
112
120
 
@@ -119,8 +127,8 @@ export default defineComponent({
119
127
  } else {
120
128
  this.destroyModal();
121
129
  }
122
- }
123
- }
130
+ },
131
+ },
124
132
  },
125
133
 
126
134
  methods: {
@@ -144,7 +152,7 @@ export default defineComponent({
144
152
  document.removeEventListener("keydown", this.onKeyDown);
145
153
 
146
154
  this.$emit("closemodal", true);
147
- }
148
- }
155
+ },
156
+ },
149
157
  });
150
158
  </script>
@@ -20,12 +20,14 @@
20
20
  @click.stop="closeModal"
21
21
  title="Cancel"
22
22
  modifier-classes="is-outlined"
23
+ data-testid="delete-confirmation-modal-close-button"
23
24
  />
24
25
  <ac-button
25
26
  modifier-classes="is-danger"
26
27
  :is-loader-active="isDeleteActive"
27
28
  title="Yes"
28
29
  @click.stop="confirm(true)"
30
+ data-testid="delete-confirmation-modal-confirm-button"
29
31
  />
30
32
  </template>
31
33
  </modal>
@@ -26,6 +26,7 @@
26
26
  <a
27
27
  :href="`${serverDomain}/${user.username}`"
28
28
  :title="user.username.toUpperCase()"
29
+ data-testid="user-profile-link"
29
30
  class="line-break-anywhere is-ellipsis-1"
30
31
  >{{ user.username.toUpperCase() }}</a
31
32
  >
@@ -34,10 +35,16 @@
34
35
  </div>
35
36
  <transition-group name="list" tag="ul">
36
37
  <li key="settings">
37
- <a :href="`${serverDomain}/user/settings/`">Settings</a>
38
+ <a
39
+ data-testid="user-settings-link"
40
+ :href="`${serverDomain}/user/settings/`"
41
+ >Settings</a
42
+ >
38
43
  </li>
39
44
  <li v-if="user.is_admin" key="site-admin">
40
- <a :href="`${accountsDomain}/admin`">Site Administration</a>
45
+ <a data-testid="site-admin-link" :href="`${accountsDomain}/admin`"
46
+ >Site Administration</a
47
+ >
41
48
  </li>
42
49
  <li
43
50
  v-if="showAccountSwitcher"
@@ -9,11 +9,7 @@
9
9
  "
10
10
  >
11
11
  <label>Rows per page</label>
12
- <select
13
- v-model="selectedItemCountPerPage"
14
- name="page"
15
- data-testid="rows-per-page-selector"
16
- >
12
+ <select v-model="selectedItemCountPerPage" name="page">
17
13
  <option :value="5">5</option>
18
14
  <option :value="10" v-show="totalNoOfItems > 5">10</option>
19
15
  <option :value="15" v-show="totalNoOfItems > 10">15</option>
@@ -35,28 +31,19 @@
35
31
 
36
32
  <ul v-if="totalNoOfItems > selectedItemCountPerPage">
37
33
  <li>
38
- <a
39
- class="previous"
40
- @click.prevent="prevPage()"
41
- data-testid="pagination-previous-page-button"
42
- >
34
+ <a class="previous" @click.prevent="prevPage()">
43
35
  <i class="fa fa-angle-left" aria-hidden="true"></i>
44
36
  </a>
45
37
  </li>
46
38
  <li v-for="page in pages" :key="`page-${page}`">
47
39
  <a
48
40
  @click.prevent="changePage(page)"
49
- data-testid="pagination-page-switch-button"
50
41
  :class="{ 'is-current': activePageNo === page }"
51
42
  >{{ page }}</a
52
43
  >
53
44
  </li>
54
45
  <li>
55
- <a
56
- class="next"
57
- @click.prevent="nextPage()"
58
- data-testid="pagination-next-page-button"
59
- >
46
+ <a class="next" @click.prevent="nextPage()">
60
47
  <i class="fa fa-angle-right" aria-hidden="true"></i>
61
48
  </a>
62
49
  </li>
@@ -1,5 +1,5 @@
1
1
  <template>
2
- <li :class="{ 'is-active': isActive }">
2
+ <li :class="{ 'is-active': isActive }" data-testid="tab-item">
3
3
  <slot />
4
4
  </li>
5
5
  </template>
@@ -6,7 +6,12 @@
6
6
  custom
7
7
  v-slot="{ navigate }"
8
8
  >
9
- <tr class="is-link" @click="navigate" v-bind="$attrs">
9
+ <tr
10
+ class="is-link"
11
+ @click="navigate"
12
+ v-bind="$attrs"
13
+ data-testid="ac-table-row"
14
+ >
10
15
  <slot />
11
16
  <fake-table-cell
12
17
  v-if="fakeCellWidth > 0"
@@ -21,6 +26,7 @@
21
26
  'is-hoverless': !isSelected,
22
27
  'is-disabled': isDisabled,
23
28
  }"
29
+ data-testid="ac-table-row"
24
30
  @click.prevent="$emit('rowselect', true)"
25
31
  >
26
32
  <slot />
@@ -14,15 +14,17 @@
14
14
  :obj="value"
15
15
  :cell-title="cellTitle"
16
16
  :max-character-length="maxCharacterLength"
17
+ data-testid="object-cell-value"
17
18
  />
18
19
  <array-cell
19
20
  v-else-if="valueType === 'array'"
20
21
  :items="value"
21
22
  :cell-title="cellTitle"
22
23
  :max-character-length="maxCharacterLength"
24
+ data-testid="array-cell-value"
23
25
  />
24
26
  <template v-else>
25
- <span class="is-ellipsis-1" :title="tooltip">{{
27
+ <span class="is-ellipsis-1" :title="tooltip" data-testid="cell-value">{{
26
28
  value || (value === 0 ? 0 : "-")
27
29
  }}</span>
28
30
  </template>