Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/release' into update/formwidget-…
Browse files Browse the repository at this point in the history
…use-btnwidget
  • Loading branch information
techbhavin committed Jul 19, 2021
2 parents 313a4b8 + dc012be commit 0953088
Show file tree
Hide file tree
Showing 81 changed files with 1,320 additions and 388 deletions.
1 change: 1 addition & 0 deletions .github/workflows/client-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,7 @@ jobs:
REACT_APP_VERSION_ID=${{ steps.vars.outputs.version }} \
REACT_APP_VERSION_RELEASE_DATE=$(date -u '+%Y-%m-%dT%H:%M:%SZ') \
REACT_APP_GOOGLE_ANALYTICS_ID=${{ secrets.GOOGLE_TAG_MANAGER_ID }} \
REACT_APP_INTERCOM_APP_ID=${{ secrets.APPSMITH_INTERCOM_ID }} \
REACT_APP_SHOW_ONBOARDING_FORM=true \
yarn build
Expand Down
7 changes: 4 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,13 @@
<p align="center">
Turn any datasource into an internal app in minutes. Appsmith lets you drag-and-drop components to build dashboards, write logic with JavaScript objects and connect to any API, database or GraphQL source.
<br />
<br>
<br />
<img src="static/images/integrations.png" width="320px">
<img width="783" alt="MVC-Github-Readme" src="https://user-images.githubusercontent.com/1650391/124094578-d1618480-da50-11eb-839b-c702c2574f15.png">
<br/>
<br/>
<img width="100%" alt="MVC-Github-Readme" src="static/how-it-works.svg">

</p>
<br>

## Quick Start

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,42 +72,8 @@ describe("Checkbox Widget Functionality", function() {
cy.get(publish.checkboxWidget + " " + "input").should("be.checked");
cy.get(publish.backToEditor).click();
});

it("Checkbox Functionality To Check required toggle for form", function() {
cy.addDsl(formWidgetDsl);
cy.openPropertyPane("checkboxwidget");
cy.togglebar(commonlocators.requiredjs + " " + "input");
cy.PublishtheApp();
cy.get(publish.checkboxWidget).click();
cy.get(widgetsPage.formButtonWidget)
.contains("Submit")
.should("have.class", "bp3-disabled");

cy.get(publish.checkboxWidget).click();
cy.get(widgetsPage.formButtonWidget)
.contains("Submit")
.should("not.have.attr", "disabled");

cy.get(publish.backToEditor).click();
});
it("Checkbox Functionality To swap label placement of checkbox", function() {
cy.openPropertyPane("checkboxwidget");
cy.get(publish.checkboxWidget + " " + ".bp3-align-right").should(
"not.exist",
);
cy.get(publish.checkboxWidget + " " + ".bp3-align-left").should("exist");
cy.get(commonlocators.optionalignment)
.last()
.click();
cy.dropdownDynamicUpdated("Right");
cy.PublishtheApp();
cy.get(publish.checkboxWidget + " " + ".bp3-align-right").should("exist");
cy.get(publish.checkboxWidget + " " + ".bp3-align-left").should(
"not.exist",
);
cy.get(publish.backToEditor).click();
});
});

afterEach(() => {
// put your clean up code if any
});
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
const commonlocators = require("../../../../locators/commonlocators.json");
const formWidgetsPage = require("../../../../locators/FormWidgets.json");
const widgetsPage = require("../../../../locators/Widgets.json");
const publish = require("../../../../locators/publishWidgetspage.json");
const dsl = require("../../../../fixtures/formWidgetdsl.json");
const pages = require("../../../../locators/Pages.json");

