Commit 311e6b52 authored by Mike Greiling's avatar Mike Greiling

Merge branch 'nfriend-fix-edit_url-property' into 'master'

Update release blocks to look for correct property name in API response

Closes #26016

See merge request gitlab-org/gitlab!19226
parents f04ffadc 5a9046a5
...@@ -76,7 +76,7 @@ export default { ...@@ -76,7 +76,7 @@ export default {
}, },
shouldShowEditButton() { shouldShowEditButton() {
return Boolean( return Boolean(
this.glFeatures.releaseEditPage && this.release._links && this.release._links.edit, this.glFeatures.releaseEditPage && this.release._links && this.release._links.edit_url,
); );
}, },
}, },
...@@ -108,7 +108,7 @@ export default { ...@@ -108,7 +108,7 @@ export default {
v-gl-tooltip v-gl-tooltip
class="btn btn-default js-edit-button ml-2" class="btn btn-default js-edit-button ml-2"
:title="__('Edit this release')" :title="__('Edit this release')"
:href="release._links.edit" :href="release._links.edit_url"
> >
<icon name="pencil" /> <icon name="pencil" />
</gl-link> </gl-link>
......
---
title: Allow release block edit button to be visible
merge_request: 19226
author:
type: fixed
...@@ -73,7 +73,7 @@ describe('Release block', () => { ...@@ -73,7 +73,7 @@ describe('Release block', () => {
it('renders an edit button that links to the "Edit release" page', () => { it('renders an edit button that links to the "Edit release" page', () => {
expect(editButton().exists()).toBe(true); expect(editButton().exists()).toBe(true);
expect(editButton().attributes('href')).toBe(release._links.edit); expect(editButton().attributes('href')).toBe(release._links.edit_url);
}); });
it('renders release name', () => { it('renders release name', () => {
...@@ -180,7 +180,7 @@ describe('Release block', () => { ...@@ -180,7 +180,7 @@ describe('Release block', () => {
}); });
}); });
it("does not render an edit button if release._links.edit isn't a string", () => { it("does not render an edit button if release._links.edit_url isn't a string", () => {
delete releaseClone._links; delete releaseClone._links;
return factory(releaseClone).then(() => { return factory(releaseClone).then(() => {
......
...@@ -95,6 +95,6 @@ export const release = { ...@@ -95,6 +95,6 @@ export const release = {
], ],
}, },
_links: { _links: {
edit: 'http://0.0.0.0:3001/root/release-test/-/releases/v0.3/edit', edit_url: 'http://0.0.0.0:3001/root/release-test/-/releases/v0.3/edit',
}, },
}; };
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