Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion cypress/e2e/po/pages/chart-repositories.po.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ export default class ChartRepositoriesPagePo extends PagePo {
}

create() {
return this.list().masthead().actions().contains('Create')
return this.list().masthead().actions().contains('Add Repository')
.click();
}

Expand Down
1 change: 1 addition & 0 deletions shell/assets/translations/en-us.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1379,6 +1379,7 @@ catalog:
releaseName: Release Name
releaseNamespace: Release Namespace
repo:
add: Add Repository
action:
refresh: Refresh
all: All
Expand Down
1 change: 1 addition & 0 deletions shell/config/product/apps.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ export function init(store) {

configureType(CATALOG.APP, { isCreatable: false, isEditable: false });
configureType(CATALOG.OPERATION, { isCreatable: false, isEditable: false });
configureType(CATALOG.CLUSTER_REPO, { listCreateButtonLabelKey: 'catalog.repo.add' });

const repoType = {
name: 'type',
Expand Down
15 changes: 14 additions & 1 deletion shell/edit/catalog.cattle.io.clusterrepo.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
<script lang="ts">
import CreateEditView from '@shell/mixins/create-edit-view';
import AsyncButton from '@shell/components/AsyncButton.vue';
import Footer from '@shell/components/form/Footer';
import { LabeledInput } from '@components/Form/LabeledInput';
import NameNsDescription from '@shell/components/form/NameNsDescription';
Expand All @@ -23,6 +24,7 @@ export default {
emits: ['input'],

components: {
AsyncButton,
Footer,
LabeledInput,
NameNsDescription,
Expand Down Expand Up @@ -90,6 +92,7 @@ export default {
ociMaxRetries: this.value.spec.exponentialBackOffValues?.maxRetries,
getVersionData,
isView: this.mode === _VIEW,
isCreate: this.mode === _CREATE,
clusterRepoTargets,
previousName: '',
previousDescription: '',
Expand Down Expand Up @@ -450,7 +453,17 @@ export default {
:errors="errors"
@save="save"
@done="done"
/>
>
<template
v-if="isCreate"
#save
>
<AsyncButton
:action-label="t('catalog.repo.add')"
@click="save"
/>
</template>
</Footer>
</form>
</template>

Expand Down
9 changes: 9 additions & 0 deletions shell/models/catalog.cattle.io.clusterrepo.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { CATALOG } from '@shell/config/labels-annotations';
import { insertAt } from '@shell/utils/array';
import { CLUSTER_REPO_APPCO_AUTH_GENERATE_NAME, CATALOG as CATALOG_TYPE } from '@shell/config/types';
import { colorForState, stateDisplay } from '@shell/plugins/dashboard-store/resource-class';
import { _CREATE } from '@shell/config/query-params';

import SteveModel from '@shell/plugins/steve/steve-class';

Expand Down Expand Up @@ -173,6 +174,14 @@ export default class ClusterRepo extends SteveModel {
return this.$rootGetters['i18n/withFallback'](key, null, name);
}

detailPageHeaderActionOverride(realMode) {
if (realMode === _CREATE) {
return this.t('catalog.repo.add');
}

return null;
}

get urlDisplay() {
return this.status?.url || this.spec.gitRepo || this.spec.url;
}
Expand Down
Loading