diff --git a/src/view/pipeline/app/start-pipeline/StartPipelineModal.tsx b/src/view/pipeline/app/start-pipeline/StartPipelineModal.tsx index 80d4294d..c71b1a37 100644 --- a/src/view/pipeline/app/start-pipeline/StartPipelineModal.tsx +++ b/src/view/pipeline/app/start-pipeline/StartPipelineModal.tsx @@ -12,144 +12,14 @@ import { startPipelineSchema } from '../modals/validation-utils'; import ModalStructure from '../common/ModalStructure'; import StartPipelineForm from './StartPipelineForm'; -const pipeline: Pipeline = { - 'apiVersion': 'tekton.dev/v1beta1', - 'kind': 'Pipeline', - 'metadata': { - 'annotations': { - 'kubectl.kubernetes.io/last-applied-configuration': '{\'apiVersion\':\'tekton.dev/v1beta1\',\'kind\':\'Pipeline\',\'metadata\':{\'annotations\':{},\'name\':\'build-and-deploy\',\'namespace\':\'pipelines-tutorial\'},\'spec\':{\'params\':[{\'description\':\'name of the deployment to be patched\',\'name\':\'deployment-name\',\'type\':\'string\'}],\'resources\':[{\'name\':\'git-repo\',\'type\':\'git\'},{\'name\':\'image\',\'type\':\'image\'}],\'tasks\':[{\'name\':\'build-image\',\'params\':[{\'name\':\'TLSVERIFY\',\'value\':\'false\'}],\'resources\':{\'inputs\':[{\'name\':\'source\',\'resource\':\'git-repo\'}],\'outputs\':[{\'name\':\'image\',\'resource\':\'image\'}]},\'taskRef\':{\'kind\':\'ClusterTask\',\'name\':\'buildah\'}},{\'name\':\'apply-manifests\',\'resources\':{\'inputs\':[{\'name\':\'source\',\'resource\':\'git-repo\'}]},\'runAfter\':[\'build-image\'],\'taskRef\':{\'name\':\'apply-manifests\'}},{\'name\':\'update-deployment\',\'params\':[{\'name\':\'deployment\',\'value\':\'$(params.deployment-name)\'}],\'resources\':{\'inputs\':[{\'name\':\'image\',\'resource\':\'image\'}]},\'runAfter\':[\'apply-manifests\'],\'taskRef\':{\'name\':\'update-deployment\'}}]}}\n' - }, - 'creationTimestamp': '2020-06-05T14:28:13Z', - 'generation': 1, - 'managedFields': [ - { - 'apiVersion': 'tekton.dev/v1beta1', - 'fieldsType': 'FieldsV1', - 'fieldsV1': { - 'f:metadata': { - 'f:annotations': { - '.': {}, - 'f:kubectl.kubernetes.io/last-applied-configuration': {} - } - }, - 'f:spec': { - '.': {}, - 'f:params': {}, - 'f:resources': {}, - 'f:tasks': {} - } - }, - 'manager': 'oc', - 'operation': 'Update', - 'time': '2020-06-05T14:28:13Z' - } - ], - 'name': 'build-and-deploy', - 'namespace': 'pipelines-tutorial', - 'resourceVersion': '56200', - 'selfLink': '/apis/tekton.dev/v1beta1/namespaces/pipelines-tutorial/pipelines/build-and-deploy', - 'uid': 'a771e905-15c7-4966-a743-66bbfc60de39' - }, - 'spec': { - 'params': [ - { - 'description': 'name of the deployment to be patched', - 'name': 'deployment-name', - 'type': 'string' - } - ], - 'resources': [ - { - 'name': 'git-repo', - 'type': 'git' - }, - { - 'name': 'image', - 'type': 'image' - } - ], - 'tasks': [ - { - 'name': 'build-image', - 'params': [ - { - 'name': 'TLSVERIFY', - 'value': 'false' - } - ], - 'resources': { - 'inputs': [ - { - 'name': 'source', - 'resource': 'git-repo' - } - ], - 'outputs': [ - { - 'name': 'image', - 'resource': 'image' - } - ] - }, - 'taskRef': { - 'kind': 'ClusterTask', - 'name': 'buildah' - } - }, - { - 'name': 'apply-manifests', - 'resources': { - 'inputs': [ - { - 'name': 'source', - 'resource': 'git-repo' - } - ] - }, - 'runAfter': [ - 'build-image' - ], - 'taskRef': { - 'kind': 'Task', - 'name': 'apply-manifests' - } - }, - { - 'name': 'update-deployment', - 'params': [ - { - 'name': 'deployment', - 'value': '$(params.deployment-name)' - } - ], - 'resources': { - 'inputs': [ - { - 'name': 'image', - 'resource': 'image' - } - ] - }, - 'runAfter': [ - 'apply-manifests' - ], - 'taskRef': { - 'kind': 'Task', - 'name': 'update-deployment' - } - } - ] - } -} - // const pipeline: Pipeline = { // 'apiVersion': 'tekton.dev/v1beta1', // 'kind': 'Pipeline', // 'metadata': { // 'annotations': { -// 'kubectl.kubernetes.io/last-applied-configuration': '{"apiVersion":"tekton.dev/v1beta1","kind":"Pipeline","metadata":{"annotations":{},"name":"fetch-and-print-recipe","namespace":"pipelines-tutorial"},"spec":{"tasks":[{"name":"fetch-the-recipe","taskRef":{"name":"fetch-secure-data"},"workspaces":[{"name":"super-secret-password","workspace":"password-vault"},{"name":"secure-store","workspace":"recipe-store"},{"name":"filedrop","workspace":"shared-data"}]},{"name":"print-the-recipe","params":[{"name":"filename","value":"recipe.txt"}],"runAfter":["fetch-the-recipe"],"taskRef":{"name":"print-data"},"workspaces":[{"name":"storage","workspace":"shared-data"}]}],"workspaces":[{"name":"password-vault"},{"name":"recipe-store"},{"name":"shared-data"}]}}\n' +// 'kubectl.kubernetes.io/last-applied-configuration': '{\'apiVersion\':\'tekton.dev/v1beta1\',\'kind\':\'Pipeline\',\'metadata\':{\'annotations\':{},\'name\':\'build-and-deploy\',\'namespace\':\'pipelines-tutorial\'},\'spec\':{\'params\':[{\'description\':\'name of the deployment to be patched\',\'name\':\'deployment-name\',\'type\':\'string\'}],\'resources\':[{\'name\':\'git-repo\',\'type\':\'git\'},{\'name\':\'image\',\'type\':\'image\'}],\'tasks\':[{\'name\':\'build-image\',\'params\':[{\'name\':\'TLSVERIFY\',\'value\':\'false\'}],\'resources\':{\'inputs\':[{\'name\':\'source\',\'resource\':\'git-repo\'}],\'outputs\':[{\'name\':\'image\',\'resource\':\'image\'}]},\'taskRef\':{\'kind\':\'ClusterTask\',\'name\':\'buildah\'}},{\'name\':\'apply-manifests\',\'resources\':{\'inputs\':[{\'name\':\'source\',\'resource\':\'git-repo\'}]},\'runAfter\':[\'build-image\'],\'taskRef\':{\'name\':\'apply-manifests\'}},{\'name\':\'update-deployment\',\'params\':[{\'name\':\'deployment\',\'value\':\'$(params.deployment-name)\'}],\'resources\':{\'inputs\':[{\'name\':\'image\',\'resource\':\'image\'}]},\'runAfter\':[\'apply-manifests\'],\'taskRef\':{\'name\':\'update-deployment\'}}]}}\n' // }, -// 'creationTimestamp': '2020-06-12T16:05:41Z', +// 'creationTimestamp': '2020-06-05T14:28:13Z', // 'generation': 1, // 'managedFields': [ // { @@ -164,81 +34,211 @@ const pipeline: Pipeline = { // }, // 'f:spec': { // '.': {}, -// 'f:tasks': {}, -// 'f:workspaces': {} +// 'f:params': {}, +// 'f:resources': {}, +// 'f:tasks': {} // } // }, -// 'manager': 'kubectl', +// 'manager': 'oc', // 'operation': 'Update', -// 'time': '2020-06-12T16:05:41Z' +// 'time': '2020-06-05T14:28:13Z' // } // ], -// 'name': 'fetch-and-print-recipe', +// 'name': 'build-and-deploy', // 'namespace': 'pipelines-tutorial', -// 'resourceVersion': '41631', -// 'selfLink': '/apis/tekton.dev/v1beta1/namespaces/pipelines-tutorial/pipelines/fetch-and-print-recipe', -// 'uid': '521708a0-5e83-4ba5-b4db-ba5c78f6f7f1' +// 'resourceVersion': '56200', +// 'selfLink': '/apis/tekton.dev/v1beta1/namespaces/pipelines-tutorial/pipelines/build-and-deploy', +// 'uid': 'a771e905-15c7-4966-a743-66bbfc60de39' // }, // 'spec': { +// 'params': [ +// { +// 'description': 'name of the deployment to be patched', +// 'name': 'deployment-name', +// 'type': 'string' +// } +// ], +// 'resources': [ +// { +// 'name': 'git-repo', +// 'type': 'git' +// }, +// { +// 'name': 'image', +// 'type': 'image' +// } +// ], // 'tasks': [ // { -// 'name': 'fetch-the-recipe', -// 'taskRef': { -// 'kind': 'Task', -// 'name': 'fetch-secure-data' -// }, -// 'workspaces': [ -// { -// 'name': 'super-secret-password', -// 'workspace': 'password-vault' -// }, -// { -// 'name': 'secure-store', -// 'workspace': 'recipe-store' -// }, +// 'name': 'build-image', +// 'params': [ // { -// 'name': 'filedrop', -// 'workspace': 'shared-data' +// 'name': 'TLSVERIFY', +// 'value': 'false' // } -// ] +// ], +// 'resources': { +// 'inputs': [ +// { +// 'name': 'source', +// 'resource': 'git-repo' +// } +// ], +// 'outputs': [ +// { +// 'name': 'image', +// 'resource': 'image' +// } +// ] +// }, +// 'taskRef': { +// 'kind': 'ClusterTask', +// 'name': 'buildah' +// } +// }, +// { +// 'name': 'apply-manifests', +// 'resources': { +// 'inputs': [ +// { +// 'name': 'source', +// 'resource': 'git-repo' +// } +// ] +// }, +// 'runAfter': [ +// 'build-image' +// ], +// 'taskRef': { +// 'kind': 'Task', +// 'name': 'apply-manifests' +// } // }, // { -// 'name': 'print-the-recipe', +// 'name': 'update-deployment', // 'params': [ // { -// 'name': 'filename', -// 'value': 'recipe.txt' +// 'name': 'deployment', +// 'value': '$(params.deployment-name)' // } // ], +// 'resources': { +// 'inputs': [ +// { +// 'name': 'image', +// 'resource': 'image' +// } +// ] +// }, // 'runAfter': [ -// 'fetch-the-recipe' +// 'apply-manifests' // ], // 'taskRef': { // 'kind': 'Task', -// 'name': 'print-data' -// }, -// 'workspaces': [ -// { -// 'name': 'storage', -// 'workspace': 'shared-data' -// } -// ] -// } -// ], -// 'workspaces': [ -// { -// 'name': 'password-vault' -// }, -// { -// 'name': 'recipe-store' -// }, -// { -// 'name': 'shared-data' +// 'name': 'update-deployment' +// } // } // ] // } // } +const pipeline: Pipeline = { + 'apiVersion': 'tekton.dev/v1beta1', + 'kind': 'Pipeline', + 'metadata': { + 'annotations': { + 'kubectl.kubernetes.io/last-applied-configuration': '{"apiVersion":"tekton.dev/v1beta1","kind":"Pipeline","metadata":{"annotations":{},"name":"fetch-and-print-recipe","namespace":"pipelines-tutorial"},"spec":{"tasks":[{"name":"fetch-the-recipe","taskRef":{"name":"fetch-secure-data"},"workspaces":[{"name":"super-secret-password","workspace":"password-vault"},{"name":"secure-store","workspace":"recipe-store"},{"name":"filedrop","workspace":"shared-data"}]},{"name":"print-the-recipe","params":[{"name":"filename","value":"recipe.txt"}],"runAfter":["fetch-the-recipe"],"taskRef":{"name":"print-data"},"workspaces":[{"name":"storage","workspace":"shared-data"}]}],"workspaces":[{"name":"password-vault"},{"name":"recipe-store"},{"name":"shared-data"}]}}\n' + }, + 'creationTimestamp': '2020-06-12T16:05:41Z', + 'generation': 1, + 'managedFields': [ + { + 'apiVersion': 'tekton.dev/v1beta1', + 'fieldsType': 'FieldsV1', + 'fieldsV1': { + 'f:metadata': { + 'f:annotations': { + '.': {}, + 'f:kubectl.kubernetes.io/last-applied-configuration': {} + } + }, + 'f:spec': { + '.': {}, + 'f:tasks': {}, + 'f:workspaces': {} + } + }, + 'manager': 'kubectl', + 'operation': 'Update', + 'time': '2020-06-12T16:05:41Z' + } + ], + 'name': 'fetch-and-print-recipe', + 'namespace': 'pipelines-tutorial', + 'resourceVersion': '41631', + 'selfLink': '/apis/tekton.dev/v1beta1/namespaces/pipelines-tutorial/pipelines/fetch-and-print-recipe', + 'uid': '521708a0-5e83-4ba5-b4db-ba5c78f6f7f1' + }, + 'spec': { + 'tasks': [ + { + 'name': 'fetch-the-recipe', + 'taskRef': { + 'kind': 'Task', + 'name': 'fetch-secure-data' + }, + 'workspaces': [ + { + 'name': 'super-secret-password', + 'workspace': 'password-vault' + }, + { + 'name': 'secure-store', + 'workspace': 'recipe-store' + }, + { + 'name': 'filedrop', + 'workspace': 'shared-data' + } + ] + }, + { + 'name': 'print-the-recipe', + 'params': [ + { + 'name': 'filename', + 'value': 'recipe.txt' + } + ], + 'runAfter': [ + 'fetch-the-recipe' + ], + 'taskRef': { + 'kind': 'Task', + 'name': 'print-data' + }, + 'workspaces': [ + { + 'name': 'storage', + 'workspace': 'shared-data' + } + ] + } + ], + 'workspaces': [ + { + 'name': 'password-vault' + }, + { + 'name': 'recipe-store' + }, + { + 'name': 'shared-data' + } + ] + } +} + // eslint-disable-next-line @typescript-eslint/explicit-function-return-type diff --git a/src/view/pipeline/app/utils/_dropdown.scss b/src/view/pipeline/app/utils/_dropdown.scss new file mode 100644 index 00000000..37a19f17 --- /dev/null +++ b/src/view/pipeline/app/utils/_dropdown.scss @@ -0,0 +1,76 @@ +$co-side-nav-font-size: 16px; + +.pf-c-dropdown__toggle { + position: relative; + display: flex; + align-items: center; + justify-content: space-between; + min-width: var(--pf-c-dropdown__toggle--MinWidth); + max-width: 100%; + padding: var(--pf-c-dropdown__toggle--PaddingTop) var(--pf-c-dropdown__toggle--PaddingRight) var(--pf-c-dropdown__toggle--PaddingBottom) var(--pf-c-dropdown__toggle--PaddingLeft); + font-size: var(--pf-c-dropdown__toggle--FontSize); + font-weight: var(--pf-c-dropdown__toggle--FontWeight); + line-height: var(--pf-c-dropdown__toggle--LineHeight); + color: var(--pf-c-dropdown__toggle--Color); + background-color: var(--pf-c-dropdown__toggle--BackgroundColor); + border: none; +} + +.dropdown--full-width { + &, + .pf-c-dropdown__toggle { + justify-content: space-between; + width: 100%; + } +} + +.pf-c-dropdown__menu-item { + padding-left: 7px; +} + +.pf-c-dropdown__menu-item, +// For Edge +.pf-c-dropdown__toggle { + h1 { + font-size: $co-side-nav-font-size; + } +} + +.co-namespace-selector .dropdown-menu__autocomplete-filter { + li { + display: flex; + padding: 0; + &:focus { + outline: none; + } + &.active a { + background-color: var(--pf-global--BackgroundColor--150); + } + a { + cursor: pointer; + flex-grow: 1; + width: 100%; + &.disabled { + color: var(--pf-global--Color--dark-200); + cursor: not-allowed; + &:active, + &:focus, + &:hover { + background-color: inherit; + border-color: transparent; + color: var(--pf-global--Color--dark-200) !important; + } + } + &.next-to-bookmark { + padding-left: 5px + } + } + } + + ul { + list-style: none; + margin: 0; + padding: 0; + } +} + diff --git a/src/view/pipeline/app/utils/dropdown.jsx b/src/view/pipeline/app/utils/dropdown.jsx index 7a4c7796..ae745b8a 100644 --- a/src/view/pipeline/app/utils/dropdown.jsx +++ b/src/view/pipeline/app/utils/dropdown.jsx @@ -2,6 +2,7 @@ import * as _ from 'lodash-es'; import * as React from 'react'; import * as classNames from 'classnames'; import { CaretDownIcon, MinusCircleIcon, PlusCircleIcon, StarIcon } from '@patternfly/react-icons'; +import './_dropdown.scss' export class DropdownMixin extends React.PureComponent { constructor(props) {