Skip to content

Add 3rd step for offline registration #14678

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jul 4, 2025
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
7 changes: 5 additions & 2 deletions pkg/rancher-prime/l10n/en-us.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,15 @@ registration:

offline:
title: Offline Registration
stepone: '<b>Step 1:</b> To register Rancher Manager offline, you must download the registration request file below and visit the SUSE Customer Center (SCC) offline registration tool <a tabindex="0" target="_blank" href="https://scc.suse.com/register-offline/rancher">https://scc.suse.com/register-offline/rancher</a>.'
steptwo: '<b>Step 2:</b> Once logged in to SCC, follow the instructions to get your registration certificate provided by SCC. Once retrieved, upload the file below to register your product.'
stepone: '<b>Step 1:</b> To register Rancher Manager offline, you must download the registration request file below'
steptwo: '<b>Step 2:</b> Visit the SUSE Customer Center (SCC) offline registration tool.'
stepthree: '<b>Step 3:</b> Once logged in to SCC, follow the instructions to get your registration certificate provided by SCC. Once retrieved, upload the file below to register your product.'
button:
download:
label: Download registration request
progress: Downloading
visit:
label: Visit SCC
register:
label: Upload certificate and register
progress: Registering
Expand Down
30 changes: 3 additions & 27 deletions pkg/rancher-prime/pages/Registration.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ describe('page: Registration', () => {
it('should prevent to type the registration code', () => {
const registerOnlineInput = wrapper.find('[data-testid="registration-code-input"]');

expect(registerOnlineInput.attributes().disabled).toStrictEqual('true');
expect(registerOnlineInput.isDisabled()).toStrictEqual(true);
});

it('should prevent to download registration request', () => {
Expand Down Expand Up @@ -173,7 +173,7 @@ describe('page: Registration', () => {
});
});

describe('while de-registering a online case', () => {
describe('while registered', () => {
beforeEach(() => {
wrapper.vm.registrationStatus = 'registered';
});
Expand All @@ -187,31 +187,7 @@ describe('page: Registration', () => {
it('should prevent to type the registration code', () => {
const registerOnlineInput = wrapper.find('[data-testid="registration-code-input"]');

expect(registerOnlineInput.attributes().disabled).toStrictEqual('true');
});

it('should prevent new offline request', () => {
const registerOfflineButton = wrapper.find('[data-testid="registration-offline-cta"]');

expect(registerOfflineButton.isDisabled()).toStrictEqual(true);
});
});

describe('while de-registering a offline case', () => {
beforeEach(() => {
wrapper.vm.registrationStatus = 'registered';
});

it('should prevent new online request', () => {
const registerOnlineButton = wrapper.find('[data-testid="registration-online-cta"]');

expect(registerOnlineButton.isDisabled()).toStrictEqual(true);
});

it('should prevent to type the registration code', () => {
const registerOnlineInput = wrapper.find('[data-testid="registration-code-input"]');

expect(registerOnlineInput.attributes().disabled).toStrictEqual('true');
expect(registerOnlineInput.isDisabled()).toStrictEqual(true);
});

it('should prevent new offline request', () => {
Expand Down
24 changes: 22 additions & 2 deletions pkg/rancher-prime/pages/Registration.vue
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,11 @@ import { useI18n } from '@shell/composables/useI18n';

import Tab from '@shell/components/Tabbed/Tab';
import Tabbed from '@shell/components/Tabbed';
import LabeledInput from '@components/Form/LabeledInput/LabeledInput.vue';
import { RcButton } from '@components/RcButton';
import { LabeledInput } from '@components/Form/LabeledInput';
import { BadgeState } from '@components/BadgeState';
import AsyncButton from '@shell/components/AsyncButton';
import Banner from '@components/Banner/Banner.vue';
import { Banner } from '@components/Banner';
import FileSelector from '@shell/components/form/FileSelector';
import { usePrimeRegistration } from './registration.composable';
import Loading from '@shell/components/Loading.vue';
Expand Down Expand Up @@ -43,6 +44,10 @@ const isRegistering = computed(() => registrationStatus.value === 'registering-o
*/
const isRegisteringOffline = computed(() => registrationStatus.value === 'registering-offline');

const visitScc = () => {
window.open('https://scc.suse.com/register-offline/rancher', '_blank');
};

onMounted(async() => {
initRegistration();
});
Expand Down Expand Up @@ -142,6 +147,21 @@ onMounted(async() => {
v-clean-html="t('registration.offline.steptwo', {}, true)"
class="mt-20"
/>
<RcButton
secondary
class="mt-20"
data-testid="registration-offline-visit-scc"
:disabled="isRegistered || isRegistering"
@click="visitScc"
>
{{ t('registration.offline.button.visit.label') }}
</RcButton>

<!-- Step 3 -->
<p
v-clean-html="t('registration.offline.stepthree', {}, true)"
class="mt-20"
/>
<!-- Show async button while submitting file -->
<div v-if="isRegisteringOffline">
<AsyncButton
Expand Down