Skip to content

Move integration channel placeholder var into constant

What does this MR do and why?

Currently the integration channel placeholder is hardcoded in trigger_fields.vue, JH wants to extend this since we are adding some JH only integration type.

Screenshots or screen recordings

before

// integrations/edit/components/trigger_fields.vue
const typeWithPlaceholder = {
  SLACK: 'slack',
  MATTERMOST: 'mattermost',
};

const placeholderForType = {
  [typeWithPlaceholder.SLACK]: __('#general, #development'),
  [typeWithPlaceholder.MATTERMOST]: __('my-channel'),
};

upstream after

// integrations/edit/components/trigger_fields.vue
const INTEGRATION_TYPE_SLACK = 'slack';
const INTEGRATION_TYPE_MATTERMOST = 'mattermost';

export const placeholderForType = {
  [INTEGRATION_TYPE_SLACK]: __('#general, #development'),
  [INTEGRATION_TYPE_MATTERMOST]: __('my-channel'),
};

JH after

import {s__} from '~/locale';
import {
  placeholderForType as cePlaceholderForType
} from '~/integrations/constants';

export * from '~/integrations/constants';

const INTEGRATION_TYPE_FEISHU = 'feishu';

export const placeholderForType = {
  ...cePlaceholderForType,
  [INTEGRATION_TYPE_FEISHU]: s__('JH_INTEGRATION|general, development')
};

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

/cc @daveliu

Edited by MAO Chao

Merge request reports