This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const startGateway = (config, apolloGatewayConfig) => { | |
const corsOptions = { | |
origin: config.CORS_ALLOWED_ORIGINS.split(", "), | |
credentials: config.CORS_ALLOW_CREDENTIALS | |
} | |
const gateway = new ApolloGateway(apolloGatewayConfig); | |
const server = new ApolloServer({ | |
gateway, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class AcceptHeaderResolver extends AcceptHeaderLocaleResolver { | |
private static final String LOCALE_PARAM = "locale"; | |
@Override | |
public Locale resolveLocale(HttpServletRequest request) { | |
String localeParam = request.getParameter(LOCALE_PARAM); | |
if (StringUtils.hasText(localeParam)) { | |
Locale locale = StringUtils.parseLocaleString(localeParam); | |
this.setDefaultLocale(locale); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package org.hyperledger.fabric.assettransfer.exception; | |
import lombok.*; | |
import lombok.experimental.FieldDefaults; | |
import org.springframework.http.HttpStatus; | |
import java.time.LocalDateTime; | |
import java.util.List; | |
@FieldDefaults(level = AccessLevel.PRIVATE) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const {postLink} = useSelector((store) => ({ | |
postLink: store.capability.links.capabilities.href | |
})); | |
const onSubmit = async e => { | |
e.preventDefault(); | |
const newCapability = { | |
techStack, | |
numOfDevelopers, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const initialState = { | |
capabilities: [], | |
capability: {}, | |
links: {}, | |
page: { | |
totalPages: 0, | |
totalElements: 0, | |
number: 0, | |
size: 3 | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export const getAllCapabilitiesHandler = (getLink) => async dispatch => { | |
try { | |
const res = await getAllCapabilities(getLink); | |
dispatch({ | |
type: GET_CAPABILITIES, | |
payload: res.data._embedded ? res.data._embedded.capabilities : [], | |
links: res.data._links, | |
page: res.data.page | |
}); | |
} catch (error) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export const deleteCapability = (deleteLink) => { | |
return instance.delete(deleteLink); | |
} | |
export const addCapability = (capability, postLink) => { | |
return instance.post(postLink, capability); | |
} | |
export const updateCapability = (capability, updateLink) => { | |
return instance.put(updateLink, capability); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public ResponseEntity<PagedModel<CapabilityDto>> getAllCapabilitiesWithPagination(@ParameterObject Pageable pageable) { | |
Page<Capability> page = capabilityService.getAllCapabilitiesWithPagination(pageable); | |
return ResponseEntity.ok(capabilityModelAssembler.toPagedModel(page)); | |
} | |
ResponseEntity<CollectionModel<CapabilityDto>> getAllCapabilities() { | |
List<Capability> entities = capabilityService.getAllCapabilities(); | |
return ResponseEntity.ok(capabilityModelAssembler.toCollectionModel(entities)); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Component | |
@FieldDefaults(level = AccessLevel.PRIVATE) | |
@RequiredArgsConstructor | |
public class CapabilityModelAssembler implements RepresentationModelAssembler<Capability, CapabilityDto> { | |
final PagedResourcesAssembler<Capability> pagedResourcesAssembler; | |
final CapabilityMapper capabilityMapper; | |
@Override | |
public CapabilityDto toModel(Capability entity) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Schema(name="Capability", description = "Capability") | |
@FieldDefaults(level = AccessLevel.PRIVATE) | |
@Getter | |
@Setter | |
@ToString | |
@NoArgsConstructor | |
@AllArgsConstructor | |
@EqualsAndHashCode(callSuper = false) | |
@Relation(collectionRelation = "capabilities") | |
@Builder |