describe("Checkbox Widget Functionality", function() {
before(() => {
cy.addDsl(dsl);
});

it("Checkbox Functionality To Check required toggle for form", function() {
cy.openPropertyPane("checkboxwidget");
cy.togglebar(commonlocators.requiredjs + " " + "input");
cy.PublishtheApp();
cy.get(publish.checkboxWidget).click();
cy.get(widgetsPage.formButtonWidget)
.contains("Submit")
.should("have.class", "bp3-disabled");

cy.get(publish.checkboxWidget).click();
cy.get(widgetsPage.formButtonWidget)
.contains("Submit")
.should("not.have.attr", "disabled");

cy.get(publish.backToEditor).click();
});
it("Checkbox Functionality To swap label placement of checkbox", function() {
cy.openPropertyPane("checkboxwidget");
cy.get(publish.checkboxWidget + " " + ".bp3-align-right").should(
"not.exist",
);
cy.get(publish.checkboxWidget + " " + ".bp3-align-left").should("exist");
cy.get(commonlocators.optionalignment)
.last()
.click();
cy.dropdownDynamicUpdated("Right");
cy.PublishtheApp();
cy.get(publish.checkboxWidget + " " + ".bp3-align-right").should("exist");
cy.get(publish.checkboxWidget + " " + ".bp3-align-left").should(
"not.exist",
);
cy.get(publish.backToEditor).click();
});
});
afterEach(() => {
// put your clean up code if any
});
10 changes: 5 additions & 5 deletions app/client/public/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@
// '' (empty strings), 'false' are falsy
// could return either boolean or string based on value
const parseConfig = (config) => {
if (config.indexOf("__") === 0 || config.indexOf("$") === 0)
if (config.indexOf("__") === 0 || config.indexOf("$") === 0 || config.indexOf("%") === 0)
return "";

const result = config.trim();
Expand All @@ -157,13 +157,13 @@
const LOG_LEVELS = ["debug", "error"];
const CONFIG_LOG_LEVEL_INDEX = LOG_LEVELS.indexOf(parseConfig("__APPSMITH_CLIENT_LOG_LEVEL__"));

const APP_ID = parseConfig("__APPSMITH_INTERCOM_APP_ID__");
const INTERCOM_APP_ID = parseConfig("%REACT_APP_INTERCOM_APP_ID%") || parseConfig("__APPSMITH_INTERCOM_APP_ID__");
const CLOUD_HOSTING = parseConfig("__APPSMITH_CLOUD_HOSTING__");
const DISABLE_TELEMETRY = parseConfig("__APPSMITH_DISABLE_TELEMETRY__");

// Initialize the Intercom library
if (APP_ID.length && APP_ID[0] !== "%" && CLOUD_HOSTING) {
(function () { var w = window; var ic = w.Intercom; if (typeof ic === "function") { ic('reattach_activator'); ic('update', w.intercomSettings); } else { var d = document; var i = function () { i.c(arguments); }; i.q = []; i.c = function (args) { i.q.push(args); }; w.Intercom = i; var l = function () { var s = d.createElement('script'); s.type = 'text/javascript'; s.async = true; s.src = 'https://widget.intercom.io/widget/' + APP_ID; var x = d.getElementsByTagName('script')[0]; x.parentNode.insertBefore(s, x); }; if (document.readyState === 'complete') { l(); } else if (w.attachEvent) { w.attachEvent('onload', l); } else { w.addEventListener('load', l, false); } } })();
if (INTERCOM_APP_ID.length) {
(function () { var w = window; var ic = w.Intercom; if (typeof ic === "function") { ic('reattach_activator'); ic('update', w.intercomSettings); } else { var d = document; var i = function () { i.c(arguments); }; i.q = []; i.c = function (args) { i.q.push(args); }; w.Intercom = i; var l = function () { var s = d.createElement('script'); s.type = 'text/javascript'; s.async = true; s.src = 'https://widget.intercom.io/widget/' + INTERCOM_APP_ID; var x = d.getElementsByTagName('script')[0]; x.parentNode.insertBefore(s, x); }; if (document.readyState === 'complete') { l(); } else if (w.attachEvent) { w.attachEvent('onload', l); } else { w.addEventListener('load', l, false); } } })();
}

window.SENTRY_CONFIG = parseConfig("__APPSMITH_SENTRY_DSN__");
Expand Down Expand Up @@ -201,7 +201,7 @@
id: parseConfig("__APPSMITH_VERSION_ID__"),
releaseDate: parseConfig("__APPSMITH_VERSION_RELEASE_DATE__")
},
intercomAppID: APP_ID,
intercomAppID: INTERCOM_APP_ID,
mailEnabled: parseConfig("__APPSMITH_MAIL_ENABLED__"),
disableTelemetry: DISABLE_TELEMETRY === "" || DISABLE_TELEMETRY,
cloudServicesBaseUrl: parseConfig("__APPSMITH_CLOUD_SERVICES_BASE_URL__") || "https://cs.appsmith.com",
Expand Down
3 changes: 2 additions & 1 deletion app/client/src/actions/orgActions.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
import { ReduxActionTypes } from "constants/ReduxActionConstants";
import { SaveOrgLogo, SaveOrgRequest } from "api/OrgApi";

export const fetchOrg = (orgId: string) => {
export const fetchOrg = (orgId: string, skipValidation?: boolean) => {
return {
type: ReduxActionTypes.FETCH_CURRENT_ORG,
payload: {
orgId,
skipValidation,
},
};
};
Expand Down
1 change: 1 addition & 0 deletions app/client/src/api/OrgApi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ export interface FetchAllRolesResponse extends ApiResponse {

export interface FetchOrgRequest {
orgId: string;
skipValidation?: boolean;
}

export interface FetchAllUsersRequest {
Expand Down
Binary file not shown.
13 changes: 13 additions & 0 deletions app/client/src/assets/icons/comments/commentCursor.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
24 changes: 18 additions & 6 deletions app/client/src/comments/CommentCard/CommentCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,8 @@ import { Variant } from "components/ads/common";
import TourTooltipWrapper from "components/ads/tour/TourTooltipWrapper";
import { TourType } from "entities/Tour";
import { getCurrentApplicationId } from "selectors/editorSelectors";
import useProceedToNextTourStep from "utils/hooks/useProceedToNextTourStep";
import { commentsTourStepsEditModeTypes } from "comments/tour/commentsTourSteps";

const StyledContainer = styled.div`
width: 100%;
Expand Down Expand Up @@ -202,18 +204,19 @@ const reduceReactions = (
(Array.isArray(reactions) &&
reactions.reduce(
(res: Record<string, ComponentReaction>, reaction: Reaction) => {
const { byUsername, emoji } = reaction;
const { byName, byUsername, emoji } = reaction;
const sameAsCurrent = byUsername === username;
const name = byName || byUsername;
if (res[reaction.emoji]) {
res[reaction.emoji].count++;
if (!sameAsCurrent) {
res[reaction.emoji].users = [
...(res[reaction.emoji].users || []),
byUsername,
name,
];
}
} else {
const users = !sameAsCurrent ? [byUsername] : [];
const users = !sameAsCurrent ? [name] : [];
res[emoji] = {
count: 1,
reactionEmoji: emoji,
Expand Down Expand Up @@ -263,6 +266,10 @@ function CommentCard({
inline?: boolean;
visible?: boolean;
}) {
const proceedToNextTourStep = useProceedToNextTourStep({
[TourType.COMMENTS_TOUR_EDIT_MODE]: commentsTourStepsEditModeTypes.RESOLVE,
});

const [isHovered, setIsHovered] = useState(false);
const [cardMode, setCardMode] = useState(CommentCardModes.VIEW);
const dispatch = useDispatch();
Expand Down Expand Up @@ -427,11 +434,16 @@ function CommentCard({
<ResolveButtonContainer>
{inline ? (
<TourTooltipWrapper
tourIndex={2}
tourType={TourType.COMMENTS_TOUR}
activeStepConfig={{
[TourType.COMMENTS_TOUR_EDIT_MODE]:
commentsTourStepsEditModeTypes.RESOLVE,
}}
>
<ResolveCommentButton
handleClick={toggleResolved as () => void}
handleClick={() => {
toggleResolved && toggleResolved();
proceedToNextTourStep();
}}
resolved={!!resolved}
/>
</TourTooltipWrapper>
Expand Down
2 changes: 1 addition & 1 deletion app/client/src/comments/CommentThread/CommentThread.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ const ThreadContainer = styled(animated.div)<{
max-height: ${(props) =>
props.inline ? `calc(100vh - ${props.theme.smallHeaderHeight})` : "unset"};
/* overflow: auto collapses the comment threads in the sidebar */
overflow: ${(props) => (props.inline ? "auto" : "unset")};
overflow: ${(props) => (props.inline ? "visible" : "unset")};
`;

const CommentsContainer = styled.div<{ inline?: boolean }>`
Expand Down
Loading

0 comments on commit 0953088

Please sign in to comment.