diff --git a/.github/workflows/code-quality.yml b/.github/workflows/code-quality.yml index d72f1f10..87b1d30f 100644 --- a/.github/workflows/code-quality.yml +++ b/.github/workflows/code-quality.yml @@ -177,7 +177,7 @@ jobs: sonarqube: runs-on: ubuntu-latest - if: ${{ github.actor != 'dependabot[bot]' }} + if: ${{ github.actor != 'dependabot[bot]' && vars.SONAR_DISABLE_CI != 'true' }} needs: unit-tests steps: - name: Checkout repository @@ -192,6 +192,15 @@ jobs: - name: SonarQube Scan uses: sonarsource/sonarqube-scan-action@v5.0.0 + with: + args: > + -Dsonar.verbose=true + -Dsonar.host.url=https://sonarcloud.io + -Dsonar.organization=speedandfunction + -Dsonar.projectKey=speedandfunction_website + -Dsonar.pullrequest.key=${{ github.event.pull_request.number }} + -Dsonar.pullrequest.branch=${{ github.head_ref }} + -Dsonar.pullrequest.base=${{ github.base_ref }} env: SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} diff --git a/website/app.js b/website/app.js index ad7db284..90a860cb 100644 --- a/website/app.js +++ b/website/app.js @@ -125,6 +125,7 @@ function createAposConfig() { 'cases-tags': {}, 'case-studies': {}, 'case-studies-page': {}, + 'business-partner': {}, 'categories': {}, 'vacancies': {}, 'vacancies-list-widget': {}, diff --git a/website/modules/@apostrophecms/admin-bar/index.js b/website/modules/@apostrophecms/admin-bar/index.js index 0e002c44..0dcad5d6 100644 --- a/website/modules/@apostrophecms/admin-bar/index.js +++ b/website/modules/@apostrophecms/admin-bar/index.js @@ -12,7 +12,7 @@ module.exports = { }, { label: 'Cases', - items: ['case-studies', 'cases-tags'], + items: ['case-studies', 'cases-tags', 'business-partner'], }, { label: 'Categories', diff --git a/website/modules/asset/ui/src/scss/_cases.scss b/website/modules/asset/ui/src/scss/_cases.scss index 98b53b69..c805bbfa 100644 --- a/website/modules/asset/ui/src/scss/_cases.scss +++ b/website/modules/asset/ui/src/scss/_cases.scss @@ -1394,3 +1394,88 @@ } } } + +// Partnership section +.cs_partnership { + z-index: 2; + text-decoration: none; + display: block; + width: 100%; + max-width: 687px; + padding: 0 20px; + + @include breakpoint-medium { + position: absolute; + top: 40px; + left: 0; + padding: 0; + } + + &:hover, + &:focus { + text-decoration: none; + + .cs_partnership-box { + box-shadow: 0 4px 12px rgba($black, 0.15); + transform: translateY(-2px); + } + } +} + +.cs_partnership-box { + background-color: $white; + padding: 8px; + display: flex; + flex-direction: row; + align-items: center; + justify-content: center; + gap: 16px; + text-align: center; + transition: all 0.3s ease; + + @include breakpoint-medium { + flex-direction: column; + width: 114px; + padding: 12px; + gap: 8px; + } +} + +.cs_partnership-label { + display: flex; + flex-direction: row; + align-items: center; + gap: 2px; + + .cs_partnership-text:nth-child(3) { + display: none; + } + + @include breakpoint-medium { + flex-direction: column; + align-items: center; + } +} + +.cs_partnership-text { + @include font-settings(11px, 110%, $font-weight-extra-bold); + color: $gray-500; + display: block; + + @include breakpoint-medium { + text-transform: uppercase; + } +} + +.cs_partnership-logo { + max-width: 100%; + height: auto; + max-height: 36px; + width: auto; + object-fit: contain; + display: block; + + @include breakpoint-medium { + max-height: 46px; + } +} diff --git a/website/modules/business-partner/index.js b/website/modules/business-partner/index.js new file mode 100644 index 00000000..e18bbfeb --- /dev/null +++ b/website/modules/business-partner/index.js @@ -0,0 +1,46 @@ +module.exports = { + extend: '@apostrophecms/piece-type', + options: { + label: 'Business Partner', + pluralLabel: 'Business Partners', + slugPrefix: 'business-partner-', + sort: { + title: 1, + }, + shortcut: false, + }, + fields: { + add: { + title: { + label: 'Partner Name', + type: 'string', + required: true, + }, + partnerLogo: { + label: 'Partner Logo', + type: 'area', + required: true, + options: { + max: 1, + min: 1, + widgets: { + '@apostrophecms/image': {}, + }, + }, + }, + partnerWebsite: { + label: 'Partner Website', + type: 'url', + required: true, + help: "Link to partner's official website (must include http(s) protocol).", + placeholder: 'https://example.com', + }, + }, + group: { + basics: { + label: 'Basics', + fields: ['title', 'partnerLogo', 'partnerWebsite'], + }, + }, + }, +}; diff --git a/website/modules/case-studies-page/views/show.html b/website/modules/case-studies-page/views/show.html index aa011a6f..fb85ac1d 100644 --- a/website/modules/case-studies-page/views/show.html +++ b/website/modules/case-studies-page/views/show.html @@ -132,6 +132,46 @@ {% endif %} + {% if data.piece._partner and data.piece._partner.length %} + {% set partner = data.piece._partner[0] %} + {% set partnerLogo = apos.image.first(partner.partnerLogo) %} + {% if partner.partnerWebsite %} + + {% else %} +
+ {% endif %} +
+
+ In partnership + with + {% if partner.title %} + {{ partner.title }} + {% endif %} +
+ {% if partnerLogo %} + + {% endif %} +
+ {% if partner.partnerWebsite %} +
+ {% else %} +
+ {% endif %} + {% endif %} +
diff --git a/website/modules/case-studies/index.js b/website/modules/case-studies/index.js index 1108f09b..69a74614 100644 --- a/website/modules/case-studies/index.js +++ b/website/modules/case-studies/index.js @@ -50,6 +50,21 @@ module.exports = { }, help: 'Select technologies utilized in the project.', }, + _partner: { + label: 'Partner', + type: 'relationship', + withType: 'business-partner', + max: 1, + builders: { + project: { + title: 1, + slug: 1, + partnerLogo: 1, + partnerWebsite: 1, + }, + }, + help: 'Select a partner for this case study.', + }, _caseStudyType: { label: 'Case Study Type', type: 'relationship', @@ -144,6 +159,7 @@ module.exports = { '_stack', '_caseStudyType', '_industry', + '_partner', 'portfolioTitle', 'descriptor', 'prodLink',