Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Index: src/Components/NeoAdminFoo/Sass/NeoAdminFoo.scss
- IDEA additional info:
- Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
- <+>UTF-8
- ===================================================================
- --- src/Components/NeoAdminFoo/Sass/NeoAdminFoo.scss (date 1570721516000)
- +++ src/Components/NeoAdminFoo/Sass/NeoAdminFoo.scss (date 1571062720242)
- @@ -1,1 +1,13 @@
- +#NeoAdminFoo{
- + .hotelMargin{
- + padding: 10px;
- + }
- + .hotelImg {
- + max-width: 100%;
- + }
- +
- + .hotelDescription{
- + font-size: 14px;
- + }
- +}
- \ No newline at end of file
- Index: src/Components/NeoAdminFoo/Views/NeoAdminFoo.twig
- IDEA additional info:
- Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
- <+>UTF-8
- ===================================================================
- --- src/Components/NeoAdminFoo/Views/NeoAdminFoo.twig (date 1570721516000)
- +++ src/Components/NeoAdminFoo/Views/NeoAdminFoo.twig (date 1571062720243)
- @@ -1,1 +1,15 @@
- -<!-- HTML component content -->
- +{% block content %}
- + {% set hotelData = component.response %}
- + <div id="NeoAdminFoo">
- + <div class="row">
- + <div class="col-md-6">
- + <img class="hotelImg hotelMargin" src="{{ hotelData.media.url }}"/>
- + </div>
- + <div class="col-md-6">
- + <h1 class="hotelMargin">{{ hotelData.HotelName }}</h1>
- + <div class="hotelDescription hotelMargin">{{ hotelData.HotelDescription | raw }}</div>
- + <button id="diplayDescription" type="button" class="btn btn-primary hotelMargin">Ocultar Descripción</button>
- + </div>
- + </div>
- + </div>
- +{% endblock %}
- Index: src/Components/NeoAdminFoo/Controllers/NeoAdminFooComponent.php
- IDEA additional info:
- Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
- <+>UTF-8
- ===================================================================
- --- src/Components/NeoAdminFoo/Controllers/NeoAdminFooComponent.php (date 1570721516000)
- +++ src/Components/NeoAdminFoo/Controllers/NeoAdminFooComponent.php (date 1571062720240)
- @@ -40,7 +40,38 @@
- */
- public function getNewResponse(): ComponentResponseContract
- {
- - return new NeoAdminFooComponentResponse();
- +
- + $response = new NeoAdminFooComponentResponse();
- + //Se envia un array con una única posición por temas de testing.
- + $response = $this->getDetails([7]);
- +
- + return $response;
- + }
- +
- + /**
- + * Hace la llamada a los detalles del hotel. Seguidamente rellena el componente response, comprobando antes
- + * que el media devuelto sea una foto del hotel, y no otro tipo de documento.
- + *
- + * @param $hotelId
- + *
- + * @return NeoAdminFooComponentResponse
- + */
- + public function getDetails($hotelId): ComponentResponseContract
- + {
- + $apiResponse = ApiManager::hotelDetails($hotelId);
- + $hotelDetail = $apiResponse['hotel_detail'][0];
- + $hotelDetailResponse = new NeoAdminFooComponentResponse();
- + $hotelDetailResponse->setHotelName($hotelDetail['hotel_name']);
- + $hotelDetailResponse->setHotelDescription($hotelDetail['hotel_description']);
- + foreach ($hotelDetail['media'] as $media){
- + if($media['media_type']==='photo'){
- + $hotelDetailResponse->setMedia($media);
- + break;
- + }
- + }
- +
- +
- + return $hotelDetailResponse;
- }
- /**
- Index: src/Model/NeoAdminFooComponentRequest.php
- IDEA additional info:
- Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
- <+>UTF-8
- ===================================================================
- --- src/Model/NeoAdminFooComponentRequest.php (date 1570721516000)
- +++ src/Model/NeoAdminFooComponentRequest.php (date 1571062720244)
- @@ -58,7 +58,7 @@
- * @var string[]
- */
- protected static $swaggerTypes = [
- -
- + 'hotel_id' => 'string'
- ];
- /**
- @@ -67,7 +67,7 @@
- * @var string[]
- */
- protected static $swaggerFormats = [
- -
- + 'hotel_id' => null
- ];
- /**
- @@ -97,7 +97,7 @@
- * @var string[]
- */
- protected static $attributeMap = [
- -
- + 'hotel_id' => 'HotelId'
- ];
- /**
- @@ -106,7 +106,7 @@
- * @var string[]
- */
- protected static $setters = [
- -
- + 'hotel_id' => 'setHotelId'
- ];
- /**
- @@ -115,7 +115,7 @@
- * @var string[]
- */
- protected static $getters = [
- -
- + 'hotel_id' => 'getHotelId'
- ];
- /**
- @@ -178,6 +178,7 @@
- */
- public function __construct(array $data = null)
- {
- + $this->container['hotel_id'] = isset($data['hotel_id']) ? $data['hotel_id'] : null;
- }
- /**
- @@ -203,6 +204,30 @@
- return count($this->listInvalidProperties()) === 0;
- }
- +
- + /**
- + * Gets hotel_id
- + *
- + * @return string
- + */
- + public function getHotelId()
- + {
- + return $this->container['hotel_id'];
- + }
- +
- + /**
- + * Sets hotel_id
- + *
- + * @param string $hotel_id Hotel id which details are needed
- + *
- + * @return $this
- + */
- + public function setHotelId($hotel_id)
- + {
- + $this->container['hotel_id'] = $hotel_id;
- +
- + return $this;
- + }
- /**
- * Returns true if offset exists. False otherwise.
- *
- Index: src/Components/NeoAdminFoo/Js/NeoAdminFoo.js
- IDEA additional info:
- Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
- <+>UTF-8
- ===================================================================
- --- src/Components/NeoAdminFoo/Js/NeoAdminFoo.js (date 1570721516000)
- +++ src/Components/NeoAdminFoo/Js/NeoAdminFoo.js (date 1571062720242)
- @@ -1,5 +1,13 @@
- require('./Plugins/NeoAdminFoo');
- jQuery(window).ready(function () {
- - //$('.example_element').examplePlugin();
- + $('body').on('click','#diplayDescription',function(){
- + //Toggles the display of the description. Also changes the button text, depending of the description display.
- + $('.hotelDescription').toggle();
- + if($('.hotelDescription').css('display')==='none'){
- + $('#diplayDescription').html('Ver descripción');
- + }else {
- + $('#diplayDescription').html('Ocultar descripción');
- + }
- + });
- });
- Index: src/Model/NeoAdminFooComponentResponse.php
- IDEA additional info:
- Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
- <+>UTF-8
- ===================================================================
- --- src/Model/NeoAdminFooComponentResponse.php (date 1570721516000)
- +++ src/Model/NeoAdminFooComponentResponse.php (date 1571062720245)
- @@ -57,7 +57,10 @@
- * @var string[]
- */
- protected static $swaggerTypes = [
- - 'error' => '\NeoAdminComponents\Model\ComponentResponseError[]'
- + 'error' => '\NeoAdminComponents\Model\ComponentResponseError[]',
- + 'hotel_name' => 'string',
- + 'hotel_description' => 'string',
- + 'media' => 'object'
- ];
- /**
- @@ -66,7 +69,10 @@
- * @var string[]
- */
- protected static $swaggerFormats = [
- - 'error' => null
- + 'error' => null,
- + 'hotel_name' => null,
- + 'hotel_description' => null,
- + 'media' => null
- ];
- /**
- @@ -96,7 +102,10 @@
- * @var string[]
- */
- protected static $attributeMap = [
- - 'error' => 'Error'
- + 'error' => 'Error',
- + 'hotel_name' => 'HotelName',
- + 'hotel_description' => 'HotelDescription',
- + 'media' => 'Media'
- ];
- /**
- @@ -105,7 +114,10 @@
- * @var string[]
- */
- protected static $setters = [
- - 'error' => 'setError'
- + 'error' => 'setError',
- + 'hotel_name' => 'setHotelName',
- + 'hotel_description' => 'setHotelDescription',
- + 'media' => 'setMedia'
- ];
- /**
- @@ -114,7 +126,10 @@
- * @var string[]
- */
- protected static $getters = [
- - 'error' => 'getError'
- + 'error' => 'getError',
- + 'hotel_name' => 'getHotelName',
- + 'hotel_description' => 'getHotelDescription',
- + 'media' => 'getMedia'
- ];
- /**
- @@ -178,6 +193,9 @@
- public function __construct(array $data = null)
- {
- $this->container['error'] = isset($data['error']) ? $data['error'] : null;
- + $this->container['hotel_name'] = isset($data['hotel_name']) ? $data['hotel_name'] : null;
- + $this->container['hotel_description'] = isset($data['hotel_description']) ? $data['hotel_description'] : null;
- + $this->container['media'] = isset($data['media']) ? $data['media'] : null;
- }
- /**
- @@ -225,6 +243,78 @@
- {
- $this->container['error'] = $error;
- + return $this;
- + }
- +
- + /**
- + * Gets hotel_name
- + *
- + * @return string
- + */
- + public function getHotelName()
- + {
- + return $this->container['hotel_name'];
- + }
- +
- + /**
- + * Sets hotel_name
- + *
- + * @param string $hotel_name Name of the hotel needed
- + *
- + * @return $this
- + */
- + public function setHotelName($hotel_name)
- + {
- + $this->container['hotel_name'] = $hotel_name;
- +
- + return $this;
- + }
- +
- + /**
- + * Gets hotel_description
- + *
- + * @return string
- + */
- + public function getHotelDescription()
- + {
- + return $this->container['hotel_description'];
- + }
- +
- + /**
- + * Sets hotel_description
- + *
- + * @param string $hotel_description Description of the hotel needed
- + *
- + * @return $this
- + */
- + public function setHotelDescription($hotel_description)
- + {
- + $this->container['hotel_description'] = $hotel_description;
- +
- + return $this;
- + }
- +
- + /**
- + * Gets media
- + *
- + * @return object
- + */
- + public function getMedia()
- + {
- + return $this->container['media'];
- + }
- +
- + /**
- + * Sets media
- + *
- + * @param object $media Media details where image photo resides
- + *
- + * @return $this
- + */
- + public function setMedia($media)
- + {
- + $this->container['media'] = $media;
- +
- return $this;
- }
- /**
- Index: swagger.yaml
- IDEA additional info:
- Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
- <+>UTF-8
- ===================================================================
- --- swagger.yaml (date 1570721516000)
- +++ swagger.yaml (date 1571062720246)
- @@ -1075,9 +1075,24 @@
- description: Modelo del request del componente NeoAdminFoo
- type: object
- required: []
- + properties:
- + HotelId:
- + description: Hotel id which details are needed
- + type: string
- NeoAdminFooComponentResponse:
- allOf:
- - $ref: '#/definitions/ComponentResponse'
- - type: object
- description: Modelo del response del componente NeoAdminFoo
- + properties:
- + HotelName:
- + description: Name of the hotel needed
- + type: string
- + HotelDescription:
- + description: Description of the hotel needed
- + type: string
- + Media:
- + type: object
- + description: Media details where image photo resides
- +
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement