Skip to content

Commit

Permalink
chore: Revert #31102 (#33612)
Browse files Browse the repository at this point in the history
This reverts commit 9aff835.
  • Loading branch information
yash-rajpal authored and ggazzo committed Oct 17, 2024
1 parent 813a032 commit 31703f7
Show file tree
Hide file tree
Showing 77 changed files with 353 additions and 69 deletions.
5 changes: 0 additions & 5 deletions .changeset/large-clouds-talk.md

This file was deleted.

2 changes: 2 additions & 0 deletions apps/meteor/app/api/server/v1/settings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,8 @@ API.v1.addRoute(
(service as OAuthConfiguration).clientId ||
(service as TwitterOAuthConfiguration).consumerKey,
buttonLabelText: service.buttonLabelText || '',
buttonColor: service.buttonColor || '',
buttonLabelColor: service.buttonLabelColor || '',
custom: false,
};
}),
Expand Down
2 changes: 2 additions & 0 deletions apps/meteor/app/apple/server/appleOauthRegisterService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,8 @@ settings.watchMultiple(
enabled: settings.get('Accounts_OAuth_Apple'),
loginStyle: 'popup',
clientId: clientId as string,
buttonColor: '#000',
buttonLabelColor: '#FFF',
},
},
);
Expand Down
2 changes: 2 additions & 0 deletions apps/meteor/app/dolphin/server/lib.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@ Meteor.startup(async () => {
if (settings.get('Accounts_OAuth_Dolphin_URL')) {
const data = {
buttonLabelText: settings.get<string>('Accounts_OAuth_Dolphin_button_label_text'),
buttonColor: settings.get<string>('Accounts_OAuth_Dolphin_button_color'),
buttonLabelColor: settings.get<string>('Accounts_OAuth_Dolphin_button_label_color'),
clientId: settings.get<string>('Accounts_OAuth_Dolphin_id'),
secret: settings.get<string>('Accounts_OAuth_Dolphin_secret'),
serverURL: settings.get<string>('Accounts_OAuth_Dolphin_URL'),
Expand Down
2 changes: 2 additions & 0 deletions apps/meteor/app/lib/server/methods/removeOAuthService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,8 @@ Meteor.methods<ServerMethods>({
`Accounts_OAuth_Custom-${name}-id`,
`Accounts_OAuth_Custom-${name}-secret`,
`Accounts_OAuth_Custom-${name}-button_label_text`,
`Accounts_OAuth_Custom-${name}-button_label_color`,
`Accounts_OAuth_Custom-${name}-button_color`,
`Accounts_OAuth_Custom-${name}-login_style`,
`Accounts_OAuth_Custom-${name}-key_field`,
`Accounts_OAuth_Custom-${name}-username_field`,
Expand Down
10 changes: 10 additions & 0 deletions apps/meteor/app/meteor-accounts-saml/server/lib/settings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ import {
const getSamlConfigs = function (service: string): SAMLConfiguration {
const configs: SAMLConfiguration = {
buttonLabelText: settings.get(`${service}_button_label_text`),
buttonLabelColor: settings.get(`${service}_button_label_color`),
buttonColor: settings.get(`${service}_button_color`),
clientConfig: {
provider: settings.get<string>(`${service}_provider`),
},
Expand Down Expand Up @@ -225,6 +227,14 @@ export const addSettings = async function (name: string): Promise<void> {
type: 'string',
i18nLabel: 'Accounts_OAuth_Custom_Button_Label_Text',
});
await this.add(`SAML_Custom_${name}_button_label_color`, '#FFFFFF', {
type: 'string',
i18nLabel: 'Accounts_OAuth_Custom_Button_Label_Color',
});
await this.add(`SAML_Custom_${name}_button_color`, '#1d74f5', {
type: 'string',
i18nLabel: 'Accounts_OAuth_Custom_Button_Color',
});
});

await this.section('SAML_Section_3_Behavior', async function () {
Expand Down
2 changes: 2 additions & 0 deletions apps/meteor/definition/externals/service-configuration.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ declare module 'meteor/service-configuration' {
service: string;

buttonLabelText?: string;
buttonLabelColor?: string;
buttonColor?: string;

clientConfig: unknown;
clientId?: string;
Expand Down
2 changes: 2 additions & 0 deletions apps/meteor/server/lib/cas/updateCasService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ export async function updateCasServices(): Promise<void> {
login_url: settings.get('CAS_login_url'),
// Rocketchat Visuals
buttonLabelText: settings.get('CAS_button_label_text'),
buttonLabelColor: settings.get('CAS_button_label_color'),
buttonColor: settings.get('CAS_button_color'),
width: settings.get('CAS_popup_width'),
height: settings.get('CAS_popup_height'),
autoclose: settings.get('CAS_autoclose'),
Expand Down
14 changes: 14 additions & 0 deletions apps/meteor/server/lib/oauth/addOAuthService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,20 @@ export async function addOAuthService(name: string, values: { [k: string]: strin
i18nLabel: 'Accounts_OAuth_Custom_Button_Label_Text',
persistent: true,
});
await settingsRegistry.add(`Accounts_OAuth_Custom-${name}-button_label_color`, values.buttonLabelColor || '#FFFFFF', {
type: 'string',
group: 'OAuth',
section: `Custom OAuth: ${name}`,
i18nLabel: 'Accounts_OAuth_Custom_Button_Label_Color',
persistent: true,
});
await settingsRegistry.add(`Accounts_OAuth_Custom-${name}-button_color`, values.buttonColor || '#1d74f5', {
type: 'string',
group: 'OAuth',
section: `Custom OAuth: ${name}`,
i18nLabel: 'Accounts_OAuth_Custom_Button_Color',
persistent: true,
});
await settingsRegistry.add(`Accounts_OAuth_Custom-${name}-key_field`, values.keyField || 'username', {
type: 'select',
group: 'OAuth',
Expand Down
2 changes: 2 additions & 0 deletions apps/meteor/server/lib/oauth/initCustomOAuthServices.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,9 @@ export async function initCustomOAuthServices(): Promise<void> {
scope: process.env[`${serviceKey}_scope`],
accessTokenParam: process.env[`${serviceKey}_access_token_param`],
buttonLabelText: process.env[`${serviceKey}_button_label_text`],
buttonLabelColor: process.env[`${serviceKey}_button_label_color`],
loginStyle: process.env[`${serviceKey}_login_style`],
buttonColor: process.env[`${serviceKey}_button_color`],
tokenSentVia: process.env[`${serviceKey}_token_sent_via`],
identityTokenSentVia: process.env[`${serviceKey}_identity_token_sent_via`],
keyField: process.env[`${serviceKey}_key_field`],
Expand Down
4 changes: 4 additions & 0 deletions apps/meteor/server/lib/oauth/updateOAuthServices.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,9 @@ export async function updateOAuthServices(): Promise<void> {
data.scope = settings.get(`${key}-scope`);
data.accessTokenParam = settings.get(`${key}-access_token_param`);
data.buttonLabelText = settings.get(`${key}-button_label_text`);
data.buttonLabelColor = settings.get(`${key}-button_label_color`);
data.loginStyle = settings.get(`${key}-login_style`);
data.buttonColor = settings.get(`${key}-button_color`);
data.tokenSentVia = settings.get(`${key}-token_sent_via`);
data.identityTokenSentVia = settings.get(`${key}-identity_token_sent_via`);
data.keyField = settings.get(`${key}-key_field`);
Expand Down Expand Up @@ -110,6 +112,8 @@ export async function updateOAuthServices(): Promise<void> {

if (serviceName === 'Nextcloud') {
data.buttonLabelText = settings.get('Accounts_OAuth_Nextcloud_button_label_text');
data.buttonLabelColor = settings.get('Accounts_OAuth_Nextcloud_button_label_color');
data.buttonColor = settings.get('Accounts_OAuth_Nextcloud_button_color');
}

await LoginServiceConfiguration.createOrUpdateService(serviceKey, data);
Expand Down
2 changes: 2 additions & 0 deletions apps/meteor/server/settings/cas.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ export const createCasSettings = () =>
await this.add('CAS_popup_width', 810, { type: 'int', group: 'CAS', public: true });
await this.add('CAS_popup_height', 610, { type: 'int', group: 'CAS', public: true });
await this.add('CAS_button_label_text', 'CAS', { type: 'string', group: 'CAS' });
await this.add('CAS_button_label_color', '#FFFFFF', { type: 'color', group: 'CAS' });
await this.add('CAS_button_color', '#1d74f5', { type: 'color', group: 'CAS' });
await this.add('CAS_autoclose', true, { type: 'boolean', group: 'CAS' });
});
});
22 changes: 22 additions & 0 deletions apps/meteor/server/settings/oauth.ts
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,18 @@ export const createOauthSettings = () =>
i18nLabel: 'Accounts_OAuth_Custom_Button_Label_Text',
persistent: true,
});
await this.add('Accounts_OAuth_Nextcloud_button_label_color', '#ffffff', {
type: 'string',
public: true,
i18nLabel: 'Accounts_OAuth_Custom_Button_Label_Color',
persistent: true,
});
await this.add('Accounts_OAuth_Nextcloud_button_color', '#0082c9', {
type: 'string',
public: true,
i18nLabel: 'Accounts_OAuth_Custom_Button_Color',
persistent: true,
});
});

await this.section('Tokenpass', async function () {
Expand Down Expand Up @@ -257,6 +269,16 @@ export const createOauthSettings = () =>
i18nLabel: 'Accounts_OAuth_Custom_Button_Label_Text',
persistent: true,
});
await this.add('Accounts_OAuth_Dolphin_button_label_color', '#FFFFFF', {
type: 'string',
i18nLabel: 'Accounts_OAuth_Custom_Button_Label_Color',
persistent: true,
});
await this.add('Accounts_OAuth_Dolphin_button_color', '#1d74f5', {
type: 'string',
i18nLabel: 'Accounts_OAuth_Custom_Button_Color',
persistent: true,
});
});
await this.section('Facebook', async function () {
const enableQuery = {
Expand Down
1 change: 0 additions & 1 deletion apps/meteor/server/startup/migrations/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,5 @@ import './v310';
import './v311';
import './v312';
import './v313';
import './v314';

export * from './xrun';
18 changes: 0 additions & 18 deletions apps/meteor/server/startup/migrations/v314.ts

This file was deleted.

6 changes: 6 additions & 0 deletions packages/core-typings/src/ILoginServiceConfiguration.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,9 @@ export type OAuthConfiguration = {
scope: string;
accessTokenParam: string;
buttonLabelText: string;
buttonLabelColor: string;
loginStyle: '' | 'redirect' | 'popup';
buttonColor: string;
tokenSentVia: 'header' | 'payload';
identityTokenSentVia: 'default' | 'header' | 'payload';
keyField: 'username' | 'email';
Expand Down Expand Up @@ -53,13 +55,17 @@ export type CASConfiguration = {
base_url: string;
login_url: string;
buttonLabelText: string;
buttonLabelColor: string;
buttonColor: string;
width: number;
height: number;
autoclose: boolean;
};

export type SAMLConfiguration = {
buttonLabelText: string;
buttonLabelColor: string;
buttonColor: string;
clientConfig: {
provider?: string;
};
Expand Down
6 changes: 5 additions & 1 deletion packages/i18n/src/locales/af.i18n.json
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,8 @@
"Accounts_LoginExpiration": "Inloggen Expiration in Days",
"Accounts_ManuallyApproveNewUsers": "Handmatig nuwe gebruikers goedkeur",
"Accounts_OAuth_Custom_Authorize_Path": "Gee pad toe",
"Accounts_OAuth_Custom_Button_Color": "Knoppie Kleur",
"Accounts_OAuth_Custom_Button_Label_Color": "Knoppie Tekst Kleur",
"Accounts_OAuth_Custom_Button_Label_Text": "Knoppie teks",
"Accounts_OAuth_Custom_Enable": "in staat te stel",
"Accounts_OAuth_Custom_id": "id",
Expand Down Expand Up @@ -407,6 +409,8 @@
"CAS_autoclose": "Autoclose Inloggen Popup",
"CAS_base_url": "SSO-basis-URL",
"CAS_base_url_Description": "Die basis-URL van u eksterne SSO-diens, byvoorbeeld: https: //sso.example.undef/sso/",
"CAS_button_color": "Login Button Agtergrond Kleur",
"CAS_button_label_color": "Intekenknoppie Teks Kleur",
"CAS_button_label_text": "Inlogknoppie",
"CAS_enabled": "enabled",
"CAS_Login_Layout": "CAS Login Layout",
Expand Down Expand Up @@ -2754,4 +2758,4 @@
"registration.component.form.sendConfirmationEmail": "Stuur bevestiging e-pos",
"Enterprise": "onderneming",
"UpgradeToGetMore_engagement-dashboard_Title": "Analytics"
}
}
4 changes: 4 additions & 0 deletions packages/i18n/src/locales/ar.i18n.json
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,8 @@
"Accounts_OAuth_Custom_Access_Token_Param": "اسم المؤشر للرمز المميز للوصول",
"Accounts_OAuth_Custom_Authorize_Path": "مسار التخويل",
"Accounts_OAuth_Custom_Avatar_Field": "حقل الصورة الرمزية",
"Accounts_OAuth_Custom_Button_Color": "لون الزر",
"Accounts_OAuth_Custom_Button_Label_Color": "لون نَص الزر",
"Accounts_OAuth_Custom_Button_Label_Text": "نَص الزر",
"Accounts_OAuth_Custom_Channel_Admin": "خريطة مجموعة بيانات المستخدم",
"Accounts_OAuth_Custom_Channel_Map": "خريطة Channel لمجموعة OAuth",
Expand Down Expand Up @@ -741,6 +743,8 @@
"CAS_autoclose": "نافذة منبثقة لتسجيل الدخول التلقائي",
"CAS_base_url": "عنوان URL الأساسي الخاص بـ SSO",
"CAS_base_url_Description": "عنوان URL الأساسي لخدمة SSO الخارجية، مثل: https://sso.example.undef/sso/‎",
"CAS_button_color": "لون خلفية زر تسجيل الدخول",
"CAS_button_label_color": "لون نص زر تسجيل الدخول",
"CAS_button_label_text": "تسمية زر تسجيل الدخول",
"CAS_Creation_User_Enabled": "السماح بإنشاء مستخدم",
"CAS_Creation_User_Enabled_Description": "السماح بإنشاء مستخدم CAS من البيانات المقدمة من تذكرة CAS.",
Expand Down
6 changes: 5 additions & 1 deletion packages/i18n/src/locales/az.i18n.json
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,8 @@
"Accounts_LoginExpiration": "Günlərdən keçmə müddəti",
"Accounts_ManuallyApproveNewUsers": "Əl ilə yeni istifadəçilər təsdiqləyin",
"Accounts_OAuth_Custom_Authorize_Path": "Yola icazə verin",
"Accounts_OAuth_Custom_Button_Color": "Button Rəng",
"Accounts_OAuth_Custom_Button_Label_Color": "Button Mətn Rəngi",
"Accounts_OAuth_Custom_Button_Label_Text": "Düymə mətni",
"Accounts_OAuth_Custom_Enable": "Enable",
"Accounts_OAuth_Custom_id": "Id",
Expand Down Expand Up @@ -407,6 +409,8 @@
"CAS_autoclose": "Autoclose Giriş Popup",
"CAS_base_url": "SSO Base URL",
"CAS_base_url_Description": "Xarici SSO xidmətinizin əsas URL-si: https: //sso.example.undef/sso/",
"CAS_button_color": "Giriş Düyməsini Arxa Rəng",
"CAS_button_label_color": "Giriş Düğmə Mətn Rəngi",
"CAS_button_label_text": "Giriş Düğmesi Etiketi",
"CAS_enabled": "Etkin",
"CAS_Login_Layout": "CAS Giriş Düzeni",
Expand Down Expand Up @@ -2754,4 +2758,4 @@
"registration.component.form.sendConfirmationEmail": "Təsdiq e-poçt göndər",
"Enterprise": "Müəssisə",
"UpgradeToGetMore_engagement-dashboard_Title": "Analytics"
}
}
6 changes: 5 additions & 1 deletion packages/i18n/src/locales/be-BY.i18n.json
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,8 @@
"Accounts_ManuallyApproveNewUsers": "Пацвярджаць новых карыстальнікаў ўручную",
"Accounts_OAuth_Apple": "Увайдзі праз Apple",
"Accounts_OAuth_Custom_Authorize_Path": "Шлях да аўтарызацыі",
"Accounts_OAuth_Custom_Button_Color": "Колер кнопкі",
"Accounts_OAuth_Custom_Button_Label_Color": "Колер тэкста кнопкі",
"Accounts_OAuth_Custom_Button_Label_Text": "Тэкст кнопкі",
"Accounts_OAuth_Custom_Enable": "Ўключыць",
"Accounts_OAuth_Custom_id": "Ідэнтыфікатар",
Expand Down Expand Up @@ -423,6 +425,8 @@
"CAS_autoclose": "Autoclose Увайсці Popup",
"CAS_base_url": "URL SSO Base",
"CAS_base_url_Description": "Базавы URL вашай знешняй службы адзінага ўваходу напрыклад: https: //sso.example.undef/sso/",
"CAS_button_color": "Увайсці Кнопка Колер фону",
"CAS_button_label_color": "Увайсці Кнопка Колер тэксту",
"CAS_button_label_text": "Увайсці Кнопка Цэтлік",
"CAS_enabled": "Уключана",
"CAS_Login_Layout": "CAS Увайсці Кампаноўка",
Expand Down Expand Up @@ -2772,4 +2776,4 @@
"registration.component.form.sendConfirmationEmail": "Адправіць па электроннай пошце пацвярджэнне",
"Enterprise": "прадпрыемства",
"UpgradeToGetMore_engagement-dashboard_Title": "аналітыка"
}
}
6 changes: 5 additions & 1 deletion packages/i18n/src/locales/bg.i18n.json
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,8 @@
"Accounts_LoginExpiration": "Изтичане на влизането в дни",
"Accounts_ManuallyApproveNewUsers": "Ръчно одобрете новите потребители",
"Accounts_OAuth_Custom_Authorize_Path": "Упълномощаване на пътя",
"Accounts_OAuth_Custom_Button_Color": "цвят на бутона",
"Accounts_OAuth_Custom_Button_Label_Color": "Цвят на текста на бутона",
"Accounts_OAuth_Custom_Button_Label_Text": "Текст на бутона",
"Accounts_OAuth_Custom_Enable": "Позволи",
"Accounts_OAuth_Custom_id": "Id",
Expand Down Expand Up @@ -407,6 +409,8 @@
"CAS_autoclose": "Автоматично влизане в изскачащи прозорци",
"CAS_base_url": "Основен URL адрес на SSO",
"CAS_base_url_Description": "Основният URL адрес на външната ви SSO услуга, например: https: //sso.example.undef/sso/",
"CAS_button_color": "Цвят на фона на бутона за вход",
"CAS_button_label_color": "Бутон за въвеждане на текст",
"CAS_button_label_text": "Етикет за бутон за вход",
"CAS_enabled": "Enabled",
"CAS_Login_Layout": "Разпределение на CAS",
Expand Down Expand Up @@ -2747,4 +2751,4 @@
"registration.component.form.sendConfirmationEmail": "Изпратете имейл за потвърждение",
"Enterprise": "начинание",
"UpgradeToGetMore_engagement-dashboard_Title": "анализ"
}
}
6 changes: 5 additions & 1 deletion packages/i18n/src/locales/bs.i18n.json
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,8 @@
"Accounts_LoginExpiration": "Istek prijave u danima",
"Accounts_ManuallyApproveNewUsers": "Ručno odobri nove korisnike",
"Accounts_OAuth_Custom_Authorize_Path": "Autorizacijski put",
"Accounts_OAuth_Custom_Button_Color": "Boja Gumba",
"Accounts_OAuth_Custom_Button_Label_Color": "Boja teksta u gumbu",
"Accounts_OAuth_Custom_Button_Label_Text": "Tekst Gumba",
"Accounts_OAuth_Custom_Enable": "Omogući",
"Accounts_OAuth_Custom_id": "Id",
Expand Down Expand Up @@ -407,6 +409,8 @@
"CAS_autoclose": "Automatski zatvori prijavni prozor",
"CAS_base_url": "SSO osnovni URL",
"CAS_base_url_Description": "Osnovni URL vaše vanjske SSO usluge, npr. Https: //sso.example.undef/sso/",
"CAS_button_color": "Pozadinska boja gumba za prijavu",
"CAS_button_label_color": "Boja teksta gumba za prijavu",
"CAS_button_label_text": "Oznaka gumba za prijavu",
"CAS_enabled": "Omogućeno",
"CAS_Login_Layout": "CAS Login Layout",
Expand Down Expand Up @@ -2744,4 +2748,4 @@
"registration.component.form.sendConfirmationEmail": "Pošalji potvrdni email",
"Enterprise": "Poduzeće",
"UpgradeToGetMore_engagement-dashboard_Title": "Analitika"
}
}
4 changes: 4 additions & 0 deletions packages/i18n/src/locales/ca.i18n.json
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,8 @@
"Accounts_OAuth_Custom_Access_Token_Param": "Nom de paràmetre per al token d'accés",
"Accounts_OAuth_Custom_Authorize_Path": "Ruta d'autorització",
"Accounts_OAuth_Custom_Avatar_Field": "Camp Avatar",
"Accounts_OAuth_Custom_Button_Color": "Color del botó",
"Accounts_OAuth_Custom_Button_Label_Color": "Color del text del botó",
"Accounts_OAuth_Custom_Button_Label_Text": "Text del botó",
"Accounts_OAuth_Custom_Channel_Admin": "Mapa de grup de dades d'usuari",
"Accounts_OAuth_Custom_Channel_Map": "Mapa Channel de grup OAuth",
Expand Down Expand Up @@ -733,6 +735,8 @@
"CAS_autoclose": "Finestra emergent de tancament automàtic de sessió",
"CAS_base_url": "URL base de SSO",
"CAS_base_url_Description": "Adreça URL base del servei extern SSO. Ex: `https://sso.example.undef/sso/`",
"CAS_button_color": "Color de fons del botó d'inici de sessió",
"CAS_button_label_color": "Color de text del botó d'inici de sessió",
"CAS_button_label_text": "Etiqueta del botó d'inici de sessió",
"CAS_Creation_User_Enabled": "Permetre crear usuaris",
"CAS_Creation_User_Enabled_Description": "Permetre crear usuaris CAS a partir de les dades proporcionades pel tiquet CAS.",
Expand Down
Loading

0 comments on commit 31703f7

Please sign in to comment.