-
Notifications
You must be signed in to change notification settings - Fork 51
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #304 from bcgov/feature/tenant-ui-refactor-row-expand
Reduce duplicated code for Row Expand components
- Loading branch information
Showing
16 changed files
with
57 additions
and
273 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
27 changes: 0 additions & 27 deletions
27
services/tenant-ui/frontend/src/components/contacts/ContactRowExpandData.vue
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
27 changes: 0 additions & 27 deletions
27
services/tenant-ui/frontend/src/components/holder/CredentialRowExpandData.vue
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
27 changes: 0 additions & 27 deletions
27
services/tenant-ui/frontend/src/components/issuance/IssuedCredentialRowExpandData.vue
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
27 changes: 0 additions & 27 deletions
27
services/tenant-ui/frontend/src/components/issuance/SchemaRowExpandData.vue
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
33 changes: 0 additions & 33 deletions
33
services/tenant-ui/frontend/src/composables/useGetCredential.ts
This file was deleted.
Oops, something went wrong.
33 changes: 0 additions & 33 deletions
33
services/tenant-ui/frontend/src/composables/useGetIssuedCredential.ts
This file was deleted.
Oops, something went wrong.
14 changes: 5 additions & 9 deletions
14
...frontend/src/composables/useGetContact.ts → ...ui/frontend/src/composables/useGetItem.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,33 +1,29 @@ | ||
import { ref } from 'vue'; | ||
import { GetItem } from '../types'; | ||
import { useContactsStore } from '../store'; | ||
import { fetchItem as utilFetchItem } from '../store/utils/fetchItem'; | ||
|
||
export default function useGetContact(): GetItem { | ||
const store = useContactsStore(); | ||
export default function useGetItem(url: string): GetItem { | ||
const _url = ref(url); | ||
|
||
const item = ref(); | ||
const loading: any = ref(false); | ||
|
||
async function fetchItem(id: string, params: any = {}) { | ||
const error: any = ref(null); | ||
try { | ||
// call store | ||
loading.value = true; | ||
item.value = await store.getContact(id, params); | ||
item.value = await utilFetchItem(_url.value, id, error, loading, params); | ||
} catch (error) { | ||
item.value = null; | ||
} finally { | ||
loading.value = false; | ||
} | ||
} | ||
|
||
async function fetchItemWithAcapy(id: string) { | ||
return fetchItem(id, { acapy: true }); | ||
} | ||
|
||
return { | ||
item, | ||
loading, | ||
fetchItem, | ||
fetchItemWithAcapy, | ||
}; | ||
} |
Oops, something went wrong.