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

Add translation for new permission #156

Merged
merged 2 commits into from
Oct 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
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
Loading