Skip to content

Commit

Permalink
Merge remote-tracking branch 'nrk/release51' into bbc-release51-3
Browse files Browse the repository at this point in the history
  • Loading branch information
mint-dewit committed Sep 27, 2024
2 parents 830d529 + 5bc0155 commit 2db3b1d
Show file tree
Hide file tree
Showing 49 changed files with 614 additions and 401 deletions.
19 changes: 15 additions & 4 deletions .github/workflows/node.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -569,13 +569,17 @@ jobs:
yarn
env:
CI: true
- name: Run generator
- name: Build OpenAPI client library
run: |
cd packages/openapi
yarn build
env:
CI: true
- name: Generate OpenAPI docs and server
run: |
cd packages/openapi
yarn gendocs
yarn genserver
yarn genclient:ts
env:
CI: true

Expand Down Expand Up @@ -664,7 +668,7 @@ jobs:
else
# make dependencies of `determine-npm-tag` available
yarn install --mode=skip-build
cd packages
PACKAGE_NAME="@sofie-automation/shared-lib"
PUBLISHED_VERSION=$(yarn npm info --json $PACKAGE_NAME | jq -c '.version' -r)
Expand All @@ -682,6 +686,13 @@ jobs:
yarn build
env:
CI: true
- name: Build OpenAPI client library
if: ${{ steps.do-publish.outputs.tag }}
run: |
cd packages/openapi
yarn build
env:
CI: true
- name: Modify dependencies to use npm packages
run: node scripts/prepublish.js
- name: Publish to NPM
Expand Down
8 changes: 8 additions & 0 deletions .github/workflows/prerelease-libs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,14 @@ jobs:
yarn build
env:
CI: true

- name: Build OpenAPI client library
if: ${{ steps.do-publish.outputs.publish }}
run: |
cd packages/openapi
yarn build
env:
CI: true
- name: Modify dependencies to use npm packages
run: node scripts/prepublish.js
- name: Publish to NPM
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/sonar.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ jobs:
name: SonarCloud
runs-on: ubuntu-latest
if: ${{ github.repository_owner == 'nrkno' && !github.event.pull_request.head.repo.fork }}
timeout-minutes: 15

steps:
- uses: actions/checkout@v4
Expand Down
4 changes: 3 additions & 1 deletion .github/workflows/trivy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ jobs:
strategy:
matrix:
image: ["server-core", "playout-gateway", "mos-gateway"]
timeout-minutes: 15

