|
|
@ -1,8 +1,8 @@
|
|
|
|
<script>
|
|
|
|
<script>
|
|
|
|
import $ from 'jquery';
|
|
|
|
|
|
|
|
import {SvgIcon} from '../svg.js';
|
|
|
|
import {SvgIcon} from '../svg.js';
|
|
|
|
import {useLightTextOnBackground} from '../utils/color.js';
|
|
|
|
import {useLightTextOnBackground} from '../utils/color.js';
|
|
|
|
import tinycolor from 'tinycolor2';
|
|
|
|
import tinycolor from 'tinycolor2';
|
|
|
|
|
|
|
|
import {GET} from '../modules/fetch.js';
|
|
|
|
|
|
|
|
|
|
|
|
const {appSubUrl, i18n} = window.config;
|
|
|
|
const {appSubUrl, i18n} = window.config;
|
|
|
|
|
|
|
|
|
|
|
@ -80,20 +80,23 @@ export default {
|
|
|
|
});
|
|
|
|
});
|
|
|
|
},
|
|
|
|
},
|
|
|
|
methods: {
|
|
|
|
methods: {
|
|
|
|
load(data) {
|
|
|
|
async load(data) {
|
|
|
|
this.loading = true;
|
|
|
|
this.loading = true;
|
|
|
|
this.i18nErrorMessage = null;
|
|
|
|
this.i18nErrorMessage = null;
|
|
|
|
$.get(`${appSubUrl}/${data.owner}/${data.repo}/issues/${data.index}/info`).done((issue) => {
|
|
|
|
|
|
|
|
this.issue = issue;
|
|
|
|
try {
|
|
|
|
}).fail((jqXHR) => {
|
|
|
|
const response = await GET(`${appSubUrl}/${data.owner}/${data.repo}/issues/${data.index}/info`);
|
|
|
|
if (jqXHR.responseJSON && jqXHR.responseJSON.message) {
|
|
|
|
const respJson = await response.json();
|
|
|
|
this.i18nErrorMessage = jqXHR.responseJSON.message;
|
|
|
|
if (!response.ok) {
|
|
|
|
} else {
|
|
|
|
this.i18nErrorMessage = respJson.message ?? i18n.network_error;
|
|
|
|
this.i18nErrorMessage = i18n.network_error;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}).always(() => {
|
|
|
|
this.issue = respJson;
|
|
|
|
|
|
|
|
} catch {
|
|
|
|
|
|
|
|
this.i18nErrorMessage = i18n.network_error;
|
|
|
|
|
|
|
|
} finally {
|
|
|
|
this.loading = false;
|
|
|
|
this.loading = false;
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
};
|
|
|
|
};
|
|
|
|