Welcome to mirror list, hosted at ThFree Co, Russian Federation.

mock_data.js « dependency_proxy « packages_and_registries « frontend « spec - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 8bad22b5287b6ddc222e910e07782feaa3716a22 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
export const proxyData = () => ({
  dependencyProxyBlobCount: 2,
  dependencyProxyTotalSize: '1024 Bytes',
  dependencyProxyImagePrefix: 'gdk.test:3000/private-group/dependency_proxy/containers',
  dependencyProxySetting: { enabled: true, __typename: 'DependencyProxySetting' },
});

export const proxySettings = (extend = {}) => ({ enabled: true, ...extend });

export const proxyManifests = () => [
  { createdAt: '2021-09-22T09:45:28Z', imageName: 'alpine:latest' },
  { createdAt: '2021-09-21T09:45:28Z', imageName: 'alpine:stable' },
];

export const pagination = (extend) => ({
  endCursor: 'eyJpZCI6IjIwNSIsIm5hbWUiOiJteS9jb21wYW55L2FwcC9teS1hcHAifQ',
  hasNextPage: true,
  hasPreviousPage: true,
  startCursor: 'eyJpZCI6IjI0NyIsIm5hbWUiOiJ2ZXJzaW9uX3Rlc3QxIn0',
  __typename: 'PageInfo',
  ...extend,
});

export const proxyDetailsQuery = ({ extendSettings = {}, extend } = {}) => ({
  data: {
    group: {
      ...proxyData(),
      __typename: 'Group',
      dependencyProxySetting: {
        ...proxySettings(extendSettings),
        __typename: 'DependencyProxySetting',
      },
      dependencyProxyManifests: {
        nodes: proxyManifests(),
        pageInfo: pagination(),
      },
      ...extend,
    },
  },
});