From fea8520544c815bfaaabbc01d95f7ab23f3cc6af Mon Sep 17 00:00:00 2001 From: Kyle Turney Date: Thu, 30 Jan 2020 12:01:45 -0600 Subject: [PATCH] fix deprecation computed-property.override by adding setters see https://emberjs.com/deprecations/v3.x#toc_computed-property-override --- .../components/docs-viewer/x-nav/component.js | 10 ++++- addon/services/project-version.js | 37 +++++++++++-------- 2 files changed, 29 insertions(+), 18 deletions(-) diff --git a/addon/components/docs-viewer/x-nav/component.js b/addon/components/docs-viewer/x-nav/component.js index ccb8d4d8b..cc2f869c6 100644 --- a/addon/components/docs-viewer/x-nav/component.js +++ b/addon/components/docs-viewer/x-nav/component.js @@ -27,7 +27,13 @@ export default Component.extend({ /* This is overwritten for the Sandbox. */ - project: computed(function() { - return this.get('store').peekRecord('project', projectName); + project: computed({ + get() { + return this.get('store').peekRecord('project', projectName); + }, + + set(key, val) { + return val; + } }) }); diff --git a/addon/services/project-version.js b/addon/services/project-version.js index 52c1c4c62..d8fdfbbd3 100644 --- a/addon/services/project-version.js +++ b/addon/services/project-version.js @@ -42,22 +42,27 @@ export default Service.extend({ return rootURL.replace(`/${this.get('currentVersion.path')}/`, '/'); }), - currentVersion: computed(function() { - let config = getOwner(this).resolveRegistration('config:environment')['ember-cli-addon-docs']; - let currentVersion = config.deployVersion; - - // In development, this token won't have been replaced replaced - if (currentVersion === 'ADDON_DOCS_DEPLOY_VERSION') { - currentVersion = { - key: latestVersionName, - name: latestVersionName, - tag: config.projectTag, - path: '', - sha: 'abcde' - }; - } + currentVersion: computed({ + get() { + let config = getOwner(this).resolveRegistration('config:environment')['ember-cli-addon-docs']; + let currentVersion = config.deployVersion; - return currentVersion; - }) + // In development, this token won't have been replaced replaced + if (currentVersion === 'ADDON_DOCS_DEPLOY_VERSION') { + currentVersion = { + key: latestVersionName, + name: latestVersionName, + tag: config.projectTag, + path: '', + sha: 'abcde' + }; + } + + return currentVersion; + }, + set(key, val) { + return val; + } + }) });