Skip to content
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

LITE-29926: Update UI to use SAS Token instead of Connection String #45

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

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion connect_bi_reporter/static/assets/settings-DHU-f3SM.js

This file was deleted.

1 change: 1 addition & 0 deletions connect_bi_reporter/static/assets/settings-yl6ZGDej.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions connect_bi_reporter/static/settings.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,12 @@
content="width=device-width, initial-scale=1.0"
/>
<title>Connect BI Reporter Extension</title>
<script type="module" crossorigin src="/static/assets/settings-DHU-f3SM.js"></script>
<script type="module" crossorigin src="/static/assets/settings-yl6ZGDej.js"></script>
<link rel="modulepreload" crossorigin href="/static/assets/vendor-1x2ovGvJ.js">
<link rel="modulepreload" crossorigin href="/static/assets/ActionsMenu-BdIbYJG3.js">
<link rel="modulepreload" crossorigin href="/static/assets/connect-BV-2I-fJ.js">
<link rel="stylesheet" crossorigin href="/static/assets/ActionsMenu-DuD_41Xi.css">
<link rel="stylesheet" crossorigin href="/static/assets/settings-CW7gT9jj.css">
<link rel="stylesheet" crossorigin href="/static/assets/settings-Bd151nFI.css">
</head>
<body>
<div id="app"></div>
Expand Down
16 changes: 8 additions & 8 deletions ui/components/AddEditCredentialDialog.vue
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@
label="Name"
/>
<text-field
v-model="connectionString"
v-model="sasToken"
class="dialog-input"
label="Connection String"
label="SAS Token"
/>
</simple-dialog>
</template>
Expand Down Expand Up @@ -49,9 +49,9 @@ const value = defineModel({
});

const name = ref('');
const connectionString = ref('');
const sasToken = ref('');

const isValid = computed(() => name.value?.length > 0 && connectionString.value?.length > 0);
const isValid = computed(() => name.value?.length > 0 && sasToken.value?.length > 0);
const isEditMode = computed(() => props.mode === 'edit');
const title = computed(() => (isEditMode.value ? 'Edit Credentials' : 'Add Credentials'));
const submitLabel = computed(() => (isEditMode.value ? 'Save' : 'Add'));
Expand All @@ -63,19 +63,19 @@ const getCredential = async () => {
const { result: credentialToEdit, request: credentialRequest } = useRequest(useToolkit());
await credentialRequest(`/api/credentials/${props.credentialId}`);
name.value = credentialToEdit.name;
connectionString.value = credentialToEdit.connection_string;
sasToken.value = credentialToEdit.sas_token;
};

const resetForm = () => {
name.value = '';
connectionString.value = '';
sasToken.value = '';
};

const submit = async () => {
if (props.mode === 'create') {
const status = await createCredentialAction.request('/api/credentials', 'POST', {
name: name.value,
connection_string: connectionString.value,
sas_token: sasToken.value,
});
if (status < 400) emit('created');
} else {
Expand All @@ -84,7 +84,7 @@ const submit = async () => {
'PUT',
{
name: name.value,
connection_string: connectionString.value,
sas_token: sasToken.value,
},
);
if (status < 400) emit('edited');
Expand Down
2 changes: 1 addition & 1 deletion ui/pages/settings/MainPage.vue
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,6 @@ provide('fullscreen-height', fullscreenHeight);
<style scoped>
.app {
max-width: 800px;
margin: 0 auto;
margin: 20px auto;
}
</style>
18 changes: 9 additions & 9 deletions ui/tests/specs/components/AddEditCredentialDialog.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ vi.mock('@cloudblueconnect/connect-ui-toolkit/tools/vue/toolkitPlugin');

const requestResult = {
name: 'credName',
connection_string: 'someconnnection',
sas_token: 'someconnnection',
};

describe('AddEditCredentialDialog component', () => {
Expand Down Expand Up @@ -66,10 +66,10 @@ describe('AddEditCredentialDialog component', () => {
}),
);

const connectionStringTexfield = textfields[1];
expect(connectionStringTexfield.attributes()).toEqual(
const sasTokenTextfield = textfields[1];
expect(sasTokenTextfield.attributes()).toEqual(
expect.objectContaining({
label: 'Connection String',
label: 'SAS Token',
}),
);
});
Expand Down Expand Up @@ -104,7 +104,7 @@ describe('AddEditCredentialDialog component', () => {
wrapper.vm.submit();
expect(useRequestStub.request).toHaveBeenCalledWith('/api/credentials', 'POST', {
name: '',
connection_string: '',
sas_token: '',
});
});
});
Expand Down Expand Up @@ -147,10 +147,10 @@ describe('AddEditCredentialDialog component', () => {
}),
);

const connectionStringTexfield = textfields[1];
expect(connectionStringTexfield.attributes()).toEqual(
const sasTokenTextfield = textfields[1];
expect(sasTokenTextfield.attributes()).toEqual(
expect.objectContaining({
label: 'Connection String',
label: 'SAS Token',
modelvalue: 'someconnnection',
}),
);
Expand Down Expand Up @@ -195,7 +195,7 @@ describe('AddEditCredentialDialog component', () => {
'PUT',
{
name: 'credName',
connection_string: 'someconnnection',
sas_token: 'someconnnection',
},
);
});
Expand Down
Loading