mirror of
https://github.com/ansible/awx.git
synced 2026-01-15 03:40:42 -03:30
Update return structure of readInputSources to match what the edit component is expecting. This also required me to make corresponding updates to the detail component so that it matched.
This commit is contained in:
parent
e6a1ad0127
commit
6df173ce1d
@ -41,7 +41,11 @@ class Credentials extends Base {
|
||||
inputSources.concat(data.results)
|
||||
);
|
||||
}
|
||||
return Promise.resolve(inputSources.concat(data.results));
|
||||
return Promise.resolve({
|
||||
data: {
|
||||
results: inputSources.concat(data.results),
|
||||
},
|
||||
});
|
||||
} catch (error) {
|
||||
return Promise.reject(error);
|
||||
}
|
||||
|
||||
@ -60,7 +60,9 @@ function CredentialDetail({ i18n, credential }) {
|
||||
{
|
||||
data: { inputs: credentialTypeInputs, managed_by_tower },
|
||||
},
|
||||
loadedInputSources,
|
||||
{
|
||||
data: { results: loadedInputSources },
|
||||
},
|
||||
] = await Promise.all([
|
||||
CredentialTypesAPI.readDetail(credential_type.id),
|
||||
CredentialsAPI.readInputSources(credentialId),
|
||||
|
||||
@ -37,7 +37,11 @@ CredentialTypesAPI.readDetail.mockResolvedValue({
|
||||
data: mockCredentialType,
|
||||
});
|
||||
|
||||
CredentialsAPI.readInputSources.mockResolvedValue([mockInputSource]);
|
||||
CredentialsAPI.readInputSources.mockResolvedValue({
|
||||
data: {
|
||||
results: [mockInputSource],
|
||||
},
|
||||
});
|
||||
|
||||
function expectDetailToMatch(wrapper, label, value) {
|
||||
const detail = wrapper.find(`Detail[label="${label}"]`);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user