Skip to content

Commit

Permalink
Merge pull request #156 from ditrit/feature/add_new_permission
Browse files Browse the repository at this point in the history
Add translation for new permission
  • Loading branch information
Zorin95670 authored Oct 15, 2024
2 parents 44a9567 + dc6bbbf commit 0f91af8
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 3 deletions.
2 changes: 2 additions & 0 deletions src/i18n/en-US/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -645,10 +645,12 @@ export default {
LIBRARY_UPDATE_ID: 'Permission to update a specific library defined by its id',
LIBRARY_UPDATE_NULL: 'Permission to update a library',
PROJECT_CREATE_NULL: 'Permission to create a project',
PROJECT_GIT_CREATE_NULL: 'Permission to import a project from git',
PROJECT_TEMPLATE_CREATE_NULL: 'Permission to create a project from template',
libraryInfo: 'More information about library',
ADMIN: 'Administration application',
PROJECT: 'Project',
PROJECT_GIT: 'Project from git',
COMPONENT: 'Component',
DIAGRAM: 'Diagram',
PROJECT_TEMPLATE: 'Project template',
Expand Down
6 changes: 5 additions & 1 deletion src/services/LibraryService.js
Original file line number Diff line number Diff line change
Expand Up @@ -72,5 +72,9 @@ export async function create(url, role) {
export async function synchronize(id, url) {
const api = await prepareRequest();

return api.put(`/libraries/${id}`, { url }).then(({ data }) => data);
return api.put(`/libraries/${id}`, url, {
headers: {
'Content-Type': 'text/plain',
},
}).then(({ data }) => data);
}
2 changes: 1 addition & 1 deletion tests/e2e/support/step_definitions/api.js
Original file line number Diff line number Diff line change
Expand Up @@ -875,7 +875,7 @@ function setLibraryIntercepts() {
});

cy.intercept('PUT', '/api/libraries/1', (request) => {
const { url } = request.body;
const url = request.body;

if (url === 'notFound') {
request.reply({
Expand Down
6 changes: 5 additions & 1 deletion tests/unit/services/LibraryService.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,11 @@ describe('Test: LibraryService', () => {

const result = await LibraryService.synchronize('id', 'url');

expect(mockPutRequest).toBeCalledWith('/libraries/id', { url: 'url' });
expect(mockPutRequest).toBeCalledWith('/libraries/id', 'url', {
headers: {
'Content-Type': 'text/plain',
},
});
expect(result).toEqual({ id: 1 });
});
});
Expand Down

0 comments on commit 0f91af8

Please sign in to comment.