Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Onboard Slack and Zoom SSO templates #7164

Merged
merged 5 commits into from
Dec 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions .changeset/witty-shoes-fly.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
"@wso2is/admin.template-core.v1": minor
"@wso2is/admin.applications.v1": patch
"@wso2is/console": patch
"@wso2is/form": patch
---

Onboard Slack and Zoom SSO templates
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
306 changes: 185 additions & 121 deletions features/admin.applications.v1/components/forms/inbound-saml-form.tsx

Large diffs are not rendered by default.

50 changes: 50 additions & 0 deletions features/admin.template-core.v1/components/form-dynamic-field.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
/**
* Copyright (c) 2024, WSO2 LLC. (https://www.wso2.com).
*
* WSO2 LLC. licenses this file to you under the Apache License,
* Version 2.0 (the "License"); you may not use this file except
* in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/

.dynamic-template-selection-field {
.oxygen-form-control {
margin-top: 0;
margin-bottom: 0;

.oxygen-input-label {
margin-top: 0;
margin-left: 0;
position: relative;
transform: unset;
-webkit-transform: unset;
}

.oxygen-select {
margin-top: 8px;
margin-bottom: 4px;
}

.oxygen-form-helper-text {
margin-top: 3px;
margin-left: 0;
margin-right: 0;
}
}
}

.dynamic-template-selection-field-dropdown {
&.MuiPopover-root {
z-index: 1500;
filter: unset !important;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,24 @@

import { getCertificateIllustrations } from "@wso2is/admin.core.v1";
import { IdentifiableComponentInterface } from "@wso2is/core/models";
import { CheckboxFieldAdapter, FilePickerAdapter, FinalFormField, FormApi, TextFieldAdapter } from "@wso2is/form";
import {
CheckboxFieldAdapter,
FilePickerAdapter,
FinalFormField,
FormApi,
SelectFieldAdapter,
TextFieldAdapter
} from "@wso2is/form";
import { Hint } from "@wso2is/react-components";
import React, { FunctionComponent, PropsWithChildren, ReactElement } from "react";
import { Icon } from "semantic-ui-react";
import {
DynamicDropdownFieldInterface,
DynamicFieldInterface,
DynamicFilePickerFieldInterface,
DynamicInputFieldTypes
} from "../models/dynamic-fields";
import "./form-dynamic-field.scss";

/**
* Prop types for the dynamic input fields.
Expand Down Expand Up @@ -139,6 +148,38 @@ export const FormDynamicField: FunctionComponent<PropsWithChildren<
}
/>
);
case DynamicInputFieldTypes.SELECT:
return (
<div className="dynamic-template-selection-field">
<FinalFormField
fullWidth
FormControlProps={ {
margin: "dense"
} }
MenuProps={ {
className: "dynamic-template-selection-field-dropdown"
} }
aria-label={ field?.["aria-label"] }
data-componentid={ field?.dataComponentId }
name={ field?.name }
type={ "dropdown" }
displayEmpty={ true }
label={ field?.label }
placeholder={ field?.placeholder }
component={ SelectFieldAdapter }
readOnly={ readOnly || field?.readOnly }
required={ field?.required }
options={ (field as DynamicDropdownFieldInterface)?.options }
helperText={
field?.helperText ? (
<Hint compact>
{ field?.helperText }
</Hint>
) : null
}
/>
</div>
);
case DynamicInputFieldTypes.FILE:
return (
<FinalFormField
Expand Down
18 changes: 16 additions & 2 deletions features/admin.template-core.v1/models/dynamic-fields.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
* under the License.
*/

import { SupportedFileTypes } from "@wso2is/form";
import { DropDownItemInterface, SupportedFileTypes } from "@wso2is/form";

/**
* Interface to define a dynamic form.
Expand Down Expand Up @@ -120,6 +120,16 @@ export interface DynamicFilePickerFieldInterface extends DynamicFieldInterface {
hidePasteOption?: boolean;
}

/**
* Data types required to render the dynamic dropdown field.
*/
export interface DynamicDropdownFieldInterface extends DynamicFieldInterface {
/**
* File type to be used in the FilePicker component.
*/
options: DropDownItemInterface[];
}

/**
* Interface for the handlers of dynamic fields.
*/
Expand Down Expand Up @@ -157,7 +167,11 @@ export enum DynamicInputFieldTypes {
/**
* File picker field.
*/
FILE = "file"
FILE = "file",
/**
* Dropdown field.
*/
SELECT = "select"
}

/**
Expand Down
3 changes: 2 additions & 1 deletion modules/form/src/components/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* Copyright (c) 2021-2023, WSO2 LLC. (https://www.wso2.com).
* Copyright (c) 2021-2024, WSO2 LLC. (https://www.wso2.com).
*
* WSO2 LLC. licenses this file to you under the Apache License,
* Version 2.0 (the "License"); you may not use this file except
Expand All @@ -20,6 +20,7 @@ export * from "./adapters/__DEPRECATED__adapters";
export * from "./adapters/text-field-adapter";
export * from "./adapters/url-field-adapter";
export * from "./adapters/file-picker-adapter";
export * from "./adapters/select-field-adapter";
export * from "./adapters/checkbox-field-adapter";

export { default as TextFieldAdapter } from "./adapters/text-field-adapter";
Expand Down
Loading