Conversation
client/src/api/axios.ts
Outdated
| await AuthClient.post(`/test_plan/${project_id}/search/${key_word}/`) | ||
| .then(response=>{ | ||
| return response.data | ||
| }) | ||
| .catch(error=>{ | ||
| return error | ||
| }) |
There was a problem hiding this comment.
| await AuthClient.post(`/test_plan/${project_id}/search/${key_word}/`) | |
| .then(response=>{ | |
| return response.data | |
| }) | |
| .catch(error=>{ | |
| return error | |
| }) | |
| return await AuthClient.post(`/test_plan/${project_id}/search/${key_word}/`) | |
handle it with try and catch when you call it
client/src/api/axios.ts
Outdated
| }) | ||
| } | ||
|
|
||
| async function DeletePlan(project_id:any,test_plan_id:any) { |
client/src/api/axios.ts
Outdated
| }) | ||
| } | ||
|
|
||
| async function UpdatePlanTitle(project_id:any,test_plan_id:any,title:any) { |
client/src/components/NewPlan.vue
Outdated
| <v-divider></v-divider> | ||
| <v-card-actions> | ||
| <v-btn color="primary" @click="dialog = false">Close</v-btn> | ||
| <v-btn color="success" @click="createTestPlan">Create</v-btn> |
client/src/components/NewPlan.vue
Outdated
| type: null, | ||
| }); | ||
|
|
||
| const createTestPlan=async()=>{ |
Mahmoud-Emad
left a comment
There was a problem hiding this comment.
Good job ya Nabila
| baseURL: 'https://server.gent02.dev.grid.tf/api', | ||
| timeout: 1000, | ||
| headers: { | ||
| 'Content-Type': 'application/json', | ||
| 'Authorization': 'Bearer ' + localStorage.getItem("token"), | ||
| Authorization: 'Bearer ' + localStorage.getItem('token'), | ||
| }, | ||
| }); | ||
| }) |
There was a problem hiding this comment.
As I mentioned earlier, this should be loaded from the window. Also, I've noticed that you and @abdahmed22 are re-implementing the same functionality in several open PRs. What do you think about creating a new PR with only these changes and merging it into your base branch to incorporate the changes you both made?
| export { AuthClient, BaseClient }; | ||
| async function GetPlans (projectId:string) { | ||
| try { | ||
| localStorage.setItem('token', 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ0b2tlbl90eXBlIjoiYWNjZXNzIiwiZXhwIjoxNzIzNzI0Njg5LCJpYXQiOjE3MjM3MTUzODksImp0aSI6IjlmNTU1NmY0MjQzZTRjMmI5OWZmZTcxYjFkNWQxYmJiIiwidXNlcl9pZCI6MSwiZW1haWwiOiJuYWJpbGFAZ21haWwuY29tIn0.OUIvvLV5sgtyVQM_PtLu4HsqJaeOLC5FIx7w39VZ7js') |
There was a problem hiding this comment.
We agree about the idea of the tokens no? We must not hard-code a user secret and push it into GitHub
| } | ||
| } | ||
|
|
||
| async function SearchPlans (projectId:any, keyWord:any) { |
There was a problem hiding this comment.
Let's define the types
| notifier.notify({ | ||
| title: 'Success', | ||
| description: 'plan created successfully', | ||
| showProgressBar: true, | ||
| timeout: 7_000, | ||
| type: 'success', | ||
| }) | ||
| } catch (error) { | ||
| console.error(error) | ||
| notifier.notify({ | ||
| title: 'Fail', | ||
| description: 'Failed to create plan', | ||
| showProgressBar: true, | ||
| timeout: 7_000, | ||
| type: 'error', | ||
| }) | ||
| } finally { |
There was a problem hiding this comment.
Please do the same here
| // const testPlans = ref([{id: '1',title: 'Plan A',created: '2024-08-01',modified: '2024-08-05'}, | ||
| // {id: '1',title: 'Plan A',created: '2024-08-01',modified: '2024-08-05'}, | ||
| // {id: '1',title: 'Plan A',created: '2024-08-01',modified: '2024-08-05'} | ||
| // ]); |
There was a problem hiding this comment.
Please remove this dummy data
| } | ||
| }; | ||
|
|
||
| async function updatePlan(planId){ |
There was a problem hiding this comment.
Define the type of planId
| const title=ref(""); | ||
|
|
||
|
|
||
| function openDeleteDialog(plan) { |
There was a problem hiding this comment.
Define the type of plan
| dialogDelete.value = true; | ||
| } | ||
|
|
||
| function openUpdateDialog(plan){ |
There was a problem hiding this comment.
Define the type of plan
|
|
||
| serializer_class = TestSuitesDetailSerializer | ||
| permission_classes = (HasProjectAccess,) | ||
| # permission_classes = (HasProjectAccess,) |
There was a problem hiding this comment.
Please don't push this, apply this on all backend commented code
| DEFAULT_AUTO_FIELD = "django.db.models.BigAutoField" | ||
| AUTH_USER_MODEL = "test_tracker.User" | ||
|
|
||
| print("config",config("CLIENT_DOMAIN_NAME")) |
There was a problem hiding this comment.
Remove the debug line
Description
add test plan
Changes
Related issues
#25