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

replace hard coded api urls with templated links #5168

Merged
merged 1 commit into from
May 15, 2024
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
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ export default {
data() {
return {
entityProperties: ['camp', 'position', 'title'],
entityUri: '/activity_progress_labels',
entityUri: '',
}
},
watch: {
Expand All @@ -53,6 +53,11 @@ export default {
}
},
},
mounted() {
this.api
.href(this.api.get(), 'activityProgressLabels')
.then((uri) => (this.entityUri = uri))
},
methods: {
createDialogActivityProgressLabelCreate() {
return this.create().then(() => {
Expand Down
5 changes: 4 additions & 1 deletion frontend/src/components/campAdmin/DialogCategoryCreate.vue
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ export default {
return {
entityProperties: ['camp', 'short', 'name', 'color', 'numberingStyle'],
embeddedCollections: ['preferredContentTypes'],
entityUri: '/categories',
entityUri: '',
clipboardPermission: 'unknown',
copyCategorySource: null,
copyCategorySourceUrl: null,
Expand Down Expand Up @@ -224,6 +224,9 @@ export default {
)
},
},
mounted() {
this.api.href(this.api.get(), 'categories').then((uri) => (this.entityUri = uri))
},
methods: {
async createCategory() {
const createdCategory = await this.create()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ export default {
data() {
return {
entityProperties: ['camp', 'name'],
entityUri: '/material_lists',
entityUri: '',
}
},
watch: {
Expand All @@ -49,6 +49,9 @@ export default {
}
},
},
mounted() {
this.api.href(this.api.get(), 'materialLists').then((uri) => (this.entityUri = uri))
},
methods: {
createMaterialList() {
return this.create().then(() => {
Expand Down
5 changes: 4 additions & 1 deletion frontend/src/components/campAdmin/DialogPeriodCreate.vue
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ export default {
data() {
return {
entityProperties: ['camp', 'description', 'start', 'end'],
entityUri: '/periods',
entityUri: '',
}
},
watch: {
Expand All @@ -50,6 +50,9 @@ export default {
}
},
},
mounted() {
this.api.href(this.api.get(), 'periods').then((uri) => (this.entityUri = uri))
},
methods: {
createPeriod() {
return this.create().then(() => {
Expand Down
7 changes: 6 additions & 1 deletion frontend/src/components/collaborator/CollaboratorCreate.vue
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ export default {
data() {
return {
entityProperties: ['camp', 'inviteEmail', 'role'],
entityUri: '/camp_collaborations',
entityUri: '',
}
},
watch: {
Expand All @@ -69,6 +69,11 @@ export default {
}
},
},
mounted() {
this.api
.href(this.api.get(), 'campCollaborations')
.then((uri) => (this.entityUri = uri))
},
methods: {
createCollaboration() {
return this.create().then(() => {
Expand Down
7 changes: 6 additions & 1 deletion frontend/src/components/collaborator/CollaboratorEdit.vue
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ export default {
resendingEmail: false,
emailSent: false,
entityProperties: ['camp', 'inviteEmail', 'role', 'status'],
entityUri: '/camp_collaborations',
entityUri: '',
}
},
computed: {
Expand Down Expand Up @@ -195,6 +195,11 @@ export default {
}
},
},
mounted() {
this.api
.href(this.api.get(), 'campCollaborations')
.then((uri) => (this.entityUri = uri))
},
methods: {
resendInvitation() {
this.emailSent = true
Expand Down
5 changes: 4 additions & 1 deletion frontend/src/components/program/DialogActivityCreate.vue
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ export default {
copyActivitySourceUrlShowPopover: false,
entityProperties: ['title', 'location', 'scheduleEntries'],
embeddedEntities: ['category'],
entityUri: '/activities',
entityUri: '',
}
},
computed: {
Expand Down Expand Up @@ -247,6 +247,9 @@ export default {
)
},
},
mounted() {
this.api.href(this.api.get(), 'activities').then((url) => (this.entityUri = url))
},
methods: {
refreshCopyActivitySource() {
navigator.permissions.query({ name: 'clipboard-read' }).then(
Expand Down
Loading