diff --git a/app/assets/javascripts/ide/stores/mutations.js b/app/assets/javascripts/ide/stores/mutations.js index 2587b57a817..e84e2782e46 100644 --- a/app/assets/javascripts/ide/stores/mutations.js +++ b/app/assets/javascripts/ide/stores/mutations.js @@ -73,16 +73,15 @@ export default { const entry = data.entries[key]; const foundEntry = state.entries[key]; + // NOTE: We can't clone `entry` in any of the below assignments because + // we need `state.entries` and the `entry.tree` to reference the same object. if (!foundEntry) { Object.assign(state.entries, { [key]: entry, }); } else if (foundEntry.deleted) { Object.assign(state.entries, { - [key]: { - ...entry, - replaces: true, - }, + [key]: Object.assign(entry, { replaces: true }), }); } else { const tree = entry.tree.filter( diff --git a/app/assets/javascripts/registry/components/app.vue b/app/assets/javascripts/registry/components/app.vue index 7ae06af02cf..a20bae9e37e 100644 --- a/app/assets/javascripts/registry/components/app.vue +++ b/app/assets/javascripts/registry/components/app.vue @@ -15,15 +15,19 @@ export default { GlLoadingIcon, }, props: { - endpoint: { - type: String, - required: true, - }, characterError: { type: Boolean, required: false, default: false, }, + containersErrorImage: { + type: String, + required: true, + }, + endpoint: { + type: String, + required: true, + }, helpPagePath: { type: String, required: true, @@ -32,7 +36,11 @@ export default { type: String, required: true, }, - containersErrorImage: { + personalAccessTokensHelpLink: { + type: String, + required: true, + }, + registryHostUrlWithPort: { type: String, required: true, }, @@ -40,6 +48,10 @@ export default { type: String, required: true, }, + twoFactorAuthHelpLink: { + type: String, + required: true, + }, }, store, computed: { @@ -79,6 +91,26 @@ export default { false, ); }, + notLoggedInToRegistryText() { + return sprintf( + s__(`ContainerRegistry|If you are not already logged in, you need to authenticate to + the Container Registry by using your GitLab username and password. If you have + %{twofaDocLinkStart}Two-Factor Authentication%{twofaDocLinkEnd} enabled, use a + %{personalAccessTokensDocLinkStart}Personal Access Token + %{personalAccessTokensDocLinkEnd}instead of a password.`), + { + twofaDocLinkStart: ``, + twofaDocLinkEnd: '', + personalAccessTokensDocLinkStart: ``, + personalAccessTokensDocLinkEnd: '', + }, + false, + ); + }, + dockerLoginCommand() { + // eslint-disable-next-line @gitlab/i18n/no-non-i18n-strings + return `docker login ${this.registryHostUrlWithPort}`; + }, dockerBuildCommand() { // eslint-disable-next-line @gitlab/i18n/no-non-i18n-strings return `docker build -t ${this.repositoryUrl} .`; @@ -130,6 +162,17 @@ export default {