Commit 29535c01 authored by Dave Pisek's avatar Dave Pisek

Add migration info comments to direct API calls

* Adds comments to Vue components where we directly call the API
  to raise awareness that there is an epic to move the whole feature
  to GraphQL
parent fc6b8d0a
...@@ -112,6 +112,8 @@ export default { ...@@ -112,6 +112,8 @@ export default {
return Date.parse(date) / 1000; return Date.parse(date) / 1000;
}, },
fetchDiscussions() { fetchDiscussions() {
// note: this direct API call will be replaced when migrating the vulnerability details page to GraphQL
// related epic: https://gitlab.com/groups/gitlab-org/-/epics/3657
axios axios
.get(this.vulnerability.discussionsUrl) .get(this.vulnerability.discussionsUrl)
.then(({ data, headers: { date } }) => { .then(({ data, headers: { date } }) => {
...@@ -146,6 +148,8 @@ export default { ...@@ -146,6 +148,8 @@ export default {
}); });
}, },
createNotesPoll() { createNotesPoll() {
// note: this polling call will be replaced when migrating the vulnerability details page to GraphQL
// related epic: https://gitlab.com/groups/gitlab-org/-/epics/3657
this.poll = new Poll({ this.poll = new Poll({
resource: { resource: {
fetchNotes: () => fetchNotes: () =>
......
...@@ -208,6 +208,8 @@ export default { ...@@ -208,6 +208,8 @@ export default {
projectFingerprint, projectFingerprint,
} = this.vulnerability; } = this.vulnerability;
// note: this direct API call will be replaced when migrating the vulnerability details page to GraphQL
// related epic: https://gitlab.com/groups/gitlab-org/-/epics/3657
axios axios
.post(this.vulnerability.createMrUrl, { .post(this.vulnerability.createMrUrl, {
vulnerability_feedback: { vulnerability_feedback: {
......
...@@ -100,6 +100,8 @@ export default { ...@@ -100,6 +100,8 @@ export default {
this.isSavingComment = true; this.isSavingComment = true;
const { method, url, data, emitName } = this.getSaveConfig(note); const { method, url, data, emitName } = this.getSaveConfig(note);
// note: this direct API call will be replaced when migrating the vulnerability details page to GraphQL
// related epic: https://gitlab.com/groups/gitlab-org/-/epics/3657
axios({ method, url, data }) axios({ method, url, data })
.then(({ data: responseData }) => { .then(({ data: responseData }) => {
this.isEditingComment = false; this.isEditingComment = false;
......
...@@ -103,6 +103,8 @@ export default { ...@@ -103,6 +103,8 @@ export default {
// The endpoint can only accept one issue, so we need to do a separate call for each pending reference. // The endpoint can only accept one issue, so we need to do a separate call for each pending reference.
const requests = this.state.pendingReferences.map((reference) => { const requests = this.state.pendingReferences.map((reference) => {
// note: this direct API call will be replaced when migrating the vulnerability details page to GraphQL
// related epic: https://gitlab.com/groups/gitlab-org/-/epics/3657
return axios return axios
.post( .post(
this.endpoint, this.endpoint,
...@@ -140,6 +142,8 @@ export default { ...@@ -140,6 +142,8 @@ export default {
removeRelatedIssue(idToRemove) { removeRelatedIssue(idToRemove) {
const issue = this.state.relatedIssues.find(({ id }) => id === idToRemove); const issue = this.state.relatedIssues.find(({ id }) => id === idToRemove);
// note: this direct API call will be replaced when migrating the vulnerability details page to GraphQL
// related epic: https://gitlab.com/groups/gitlab-org/-/epics/3657
axios axios
.delete(joinPaths(this.endpoint, issue.vulnerabilityLinkId.toString())) .delete(joinPaths(this.endpoint, issue.vulnerabilityLinkId.toString()))
.then(() => { .then(() => {
...@@ -152,6 +156,8 @@ export default { ...@@ -152,6 +156,8 @@ export default {
fetchRelatedIssues() { fetchRelatedIssues() {
this.isFetching = true; this.isFetching = true;
// note: this direct API call will be replaced when migrating the vulnerability details page to GraphQL
// related epic: https://gitlab.com/groups/gitlab-org/-/epics/3657
axios axios
.get(this.endpoint) .get(this.endpoint)
.then(({ data }) => { .then(({ data }) => {
......
...@@ -79,6 +79,8 @@ export default { ...@@ -79,6 +79,8 @@ export default {
this.fetchRelatedIssues(); this.fetchRelatedIssues();
}, },
methods: { methods: {
// note: this direct API call will be replaced when migrating the vulnerability details page to GraphQL
// related epic: https://gitlab.com/groups/gitlab-org/-/epics/3657
async fetchRelatedIssues() { async fetchRelatedIssues() {
this.isFetchingRelatedIssues = true; this.isFetchingRelatedIssues = true;
try { try {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment