-
Notifications
You must be signed in to change notification settings - Fork 2
Add test plan #51
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
base: development_2.0.0
Are you sure you want to change the base?
Add test plan #51
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| 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) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same here
client/src/api/axios.ts
Outdated
| }) | ||
| } | ||
|
|
||
| async function UpdatePlanTitle(project_id:any,test_plan_id:any,title:any) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same here
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> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
add loading and disabled props
client/src/components/NewPlan.vue
Outdated
| type: null, | ||
| }); | ||
| const createTestPlan=async()=>{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
implement notifier
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove changes made in this file
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same here
Mahmoud-Emad
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please remove this dummy data
| } | ||
| }; | ||
| async function updatePlan(planId){ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Define the type of planId
| const title=ref(""); | ||
| function openDeleteDialog(plan) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Define the type of plan
| dialogDelete.value = true; | ||
| } | ||
| function openUpdateDialog(plan){ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Define the type of plan
|
|
||
| serializer_class = TestSuitesDetailSerializer | ||
| permission_classes = (HasProjectAccess,) | ||
| # permission_classes = (HasProjectAccess,) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove the debug line
Description
add test plan
Changes
Related issues
#25