@appscode/design-system 1.0.43-alpha.112 → 1.0.43-alpha.113

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.112",
3
+ "version": "1.0.43-alpha.113",
4
4
  "description": "A design system for Appscode websites and dashboards made using Bulma",
5
5
  "main": "main.scss",
6
6
  "scripts": {
@@ -93,7 +93,7 @@ export default {
93
93
  const activeFile = this.filteredYamls.find(
94
94
  element => element.uid === this.activeKey
95
95
  );
96
- return activeFile || { content: "No resource available", format: "yaml" };
96
+ return activeFile || { content: "", format: "yaml" };
97
97
  },
98
98
  filteredYamls() {
99
99
  if (this.searchText) {
@@ -101,13 +101,21 @@ export default {
101
101
  element => JSON.stringify(element).search(this.searchText) > -1
102
102
  );
103
103
  } else return this.previewYamls;
104
+ },
105
+ isKeyAvailable() {
106
+ const val = this.previewYamls.find(element => {
107
+ return element.uid === this.activeKey;
108
+ });
109
+ return val === undefined ? false : true;
104
110
  }
105
111
  },
106
112
  methods: {
107
113
  initActivePreview() {
108
- this.activeKey = this.previewYamls[0].uid;
109
- this.hideValue = this.activeFile.isSecret;
110
- this.$emit("setActiveKey", this.activeKey);
114
+ if (!this.isKeyAvailable) {
115
+ this.activeKey = this.previewYamls[0].uid;
116
+ this.hideValue = this.activeFile.isSecret;
117
+ this.$emit("setActiveKey", this.activeKey);
118
+ }
111
119
  },
112
120
  setActivePreview(uid) {
113
121
  this.activeKey = uid;