首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >带有Grid控件的后台模板(来自Spotify)

带有Grid控件的后台模板(来自Spotify)
EN

Stack Overflow用户
提问于 2022-08-15 19:01:58
回答 1查看 201关注 0票数 0

我正在使用Spotify的后台软件目录UX来创建产品。当使用后台模板引擎创建创建此产品的步骤时,我的问题就出现了。

当前,模板将每个参数呈现为模板窗体上的单个页面范围的文本字段。不过,我正在尝试自定义模板,以允许一组类似网格的文本字段。

是否有一种方法可以自定义"template.yaml“文件以允许每行多个文本字段(以简单的网格格式)?

EN

回答 1

Stack Overflow用户

发布于 2022-10-07 02:45:34

我希望我能正确地理解你的问题,但在这里我举了一个有“步骤”的例子:

代码语言:javascript
运行
复制
apiVersion: scaffolder.backstage.io/v1beta3
kind: Template
metadata:
  name: example-repository
  title: Example Repository
  description: An Example
  tags:
    - recommended
    - template
spec:
  owner: group:team
  type: component
  parameters:
    - title: Provide some simple information
      required:
        - component_id
        - owner
      properties:
        component_id:
          title: Name
          type: string
          description: Unique name of the component
          ui:field: EntityNamePicker
        description:
          title: Description
          type: string
          description: Help others understand what this website is for.
        owner:
          title: Owner
          type: string
          description: Owner of the component
          ui:field: OwnerPicker
          ui:options:
            allowedKinds:
              - Group
    - title: Choose a location
      required:
        - repoUrl
      properties:
        repoUrl:
          title: Repository Location
          type: string
          ui:field: RepoUrlPicker
          ui:options:
            requestUserCredentials:
              secretsKey: USER_OAUTH_TOKEN
              additionalScopes:
                github: 
                  - workflow
            allowedHosts:
              - github.com
  steps:
    - id: template
      name: Fetch Skeleton + Template
      action: fetch:template
      input:
        url: ./content
        copyWithoutRender:
          - .github/workflows/*
        values:
          component_id: ${{ parameters.component_id }}
          description: ${{ parameters.description }}
          destination: ${{ parameters.repoUrl | parseRepoUrl }}
          owner: ${{ parameters.owner }}

    - id: publish
      name: Publish
      action: publish:github
      input:
        allowedHosts: ["github.com"]
        description: This is ${{ parameters.component_id }}
        repoUrl: ${{ parameters.repoUrl }}
        repoVisibility: private
        token: ${{ secrets.USER_OAUTH_TOKEN }}

    - id: register
      name: Register
      action: catalog:register
      input:
        repoContentsUrl: ${{ steps.publish.output.repoContentsUrl }}
        catalogInfoPath: "/catalog-info.yaml"

  output:
    links:
      - title: Repository
        url: ${{ steps.publish.output.remoteUrl }}
      - title: Open in catalog
        icon: catalog
        entityRef: ${{ steps.register.output.entityRef }}
票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/73365364

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档