steps:
- name: Run Trivy vulnerability scanner (json)
uses: aquasecurity/[email protected]
Expand Down Expand Up @@ -54,7 +56,7 @@ jobs:
echo ${{ env.SUMMARY }}
- name: Send Slack Notification
uses: slackapi/slack-github-action@v1.26.0
uses: slackapi/slack-github-action@v1.27.0
with:
payload: |
{
Expand Down
13 changes: 13 additions & 0 deletions meteor/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,19 @@

All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.

## [1.51.0-in-testing.3](https://github.com/nrkno/sofie-core/compare/v1.51.0-in-testing.2...v1.51.0-in-testing.3) (2024-09-25)

## [1.51.0-in-testing.2](https://github.com/nrkno/sofie-core/compare/v1.51.0-in-testing.1...v1.51.0-in-testing.2) (2024-09-24)


### Bug Fixes

* allow replacement in replaceInfinitesFromPreviousPlayhead ([ebb154d](https://github.com/nrkno/sofie-core/commit/ebb154d6b59369588da400d8d921a00e41b84dc8))
* **BucketPanel:** Bucket AdLibs don't trigger when created before Rundown activation (SOFIE-3478) ([a16d977](https://github.com/nrkno/sofie-core/commit/a16d9777a301a6d7d69ea00be02b70c53cb9bdcc))
* **LinePartTimeline:** make rules for findMainPiece consistent, make infinite graphics Pieces display correctly ([153d100](https://github.com/nrkno/sofie-core/commit/153d100fb659546201a654af5c566b513951df88))
* **NoraFloatingInspector:** prevent Segment crash when trying to show a Piece with an invalid Nora `previewPayload` ([4a3a2e7](https://github.com/nrkno/sofie-core/commit/4a3a2e779c144b1c9e88c187cce2e5c80d34626d))
* resolve an issue with prompter moving when Parts become PartInstances and the prompter position is juuuust right ([a670a73](https://github.com/nrkno/sofie-core/commit/a670a73fa6bfb8331921a2bedd9c927952cfffcf))

## [1.51.0-in-testing.0](https://github.com/nrkno/sofie-core/compare/v1.50.4...v1.51.0-in-testing.0) (2024-08-19)


Expand Down
46 changes: 44 additions & 2 deletions meteor/client/lib/Components/TextInput.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,21 @@
import React, { useCallback, useState } from 'react'
import React, { useCallback, useMemo, useState } from 'react'
import ClassNames from 'classnames'
import { DropdownInputOption } from './DropdownInput'
import { getRandomString } from '@sofie-automation/corelib/dist/lib'

export type TextInputSuggestion = DropdownInputOption<string>
export interface TextInputSuggestionGroup {
name: string
options: TextInputSuggestion[]
}
interface ITextInputControlProps {
classNames?: string
modifiedClassName?: string
disabled?: boolean
placeholder?: string
spellCheck?: boolean

suggestions?: Array<TextInputSuggestionGroup | TextInputSuggestion>

/** Call handleUpdate on every change, before focus is lost */
updateOnKey?: boolean
Expand All @@ -19,6 +29,8 @@ export function TextInputControl({
value,
disabled,
placeholder,
spellCheck,
suggestions,
handleUpdate,
updateOnKey,
}: Readonly<ITextInputControlProps>): JSX.Element {
Expand Down Expand Up @@ -60,7 +72,9 @@ export function TextInputControl({
[handleUpdate]
)

return (
const fieldId = useMemo(() => getRandomString(), [])

const textInput = (
<input
type="text"
className={ClassNames('form-control', classNames, editingValue !== null && modifiedClassName)}
Expand All @@ -71,6 +85,34 @@ export function TextInputControl({
onFocus={handleFocus}
onKeyUp={handleKeyUp}
disabled={disabled}
spellCheck={spellCheck}
list={suggestions ? fieldId : undefined}
/>
)

if (!suggestions) {
return textInput
} else {
return (
<div className="input-dropdowntext">
{textInput}

<datalist id={fieldId}>
{suggestions.map((o, j) =>
'options' in o ? (
<optgroup key={j} label={o.name}>
{o.options.map((v, i) => (
<option key={i} value={v + ''}></option>
))}
</optgroup>
) : (
<option key={o.i} value={o.value + ''}>
{o.value !== o.name ? o.name : null}
</option>
)
)}
</datalist>
</div>
)
}
}
87 changes: 14 additions & 73 deletions meteor/client/lib/EditAttribute.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@ import { MultiSelect, MultiSelectEvent, MultiSelectOptions } from './multiSelect
import ClassNames from 'classnames'
import { ColorPickerEvent, ColorPicker } from './colorPicker'
import { IconPicker, IconPickerEvent } from './iconPicker'
import { assertNever, getRandomString } from '../../lib/lib'
import { assertNever } from '../../lib/lib'
import { MongoCollection } from '../../lib/collections/lib'
import { CheckboxControl } from './Components/Checkbox'
import { TextInputControl } from './Components/TextInput'
import { IntInputControl } from './Components/IntInput'
import { DropdownInputControl, getDropdownInputOptions } from './Components/DropdownInput'
import { DropdownInputControl, DropdownInputOption, getDropdownInputOptions } from './Components/DropdownInput'
import { FloatInputControl } from './Components/FloatInput'
import { joinLines, MultiLineTextInputControl, splitValueIntoLines } from './Components/MultiLineTextInput'
import { JsonTextInputControl, tryParseJson } from './Components/JsonTextInput'
Expand Down Expand Up @@ -469,81 +469,22 @@ const EditAttributeDropdown = wrapEditAttribute(
)
const EditAttributeDropdownText = wrapEditAttribute(
class EditAttributeDropdownText extends EditAttributeBase {
private _id: string

constructor(props: any) {
super(props)

this.handleChangeDropdown = this.handleChangeDropdown.bind(this)
this.handleChangeText = this.handleChangeText.bind(this)
this.handleBlurText = this.handleBlurText.bind(this)
this.handleEscape = this.handleEscape.bind(this)

this._id = getRandomString()
}
handleChangeDropdown(event: React.ChangeEvent<HTMLInputElement>) {
// because event.target.value is always a string, use the original value instead
const option = _.find(this.getOptions(), (o) => {
return o.value + '' === event.target.value + ''
})

const value = option ? option.value : event.target.value

this.handleUpdate(this.props.optionsAreNumbers ? Number(value) : value)
}
handleChangeText(event: React.ChangeEvent<HTMLInputElement>) {
this.handleChangeDropdown(event)
}
handleBlurText(event: React.FocusEvent<HTMLInputElement>) {
this.handleUpdate(event.target.value)
}
handleEscape(e: React.KeyboardEvent<HTMLInputElement>) {
if (e.key === 'Escape') {
this.handleDiscard()
}
}
getOptions() {
private getOptions(): DropdownInputOption<string>[] {
return getDropdownInputOptions(this.props.options)
}
render(): JSX.Element {
return (
<div className="input-dropdowntext">
<input
type="text"
className={
'form-control' +
' ' +
(this.state.valueError ? 'error ' : '') +
(this.props.className || '') +
' ' +
(this.state.editing ? this.props.modifiedClassName || '' : '')
}
placeholder={this.props.label}
value={this.getEditAttribute() || ''}
onChange={this.handleChangeText}
onBlur={this.handleBlurText}
onKeyUp={this.handleEscape}
disabled={this.props.disabled}
spellCheck={false}
list={this._id}
/>

<datalist id={this._id}>
{this.getOptions().map((o, j) =>
Array.isArray(o.value) ? (
<optgroup key={j} label={o.name}>
{o.value.map((v, i) => (
<option key={i} value={v + ''}></option>
))}
</optgroup>
) : (
<option key={o.i} value={o.value + ''}>
{o.value !== o.name ? o.name : null}
</option>
)
)}
</datalist>
</div>
<TextInputControl
classNames={`${this.props.className || ''} ${this.state.valueError ? 'error ' : ''}`}
modifiedClassName={this.props.modifiedClassName}
disabled={this.props.disabled}
placeholder={this.props.label}
updateOnKey={this.props.updateOnKey}
value={this.getAttribute() ?? ''}
handleUpdate={this.handleUpdate}
spellCheck={false}
suggestions={this.getOptions()}
/>
)
}
}
Expand Down
21 changes: 0 additions & 21 deletions meteor/client/lib/RenderLimiter.tsx

This file was deleted.

Loading

0 comments on commit 2db3b1d

Please sign in to comment.